:root {
  --bg: #0b0b0c;
  --ink: #fff;
  --ink-soft: rgba(255, 255, 255, 0.78);
  --ink-mute: rgba(255, 255, 255, 0.55);
  --accent: #ff5a36;      /* TTTmenu orange */
  --accent-ink: #fff;
  --sheet: #151517;
  --sheet-line: rgba(255, 255, 255, 0.08);
  --radius: 18px;
  --display: "Fraunces", Georgia, serif;
  --body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --badge-space: 0px; /* set by app.js when the host adds a corner badge */
  --bottom-space: calc(var(--safe-bottom) + var(--badge-space));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--body); overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* On a computer, show it like a phone in the middle of the screen */
.app { position: relative; height: 100dvh; max-width: 480px; margin: 0 auto; overflow: hidden; background: #000; }
@media (min-width: 560px) {
  body { background: radial-gradient(circle at 50% 30%, #1d1d21, #08080a); }
  .app { height: min(100dvh, 920px); top: 50%; transform: translateY(-50%); border-radius: 28px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
}

/* ---------- Top bar ---------- */
.topbar {
  position: absolute; z-index: 5; inset: 0 0 auto 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + var(--safe-top)) 16px 28px;
  background: linear-gradient(to bottom, rgba(0,0,0,.6), transparent);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: .2px; }
.brand-tag { font-size: 12px; color: var(--ink-mute); letter-spacing: .08em; text-transform: uppercase; margin-top: 2px; }

.lang { display: flex; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.14); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.lang span { padding: 6px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--ink-soft); transition: .2s; }
.lang span.on { background: #fff; color: #111; }

/* ---------- Feed ---------- */
.feed { height: 100%; overflow-y: scroll; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; }
.feed::-webkit-scrollbar { display: none; }

.slide { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; background: #111; }
.slide video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide::after { /* dark fade so text is readable */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.45) 32%, transparent 58%);
}
.slide .loader { position: absolute; inset: 0; display: grid; place-items: center; }
.slide .loader::before { content: ""; width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: #fff; animation: spin 0.9s linear infinite; }
.slide.ready .loader { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.paused-icon { position: absolute; inset: 0; display: grid; place-items: center; z-index: 2; opacity: 0; transition: opacity .2s; pointer-events: none; }
.paused-icon span { width: 72px; height: 72px; border-radius: 50%; background: rgba(0,0,0,.45); display: grid; place-items: center; }
.paused-icon svg { width: 30px; height: 30px; fill: #fff; stroke: none; margin-left: 4px; }
.slide.paused .paused-icon { opacity: 1; }

/* Dish info */
.info {
  position: absolute; z-index: 3; left: 0; right: 72px;
  bottom: calc(84px + var(--bottom-space)); padding: 0 16px;
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 5px 9px; border-radius: 999px; background: rgba(255,255,255,.16); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.chip.hot { background: var(--accent); }
.dish-name { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1.05; margin: 0 0 8px; text-shadow: 0 2px 16px rgba(0,0,0,.4); }
.dish-desc { font-size: 15px; line-height: 1.45; color: var(--ink-soft); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.dish-desc.open { -webkit-line-clamp: unset; }
.price { display: inline-block; margin-top: 12px; font-weight: 700; font-size: 20px; padding: 6px 14px; border-radius: 12px; background: #fff; color: #111; }

/* Right side buttons */
.rail { position: absolute; z-index: 3; right: 10px; bottom: calc(96px + var(--bottom-space)); display: flex; flex-direction: column; gap: 18px; align-items: center; }
.rail button { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--ink-soft); }
.rail .ic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.14); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform .15s, background .2s; }
.rail .ic svg { width: 24px; height: 24px; }
.rail button:active .ic { transform: scale(.9); }
.rail .picked .ic { background: var(--accent); }
.rail .picked .ic svg { fill: #fff; }

.counter { position: absolute; z-index: 3; top: calc(78px + var(--safe-top)); right: 16px; font-size: 12px; font-weight: 600; color: var(--ink-mute); }

/* ---------- Bottom bar ---------- */
.bottombar {
  position: absolute; z-index: 6; left: 0; right: 0; bottom: 0;
  display: flex; gap: 10px; padding: 12px 16px calc(16px + var(--bottom-space));
}
.pill { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; height: 50px; border-radius: 999px; font-weight: 600; font-size: 15px; background: rgba(255,255,255,.16); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.pill-primary { background: var(--accent); color: var(--accent-ink); flex: 1.3; }
.badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #fff; color: #111; font-size: 12px; font-weight: 700; display: grid; place-items: center; }

/* Swipe hint */
.swipe-hint { position: absolute; z-index: 4; left: 50%; top: 42%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; pointer-events: none; padding: 10px 16px; border-radius: 16px; background: rgba(0,0,0,.4); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); white-space: nowrap; animation: bob 1.4s ease-in-out infinite; transition: opacity .4s; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.swipe-hint svg { width: 28px; height: 28px; }
.swipe-hint.hide { opacity: 0; }
@keyframes bob { 50% { transform: translate(-50%, -10px); } }

/* ---------- Sheets ---------- */
.scrim { position: absolute; inset: 0; z-index: 9; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .3s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: absolute; z-index: 10; left: 0; right: 0; bottom: 0; max-height: 86%;
  display: flex; flex-direction: column;
  background: var(--sheet); border-radius: 24px 24px 0 0;
  transform: translateY(102%); transition: transform .35s cubic-bezier(.2,.8,.2,1);
  padding-bottom: var(--bottom-space);
}
.sheet.on { transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 8px; }
.sheet-head h2 { margin: 0; font-family: var(--display); font-size: 24px; }
.close { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.1); font-size: 24px; line-height: 1; }
.sheet-body { overflow-y: auto; padding: 4px 16px 24px; }

.sheet-head, .cat-tabs { flex: none; }
.cat-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 6px 16px 10px; scrollbar-width: none; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tabs button { flex: none; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.08); font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.cat-tabs button.on { background: #fff; color: #111; }

.cat-title { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); margin: 20px 0 6px; font-weight: 700; }
.row { width: 100%; display: flex; gap: 14px; align-items: center; text-align: left; padding: 12px 0; border-bottom: 1px solid var(--sheet-line); }
.thumb { flex: none; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; background: #222; position: relative; }
.thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb::after { content: ""; position: absolute; right: 5px; bottom: 5px; width: 8px; height: 10px; background: #fff; clip-path: polygon(0 0, 100% 50%, 0 100%); filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.row-main { flex: 1; min-width: 0; }
.row-name { font-weight: 600; font-size: 16px; }
.row-desc { font-size: 13px; color: var(--ink-mute); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-price { font-weight: 700; font-size: 15px; }

.picks-empty { color: var(--ink-mute); text-align: center; padding: 30px 10px; line-height: 1.5; }
.pick-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--sheet-line); }
.pick-row .row-main { cursor: pointer; }
.remove { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.08); font-size: 18px; }
.total { display: flex; justify-content: space-between; font-weight: 700; font-size: 18px; padding: 18px 0 4px; }
.picks-note { font-size: 13px; color: var(--ink-mute); margin-top: 6px; }

/* Toast */
.toast { position: absolute; z-index: 20; left: 50%; top: calc(80px + var(--safe-top)); transform: translate(-50%, -20px); background: #fff; color: #111; padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; opacity: 0; transition: .25s; pointer-events: none; white-space: nowrap; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .swipe-hint { animation: none; }
  .sheet, .toast, .scrim { transition: none; }
}

/* Loading / not-found messages */
.menu-msg { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px; color: var(--ink-soft); }
.menu-msg h1 { font-family: var(--display); color: var(--ink); font-size: 28px; margin: 0 0 10px; }
.menu-msg p { margin: 0; line-height: 1.5; max-width: 300px; }
.menu-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: #fff; animation: spin .9s linear infinite; }
