/* ─────────────────────────────────────────────────────────────────────
   What's for Dinner? — cozy UI chrome + the schedule-planner board.
   ───────────────────────────────────────────────────────────────────── */
:root {
  --bg: #1b1430; --bg2: #211738; --card: #281d46; --card2: #33265c; --ink: #f6f1ff;
  --muted: #b7a9d8; --line: #4a3585; --gold: #ffce5c; --gold-deep: #e0a92e;
  --good: #5fd6a0; --bad: #ff7a8a; --warn: #ffb454; --accent: #8a6cf0;
  --steel: #cfd6dd; --steel-d: #9aa4ad; --flame: #ff8a3c;
  --d0: #f0b24e; --d0a: #ffd98a; --d0b: #ef9f3a; --d0ink: #4a3206;   /* dish 1 — amber */
  --d1: #46bcae; --d1a: #8fe3d6; --d1b: #38ad9f; --d1ink: #06352f;   /* dish 2 — teal  */
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; color: var(--ink); line-height: 1.45;
  background: radial-gradient(120% 80% at 50% -10%, #2a1d4d 0%, var(--bg) 55%) fixed;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
#app { max-width: 560px; margin: 0 auto; padding: 12px 12px 36px; }
h1 { font-size: 1.5rem; text-align: center; margin: 6px 0; }
.muted { color: var(--muted); } .center { text-align: center; }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }

.btn {
  display: block; width: 100%; padding: 15px; margin-top: 12px; border: none; border-radius: 15px;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep)); color: #3a2700;
  font-size: 1.05rem; font-weight: 800; cursor: pointer; box-shadow: 0 6px 18px rgba(224,169,46,.28);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { background: #392f56; color: #7a7196; box-shadow: none; cursor: default; }
.btn.ghost { background: transparent; color: var(--gold); border: 1.5px solid var(--gold-deep); box-shadow: none; }
.btn.sm2 { padding: 11px; font-size: .9rem; margin-top: 0; }
.controls { margin-top: 12px; }
.row2 { display: flex; gap: 8px; }
.row2 .btn { flex: 1; }

.glyph, .face-svg, .char-svg { display: block; width: 100%; height: 100%; }
.ico { display: inline-flex; width: 34px; height: 34px; }
.ico.sm { width: 22px; height: 22px; }
.ico.plated { position: relative; }
/* dish photo overlay — fills the .ico box, covering the glyph; removed by onerror if missing */
.dish-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

/* ── Start / intro screen ──────────────────────────────────────────── */
.intro { text-align: center; padding: 6px 2px 8px; }
.intro-logo { margin: 8px auto 4px; }
/* hero video sized to match the Start button: full content column, same 15px corners */
.intro-video { display: block; width: 100%; height: auto; margin: 0 auto 4px;
  border-radius: 15px; background: #1b1430; box-shadow: 0 8px 22px rgba(0,0,0,.35); }
.intro-title { font-size: 1.9rem; margin: 6px 0 0; }
.preview-badge { display: inline-block; margin: 8px 0 2px; padding: 3px 14px; border-radius: 999px;
  background: rgba(95,214,160,.16); border: 1px solid var(--good); color: var(--good);
  font-size: .72rem; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; }
.intro-tag { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: .82rem; color: var(--muted); margin: 4px 0 14px; letter-spacing: .02em; }
.intro-tag b { color: var(--gold); }
.brand-mark { height: 24px; width: auto; flex: none; display: block; }
.fa-link { color: var(--gold); text-decoration: none; }
.fa-link:hover { text-decoration: underline; }
.intro-lead { font-size: .95rem; margin: 0 12px 14px; line-height: 1.5; }
.rules { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.rule { display: flex; gap: 11px; align-items: center; background: var(--card); border: 1px solid var(--line);
  border-radius: 13px; padding: 12px 14px; font-size: .9rem; }
.rule .r-emoji { font-size: 1.45rem; flex: none; line-height: 1; }
.rule b { color: var(--gold); }
.intro-note { font-size: .82rem; color: var(--muted); font-style: italic; margin: 13px 12px 2px; line-height: 1.5; }
.intro .btn { margin-top: 16px; }

/* ── Cuisine picker ────────────────────────────────────────────────── */
.cuisine-select .day-head h1 { font-size: 1.5rem; }
.cuisine-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.cuisine-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 10px;
  border-radius: 16px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.cuisine-card.all { grid-column: 1 / -1; border-color: var(--gold); background: #33265c; }
.cuisine-card:active { transform: translateY(1px); }
.cz-ic { font-size: 2rem; line-height: 1; }
.cz-l { font-weight: 800; font-size: .95rem; text-align: center; }
.intro-privacy { margin-top: 14px; font-size: .64rem; color: var(--muted); text-align: center; opacity: .8; }
.cz-chip { display: block; margin: 0 auto 4px; padding: 4px 12px; border-radius: 20px; border: 1px solid var(--line);
  background: var(--card); color: var(--gold); font-size: .78rem; font-weight: 700; cursor: pointer; }

/* ── Homecoming / verdict table room ───────────────────────────────── */
.day-head { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; margin: 2px 0 8px; }
.day-pill { background: var(--gold); color: #3a2700; font-weight: 800; font-size: .8rem; padding: 3px 11px; border-radius: 20px; }
.backbtn { position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 30px; height: 30px;
  border-radius: 50%; border: 1px solid var(--line); background: var(--card2); color: var(--ink);
  font-size: 1.3rem; line-height: 1; padding: 0 2px 2px 0; cursor: pointer; display: grid; place-items: center; }
.backbtn:active { transform: translateY(-50%) scale(.92); }
.room {
  position: relative; border-radius: 18px; padding: 16px 5px 0; overflow: hidden;
  background: linear-gradient(180deg, #5b4a86 0%, #7d6aa8 42%, #b79b7e 42%, #cdb08c 100%);
  border: 1px solid var(--line); box-shadow: inset 0 -30px 50px rgba(90,60,30,.25);
}
.window { position: absolute; top: 14px; right: 18px; width: 84px; height: 64px; border-radius: 8px;
  background: linear-gradient(180deg, #20305a, #3a4f86); border: 4px solid #e9dcc4; box-shadow: 0 0 24px rgba(120,150,220,.35); }
.window::before, .window::after { content: ""; position: absolute; background: #e9dcc4; }
.window::before { left: 50%; top: 0; width: 4px; height: 100%; margin-left: -2px; }
.window::after { top: 50%; left: 0; height: 4px; width: 100%; margin-top: -2px; }
.window .moon { position: absolute; right: 10px; top: 8px; width: 18px; height: 18px; border-radius: 50%; background: #ffe9a8; box-shadow: 0 0 14px #ffe9a8; }
.diners { display: flex; justify-content: space-around; align-items: flex-end; gap: 4px; position: relative; z-index: 2; }
/* margin:0 cancels the browser's default 40px inline margin on <figure>, which was eating
   ~80px per column and squeezing the speech bubbles narrow. */
.diner-fig { flex: 1 1 0; min-width: 0; margin: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.char-wrap { width: 100%; max-width: 108px; filter: drop-shadow(0 6px 6px rgba(40,20,60,.3)); margin-bottom: -2px; }
.diner-fig figcaption { display: flex; flex-direction: column; align-items: center; gap: 2px; max-width: 100%;
  background: rgba(28,20,46,.82); border-radius: 12px; padding: 5px 10px; margin-bottom: 12px; min-width: 0; }
.diner-fig figcaption b { font-size: .95rem; }
.role-tag { font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.speech { position: relative; background: #fffdf8; color: #2c2342; border-radius: 14px; padding: 9px 10px;
  font-size: .82rem; margin-bottom: 8px; box-shadow: 0 4px 12px rgba(30,18,50,.28);
  /* fill the diner's column instead of shrink-wrapping to content (which made it narrow & break a lot) */
  width: 100%; box-sizing: border-box; hyphens: none; overflow-wrap: break-word; }
.speech::after { content: ""; position: absolute; bottom: -8px; left: 50%; margin-left: -7px; border: 8px solid transparent; border-top-color: #fffdf8; border-bottom: 0; }
.bub-text { display: block; font-style: italic; line-height: 1.3; }
.dish-chip { display: inline-flex; align-items: center; gap: 5px; margin-top: 7px; font-weight: 800; font-size: .8rem;
  background: #fdeccb; color: #6b4a12; border-radius: 18px; padding: 3px 10px 3px 4px; }
.dish-chip .ico { width: 24px; height: 24px; }
.tip { font-size: .82rem; margin: 12px 4px 0; }

/* ── Schedule planner ──────────────────────────────────────────────── */
.timeline { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 8px 6px; }
.tl-body { position: relative; }
.lane { display: flex; align-items: stretch; height: 40px; margin: 7px 0; }
.lane-h { width: 52px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; font-size: .58rem; color: var(--muted); font-weight: 700; }
.lane-ic { width: 20px; height: 20px; opacity: .8; }
.track { flex: 1; position: relative; border-radius: 8px; overflow: hidden;
  background: repeating-linear-gradient(135deg, #221a3c, #221a3c 7px, #261d44 7px, #261d44 14px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.03); }
.blk { position: absolute; top: 3px; bottom: 3px; border-radius: 6px; display: flex; align-items: center; gap: 3px;
  padding: 0 5px; overflow: hidden; white-space: nowrap; font-size: .62rem; font-weight: 700; box-shadow: 0 2px 5px rgba(0,0,0,.25); }
.blk-ic { width: 17px; height: 17px; flex: none; }
.blk-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.blk-t { flex: none; font-weight: 800; opacity: .9; }
.blk.d0 { background: linear-gradient(180deg, var(--d0a), var(--d0b)); color: var(--d0ink); }
.blk.d1 { background: linear-gradient(180deg, var(--d1a), var(--d1b)); color: var(--d1ink); }
.blk.cook { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.5), 0 2px 5px rgba(0,0,0,.25); }
.blk.tweak { opacity: .92; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35); }
.blk-steam { position: absolute; right: 5px; top: -5px; width: 6px; height: 12px; border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,0)); animation: rise 1.8s ease-out infinite; }
@keyframes rise { 0% { transform: translateY(6px) scaleX(.7); opacity: 0; } 40% { opacity: .9; } 100% { transform: translateY(-8px) scaleX(1.2); opacity: 0; } }

.tl-overlay { position: absolute; left: 52px; right: 2px; top: 0; bottom: 0; pointer-events: none; }
.flag { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--steel-d); }
.flag.ok { border-color: var(--good); } .flag.miss { border-color: var(--bad); }
.flag-face { position: absolute; top: -7px; left: -11px; width: 22px; height: 22px; border-radius: 50%; overflow: hidden;
  background: var(--card2); box-shadow: 0 0 0 2px var(--card); }
.flag.ok .flag-face { box-shadow: 0 0 0 2px var(--good); } .flag.miss .flag-face { box-shadow: 0 0 0 2px var(--bad); }
.flag-m { position: absolute; bottom: -2px; left: -10px; font-size: .56rem; font-weight: 800; color: var(--muted); background: var(--card); padding: 0 2px; border-radius: 4px; }
.mk-mark { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid var(--gold); }
.mk-mark span { position: absolute; top: -2px; left: 3px; font-size: .6rem; font-weight: 900; color: #3a2700; background: var(--gold); padding: 1px 5px; border-radius: 8px; white-space: nowrap; }
.playhead { position: absolute; top: 0; bottom: 0; width: 3px; left: 0; background: #fff; box-shadow: 0 0 12px #fff, 0 0 4px var(--gold);
  animation: sweep 1.8s linear forwards; }
@keyframes sweep { from { left: 0; } to { left: 100%; } }
.timeline.serving .blk { animation: sizzle 1.8s ease-in-out; }
@keyframes sizzle { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.25); } }

/* coach line */
.coach { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px 11px; margin: 9px 0; font-size: .78rem; }
.coach.empty { color: var(--muted); display: block; line-height: 1.4; }
.coach-mk { display: flex; flex-direction: column; align-items: center; line-height: 1; flex: none; }
.coach-mk b { font-size: 1.5rem; font-weight: 900; color: var(--gold); }
.coach-mk small { font-size: .58rem; color: var(--muted); }
.coach-eat { display: flex; gap: 6px; flex-wrap: wrap; }
.eat { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 700; padding: 2px 8px 2px 2px; border-radius: 20px; }
.eat-face { width: 20px; height: 20px; border-radius: 50%; overflow: hidden; background: var(--card2); }
.eat.ok { color: var(--good); background: rgba(95,214,160,.12); } .eat.late { color: var(--bad); background: rgba(255,122,138,.12); }
.coach-tip { flex: 1; min-width: 90px; color: var(--muted); text-align: right; }
.coach-tip.warn { color: var(--warn); }

/* dish palette */
.palette { display: flex; flex-direction: column; gap: 9px; margin-top: 4px; }
.dish-plan { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; border-left: 4px solid var(--line); }
.dish-plan.d0 { border-left-color: var(--d0); } .dish-plan.d1 { border-left-color: var(--d1); }
.dp-head { display: flex; align-items: center; gap: 9px; }
.dp-plate { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 38%, #fff 0 58%, #e7e0f2 60%); box-shadow: inset 0 -3px 6px rgba(120,100,160,.3); }
.dp-plate .ico { width: 30px; height: 30px; }
.dp-meta { flex: 1; min-width: 0; } .dp-meta b { font-size: 1rem; } .dp-sub { display: block; font-size: .72rem; color: var(--muted); }
.dp-status { font-size: .66rem; font-weight: 800; color: var(--muted); border: 1px solid var(--line); border-radius: 20px; padding: 2px 8px; }
.dp-status.good { color: var(--good); border-color: var(--good); }
.dp-undo { width: 28px; height: 28px; flex: none; border-radius: 8px; border: 1px solid var(--line); background: var(--card2); color: var(--muted); font-size: 1rem; cursor: pointer; }
.dp-face { width: 32px; height: 32px; flex: none; border-radius: 50%; overflow: hidden; background: var(--card2); }
.chunk-strip { display: flex; align-items: center; gap: 4px; overflow-x: auto; padding: 9px 0 3px; -webkit-overflow-scrolling: touch; }
.tile { flex: none; width: 116px; position: relative; display: flex; flex-direction: column; gap: 3px;
  padding: 8px; border-radius: 11px; border: 1px solid var(--line); background: var(--card2); color: var(--ink);
  text-align: left; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tile:active { transform: scale(.97); }
.tile-ic { width: 26px; height: 26px; }
.tile-l { font-size: .76rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-meta { display: flex; align-items: center; justify-content: space-between; font-size: .64rem; color: var(--muted); font-weight: 700; }
.lane-tag { display: inline-flex; align-items: center; gap: 3px; }
.lane-tag .glyph { width: 14px; height: 14px; }
.tile.ready { border-color: var(--gold); cursor: pointer; box-shadow: 0 0 0 1px var(--gold-deep); animation: ready 1.6s ease-in-out infinite; }
@keyframes ready { 0%,100% { box-shadow: 0 0 0 1px var(--gold-deep); } 50% { box-shadow: 0 0 0 3px rgba(255,206,92,.35); } }
.tile-add { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--gold); color: #3a2700; font-weight: 900; font-size: 1rem; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--card); }
.tile.done { opacity: .5; }
.tile-chk { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; background: var(--good); color: #06301f; font-weight: 900; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--card); }
.tile.locked { opacity: .5; }
.tile-lock { position: absolute; top: -7px; right: -7px; font-size: .8rem; filter: grayscale(.3); }

/* step-detail modal — the full recipe for a tapped step */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(8,10,20,.62); backdrop-filter: blur(2px);
  display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { position: relative; width: 100%; max-width: 460px; max-height: 86vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px 18px 0 0;
  padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0,0,0,.5);
  animation: rise .2s cubic-bezier(.2,.8,.3,1); }
@keyframes rise { from { transform: translateY(24px); } to { transform: translateY(0); } }
.modal-x { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card2); color: var(--muted); font-size: .9rem; cursor: pointer; }
.m-head { display: flex; align-items: center; gap: 11px; padding-right: 34px; }
.m-face { width: 42px; height: 42px; flex: none; }
.m-title { display: flex; flex-direction: column; }
.m-title b { font-size: 1.06rem; }
.m-sub { font-size: .76rem; color: var(--muted); font-weight: 700; }
.m-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 12px 0 4px; font-size: .72rem; font-weight: 800; }
.m-dur { color: var(--ink); }
.mstate { padding: 2px 8px; border-radius: 999px; font-size: .68rem; }
.mstate.good { background: rgba(76,217,160,.16); color: var(--good); }
.mstate.rdy { background: rgba(255,206,92,.18); color: var(--gold); }
.mstate.lck { background: var(--card2); color: var(--muted); }
.msteps { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mstep { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; background: var(--card2); border: 1px solid var(--line); border-radius: 11px; }
.mstep-n { flex: none; width: 21px; height: 21px; border-radius: 50%; background: var(--gold); color: #3a2700; font-weight: 900; font-size: .72rem; display: grid; place-items: center; margin-top: 1px; }
.mstep-body { font-size: .85rem; line-height: 1.32; }
.mstep-meta { display: block; font-size: .68rem; color: var(--muted); font-weight: 700; margin-top: 2px; }
.m-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.strip-tip { margin: 2px 0 -2px; font-size: .68rem; }

.rack-label { font-size: .72rem; color: var(--muted); margin: 10px 0 5px; font-weight: 700; }
.spicerack { display: flex; flex-wrap: wrap; gap: 6px; padding: 7px; border-radius: 12px;
  background: linear-gradient(180deg, #4a3722, #5a4329); box-shadow: inset 0 2px 4px rgba(0,0,0,.3); }
.shaker { display: flex; align-items: center; gap: 5px; padding: 4px 9px 4px 4px; border-radius: 20px;
  border: 1.5px solid #6e5535; background: #2a2030; color: var(--ink); font-size: .76rem; cursor: pointer; }
.shaker .ico { width: 22px; height: 26px; }
.shaker .sh-c { color: var(--muted); font-size: .66rem; }
.shaker.on { border-color: var(--gold); background: #3c2a14; color: var(--gold); font-weight: 800; box-shadow: 0 0 8px rgba(255,206,92,.3); }

.plan-controls .row2 { margin-top: 8px; }
.btn.serve { background: linear-gradient(180deg, #6fe0a8, #36b07e); color: #06301f; box-shadow: 0 6px 18px rgba(54,176,126,.3); }
.btn.serve:disabled { background: #392f56; color: #7a7196; box-shadow: none; }
.serve-note { margin-top: 14px; font-size: .9rem; }
.serving-screen .timeline { box-shadow: 0 0 0 2px var(--good); }

/* ── Verdict ───────────────────────────────────────────────────────── */
.verdict h1 { font-size: 1.7rem; margin-top: 8px; }
.verdict-room { margin-top: 8px; }
.table { height: 30px; margin: 0 -8px; background: linear-gradient(180deg, #8a6a44, #6e5234); border-top: 4px solid #a07b4e; }
.table.set { box-shadow: inset 0 6px 14px rgba(0,0,0,.2); }
.verdict-fig { position: relative; }
.served-plate { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin-bottom: -6px;
  background: radial-gradient(circle at 50% 38%, #fff 0 60%, #e3dcf0 62%); box-shadow: 0 4px 10px rgba(0,0,0,.25); z-index: 3; }
.served-plate .ico { width: 38px; height: 38px; }
.verdict-fig figcaption { gap: 3px; }
.sat { font-weight: 900; font-size: 1.05rem; }
.brk { font-size: .68rem; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1.35; }
.brk-row { white-space: nowrap; }
.score-final { display: flex; flex-direction: column; align-items: center; margin-top: 14px; }
.score-final .big { font-size: 2.4rem; font-weight: 900; }
.score-final.good .big { color: var(--good); } .score-final.warn .big { color: var(--warn); } .score-final.bad .big { color: var(--bad); }
.stars { font-size: 1.7rem; color: var(--gold); letter-spacing: 5px; }
.gate-note { font-size: .85rem; margin: 4px 0 2px; }

@keyframes pop { 0% { transform: scale(.6); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.pop { animation: pop .3s ease-out; }
@media (max-width: 360px) { .char-wrap { width: 104px; } .speech { font-size: .78rem; } .tile { width: 104px; } }
