/* ========================================
   WORD WAVE GAME - CLEAN DESIGN
   ======================================== */

/* Mobile viewport fixes */
html {
    height: 100%;
    height: -webkit-fill-available;
}

body {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

.game-container {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    background: linear-gradient(180deg, #0a1628 0%, #0d1f35 100%);
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* ========================================
   TOP BAR - Menu Button + Title + Login
   ======================================== */
.game-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(10, 22, 40, 0.95);
    border-bottom: 2px solid rgba(45, 212, 191, 0.2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    gap: 15px;
}

/* Menu Button */
.game-menu-btn {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.2), rgba(32, 163, 158, 0.2));
    border: 2px solid rgba(45, 212, 191, 0.4);
    border-radius: 10px;
    color: #2dd4bf;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.game-menu-btn:hover {
    background: linear-gradient(135deg, #20a39e, #2dd4bf);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(45, 212, 191, 0.4);
}

/* Title */
.game-title-link {
    text-decoration: none;
    flex: 1;
    display: flex;
    justify-content: center;
    transition: transform 0.2s ease;
}

.game-title-link:hover {
    transform: scale(1.02);
}

.game-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, #20a39e, #2dd4bf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.game-title i {
    font-size: 1.6rem;
    background: linear-gradient(135deg, #20a39e, #2dd4bf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Login Container */
.game-login-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.login-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(45, 212, 191, 0.1);
    color: #2dd4bf;
    border: 1.5px solid rgba(45, 212, 191, 0.4);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.login-btn i {
    font-size: 1.1rem;
}

.login-btn:hover {
    background: rgba(45, 212, 191, 0.2);
    border-color: #2dd4bf;
    box-shadow: 0 3px 10px rgba(45, 212, 191, 0.4);
    transform: translateY(-1px);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    background: rgba(45, 212, 191, 0.1);
    border: 1.5px solid rgba(45, 212, 191, 0.3);
    border-radius: 20px;
    transition: all 0.2s ease;
}

.user-profile:hover {
    background: rgba(45, 212, 191, 0.15);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #2dd4bf;
}

.user-name {
    color: #2dd4bf;
    font-weight: 600;
    font-size: 0.9rem;
}

.logout-btn {
    width: 30px;
    height: 30px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    border-radius: 50%;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.logout-btn:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

/* ========================================
   GAME MENU OVERLAY
   ======================================== */
.game-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 80px 20px 20px 20px;
    overflow-y: auto;
}

.game-menu-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.game-menu-content {
    background: linear-gradient(135deg, #0d1f35 0%, #0a1628 100%);
    border: 2px solid rgba(45, 212, 191, 0.3);
    border-radius: 20px;
    padding: 25px 18px 20px 18px;
    max-width: 400px;
    width: 100%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-menu-close {
    position: absolute;
    top: 2px;
    right: 5px;
    width: 25px;
    height: 25px;
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid rgba(239, 68, 68, 0.4);
    border-radius: 50%;
    color: #ef4444;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-menu-close:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
}

.game-menu-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 5px;
}

.game-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 10px;
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.15), rgba(32, 163, 158, 0.15));
    border: 2px solid rgba(45, 212, 191, 0.3);
    border-radius: 12px;
    color: #2dd4bf;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    aspect-ratio: 1;
}

.game-menu-item i {
    font-size: 1.5rem;
    width: auto;
    text-align: center;
    flex-shrink: 0;
}

.game-menu-item span {
    text-align: center;
    line-height: 1.2;
}

.game-menu-item:hover {
    background: linear-gradient(135deg, #20a39e, #2dd4bf);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(45, 212, 191, 0.4);
}

.game-menu-divider {
    grid-column: 1 / -1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.3), transparent);
    margin: 8px 0;
}

.game-menu-sync {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 8px 0;
}

.sync-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 0.8rem;
    color: #9ca3af;
    white-space: nowrap;
}

.sync-status i {
    font-size: 0.9rem;
}

.sync-status.synced {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.15);
}

.sync-status.syncing {
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.15);
}

.sync-status.error {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.15);
}

/* ========================================
   GAME MAIN
   ======================================== */
.game-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
    gap: 20px;
}

/* Game Board */
.game-board {
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    gap: 5px;
    padding: 8px;
    margin-bottom: 16px;
}

.board-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

.tile {
    width: 56px;
    height: 56px;
    border: 2px solid rgba(45, 212, 191, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.1), rgba(32, 163, 158, 0.1));
    transition: all 0.3s ease;
}

