/* ===== MODERN LIGHT BLUE THEME WITH GLASSMORPHISM ===== */
:root {
    --primary-light: #e0f2fe;
    --primary: #38bdf8;
    --primary-dark: #0284c7;
    --primary-darker: #0369a1;
    --accent: #06b6d4;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1e293b;
    --dark-light: #334155;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --border: rgba(148, 163, 184, 0.2);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 32px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #f8fafb 0%, #f3f4f6 15%, #eff0f3 30%, #f0f3f6 50%, #efe9f0 70%, #f4f5f7 85%, #f8fafb 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
}

/* ===== GLASS EFFECT ===== */
.glass {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 16px;
}

.glass-light {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

/* ===== APP CONTAINER ===== */
.app {
    width: 100%;
    max-width: 1500px;
    background: linear-gradient(135deg, rgba(248, 250, 251, 0.9), rgba(243, 244, 246, 0.95));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(30, 41, 59, 0.1);
    border-radius: 24px;
    padding: 40px 32px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

/* ===== HEADER ===== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.app-header > div:first-child {
    flex: 1;
    min-width: 250px;
}

.title {
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, #38bdf8, #06b6d4, #0284c7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 8px 0 0 0;
    opacity: 0.9;
}

.controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* ===== TIMER ===== */
.timer {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.15), rgba(6, 182, 212, 0.1));
    border: 1px solid rgba(38, 189, 248, 0.4);
    color: #38bdf8;
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    display: none; /* Hidden - using timer-large instead */
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.2);
}

/* ===== THEME SELECTOR ===== */
.theme-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-selector select {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(30, 58, 90, 0.8));
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.95rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.theme-selector select:hover,
.theme-selector select:focus {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.2), rgba(30, 41, 59, 0.8));
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
    outline: none;
}

/* ===== AUTH SECTION ===== */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.1), rgba(6, 182, 212, 0.08));
    border: 1px solid rgba(38, 189, 248, 0.25);
    padding: 8px 16px;
    border-radius: 12px;
    backdrop-filter: blur(4px);
}

.user-info span {
    font-weight: 600;
    color: var(--primary);
}

.logout-btn, .admin-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-btn {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.4);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.2);
}

.admin-btn:hover {
    background: rgba(56, 189, 248, 0.25);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

.auth-btn {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #e0f2fe;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.auth-btn.register {
    background: linear-gradient(135deg, #38bdf8, #06b6d4);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.35);
}

.auth-btn.register:hover {
    box-shadow: 0 8px 20px rgba(56, 189, 248, 0.35);
}

/* ===== STATS ===== */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
    max-width: 100%;
}

.stat {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.12), rgba(6, 182, 212, 0.08));
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 18px 16px;
    border-radius: 14px;
    text-align: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat:hover {
    transform: translateY(-4px);
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 8px 16px rgba(56, 189, 248, 0.15);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #38bdf8, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    opacity: 0.85;
}

/* ===== BUTTONS ===== */
.button-group {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin: 28px 0;
}

.btn {
    padding: 14px 32px;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn.primary {
    background: linear-gradient(135deg, #0284c7, #06b6d4, #0369a1);
    color: #e0f2fe;
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.3);
}

.btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(2, 132, 199, 0.4);
}

.btn:not(.primary) {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(6, 182, 212, 0.08));
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
}

.btn:not(.primary):hover {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(6, 182, 212, 0.15));
    border-color: rgba(56, 189, 248, 0.5);
}

/* ===== TEST AREA ===== */
.test-area {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.1), rgba(6, 182, 212, 0.08));
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* New test controls layout */
.test-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.btn-start {
    padding: 14px 32px;
    font-size: 1rem;
}

.timer-large {
    font-size: 3.2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #0284c7, #06b6d4, #0369a1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
    min-width: 90px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.input-wrapper {
    width: 100%;
}

.word-display {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 1.65rem;
    line-height: 2.2;
    margin-bottom: 20px;
    min-height: 180px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(240, 248, 255, 0.9), rgba(230, 245, 255, 0.8));
    border: 2px solid rgba(56, 189, 248, 0.4);
    border-radius: 12px;
    overflow-wrap: break-word;
    letter-spacing: 0.8px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.03);
    color: #0a1628;
    font-weight: 600;
}

