body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 1rem;
    background: radial-gradient(circle at top right, #1e1b4b, var(--background));
    overflow-x: hidden;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 2rem auto;
}

.back-btn {
    background: transparent;
    border: none;
    padding: 0.3rem 0;
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
}

.back-btn:hover {
    color: var(--text);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.reset-btn {
    background: transparent;
    border: 1px solid var(--surface-border);
    color: var(--text-muted);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full);
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.reset-btn:hover {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.08);
}

.score-container {
    display: flex;
    gap: 1rem;
    background: var(--surface-glass);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--surface-border);
    font-weight: 600;
    font-size: 0.9rem;
}

.new-stat { color: #3b82f6; }
.repeat-stat { color: #f59e0b; }
.done-stat { color: #10b981; }

.game-container {
    flex: 1;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    animation: fadeIn 0.4s ease forwards;
}

.screen.active {
    display: flex;
}

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

h1 {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    text-align: center;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    width: 100%;
}

.category-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.2rem;
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    text-align: left;
}

.category-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.category-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.category-name {
    flex: 1;
    min-width: 0;
}

.category-progress-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.category-progress-bar {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.category-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: inherit;
    transition: width 0.4s ease;
}

.category-btn.completed {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.06);
}

.category-btn.completed .category-progress-text {
    color: #10b981;
}

.category-btn.completed .category-progress-fill {
    background: #10b981;
}

/* Game UI */
.question-card {
    background: var(--surface-glass);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    width: 100%;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.question-text {
    font-size: 4rem;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 0.5rem;
    font-family: var(--font-kr);
}

.question-hint {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
}

.option-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-ui);
}

.option-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.02);
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.option-btn.correct {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #10b981;
}

.option-btn.wrong {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
    opacity: 0.5;
}

.feedback-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 1rem 2rem;
    border-radius: var(--radius-full);
    font-weight: 800;
    font-size: 1.2rem;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
}

.feedback-banner.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.feedback-banner.correct {
    background: #10b981;
    color: white;
}

.feedback-banner.wrong {
    background: #ef4444;
    color: white;
}

.feedback-banner.repeat {
    background: #f59e0b;
    color: white;
}

/* Done Screen */
#screen-done {
    padding-top: 4rem;
    text-align: center;
}

.done-icon {
    font-size: 6rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-30px); }
    60% { transform: translateY(-15px); }
}

.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: var(--radius-full);
    margin-top: 2rem;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.primary-btn:hover {
    transform: scale(1.05);
    background: var(--accent);
}

@media (max-width: 600px) {
    .options-grid { grid-template-columns: 1fr; }
    .question-text { font-size: 3rem; }
    h1 { font-size: 2.2rem; }
}
