.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: calc(100vh - 100px);
    padding: 100px 5% 2rem 5%;
}

#startScreen {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex: 1;
}

.game-description {
    font-family: 'Chalkduster', 'Schoolbell', 'Comic Sans MS', cursive, sans-serif;
    font-size: 1.25rem;
    color: #F4E04D;
    text-align: center;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.question-text {
    font-family: 'Chalkduster', 'Schoolbell', 'Comic Sans MS', cursive, sans-serif;
    font-size: 4.25rem;
    font-weight: bold;
    color: #F4E04D;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 3rem;
    letter-spacing: 0.2rem;
}

.question-mark {
    color: #FF8C00;
}

.answers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 600px;
    width: 100%;
}

.answer-btn {
    font-family: 'Chalkduster', 'Schoolbell', 'Comic Sans MS', cursive, sans-serif;
    font-size: 3.25rem;
    font-weight: bold;
    color: #FFFFFF;
    background: transparent;
    border: none;
    padding: 2rem;
    cursor: pointer;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, text-shadow 0.2s, background 0.2s;
    border-radius: 12px;
}

.answer-btn:hover {
    transform: scale(1.1);
    text-shadow: 3px 3px 8px rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.7);
}

.answer-btn:active {
    transform: scale(0.95);
}

.answer-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.answer-btn.correct,
.answer-btn.wrong {
    opacity: 1 !important;
}

.answer-btn.correct {
    background: rgba(74, 222, 128, 0.6) !important;
    transform: scale(1.1) !important;
}

.answer-btn.wrong {
    background: rgba(239, 68, 68, 0.6) !important;
    transform: scale(1.1) !important;
}

.start-btn {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.5rem;
    font-weight: bold;
    color: #FFFFFF;
    background: rgba(99, 102, 241, 0.8);
    border: none;
    padding: 1rem 2rem;
    cursor: pointer;
    border-radius: 8px;
    transition: transform 0.2s, background 0.2s, opacity 0.2s;
}

.start-btn:hover:not(:disabled) {
    transform: scale(1.05);
    background: rgba(99, 102, 241, 1);
}

.start-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.progress-bar-container {
    width: 100%;
    max-width: 600px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

.results-container {
    text-align: center;
    color: #FFFFFF;
}

.results-title {
    font-family: 'Chalkduster', 'Schoolbell', 'Comic Sans MS', cursive, sans-serif;
    font-size: 3.25rem;
    font-weight: bold;
    color: #F4E04D;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
}

.results-stats {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.5rem;
    line-height: 2;
    margin-bottom: 3rem;
}

.percentage {
    font-size: 4rem;
    font-weight: bold;
    color: #4ade80;
    margin: 1rem 0;
}

.rankings-section {
    margin: 1.5rem 0;
    padding-top: 1.5rem;
}

.rankings-divider {
    width: 80%;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 auto 1.5rem auto;
}

.score-row {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.score-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.score-label {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.1rem;
}

.score-value {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 2.5rem;
    font-weight: bold;
    color: #FF8C00;
}

.score-item:first-child .score-value {
    color: #4ade80;
}

.rank-row {
    display: flex;
    gap: 3rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.ranking-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ranking-label {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.1rem;
}

.ranking-value {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.75rem;
    font-weight: bold;
    color: #FFFFFF;
}

.username-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.username-label {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    display: block;
    margin-bottom: 0.75rem;
}

.username-input-row {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
}

.leaderboard-display {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    margin-top: 10px;
    padding: 1rem 0.25rem 0.5rem 0.25rem;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: #FFFFFF;
    border-radius: 8px;
    flex: 1;
    max-width: 250px;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
    text-align: left;
}

.leaderboard-result-name {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 700;
    text-align: center;
    margin-top: 0.5rem;
}

.leaderboard-display.is-placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.leaderboard-display:focus {
    outline: none;
    border-color: #6366f1;
}

.username-btn {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    font-weight: bold;
    color: #FFFFFF;
    background: rgba(99, 102, 241, 0.8);
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-radius: 8px;
    transition: transform 0.2s, background 0.2s, opacity 0.2s;
}

.username-btn:hover:not(:disabled) {
    transform: scale(1.05);
    background: rgba(99, 102, 241, 1);
}

.username-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.username-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.custom-keyboard {
    margin-top: 0.75rem;
    display: flex;
    justify-content: center;
}

.custom-keyboard-inner {
    width: 100%;
    max-width: 520px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.custom-keyboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.custom-keyboard-title {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    color: #FFFFFF;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
}

.custom-keyboard-keys {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
}

.custom-keyboard-key {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.custom-keyboard-key:hover {
    background: rgba(255, 255, 255, 0.15);
}

.custom-keyboard-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.custom-keyboard-action {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.custom-keyboard-action.primary {
    background: rgba(99, 102, 241, 0.9);
    border-color: rgba(99, 102, 241, 0.8);
}

.custom-keyboard-action:hover {
    background: rgba(255, 255, 255, 0.15);
}

.custom-keyboard-action.primary:hover {
    background: rgba(99, 102, 241, 1);
}

.button-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.action-btn {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    font-weight: bold;
    color: #FFFFFF;
    background: rgba(99, 102, 241, 0.8);
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-radius: 8px;
    transition: transform 0.2s, background 0.2s, opacity 0.2s;
}

.action-btn.always-enabled {
    background: rgba(99, 102, 241, 1);
    opacity: 1 !important;
    pointer-events: auto !important;
}

.action-btn:hover:not(:disabled) {
    transform: scale(1.05);
    background: rgba(99, 102, 241, 1);
}

.action-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn.highlight-pulse {
    animation: pulse-glow 2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.8);
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.8), 0 0 40px rgba(99, 102, 241, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(99, 102, 241, 1), 0 0 60px rgba(99, 102, 241, 0.6);
        transform: scale(1.02);
    }
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    .question-text {
        font-size: 3.25rem;
    }

    .answer-btn {
        font-size: 2.75rem;
        padding: 1.5rem;
    }

    .answers-grid {
        gap: 1.5rem;
    }

    .score-row, .rank-row {
        gap: 1.5rem;
    }

    .score-value {
        font-size: 2rem;
    }

    .score-label {
        font-size: 0.875rem;
    }

    .ranking-value {
        font-size: 1.5rem;
    }

    .start-btn {
        font-size: 1.25rem;
        padding: 0.875rem 1.75rem;
    }

    .action-btn {
        font-size: 0.9rem;
        padding: 0.625rem 1.25rem;
    }

    .username-input-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .leaderboard-display {
        max-width: 100%;
        width: 100%;
    }

    .username-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .custom-keyboard-keys {
        grid-template-columns: repeat(5, 1fr);
    }

    .question-text {
        font-size: 2.75rem;
    }

    .answer-btn {
        font-size: 2.25rem;
        padding: 1.25rem;
    }

    .answers-grid {
        gap: 1rem;
    }

    .score-row, .rank-row {
        gap: 0.75rem;
    }

    .score-label, .ranking-label {
        font-size: 0.7rem;
    }

    .score-value {
        font-size: 1.25rem;
    }

    .ranking-value {
        font-size: 1.25rem;
    }

    .start-btn {
        font-size: 1.125rem;
        padding: 0.75rem 1.5rem;
    }

    .button-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .action-btn {
        font-size: 0.875rem;
        padding: 0.625rem 1.25rem;
        width: 100%;
    }
}