.tile.filled {
    border-color: #2dd4bf;
    animation: pop 0.1s ease-in-out;
}

.tile.correct {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
    animation: flip 0.6s ease-in-out;
}

.tile.present {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #f59e0b;
    animation: flip 0.6s ease-in-out;
}

.tile.absent {
    background: linear-gradient(135deg, #374151, #1f2937);
    border-color: #374151;
    animation: flip 0.6s ease-in-out;
}

.tile.shake {
    animation: shake 0.5s ease-in-out;
}

.tile.win {
    animation: bounce 1s ease-in-out infinite;
}

/* Animations */
@keyframes pop {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}
.game-header-content {
    max-width: 1100px; /* wider to allow left controls and centered title */
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 560px 1fr; /* left (controls), center (title), right (spacer) */
    align-items: center;
    gap: 10px;
    padding: 10px 0;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Keyboard */

/* Leaderboard Styles */
.leaderboard-list { 
    gap: 8px; 
    display: flex; 
    flex-direction: column;
    max-height: 500px;
    overflow-y: auto;
}
.leaderboard-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.2s ease;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
}
.leaderboard-row:hover { 
    background: rgba(45,212,191,0.08);
    border-color: rgba(45,212,191,0.2);
}
.leaderboard-row .rank { 
    width: 32px; 
    font-weight: 700; 
    color: #2dd4bf;
    font-size: 1.1rem;
}
.leaderboard-row .avatar img { 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    border: 2px solid rgba(45,212,191,0.3);
}
.leaderboard-row .player-name { 
    font-weight: 700; 
    color: #ffffff;
    font-size: 1rem;
}
.leaderboard-row .player-meta { 
    font-size: 0.9rem; 
    color: #9ca3af;
}

.keyboard {
    max-width: 480px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.keyboard-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.key {
    min-width: 44px;
    height: 56px;
    padding: 0 12px;
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.15), rgba(32, 163, 158, 0.15));
    border: 2px solid rgba(45, 212, 191, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
}

.key:hover {
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.3), rgba(32, 163, 158, 0.3));
    transform: scale(1.05);
}

.key:active {
    transform: scale(0.95);
}

.key-large {
    min-width: 65px;
    font-size: 0.75rem;
}

.key.correct {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
}

.key.present {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #f59e0b;
}

