/* =============== Reset =============== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body, h1, h2, p { margin: 0; }
button, a { font: inherit; }

/* =============== Theme =============== */
:root {
    --bg: #0b1020;
    --text: #eef2ff;
    --muted: rgba(238,242,255,.72);
    --card: rgba(255,255,255,.08);
    --card-border: rgba(255,255,255,.14);
    --shadow: 0 24px 60px rgba(0,0,0,.45);
    --shadow-soft: 0 10px 30px rgba(0,0,0,.30);

    --accent: #7c3aed;      /* default */
    --accent-2: #22c55e;    /* secondary pop */
    --accent-ink: #0b1020;  /* text on bright */

    --radius: 18px;
    --radius-sm: 14px;

    --space-1: .5rem;
    --space-2: .75rem;
    --space-3: 1rem;
    --space-4: 1.5rem;
    --space-5: 2rem;
    --space-6: 3rem;

    --ease: cubic-bezier(.2, .8, .2, 1);
    --fast: 140ms;
    --base: 240ms;
    --slow: 420ms;

    --tap: 52px;
}

body {
    min-height: 100%;
    background: radial-gradient(1200px 800px at 20% 10%, rgba(124,58,237,.25), transparent 60%),
    radial-gradient(1000px 700px at 90% 30%, rgba(34,197,94,.18), transparent 55%),
    radial-gradient(900px 700px at 30% 90%, rgba(59,130,246,.20), transparent 60%),
    var(--bg);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
    line-height: 1.5;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Animated background blobs (lightweight CSS only) */
.bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}
.blob {
    position: absolute;
    width: 520px;
    height: 520px;
    border-radius: 999px;
    filter: blur(40px);
    opacity: .55;
    transform: translate3d(0,0,0);
    mix-blend-mode: screen;
    will-change: transform;
}
.blob.one  { background: radial-gradient(circle at 30% 30%, rgba(124,58,237,.9), rgba(124,58,237,0) 62%); top: -140px; left: -140px; animation: drift1 14s var(--ease) infinite alternate; }
.blob.two  { background: radial-gradient(circle at 30% 30%, rgba(34,197,94,.85), rgba(34,197,94,0) 60%); top: 10%; right: -180px; animation: drift2 16s var(--ease) infinite alternate; }
.blob.three{ background: radial-gradient(circle at 30% 30%, rgba(59,130,246,.8), rgba(59,130,246,0) 60%); bottom: -220px; left: 25%; animation: drift3 18s var(--ease) infinite alternate; }

@keyframes drift1 { from { transform: translate(-10px, 10px) scale(1); } to { transform: translate(80px, 40px) scale(1.08); } }
@keyframes drift2 { from { transform: translate(0, 0) scale(1); } to { transform: translate(-80px, 60px) scale(1.06); } }
@keyframes drift3 { from { transform: translate(0, 0) scale(1); } to { transform: translate(60px, -70px) scale(1.10); } }

/* =============== Layout =============== */
.container {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    margin: 0 auto;
    padding: var(--space-5) var(--space-3) var(--space-6);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-4);
}

header {
    text-align: center;
    padding-top: var(--space-2);
    animation: enterTop .6s var(--ease) both;
}
@keyframes enterTop {
    from { opacity: 0; transform: translateY(-14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    margin-bottom: .35rem;
}

.logoDot {
    width: 12px; height: 12px; border-radius: 99px;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.9), rgba(255,255,255,0) 60%), var(--accent);
    box-shadow: 0 0 0 6px rgba(255,255,255,.06), 0 0 0 12px rgba(255,255,255,.03);
}

h1 {
    font-size: clamp(2rem, 6vw, 2.8rem);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.tagline {
    margin-top: .6rem;
    color: var(--muted);
    font-size: 1.05rem;
}

/* =============== Card =============== */
.card {
    background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: var(--space-5);
    position: relative;
    overflow: hidden;
}

/* Accent glow ring (changes per cuisine) */
.card::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: radial-gradient(900px 220px at 30% 0%, rgba(255,255,255,.18), transparent 60%),
    radial-gradient(500px 280px at 90% 10%, color-mix(in oklab, var(--accent), transparent 55%), transparent 65%);
    opacity: .9;
    pointer-events: none;
}

.cardInner { position: relative; z-index: 1; }

.initial-state {
    text-align: center;
    animation: enterUp .7s var(--ease) .08s both;
}
@keyframes enterUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.lead {
    font-size: 1.08rem;
    color: rgba(238,242,255,.78);
    margin: 0 auto var(--space-4);
    max-width: 46ch;
}

/* =============== Result =============== */
.result-state {
    display: none;
}
.result-state.active {
    display: block;
    animation: enterUp .55s var(--ease) both;
}

