body {
    margin: 0;
    font-family: sans-serif;
    background: #030712;
    color: #fff;
    background-image: url('https://uppicc.com/f/31730.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
}
.page-view {
    display: none;
    width: 100%;
    min-height: 100vh;
    box-sizing: border-box;
}

/* ดีไซน์หน้าจอโหลดหมุนๆ (Loading Overlay) */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 7, 18, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    transition: opacity 0.3s ease;
    opacity: 0;
    visibility: hidden;
}
.loader-overlay.active {
    opacity: 1;
    visibility: visible;
}
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(212, 175, 55, 0.2);
    border-top: 5px solid #ffd700;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}
.loader-text {
    color: #ffd700;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(7, 19, 37, 0.95);
    border-bottom: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 10px;
    margin-bottom: 15px;
}
.logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo-area img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 50%;
}
.logo-area span {
    color: #ffd700;
    font-weight: bold;
    font-size: 14px;
}
.form-card {
    max-width: 450px;
    margin: 0 auto;
    background: rgba(15, 34, 67, 0.9);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    backdrop-filter: blur(10px);
}
.form-card h2 {
    color: #ffd700;
    margin-bottom: 5px;
    text-align: center;
}
.form-sub {
    color: #94a3b8;
    font-size: 13px;
    text-align: center;
    margin-bottom: 20px;
}
.input-group {
    margin-bottom: 12px;
}
.input-group label {
    color: #fff;
    font-size: 13px;
    display: block;
    margin-bottom: 4px;
}
.input-group input, .input-group select, .login-input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(212,175,55,0.4);
    background: rgba(3,8,18,0.6);
    color: #fff;
    box-sizing: border-box;
}
.btn-primary {
    width: 100%;
    padding: 12px;
    background: #ffd700;
    color: #030712;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}
.btn-outline {
    padding: 7px 14px;
    background: #ffd700;
    color: #030712;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}
.btn-gold-border {
    padding: 7px 14px;
    background: transparent;
    color: #ffd700;
    border: 1px solid #ffd700;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}
.btn-danger {
    padding: 5px 10px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 11px;
}
/* แถบเมนูด้านข้างลอย */
.floating-sidebar {
    position: fixed;
    left: 10px;
    top: 90px;
    z-index: 99;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(7, 19, 37, 0.85);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.side-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 8px;
    text-decoration: none;
    transition: 0.2s;
}
.side-btn img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}
.side-btn:hover {
    border-color: #ffd700;
    transform: scale(1.05);
}
/* จัดตำแหน่งแถบเมนูด้านข้างลอย (Floating Sidebar) */
.floating-sidebar {
    position: fixed;
    top: 120px; /* ปรับระยะห่างจากด้านบนตามต้องการ */
    left: 10px;  /* ชิดซ้ายตามรูปตัวอย่าง */
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 999;
}

/* สไตล์ปุ่มไอคอนด้านข้าง */
.floating-sidebar .side-btn {
    width: 42px;
    height: 42px;
    background: rgba(7, 19, 37, 0.85);
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    transition: 0.2s;
}

.floating-sidebar .side-btn:hover {
    transform: scale(1.08);
    border-color: #ffd700;
    background: rgba(15, 34, 67, 0.95);
}

.floating-sidebar .side-btn img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}
.bottom-center-btn {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #ffd700 0%, #b8860b 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -25px;
    border: 3px solid #071325;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    cursor: pointer;
}
.bottom-center-btn img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}
.dashboard-main {
    max-width: 480px;
    margin: 0 auto;
    padding-left: 45px;
}
.wallet-card {
    background: rgba(15, 34, 67, 0.9);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.5);
    margin-bottom: 15px;
}
.wallet-balance {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-bottom: 12px;
}
.wallet-actions {
    display: flex;
    gap: 8px;
}
.btn-green {
    flex: 1;
    padding: 10px;
    background: #22c55e;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}
.btn-red {
    flex: 1;
    padding: 10px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}
.btn-yellow {
    background: #ffd700;
    color: #030712;
}
.game-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* บังคับให้แบ่งเป็น 3 คอลัมน์เรียงจากซ้ายไปขวา */
    gap: 10px; /* ระยะห่างระหว่างรูป */
    margin-bottom: 15px;
}

.game-item {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(212,175,55,0.4);
}
.game-item img {
    width: 100%;
    display: block;
}
#toast-notification {
    visibility: hidden;
    min-width: 220px;
    background-color: #ffd700;
    color: #030712;
    text-align: center;
    border-radius: 8px;
    padding: 12px;
    position: fixed;
    z-index: 100000;
    left: 50%;
    bottom: 80px;
    transform: translateX(-50%);
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    transition: visibility 0.5s, opacity 0.5s;
    opacity: 0;
}
#toast-notification.show {
    visibility: visible;
    opacity: 1;
}
.game-grid-6 {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* บังคับให้แบ่งเป็น 3 คอลัมน์ในแต่ละแถว */
    gap: 10px; /* ระยะห่างระหว่างรูป */
    margin-bottom: 15px;
    padding: 0 15px; /* เพิ่มระยะขอบซ้ายขวาเล็กน้อยให้ดูสวยงาม */
    box-sizing: border-box;
}