.key.absent {
    background: linear-gradient(135deg, #374151, #1f2937);
    border-color: #374151;
    opacity: 0.5;
}

/* Message Container */
.auth-section {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: nowrap;
}
.message-container {
    position: fixed;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}
.game-logo {
    display: flex;
    align-items: center;
    gap: 18px;
    justify-content: center;
}

.message {
    background: linear-gradient(135deg, #20a39e, #2dd4bf);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(45, 212, 191, 0.4);
    animation: slideDown 0.3s ease-out;
}
.game-logo h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.25rem;
    font-weight: 900;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #20a39e, #2dd4bf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.message.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Game Info */
.game-info {
    display: flex;
    gap: 20px;
    justify-content: center;
    padding: 10px;
    border-top: 2px solid rgba(45, 212, 191, 0.2);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e0e0e0;
    font-size: 0.85rem;
}

.info-item i {
    color: #2dd4bf;
    font-size: 1rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #0d1f35, #0a1628);
    border: 2px solid rgba(45, 212, 191, 0.3);
    border-radius: 25px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 2px solid rgba(45, 212, 191, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.modal-header i {
    color: #2dd4bf;
}

.modal-close {
    width: 35px;
    height: 35px;
    background: transparent;
    border: 2px solid rgba(45, 212, 191, 0.3);
    border-radius: 50%;
    color: #2dd4bf;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(45, 212, 191, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

.modal-body p {
    color: #e0e0e0;
    line-height: 1.7;
    margin-bottom: 20px;
}

/* Instructions */
.instructions-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.instructions-list li {
    color: #e0e0e0;
    padding: 12px 0;
    border-bottom: 1px solid rgba(45, 212, 191, 0.1);
    display: flex;
    align-items: flex-start;
}

.instructions-list li:before {
    content: "•";
    color: #2dd4bf;
    font-size: 1.5rem;
    margin-right: 15px;
}

/* Examples */
.examples {
    margin: 30px 0;
}

.examples h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 20px;
}

.example-row {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.tile-example {
    width: 45px;
    height: 45px;
    border: 2px solid rgba(45, 212, 191, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.1), rgba(32, 163, 158, 0.1));
}

.tile-example.correct {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
}

.tile-example.present {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #f59e0b;
}

.tile-example.absent {
    background: linear-gradient(135deg, #374151, #1f2937);
    border-color: #374151;
}

.tip-box {
    background: rgba(45, 212, 191, 0.1);
    border: 2px solid rgba(45, 212, 191, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin-top: 25px;
    color: #e0e0e0;
    display: flex;
    gap: 15px;
}

.tip-box i {
    color: #2dd4bf;
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* Statistics */
/* Stats Cards Grid */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
    padding: 0 10px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.1), rgba(32, 163, 158, 0.1));
    border: 2px solid rgba(45, 212, 191, 0.2);
    border-radius: 12px;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #20a39e, #2dd4bf);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(45, 212, 191, 0.5);
    box-shadow: 0 10px 30px rgba(45, 212, 191, 0.2);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.2), rgba(32, 163, 158, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #2dd4bf;
}

.stat-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-card .stat-value {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #20a39e, #2dd4bf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.stat-card .stat-label {
    font-family: 'Poppins', sans-serif;
    font-size: 0.75rem;
    color: #a0a0a0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.stats-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.3), transparent);
    margin: 30px 0 25px 0;
}

.stats-section-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #2dd4bf;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 10px;
}

.stats-section-title i {
    font-size: 1.1rem;
}

.distribution {
    margin: 20px 0;
}

.distribution-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.distribution-label {
    color: #e0e0e0;
    font-weight: 600;
    width: 20px;
}

.distribution-bar-container {
    flex: 1;
    height: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.distribution-bar {
    height: 100%;
    background: linear-gradient(90deg, #20a39e, #2dd4bf);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    min-width: 30px;
    transition: width 0.5s ease-out;
}

.distribution-bar.highlight {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

/* Next Word Timer */
.next-word {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: rgba(45, 212, 191, 0.05);
    border-radius: 15px;
}

.next-word p {
    color: #e0e0e0;
    margin-bottom: 10px;
    font-weight: 600;
}

.countdown {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #20a39e, #2dd4bf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Settings */
.settings-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(45, 212, 191, 0.1);
}

.setting-info h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 5px;
}

.setting-info p {
    color: #a0a0a0;
    font-size: 0.9rem;
    margin: 0;
}

/* Toggle Switch */
.toggle {
    position: relative;
    width: 60px;
    height: 32px;
    display: inline-block;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(45, 212, 191, 0.3);
    transition: 0.4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: 0.4s;
    border-radius: 50%;
}

.toggle input:checked + .toggle-slider {
    background: linear-gradient(135deg, #20a39e, #2dd4bf);
    border-color: #2dd4bf;
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(28px);
}

/* Buttons */
.share-btn, .reset-btn {
    width: 100%;
    margin-top: 20px;
}

/* Result Modal */
.result-content {
    max-width: 450px;
}

.result-message {
    text-align: center;
    font-size: 1.2rem;
    color: #e0e0e0;
    margin-bottom: 20px;
}

.result-word {
    text-align: center;
    font-size: 1.1rem;
    color: #e0e0e0;
    margin-bottom: 30px;
}

.result-word strong {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    color: #2dd4bf;
    display: block;
    margin-top: 10px;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.result-stat {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.1), rgba(32, 163, 158, 0.1));
    border: 2px solid rgba(45, 212, 191, 0.2);
    border-radius: 15px;
}

.result-stat-number {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #20a39e, #2dd4bf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-stat-label {
    color: #a0a0a0;
    font-size: 0.9rem;
    margin-top: 5px;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

#shareResultBtn {
    display: none !important;
}

.btn-stats {
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-stats:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.btn-stats:active {
    transform: translateY(0);
}

.btn-stats i {
    font-size: 1.1rem;
}

/* ========================================
   RESPONSIVE DESIGN - Mobile First
   ======================================== */

@media (max-width: 768px) {
    .game-top-bar {
        padding: 12px 15px;
    }
    
    .game-menu-btn {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }
    
    .game-title {
        font-size: 1.5rem;
    }
    
    .game-title i {
        font-size: 1.4rem;
    }
    
    .login-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    .login-btn i {
        font-size: 1rem;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
    }
    
    .user-name {
        font-size: 0.85rem;
    }
    
    .game-menu-content {
        padding: 22px 14px 18px 14px;
        max-width: 360px;
    }
    
    .game-menu-item {
        padding: 14px 8px;
        font-size: 0.75rem;
        gap: 5px;
    }
    
    .game-menu-item i {
        font-size: 1.4rem;
    }
    
    .game-main {
        padding: 15px 10px;
    }

    .tile {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }
    
    .board-row {
        gap: 4px;
    }
    
    .game-board {
        gap: 4px;
        margin-bottom: 15px;
    }
    
    .keyboard {
        max-width: 100%;
        padding: 8px 5px;
    }

    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 5px;
    }

    .stat-card {
        padding: 15px 10px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .stat-card .stat-value {
        font-size: 1.6rem;
    }

    .stat-card .stat-label {
        font-size: 0.65rem;
    }

    .stats-section-title {
        font-size: 1rem;
        padding-left: 5px;
    }

    .key {
        min-width: 32px;
        height: 50px;
        font-size: 0.8rem;
        padding: 0 6px;
    }

    .key-large {
        min-width: 55px;
        font-size: 0.7rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .game-info {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .info-item {
        justify-content: center;
    }
}

/* Small Mobile - 480px */
@media (max-width: 480px) {
    .game-top-bar {
        padding: 10px 12px;
        gap: 10px;
    }
    
    .game-menu-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .game-title {
        font-size: 1.3rem;
        gap: 8px;
    }
    
    .game-title i {
        font-size: 1.2rem;
    }
    
    .login-btn {
        padding: 7px 12px;
        font-size: 0.8rem;
    }
    
    .login-btn .login-text {
        display: none; /* Hide "Login" text, show only icon */
    }
    
    .user-avatar {
        width: 26px;
        height: 26px;
    }
    
    .user-name {
        font-size: 0.8rem;
        max-width: 70px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .logout-btn {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }
    
    .game-menu-overlay {
        padding: 60px 15px 15px 15px;
    }
    
    .game-menu-content {
        padding: 20px 12px 16px 12px;
        max-width: 320px;
    }
    
    .game-menu-items {
        gap: 8px;
    }
    
    .game-menu-item {
        padding: 12px 6px;
        font-size: 0.7rem;
        gap: 5px;
    }
    
    .game-menu-item i {
        font-size: 1.3rem;
    }
    
    .sync-status {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
    
    .sync-status i {
        font-size: 0.85rem;
    }
    
    .tile {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .board-row {
        gap: 3px;
    }
    
    .game-board {
        gap: 3px;
        padding: 5px;
    }
    
    .key {
        min-width: 28px;
        height: 48px;
        font-size: 0.75rem;
        padding: 0 4px;
    }

    .key-large {
        min-width: 50px;
        font-size: 0.65rem;
    }

    .modal-body {
        padding: 20px;
    }

    .result-actions {
        grid-template-columns: 1fr;
    }
}

/* Developer Tools */
.dev-section {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(29, 78, 216, 0.05);
    border: 2px solid rgba(45, 212, 191, 0.2);
    border-radius: 15px;
}

.dev-section h3 {
    color: #2dd4bf;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.dev-section p {
    color: #a0a0a0;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.dev-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid rgba(45, 212, 191, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
}

.dev-input[type="date"] {
    color-scheme: dark;
    cursor: pointer;
}

.dev-input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.dev-input:focus {
    outline: none;
    border-color: #2dd4bf;
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.1);
}

.dev-input option {
    background: #0f172a;
    color: white;
}

.dev-info {
    margin-top: 20px;
    padding: 15px;
    background: rgba(29, 78, 216, 0.1);
    border-radius: 10px;
}

.dev-info p {
    color: #e0e0e0;
    margin: 8px 0;
    font-size: 0.95rem;
}

.dev-info strong {
    color: #2dd4bf;
}

.dev-info span {
    color: white;
    font-weight: 600;
}

#devBtn {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.15), rgba(168, 85, 247, 0.15));
    border-color: rgba(147, 51, 234, 0.3);
}

#devBtn:hover {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.25), rgba(168, 85, 247, 0.25));
    border-color: rgba(147, 51, 234, 0.5);
}

#overridesList {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(45, 212, 191, 0.2);
    border-radius: 8px;
    padding: 10px;
}

.override-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    margin: 5px 0;
    background: rgba(45, 212, 191, 0.05);
    border-radius: 5px;
    border: 1px solid rgba(45, 212, 191, 0.1);
}

.override-item:hover {
    background: rgba(45, 212, 191, 0.1);
}

.override-date {
    color: #2dd4bf;
    font-weight: 600;
    font-size: 0.9rem;
}

.override-word {
    color: white;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 1px;
}

.override-remove {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.override-remove:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
}
