/* Feature layers — themes, effects, chat, builder, matchmaker, play, plans */

.fx-canvas {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}
html[data-mode="frost"] .fx-canvas,
html[data-mode="flame"] .fx-canvas { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .fx-canvas { display: none; }
}

/* Mode toggle + mood */
.mode-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem;
  background: rgba(0,0,0,0.25);
  flex-shrink: 0;
}
.mode-toggle button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.38rem 0.65rem;
  border-radius: 999px;
  min-height: 2rem;
}
.mode-toggle button[aria-pressed="true"][data-mode="frost"] {
  background: var(--frost);
  color: #06202b;
}
.mode-toggle button[aria-pressed="true"][data-mode="flame"] {
  background: var(--flame);
  color: #1a0803;
}
.mood-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--silver);
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  min-height: 2.3rem;
}
html[data-mode="frost"] body { background: var(--bg-frost); }
html[data-mode="flame"] body { background: var(--bg-flame); }
html[data-mode="frost"] .menu { --tone-bg: var(--bg-frost); }
html[data-mode="flame"] .menu { --tone-bg: var(--bg-flame); }

.hero-copy, .section, .footer { position: relative; z-index: 6; }

.hero-media { transition: opacity 0.6s ease; }

/* Mood sheet */
.mood-sheet { max-width: 28rem; width: min(calc(100% - 1.5rem), 28rem); border-radius: 1.25rem; border: 1px solid var(--line-strong); background: var(--bg-elev); color: var(--text); padding: 0; }
.mood-grid { display: grid; gap: 0.55rem; padding: 1.1rem; }
.mood-card {
  display: grid; gap: 0.15rem; text-align: left;
  border: 1px solid var(--line); background: transparent; color: inherit;
  border-radius: 0.9rem; padding: 0.85rem 1rem;
}
.mood-card strong { font-family: var(--font-display); font-size: 1.15rem; font-weight: 500; }
.mood-card span { color: var(--muted); font-size: 0.85rem; }
.mood-card[aria-pressed="true"] { border-color: var(--frost); background: var(--frost-dim); }
html[data-mode="flame"] .mood-card[aria-pressed="true"] { border-color: var(--flame); background: var(--flame-dim); }

/* Clips on signature cards */
.sig-media { cursor: pointer; }
.sig-media video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 0.4s ease;
}
.sig-media.is-playing video { opacity: 1; }
.clip-hint {
  position: absolute; right: 0.6rem; bottom: 0.6rem;
  background: rgba(0,0,0,0.55); color: #fff; border: 0;
  border-radius: 999px; padding: 0.28rem 0.6rem; font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; z-index: 1;
}

