/* Ultra Minimal - McDonald's Build Quiz */
/* Apple Native Style Refinement (rem based) */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* iOS Dark Mode Palette */
    --bg: #000000;
    --bg-card: #1c1c1e;
    --bg-hover: #2c2c2e;
    --bg-input: rgba(118, 118, 128, 0.24);

    --text: #ffffff;
    --text-secondary: #8e8e93;
    --text-tertiary: #48484a;

    --accent: #0a84ff;
    --success: #30d158;
    --error: #ff453a;
    --warning: #ffd60a;

    --separator: #38383a;

    --radius: 0.75rem;
    /* 12px */
    --radius-s: 0.5rem;
    /* 8px */
    --radius-full: 9999px;

    font-family: "Google Sans Flex", "Apple SD Gothic Neo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0, "ROND" 0;
}

html {
    font-size: 100%;
    /* Default 16px */
    height: 100%;
}

body {
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-size: 1.0625rem;
    /* ~17px (iOS default) */
}

.app-container {
    max-width: 30rem;
    padding: 1rem;
    /* 480px */
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    flex-direction: column;
    padding: 0.75rem 1rem;
    position: sticky;
    top: 1rem;
    z-index: 100;
    background: rgba(28, 28, 30, 0.85);
    backdrop-filter: blur(1rem);
    -webkit-backdrop-filter: blur(1rem);
    border-radius: 1.5rem;
    gap: .25rem;
}

.header.hidden {
    display: none;
}

.header-title {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

.header-title.visible {
    opacity: 1;
}

.logo {
    display: none;
}

.score-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    /* 14px */
    font-weight: 500;
}

.score-display.visible {
    display: flex;
}

.score-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.score-label {
    color: var(--text-secondary);
}

.score-value {
    font-weight: 600;
    color: var(--text);
}

.score-value.wrong {
    color: var(--error);
}

.score-item.streak .score-value {
    color: var(--warning);
}

.streak-fire {
    display: none;
}

/* Main Content */
.main-content {
    flex: 1;
}

.screen.hidden {
    display: none;
}

/* Start Screen */
.start-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
}

.start-icon {
    font-size: 4rem;
    /* 64px */
    margin-bottom: 1.5rem;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-0.625rem);
    }

    100% {
        transform: translateY(0);
    }
}

.start-content h2 {
    font-size: 2rem;
    /* 32px */
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: 0.02rem;
}

.start-content>p {
    color: var(--text-secondary);
    font-size: 1.0625rem;
    /* 17px */
    margin-bottom: 2.5rem;
}

/* Selectors */
.category-select,
.difficulty-select {
    margin-bottom: 2rem;
    text-align: left;
}

.category-select h3,
.difficulty-select h3 {
    font-size: 0.8125rem;
    /* 13px */
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: -0.0125rem;
    margin-left: 0.25rem;
    font-weight: 600;
}

.category-buttons,
.difficulty-buttons {
    display: grid;
    gap: 0.5rem;
}

.category-buttons {
    grid-template-columns: repeat(2, 1fr);
}

.difficulty-buttons {
    grid-template-columns: repeat(3, 1fr);
}

.category-btn,
.difficulty-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text);
    transition: all 0.2s;
}

.category-btn:active,
.difficulty-btn:active {
    transform: scale(0.96);
    background: var(--bg-hover);
}

.category-btn.active,
.difficulty-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 0.25rem 0.75rem rgba(10, 132, 255, 0.3);
}

.category-btn.active span,
.difficulty-btn.active span {
    color: white !important;
}

.cat-icon,
.diff-icon {
    font-size: 1.5rem;
    margin-bottom: 0.375rem;
}

.diff-desc {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
}

/* Buttons */
.start-btn,
.learning-btn,
.review-wrong-btn,
.check-btn,
.next-btn,
.retry-btn,
.retry-wrong-btn,
.home-btn,
.home-btn-learning {
    width: 100%;
    height: 3.125rem;
    /* 50px */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.0625rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    gap: 0.5rem;
    transition: transform 0.1s, opacity 0.2s;
}

.start-btn:active,
.learning-btn:active {
    transform: scale(0.98);
}

.start-btn,
.check-btn,
.next-btn,
.retry-btn {
    background: var(--accent);
    color: white;
    box-shadow: 0 0.25rem 0.75rem rgba(10, 132, 255, 0.25);
}