.word {
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 4px;
    position: relative;
    transition: all 0.15s ease;
}

.word.current {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.4), rgba(34, 197, 94, 0.3));
    color: #059669;
    padding: 6px 10px;
    border-radius: 6px;
    border: 2px solid rgba(16, 185, 129, 0.7);
    font-weight: 700;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
}

.word.correct {
    color: #059669;
    background: rgba(34, 197, 94, 0.25);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 700;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.word.incorrect {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.25);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.25);
}

#input-field {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.1rem;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.8));
    border: 2px solid rgba(56, 189, 248, 0.3);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#input-field:focus {
    outline: none;
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.15), rgba(6, 182, 212, 0.1));
    box-shadow: 0 0 24px rgba(56, 189, 248, 0.25), inset 0 0 12px rgba(56, 189, 248, 0.05);
}

#input-field:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: rgba(56, 189, 248, 0.15);
}

#input-field::placeholder {
    color: rgba(203, 213, 225, 0.5);
}

/* ===== LEADERBOARD ===== */
.leaderboard-section {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.12), rgba(6, 182, 212, 0.08));
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 16px;
    padding: 28px;
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    position: relative;
    top: auto;
    align-self: stretch;
}

.leaderboard-title {
    text-align: center;
    margin: 0 0 28px 0;
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #38bdf8, #06b6d4, #0284c7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.leaderboard-title-image {
    text-align: center;
    margin: 0 0 28px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100px;
}

.top10-image {
    max-width: 90%;
    height: auto;
    max-height: 150px;
    object-fit: contain;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.25));
    display: block;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.5));
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    margin-bottom: 4px;
}

.leaderboard-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.leaderboard-item:hover {
    transform: translateX(4px);
    border-color: rgba(56, 189, 248, 0.4);
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.15), rgba(30, 41, 59, 0.6));
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.15);
}

.leaderboard-item:hover::before {
    opacity: 1;
}

.leaderboard-item.rank-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(251, 191, 36, 0.1));
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.leaderboard-item.rank-1:hover {
    box-shadow: 0 4px 24px rgba(255, 215, 0, 0.25);
}

.leaderboard-item.rank-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.15), rgba(209, 213, 219, 0.1));
    border-color: rgba(192, 192, 192, 0.4);
    box-shadow: 0 0 16px rgba(192, 192, 192, 0.15);
}

.leaderboard-item.rank-2:hover {
    box-shadow: 0 4px 20px rgba(192, 192, 192, 0.2);
}

.leaderboard-item.rank-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.15), rgba(217, 119, 6, 0.1));
    border-color: rgba(205, 127, 50, 0.4);
    box-shadow: 0 0 16px rgba(205, 127, 50, 0.15);
}

.leaderboard-item.rank-3:hover {
    box-shadow: 0 4px 20px rgba(205, 127, 50, 0.2);
}

.rank-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 14px;
    font-weight: 800;
    font-size: 1.1rem;
    position: relative;
    flex-shrink: 0;
    border: 2px solid rgba(56, 189, 248, 0.3);
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.1), rgba(6, 182, 212, 0.08));
}

.rank-badge.medal {
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    color: transparent;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.rank-badge.rank-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(251, 191, 36, 0.15));
    border-color: #ffd700;
    color: #ffd700;
}

.rank-badge.rank-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(209, 213, 219, 0.15));
    border-color: #c0c0c0;
    color: #d1d5db;
}

.rank-badge.rank-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(217, 119, 6, 0.15));
    border-color: #cd7f32;
    color: #fb923c;
}

.medal-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.medal-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.player-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 0;
}

.player-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.player-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.3px;
}