/* Chat */
.chat-fab {
  position: fixed;
  right: 1rem;
  left: auto;
  bottom: calc(5.2rem + env(safe-area-inset-bottom, 0px));
  z-index: 46;
  width: 3.35rem; height: 3.35rem; border-radius: 999px;
  border: 0; background: var(--frost); color: #06202b;
  font-weight: 700; font-size: 0.7rem; letter-spacing: 0.04em;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
html[data-mode="flame"] .chat-fab { background: var(--flame); color: #1a0803; }
@media (min-width: 960px) {
  .chat-fab { bottom: 1.5rem; }
}
/* Phones: sit the bubble in the gap between the hero buttons and the order bar
   so it no longer overlaps "See the menu" (390–430px wide). */
@media (max-width: 479px) {
  .chat-fab { bottom: calc(4.8rem + env(safe-area-inset-bottom, 0px)); }
}
.chat-panel {
  position: fixed; z-index: 50;
  left: 0.75rem; right: 0.75rem;
  bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  max-height: min(34rem, 82vh);
  display: flex; flex-direction: column;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 1.2rem;
  box-shadow: 0 16px 60px rgba(0,0,0,0.45);
  padding: 0;
}
@media (min-width: 640px) {
  .chat-panel { left: auto; right: 1.25rem; width: 22.5rem; }
}
.chat-log { flex: 1; min-height: 0; overflow: auto; padding: 0.9rem 1rem; display: grid; gap: 0.65rem; }
.chat-panel .sheet-head, .chat-form, .chat-hints, #chat-disclaimer, .chat-panel > label { flex-shrink: 0; }
.chat-panel { overflow: hidden; }
.bubble { max-width: 92%; padding: 0.7rem 0.85rem; border-radius: 1rem; font-size: 0.95rem; }
.bubble-bot { background: rgba(255,255,255,0.05); border: 1px solid var(--line); border-bottom-left-radius: 0.3rem; }
.bubble-user { margin-left: auto; background: var(--text); color: #12110f; border-bottom-right-radius: 0.3rem; }
.chat-picks { display: grid; gap: 0.4rem; margin-top: 0.55rem; }
.chat-pick {
  display: flex; justify-content: space-between; gap: 0.5rem; align-items: center;
  border: 1px solid var(--line); border-radius: 0.8rem; padding: 0.45rem 0.6rem;
  background: transparent; color: inherit; text-align: left; width: 100%; font: inherit;
}
.chat-form { display: flex; gap: 0.4rem; padding: 0.7rem 0.85rem 0.9rem; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; background: #0b0d10; border: 1px solid var(--line-strong); border-radius: 999px; padding: 0.65rem 0.9rem; }
.chat-hints { display: flex; gap: 0.35rem; overflow-x: auto; padding: 0 1rem 0.5rem; scrollbar-width: none; }
.chat-hints button {
  flex: 0 0 auto; border: 1px solid var(--line); background: transparent; color: var(--silver);
  border-radius: 999px; padding: 0.3rem 0.65rem; font-size: 0.78rem;
}

/* Shared feature cards */
.feature-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  padding: 1.15rem;
}
.step-pills, .opt-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.live-price { font-family: var(--font-display); font-size: 2rem; font-weight: 500; color: var(--frost); }
html[data-mode="flame"] .live-price { color: var(--flame); }
.builder-steps { display: grid; gap: 1.15rem; max-width: 40rem; }
.progress {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.35rem;
  font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); text-align: center;
}
.progress span { padding-bottom: 0.35rem; border-bottom: 2px solid var(--line); }
.progress span.is-on { color: var(--text); border-color: var(--frost); }
.mm-results { display: grid; gap: 0.75rem; margin-top: 1.25rem; }
.pick-card { display: grid; gap: 0.3rem; }
.pick-card h3 { margin: 0; font-family: var(--font-display); font-size: 1.35rem; font-weight: 500; }
.why { margin: 0; font-style: italic; color: var(--muted); }

/* Dial */
.dial { max-width: 36rem; margin: 0 auto; }
.dial input[type="range"] { width: 100%; accent-color: var(--flame); }
.dial-level { font-family: var(--font-display); font-size: 2.2rem; margin: 0.4rem 0 1rem; }
.dial-dots { display: flex; gap: 0.25rem; margin-bottom: 0.6rem; }
.dial-dots i { flex: 1; height: 0.4rem; border-radius: 999px; background: var(--line); }
.dial-dots i.is-on { background: color-mix(in srgb, var(--frost) 50%, var(--flame)); }

/* Mix + play */
.mix-grid { display: grid; gap: 0.75rem; }
@media (min-width: 640px) { .mix-grid { grid-template-columns: 1fr 1fr; } }
.play-tabs { display: flex; gap: 0.4rem; margin-bottom: 1rem; }
.quiz-q { font-family: var(--font-display); font-size: 1.35rem; margin: 0 0 0.8rem; }
.quiz-choices { display: grid; gap: 0.4rem; }
.quiz-choices button, .puzzle-list button {
  text-align: left; border: 1px solid var(--line); background: transparent; color: inherit;
  border-radius: 0.8rem; padding: 0.7rem 0.9rem;
}
.quiz-choices button.is-right { border-color: var(--frost); }
.quiz-choices button.is-wrong { opacity: 0.5; }

/* Plans / postcode */
.plan-form { display: grid; gap: 0.7rem; margin-top: 1rem; max-width: 28rem; }
.pc-row { display: flex; gap: 0.4rem; margin-top: 0.75rem; }
.pc-row input { flex: 1; background: #0b0d10; border: 1px solid var(--line-strong); border-radius: 0.7rem; padding: 0.65rem 0.8rem; }
.pc-msg { margin: 0.5rem 0 0; font-size: 0.9rem; color: var(--muted); }
.pc-msg.is-ok { color: var(--frost); }
.pc-msg.is-no { color: var(--ember); }

.chip.is-on, .chip[aria-pressed="true"] { background: var(--text); color: #12110f; border-color: var(--text); }
.step-pills .chip { border: 1px solid var(--line-strong); background: transparent; color: inherit; border-radius: 999px; padding: 0.45rem 0.75rem; font-size: 0.88rem; }
.step-pills .chip { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.step-pills .chip.is-on, .step-pills .chip[aria-pressed="true"] { background: var(--text); color: #12110f; border-color: var(--text); }
.mm-filters-note { margin: 0.6rem 0 0; font-size: 0.85rem; color: var(--muted); }

select {
  width: 100%;
  background: #0b0d10;
  border: 1px solid var(--line-strong);
  border-radius: 0.7rem;
  padding: 0.7rem 0.8rem;
  color: inherit;
  margin-top: 0.3rem;
}
#mm-form label, .plan-form label { display: grid; gap: 0.3rem; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
#mm-form input[type="number"], #mm-form input[type="range"] { margin-top: 0.3rem; }
.mood-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.mood-icon { display: block; flex-shrink: 0; }
@media (max-width: 639px) {
  :root { --pad: 0.75rem; }
  html, body { overflow-x: hidden; }
  .header {
    gap: 0.3rem;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
    overflow: hidden;
    max-width: 100%;
  }
  .logo { min-width: 0; flex: 0 1 auto; }
  .logo img { max-width: 6.9rem; height: 1.95rem; }
  .nav { gap: 0.25rem; min-width: 0; flex-shrink: 1; }
  .mode-toggle { padding: 0.08rem; }
  .mode-toggle button {
    padding: 0.26rem 0.4rem;
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    min-height: 1.8rem;
  }
  .mood-btn {
    width: 1.9rem;
    height: 1.9rem;
    min-height: 1.9rem;
    padding: 0;
  }
  .mood-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .cart-btn {
    padding: 0.3rem 0.55rem;
    font-size: 0.76rem;
    flex-shrink: 0;
    white-space: nowrap;
  }
}

.chat-panel[hidden] { display: none !important; }

/* Letter-by-letter hero wordmark — bold and quick */
.wordmark .frost > span,
.wordmark .amp,
.wordmark .flame > span {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 0.42em, 0) scale(0.84);
  animation: spell-in 0.4s cubic-bezier(0.16, 0.84, 0.32, 1.1) forwards;
  animation-delay: calc(var(--i) * 70ms + 80ms);
}
@keyframes spell-in {
  55% { opacity: 1; transform: translate3d(0, -0.07em, 0) scale(1.06); }
  100% { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .wordmark .frost > span,
  .wordmark .amp,
  .wordmark .flame > span {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* Whole-page frost / flame atmospheres so weather shows through */
html[data-mode="frost"] body { background: #051018; }
html[data-mode="frost"] .section,
html[data-mode="frost"] .menu,
html[data-mode="frost"] .footer,
html[data-mode="frost"] .tabs-wrap {
  background: color-mix(in srgb, var(--tone-bg, var(--bg-frost)) 78%, transparent);
}
html[data-mode="frost"] .section-dark,
html[data-mode="frost"] .footer {
  background: color-mix(in srgb, #07141c 80%, transparent);
}
html[data-mode="frost"] .header,
html[data-mode="frost"] .order-bar {
  background: rgba(5, 16, 24, 0.9);
  box-shadow: inset 0 -1px 0 rgba(154, 216, 240, 0.18);
}

html[data-mode="flame"] body { background: #1a0804; }
html[data-mode="flame"] .section,
html[data-mode="flame"] .menu,
html[data-mode="flame"] .footer,
html[data-mode="flame"] .tabs-wrap {
  background: color-mix(in srgb, var(--tone-bg, var(--bg-flame)) 76%, transparent);
}
html[data-mode="flame"] .section-dark,
html[data-mode="flame"] .footer {
  background: color-mix(in srgb, #140a08 78%, transparent);
}
html[data-mode="flame"] .header,
html[data-mode="flame"] .order-bar {
  background: rgba(26, 8, 4, 0.9);
  box-shadow: inset 0 -1px 0 rgba(255, 122, 61, 0.22);
}
html[data-mode="flame"] .hero-dim {
  background:
    linear-gradient(180deg, rgba(40,10,4,0.35) 0%, rgba(30,8,4,0.4) 40%, rgba(20,6,3,0.88) 100%),
    radial-gradient(ellipse at 50% 80%, rgba(255,80,20,0.18), transparent 55%);
}
html[data-mode="frost"] .hero-dim {
  background:
    linear-gradient(180deg, rgba(4,16,28,0.4) 0%, rgba(5,18,28,0.5) 40%, rgba(5,12,18,0.9) 100%),
    radial-gradient(ellipse at 50% 80%, rgba(120,200,240,0.12), transparent 55%);
}

.chat-panel .sheet-head,
.chat-panel #chat-disclaimer,
.chat-panel > label {
  background: var(--bg-elev);
  position: relative;
  z-index: 2;
}

#build.section { padding-bottom: calc(7.5rem + env(safe-area-inset-bottom, 0px)); }

.ig-link { color: var(--silver); font-weight: 600; text-decoration: none; }
.ig-link:hover { color: var(--frost); }
.visit-card .ig-link { display: inline-block; margin-top: 0.7rem; color: var(--frost); }

html[data-mode="flame"] .hero .btn-frost {
  background: #9ad8f0;
  color: #06202b;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
html[data-mode="flame"] .hero .btn-ghost {
  background: rgba(22, 8, 4, 0.88);
  border-color: rgba(255,200,140,0.45);
}


/* Cart badges, qty steppers, +1 fly, dish sheet */
.cart-btn,
.order-bar .btn-cart { position: relative; }
@media (max-width: 639px) {
  .header { overflow: visible; }
  .header .cart-btn { padding: 0.3rem 1.05rem 0.3rem 0.55rem; }
}
.cart-btn .cart-count,
.order-bar .cart-count {
  position: absolute;
  top: -0.4rem;
  right: -0.4rem;
  margin: 0;
  display: none;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: var(--flame);
  color: #1a0803;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.25rem;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg-elev, #101215);
}
.cart-count.is-on { display: flex; align-items: center; justify-content: center; }
.cart-count.pop { animation: badge-pop 0.42s var(--ease, cubic-bezier(0.22, 1, 0.36, 1)); }
@keyframes badge-pop {
  0% { transform: scale(0.4); }
  55% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(0,0,0,0.2);
}
.qty-stepper button {
  width: 2.15rem;
  height: 2.15rem;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1;
}
.qty-stepper [data-step-qty] {
  min-width: 1.35rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
}
html[data-mode="frost"] .qty-stepper { box-shadow: inset 0 0 0 1px rgba(154,216,240,0.18); }
html[data-mode="flame"] .qty-stepper { box-shadow: inset 0 0 0 1px rgba(255,122,61,0.22); }

.fly-plus {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  transform: translate(-50%, -50%);
  font-family: var(--font-sans, inherit);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--frost);
  text-shadow: 0 0 12px rgba(154,216,240,0.8);
  animation: fly-plus 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
html[data-mode="flame"] .fly-plus { color: var(--flame); text-shadow: 0 0 12px rgba(255,122,61,0.8); }
@keyframes fly-plus {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.45); }
}

.dish, .sig-card { cursor: pointer; }
.dish .add-slot, .sig-card .add-slot { cursor: default; }

.dish-sheet {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}
.dish-sheet::backdrop { background: rgba(0,0,0,0.55); }
.dish-sheet-inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-elev, #101215);
  overflow: hidden;
  transition: transform 0.2s ease;
}
.dish-sheet-handle {
  flex: 0 0 auto;
  width: 3rem;
  height: 0.35rem;
  margin: 0.55rem auto 0;
  border-radius: 999px;
  background: rgba(245,242,236,0.28);
}
.dish-sheet .icon-close {
  position: absolute;
  top: calc(0.55rem + env(safe-area-inset-top, 0px));
  right: 0.7rem;
  z-index: 3;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
}
.dish-sheet-media {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 26svh;
  background: #0b0d10;
  overflow: hidden;
}
.dish-sheet-media img,
.dish-sheet-media .ph,
.dish-sheet-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dish-sheet-media video {
  position: absolute;
  inset: 0;
  background: #000;
}
.dish-sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 1.15rem 1.15rem 1.35rem;
  -webkit-overflow-scrolling: touch;
}
.dish-sheet-body .allergens { margin-bottom: 0.25rem; }

.dish-sheet-body h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.85rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.dish-sheet-body > .price {
  margin: 0.35rem 0 0;
  font-weight: 700;
  font-size: 1.15rem;
}
.dish-sheet-desc { margin: 0.75rem 0 0; color: var(--muted); }
.dish-sheet-options { margin: 1rem 0 0; display: grid; gap: 0.85rem; }
.dish-sheet-options .opt-group { margin: 0; }
.dish-sheet-options .opt-group h3 {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.opt-hint { margin: 0 0 0.4rem; font-size: 0.75rem; color: var(--muted); font-style: italic; }
.dish-sheet-body > .price.is-pending { font-weight: 500; color: var(--muted); font-size: 0.95rem; }
.spice-level { margin: 0.55rem 0 0; font-size: 0.88rem; font-weight: 600; color: var(--ember); }
.ingredients { margin: 1.15rem 0 0; }
.ingredients h3 {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ingredients ul {
  margin: 0;
  padding: 0 0 0 1.1rem;
  color: var(--text);
}
.ingredients li { margin: 0.2rem 0; }
.dish-sheet-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex: 0 0 auto;
  margin: 0;
  padding: 0.85rem 1.15rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--bg-elev, #101215);
}
.dish-sheet-actions .btn-add { flex: 1; min-height: 2.6rem; }
@media (min-width: 720px) {
  .dish-sheet {
    width: min(32rem, 100%);
    height: min(52rem, 100%);
    max-height: 100%;
    margin: auto;
    border-radius: 1.25rem;
    overflow: hidden;
  }
}