.check-btn {
    margin-top: 2rem;
}

.home-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.learning-btn,
.home-btn,
.home-btn-learning {
    background: var(--bg-card);
    color: var(--accent);
}

.review-wrong-btn {
    background: transparent;
    color: var(--error);
    margin-top: 1rem;
    border: 1px solid rgba(255, 69, 58, 0.3);
}

.btn-arrow {
    display: none;
}

.wrong-count-badge {
    background: var(--error);
    color: white;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-weight: 700;
}

/* Quiz Screen */
.quiz-header {
    width: 100%;
}

.quiz-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exit-btn,
.skip-btn {
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 1rem;
    cursor: pointer;
    font-weight: 500;
}

.progress-bar {
    height: 0.375rem;
    background: var(--bg-input);
    border-radius: 0.1875rem;
    overflow: hidden;
    margin-top: 0.5rem;
    width: 100%;
}

.progress-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.3s ease;
}

.menu-card {
    text-align: center;
}

.menu-category {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.menu-name {
    font-size: 1.2rem;
    /* 28px */
    font-weight: 800;
    line-height: 1.2;
}

.drop-zone {
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    border: solid .1rem var(--bg-input);
    border-radius: 1.5rem;
    margin: 1rem 0;
}

.drop-slot, .drop-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    transition: transform 0.2s, background 0.2s;
}

.drop-slot.empty {
    background: var(--bg-input);
    color: var(--text-secondary);
}

.drop-slot.empty.drag-over {
    transform: scale(1.02);
    border: 0.125rem solid var(--accent);
    background: rgba(10, 132, 255, 0.1);
}

.drop-slot.filled {
    background: var(--bg-card);
}

.drop-number {
    width: 1.5rem;
    height: 1.5rem;
    background: var(--bg-input);
    color: var(--text-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.ingredient-name {
    flex: 1;
    font-size: 1rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.remove-btn {
    width: 1.5rem;
    height: 1.5rem;
    background: var(--bg-input);
    color: var(--text-secondary);
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hint-item {
    background: var(--bg);
}

/* Ingredient Pool */
.ingredient-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem 0 1rem;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.ingredient-tabs::-webkit-scrollbar {
    display: none;
}

.ingredient-tab {
    display: flex;
    gap: .5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-input);
    border: none;
    border-radius: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s;
}

.ingredient-tab.active {
    background: var(--text);
    color: var(--bg);
}

.ingredient-pool {
    display: flex;
    flex-flow: wrap;
    gap: .75rem;
    padding: 0 1rem 1rem;
}

.ingredient-category {
    display: none;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.ingredient-category.active {
    display: flex;
}

.ingredient-item {
    padding: .5rem;
    background: var(--bg-card);
    border-radius: var(--radius-s);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text);
    cursor: grab;
    transition: transform 0.1s;
}

.ingredient-item:active {
    transform: scale(0.96);
}

.ingredient-item.used {
    opacity: 0.3;
}

/* Result / Final Screens */
.result-screen,
.final-screen {
    min-height: 70vh;
    display: flex;
    align-items: center;
}

.result-content,
.final-content {
    width: 100%;
    text-align: center;
}

.result-icon,
.final-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    display: block;
}

.result-content h2,
.final-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.result-message {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.0625rem;
}

.correct-build {
    text-align: left;
    margin-bottom: 2rem;
}

.build-list {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
}

.correct-item {
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.05);
}

.correct-item:last-child {
    border-bottom: none;
}

.correct-number {
    width: 1.5rem;
    height: 1.5rem;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.correct-item.wrong .correct-number {
    background: var(--error);
}

.user-answer {
    font-size: 0.75rem;
    color: var(--error);
    margin-left: 0.5rem;
    font-weight: 500;
}

/* Final Stats */
.final-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.03rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 0.25rem;
}

.final-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Learning Screen */
.learning-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
}

.learning-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.learning-result {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: var(--radius);
    margin-top: 1.5rem;
}

.related-menus {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.menu-chip {
    background: var(--bg-input);
    padding: 0.5rem 0.875rem;
    border-radius: 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--text);
}

.ingredient-item.selected {
    border: 0.0625rem solid var(--accent);
    background: rgba(10, 132, 255, 0.15);
    color: var(--accent);
}

@media (min-width: 30rem) {
    .final-actions {
        flex-direction: row;
    }
}