.player-stats {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-wpm {
    font-size: 1.35rem;
    font-weight: 800;
    background: linear-gradient(135deg, #38bdf8, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: right;
    flex-shrink: 0;
    margin-left: 12px;
}

.wpm-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.empty-slot {
    display: flex;
    align-items: center;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(6, 182, 212, 0.05));
    border-radius: 12px;
    border: 2px dashed rgba(56, 189, 248, 0.2);
    opacity: 0.7;
}

.empty-slot .player-name {
    color: var(--text-secondary);
    font-style: italic;
}

/* ===== ANIMATIONS ===== */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.leaderboard-item.new-entry {
    animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.leaderboard-item.rank-1 {
    animation: glow 3s ease-in-out infinite;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .app {
        padding: 32px 24px;
    }

    .main-content {
        gap: 32px;
    }

    .stats {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }

    .button-group {
        gap: 12px;
    }

    .btn {
        padding: 12px 24px;
        font-size: 0.95rem;
    }

    .title {
        font-size: 1.7rem;
    }

    .leaderboard-title {
        font-size: 1.3rem;
    }

    .timer-large {
        font-size: 2.8rem;
    }

    .test-controls {
        gap: 16px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .app {
        padding: 24px 16px;
        border-radius: 16px;
    }

    .app-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .controls {
        justify-content: center;
        gap: 12px;
    }

    .auth-buttons {
        width: 100%;
        justify-content: center;
    }

    .auth-btn {
        flex: 1;
        max-width: 120px;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 24px;
    }

    .stat {
        padding: 14px 12px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .main-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .test-area {
        padding: 20px;
        margin-bottom: 20px;
    }

    .test-controls {
        gap: 12px;
        margin-bottom: 20px;
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .btn-start {
        width: 100%;
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .timer-large {
        font-size: 2.4rem;
        text-align: center;
        padding: 8px 0;
    }

    .word-display {
        font-size: 1.1rem;
        min-height: 120px;
        padding: 16px;
        line-height: 1.8;
    }

    #input-field {
        padding: 14px 16px;
        font-size: 1rem;
    }

    .button-group {
        flex-direction: column;
        align-items: center;
        margin: 20px 0;
    }

    .btn {
        width: 100%;
        max-width: 200px;
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .leaderboard-section {
        padding: 20px;
        margin-top: 20px;
    }

    .leaderboard-title {
        font-size: 1.15rem;
        margin-bottom: 20px;
    }

    .leaderboard-item {
        padding: 12px 14px;
        margin-bottom: 8px;
    }

    .rank-badge {
        width: 40px;
        height: 40px;
        margin-right: 12px;
        font-size: 0.95rem;
    }

    .player-name {
        font-size: 0.9rem;
    }

    .player-stats {
        font-size: 0.75rem;
    }

    .player-wpm {
        font-size: 1.15rem;
        margin-left: 8px;
    }

    .title {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .controls {
        flex-direction: column;
        width: 100%;
    }

    .theme-selector select {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .app {
        padding: 20px 12px;
        border-radius: 12px;
    }

    .title {
        font-size: 1.3rem;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    .stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stat {
        padding: 12px 10px;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .word-display {
        font-size: 1rem;
        min-height: 100px;
        padding: 12px;
    }

    #input-field {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }

    .button-group {
        gap: 8px;
        margin: 16px 0;
    }

    .leaderboard-item {
        padding: 10px 12px;
    }

    .rank-badge {
        width: 36px;
        height: 36px;
        margin-right: 10px;
    }

    .player-name {
        font-size: 0.85rem;
    }

    .player-wpm {
        font-size: 1rem;
    }
}

/* ===== GLOBAL UTILITIES ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #0284c7, #06b6d4);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #38bdf8, #06b6d4);
}

/* Smooth transitions */
* {
    transition-property: background-color, border-color, color, box-shadow, transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 0.15s;
}

button, select, a, input {
    transition-duration: 0.25s;
}

/* Main content layout */
.main-content {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 40px;
    align-items: start;
    margin-top: 32px;
}

.test-column {
    min-width: 0;
}

.leaderboard-column {
    min-width: 320px;
    display: flex;
    flex-direction: column;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 2fr 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .leaderboard-column {
        min-width: unset;
    }
}