.resultTop {
    display: grid;
    gap: var(--space-2);
    justify-items: center;
    text-align: center;
    margin-bottom: var(--space-4);
}

.emoji {
    font-size: 3.75rem;
    line-height: 1;
    transform: translateZ(0);
    filter: drop-shadow(0 12px 18px rgba(0,0,0,.35));
}

.cuisine-name {
    font-size: clamp(1.6rem, 4.6vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-top: .15rem;
    color: color-mix(in oklab, var(--accent), white 20%);
    text-shadow: 0 10px 30px rgba(0,0,0,.35);
}

.cuisine-description {
    color: rgba(238,242,255,.78);
    max-width: 52ch;
    margin: 0 auto;
}

.mood {
    margin-top: .25rem;
    font-size: .95rem;
    color: rgba(238,242,255,.70);
    padding: .35rem .65rem;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
}

/* History pills */
.history {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
    margin: var(--space-3) 0 var(--space-4);
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .45rem .7rem;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    color: rgba(238,242,255,.86);
    font-size: .9rem;
    user-select: none;
}
.pillDot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(255,255,255,.05);
}

/* =============== Buttons =============== */
.actions {
    display: grid;
    gap: .75rem;
    margin-top: var(--space-3);
}

.btn {
    min-height: var(--tap);
    width: 100%;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    transition: transform var(--fast) var(--ease), filter var(--fast) var(--ease), box-shadow var(--fast) var(--ease), background var(--fast) var(--ease);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
    overflow: hidden;
    padding: 1rem 1.15rem;
}

.btn:focus-visible {
    outline: 3px solid color-mix(in oklab, var(--accent), white 25%);
    outline-offset: 3px;
}

.btn:active { transform: translateY(1px) scale(.99); }

/* Primary: accent gradient */
.btn-primary {
    color: #0b1020;
    background: linear-gradient(135deg,
    color-mix(in oklab, var(--accent), white 12%),
    color-mix(in oklab, var(--accent-2), white 6%)
    );
    box-shadow: 0 18px 35px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.10) inset;
    filter: saturate(1.05);
}
.btn-primary:hover { transform: translateY(-1px); filter: saturate(1.15) brightness(1.02); }
.btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(240px 120px at 30% 0%, rgba(255,255,255,.55), transparent 65%);
    opacity: .55;
    pointer-events: none;
    transition: opacity var(--base) var(--ease);
}
.btn-primary:hover::after { opacity: .72; }

/* Secondary */
.btn-secondary {
    color: rgba(238,242,255,.92);
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.14);
    box-shadow: var(--shadow-soft);
}
.btn-secondary:hover { transform: translateY(-1px); background: rgba(255,255,255,.08); }

/* Success / Order */
.btn-order {
    color: rgba(238,242,255,.98);
    background: rgba(34,197,94,.18);
    border: 1px solid rgba(34,197,94,.28);
    box-shadow: var(--shadow-soft);
}
.btn-order:hover { transform: translateY(-1px); background: rgba(34,197,94,.22); }

/* Tiny utility row */
.utility {
    display: flex;
    justify-content: center;
    gap: .75rem;
    margin-top: .85rem;
    flex-wrap: wrap;
}
.btn-mini {
    min-height: 42px;
    padding: .7rem .9rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: .95rem;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.14);
    color: rgba(238,242,255,.92);
    box-shadow: var(--shadow-soft);
}
.btn-mini:hover { transform: translateY(-1px); background: rgba(255,255,255,.08); }

/* Spinner / shuffle */
.spinner {
    display: none;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(11,16,32,.25);
    border-top-color: rgba(11,16,32,.85);
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.picking .btn-text { display: none; }
.picking .spinner { display: inline-block; }

/* Shuffle text */
.shuffleHint {
    margin-top: .75rem;
    font-size: .95rem;
    color: rgba(238,242,255,.70);
    display: none;
}
.picking + .shuffleHint { display: block; }

/* Footer */
footer {
    text-align: center;
    color: rgba(238,242,255,.55);
    font-size: .9rem;
    padding: 0 var(--space-3) var(--space-4);
    position: relative;
    z-index: 1;
    animation: fadeIn .7s var(--ease) .6s both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Desktop tweaks */
@media (min-width: 680px) {
    .actions {
        grid-template-columns: 1fr 1fr;
    }

}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .blob { animation: none !important; }
    * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

.content {
    max-width: 65ch;
    margin: 0 auto;
    padding: 1.5rem 0;
    color: rgba(238,242,255,.72);
}

.content h2 {
    font-size: 1.1rem;
    color: rgba(238,242,255,.9);
    margin-bottom: .5rem;
}