/* ==========================================================================
   FOOD FIGHT POOL — restaurant-ephemera UI
   cream paper · gingham · order tickets · receipts
   ========================================================================== */

:root {
  --paper: #fdf6e3;
  --paper-dark: #f3e8cd;
  --ink: #3a2417;
  --ink-soft: #6b4a33;
  --tomato: #d64530;
  --tomato-dark: #a92f1f;
  --basil: #4d7c3a;
  --mustard: #e2a72e;
  --gold: #f5c542;
  --savory: #c46a2d;
  --sweet: #e77fa3;
  --room: #17100b;
  --font-display: 'Lilita One', cursive;
  --font-body: 'Grandstander', cursive;
  --font-script: 'Pacifico', cursive;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--room);
  font-family: var(--font-body);
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
}

#app { position: fixed; inset: 0; }

#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.hidden { display: none !important; }

.screen {
  position: absolute; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
}

/* ==========================================================================
   MAIN MENU — a physical menu card
   ========================================================================== */

#menu-screen {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(255, 180, 90, 0.14), transparent 60%),
    radial-gradient(ellipse at 50% 110%, rgba(214, 69, 48, 0.10), transparent 55%),
    rgba(12, 8, 5, 0.55);
  animation: menuFade 0.6s ease both;
}
@keyframes menuFade { from { opacity: 0; } to { opacity: 1; } }

.menu-card {
  position: relative;
  background:
    /* gingham border strip */
    repeating-linear-gradient(45deg, var(--tomato) 0 10px, #fff 10px 20px);
  padding: 10px;
  border-radius: 14px;
  box-shadow:
    0 30px 80px rgba(0,0,0,0.65),
    0 6px 18px rgba(0,0,0,0.5);
  transform: rotate(-1deg);
  animation: cardIn 0.7s cubic-bezier(.2,1.4,.35,1) both;
  max-height: 92vh;
}
@keyframes cardIn {
  from { transform: rotate(-6deg) translateY(60px) scale(0.9); opacity: 0; }
  to   { transform: rotate(-1deg) translateY(0) scale(1); opacity: 1; }
}

.menu-card-inner {
  background:
    radial-gradient(circle at 20% 15%, rgba(214,69,48,0.05), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(226,167,46,0.07), transparent 45%),
    var(--paper);
  border-radius: 8px;
  padding: 26px 44px 20px;
  width: min(560px, 88vw);
  max-height: calc(92vh - 20px);
  overflow-y: auto;
  text-align: center;
  box-shadow: inset 0 0 60px rgba(160, 110, 60, 0.14);
}

.menu-ornament { color: var(--tomato); letter-spacing: 6px; font-size: 13px; opacity: 0.85; }
.menu-ornament.bottom { margin-top: 14px; font-style: italic; letter-spacing: 1px; font-size: 12px; color: var(--ink-soft); }

.menu-est {
  font-size: 10px; letter-spacing: 4px; color: var(--ink-soft);
  margin-top: 8px; font-weight: 700;
}

.game-title { line-height: 0.95; margin: 6px 0 2px; }
.title-food {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(44px, 7vw, 68px);
  color: var(--tomato);
  letter-spacing: 1px;
  text-shadow:
    2px 2px 0 var(--mustard),
    4px 4px 0 rgba(58,36,23,0.25);
}
.title-pool {
  display: block;
  font-family: var(--font-script);
  font-size: clamp(30px, 4.6vw, 44px);
  color: var(--basil);
  margin-top: -6px;
  transform: rotate(-3deg);
}

.tagline { font-size: 13px; color: var(--ink-soft); margin: 8px 0 4px; font-weight: 600; }

.menu-section-label {
  font-family: var(--font-script);
  color: var(--tomato-dark);
  font-size: 20px;
  margin: 14px 0 8px;
}

.menu-items { display: flex; flex-direction: column; gap: 8px; text-align: left; }

.menu-item {
  position: relative;
  font-family: var(--font-body);
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "name dots price" "desc desc desc";
  align-items: baseline;
  column-gap: 8px;
  color: var(--ink);
  transition: background 0.15s, transform 0.15s;
}
.menu-item:hover { background: rgba(214, 69, 48, 0.09); transform: translateX(4px) scale(1.01); }
.menu-item:active { transform: translateX(4px) scale(0.99); }

.mi-name { grid-area: name; font-weight: 800; font-size: 17px; }
.mi-badge {
  font-size: 9px; background: var(--tomato); color: #fff;
  padding: 2px 6px; border-radius: 999px; letter-spacing: 1px;
  vertical-align: middle; margin-left: 4px;
}
.mi-badge.party { background: linear-gradient(120deg, #c98a1b, #f5c542); color: #3a2417; }
.mi-dots {
  grid-area: dots;
  border-bottom: 2px dotted rgba(58,36,23,0.35);
  transform: translateY(-4px);
}
.mi-price { grid-area: price; font-weight: 800; color: var(--tomato-dark); font-size: 13px; letter-spacing: 1px; }
.mi-desc { grid-area: desc; font-size: 12px; color: var(--ink-soft); margin-top: 2px; font-weight: 400; }

.menu-options { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.menu-opt {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; font-weight: 700; color: var(--ink-soft);
}
.opt-pills { display: flex; gap: 4px; }
.opt-pills button {
  font-family: var(--font-body); font-weight: 700; font-size: 11px;
  border: 2px solid rgba(58,36,23,0.25); background: transparent; color: var(--ink-soft);
  padding: 3px 10px; border-radius: 999px; cursor: pointer;
  transition: all 0.15s;
}
.opt-pills button:hover { border-color: var(--tomato); color: var(--tomato); }
.opt-pills button.on { background: var(--tomato); border-color: var(--tomato); color: #fff; }

.menu-footer {
  color: rgba(253, 246, 227, 0.45);
  font-size: 11px;
  letter-spacing: 1px;
  animation: menuFade 1.2s ease both;
}

/* ==========================================================================
   HUD — order ticket, spin plate, power bar
   ========================================================================== */

#hud { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
#hud > * { pointer-events: auto; }

/* ---- order ticket ---- */
#ticket {
  position: absolute; top: 14px; left: 14px;
  width: 252px;
  background: var(--paper);
  border-radius: 4px 4px 8px 8px;
  box-shadow: 0 8px 26px rgba(0,0,0,0.5);
  padding: 14px 14px 10px;
  transform: rotate(-1.2deg);
  font-size: 12px;
}
.ticket-holes {
  position: absolute; top: -5px; left: 0; right: 0; height: 10px;
  background: radial-gradient(circle at 10px 5px, var(--room) 3.5px, transparent 4px);
  background-size: 28px 10px;
  background-position: 6px 0;
}
.ticket-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 2px dashed rgba(58,36,23,0.3);
  padding-bottom: 5px; margin-bottom: 7px;
}
.ticket-title { font-weight: 800; letter-spacing: 2px; font-size: 11px; color: var(--ink-soft); }
.ticket-mode { font-size: 9px; letter-spacing: 1px; color: var(--tomato-dark); font-weight: 800; }

.ticket-row { padding: 4px 2px; border-radius: 6px; transition: background 0.3s, box-shadow 0.3s; position: relative; }
.ticket-row.active { background: rgba(226, 167, 46, 0.18); box-shadow: inset 0 0 0 2px rgba(226,167,46,0.55); }
.t-serving {
  display: none;
  position: absolute; top: -7px; right: 6px;
  font-size: 8px; font-weight: 800; letter-spacing: 1px;
  background: var(--tomato); color: #fff; padding: 2px 6px; border-radius: 999px;
}
.ticket-row.active .t-serving { display: block; animation: servePulse 1.4s ease-in-out infinite; }
@keyframes servePulse { 50% { transform: scale(1.07); } }

.t-name { font-weight: 800; font-size: 14px; display: inline-block; }
.t-group {
  display: inline-block; margin-left: 6px; font-size: 9px; font-weight: 800;
  letter-spacing: 1px; padding: 1px 7px; border-radius: 999px;
  background: rgba(58,36,23,0.12); color: var(--ink-soft);
}
.t-group.savory { background: var(--savory); color: #fff; }
.t-group.sweet  { background: var(--sweet); color: #fff; }
.t-group.golden { background: var(--gold); color: var(--ink); }

.t-foods { display: flex; gap: 3px; margin-top: 4px; flex-wrap: wrap; min-height: 20px; }
.food-chip {
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; line-height: 1;
  background: rgba(58,36,23,0.07);
  transition: all 0.35s;
}
.food-chip.sunk { opacity: 0.32; filter: grayscale(0.9); transform: scale(0.82); }

.ticket-divider { border-top: 2px dashed rgba(58,36,23,0.3); margin: 6px 0; }

/* ---- golden meatball status ---- */
#golden-status {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  background: rgba(23, 16, 11, 0.72);
  border: 1px solid rgba(245, 197, 66, 0.5);
  color: var(--gold);
  font-size: 11px; font-weight: 800; letter-spacing: 2px;
  padding: 6px 16px; border-radius: 999px;
  display: flex; align-items: center; gap: 8px;
  backdrop-filter: blur(4px);
}
.gs-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); animation: servePulse 1.8s infinite; }

/* ---- control tray ---- */
#control-tray {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: flex-end; gap: 14px;
}

/* ---- pantry (power-ups) ---- */
#pantry-widget {
  background: rgba(23, 16, 11, 0.72);
  border-radius: 14px; padding: 8px 10px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(253,246,227,0.12);
}
#pantry-widget.hidden { display: none; }
.pantry-label { font-size: 9px; font-weight: 800; letter-spacing: 2px; color: rgba(253,246,227,0.6); }
#pantry-slots { display: flex; gap: 6px; }
.pantry-slot {
  width: 44px; height: 44px; border-radius: 10px;
  border: 2px dashed rgba(253,246,227,0.25);
  background: rgba(253,246,227,0.06);
  font-size: 22px; line-height: 1; cursor: pointer;
  color: rgba(253,246,227,0.35);
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.pantry-slot:not(.empty) {
  border-style: solid; border-color: rgba(245,197,66,0.55);
  background: rgba(245,197,66,0.12);
}
.pantry-slot:not(.empty):hover { transform: translateY(-2px) scale(1.06); }
.pantry-slot.armed {
  border-color: var(--tomato);
  box-shadow: 0 0 10px rgba(214,69,48,0.8), inset 0 0 6px rgba(214,69,48,0.4);
  animation: pantry-pulse 0.9s ease-in-out infinite;
}
@keyframes pantry-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.pantry-hint {
  font-size: 9px; color: rgba(253,246,227,0.45);
  letter-spacing: 0.5px; max-width: 120px; text-align: center;
}

#spin-widget {
  background: rgba(23, 16, 11, 0.72);
  border-radius: 14px; padding: 8px 10px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(253,246,227,0.12);
}
.spin-label, .power-label { font-size: 9px; font-weight: 800; letter-spacing: 2px; color: rgba(253,246,227,0.6); }
#spin-plate {
  position: relative; width: 74px; height: 74px; border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #ffffff, #e8e0ce 55%, #cfc3a9 100%);
  box-shadow: inset 0 -3px 8px rgba(0,0,0,0.25), inset 0 0 0 6px rgba(58,36,23,0.06), 0 3px 8px rgba(0,0,0,0.4);
  cursor: grab;
}
#spin-plate:active { cursor: grabbing; }
.spin-cross-v, .spin-cross-h { position: absolute; background: rgba(58,36,23,0.15); }
.spin-cross-v { left: 50%; top: 8px; bottom: 8px; width: 1px; }
.spin-cross-h { top: 50%; left: 8px; right: 8px; height: 1px; }
#spin-dot {
  position: absolute; width: 18px; height: 12px; border-radius: 4px;
  background: linear-gradient(180deg, #ffe9a3, #f2c94c);
  box-shadow: 0 2px 4px rgba(0,0,0,0.35), inset 0 1px 1px rgba(255,255,255,0.7);
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  pointer-events: none;
}
#spin-reset {
  font-family: var(--font-body); font-size: 9px; font-weight: 700;
  background: none; border: none; color: rgba(253,246,227,0.5);
  cursor: pointer; letter-spacing: 0.5px;
}
#spin-reset:hover { color: var(--gold); }

#power-widget {
  background: rgba(23, 16, 11, 0.72);
  border-radius: 14px; padding: 10px 16px 8px;
  width: min(360px, 44vw);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(253,246,227,0.12);
}
.power-label { display: flex; justify-content: space-between; margin-bottom: 6px; }
#power-pct { color: var(--gold); }
#power-bar {
  position: relative; height: 18px; border-radius: 999px;
  background: rgba(0,0,0,0.5);
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.6);
  overflow: hidden;
}
#power-fill {
  position: absolute; inset: 2px auto 2px 2px; width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--basil), var(--mustard) 55%, var(--tomato) 90%);
  transition: width 0.05s linear;
}
.power-ticks { position: absolute; inset: 0; display: flex; }
.power-ticks i { flex: 1; border-right: 1px solid rgba(253,246,227,0.12); }
.power-ticks i:last-child { border-right: none; }
.power-hint { margin-top: 6px; text-align: center; font-size: 10px; color: rgba(253,246,227,0.45); font-weight: 600; letter-spacing: 0.5px; }

#tray-buttons { display: flex; flex-direction: column; gap: 6px; }
#tray-buttons button {
  width: 40px; height: 40px; border-radius: 12px;
  background: rgba(23,16,11,0.72); color: rgba(253,246,227,0.75);
  border: 1px solid rgba(253,246,227,0.12);
  font-size: 17px; cursor: pointer; backdrop-filter: blur(6px);
  transition: all 0.15s;
}
#tray-buttons button:hover { color: var(--gold); border-color: var(--gold); transform: translateY(-2px); }
#tray-buttons button.off { opacity: 0.4; }

/* ---- turn banner ---- */
#turn-banner {
  position: absolute; top: 34%; left: 0; right: 0;
  display: flex; justify-content: center;
  pointer-events: none !important;
}
.tb-inner {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 42px);
  color: var(--paper);
  background: linear-gradient(180deg, rgba(214,69,48,0.96), rgba(169,47,31,0.96));
  padding: 10px 48px;
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), inset 0 2px 0 rgba(255,255,255,0.25);
  transform: rotate(-1.5deg);
  letter-spacing: 2px;
  animation: bannerIn 2.1s cubic-bezier(.2,1.3,.4,1) both;
  position: relative;
}
.tb-inner::before, .tb-inner::after {
  content: ''; position: absolute; top: 50%; width: 34px; height: 10px;
  background: repeating-linear-gradient(45deg, #fff 0 5px, var(--tomato) 5px 10px);
  transform: translateY(-50%);
}
.tb-inner::before { left: -34px; border-radius: 4px 0 0 4px; }
.tb-inner::after { right: -34px; border-radius: 0 4px 4px 0; }
@keyframes bannerIn {
  0%   { transform: rotate(-1.5deg) translateY(-30px) scale(0.6); opacity: 0; }
  12%  { transform: rotate(-1.5deg) translateY(0) scale(1.05); opacity: 1; }
  18%  { transform: rotate(-1.5deg) scale(1); }
  82%  { opacity: 1; }
  100% { opacity: 0; transform: rotate(-1.5deg) translateY(-14px); }
}

/* ---- foul stamp ---- */
#foul-stamp {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  pointer-events: none !important;
}
.stamp-box {
  border: 6px solid var(--tomato);
  border-radius: 10px;
  padding: 14px 34px;
  text-align: center;
  color: var(--tomato);
  background: rgba(253, 246, 227, 0.07);
  transform: rotate(-8deg);
  mix-blend-mode: screen;
  animation: stampIn 2.4s cubic-bezier(.3,1.6,.4,1) both;
  backdrop-filter: blur(1px);
}
.stamp-word {
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 54px);
  letter-spacing: 3px;
  text-shadow: 0 0 26px rgba(214,69,48,0.6);
}
.stamp-sub { font-size: 14px; font-weight: 700; letter-spacing: 2px; opacity: 0.9; }
@keyframes stampIn {
  0%   { transform: rotate(-8deg) scale(2.4); opacity: 0; }
  10%  { transform: rotate(-8deg) scale(1); opacity: 1; }
  13%  { transform: rotate(-7deg) scale(1.04); }
  16%  { transform: rotate(-8deg) scale(1); }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: rotate(-8deg) scale(1) translateY(10px); }
}

/* ---- toast ---- */
#toast {
  position: absolute; bottom: 130px; left: 50%; transform: translateX(-50%);
  background: rgba(23, 16, 11, 0.85);
  color: var(--paper);
  font-size: 13px; font-weight: 700;
  padding: 8px 22px; border-radius: 999px;
  border: 1px solid rgba(253,246,227,0.15);
  letter-spacing: 0.5px;
  animation: toastIn 2.6s ease both;
  pointer-events: none !important;
  white-space: nowrap;
}
@keyframes toastIn {
  0% { opacity: 0; transform: translate(-50%, 12px); }
  8% { opacity: 1; transform: translate(-50%, 0); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -8px); }
}

/* ---- hover label: names the food under the cursor ---- */
#ball-label {
  position: absolute; z-index: 45; pointer-events: none;
  transform: translate(-50%, -140%);
  background: #fffdf4; color: var(--ink);
  font-family: var(--font-body); font-weight: 700; font-size: 12px;
  letter-spacing: 0.3px; white-space: nowrap;
  padding: 4px 10px; border-radius: 5px;
  border: 1px solid rgba(44,35,23,0.18);
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}
#ball-label::after {   /* little pointer notch */
  content: ''; position: absolute; left: 50%; bottom: -5px;
  width: 9px; height: 9px; background: #fffdf4;
  border-right: 1px solid rgba(44,35,23,0.18);
  border-bottom: 1px solid rgba(44,35,23,0.18);
  transform: translateX(-50%) rotate(45deg);
}

/* ==========================================================================
   RESULTS — receipt
   ========================================================================== */

#result-screen { background: rgba(12, 8, 5, 0.6); backdrop-filter: blur(3px); z-index: 60; }

.receipt {
  filter: drop-shadow(0 24px 60px rgba(0,0,0,0.7));
  animation: receiptPrint 0.9s cubic-bezier(.2,1,.3,1) both;
  transform-origin: top center;
}
@keyframes receiptPrint {
  from { transform: translateY(-40px) rotate(2deg); opacity: 0; clip-path: inset(0 0 100% 0); }
  to   { transform: translateY(0) rotate(1deg); opacity: 1; clip-path: inset(0 0 -10% 0); }
}
.receipt-inner {
  width: min(340px, 86vw);
  background: #fffdf4;
  padding: 22px 24px 14px;
  font-family: var(--font-body);
  color: #2c2317;
  text-align: center;
}
.receipt-zigzag {
  height: 12px; width: min(340px, 86vw);
  background: #fffdf4;
  clip-path: polygon(0 0, 100% 0, 100% 20%, 97% 100%, 94% 20%, 91% 100%, 88% 20%, 85% 100%, 82% 20%, 79% 100%, 76% 20%, 73% 100%, 70% 20%, 67% 100%, 64% 20%, 61% 100%, 58% 20%, 55% 100%, 52% 20%, 49% 100%, 46% 20%, 43% 100%, 40% 20%, 37% 100%, 34% 20%, 31% 100%, 28% 20%, 25% 100%, 22% 20%, 19% 100%, 16% 20%, 13% 100%, 10% 20%, 7% 100%, 4% 20%, 0 100%);
}
.r-head { font-family: var(--font-display); font-size: 22px; letter-spacing: 2px; }
.r-sub { font-size: 10px; letter-spacing: 1px; color: #8a7a5f; margin-top: 2px; }
.r-line { border-top: 2px dashed rgba(44,35,23,0.3); margin: 10px 0; }
.r-winner { font-family: var(--font-display); font-size: 34px; color: var(--tomato); letter-spacing: 1px; }
.r-reason { font-size: 12px; color: #6b5a41; font-weight: 600; margin-top: 2px; }
.r-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.r-table td { padding: 3px 0; text-align: left; font-weight: 600; }
.r-table td:last-child { text-align: right; font-weight: 800; }
.r-total { display: flex; justify-content: space-between; font-weight: 800; font-size: 13px; letter-spacing: 1px; }
.r-barcode {
  height: 34px; margin: 12px 18px 6px;
  background: repeating-linear-gradient(90deg, #2c2317 0 2px, transparent 2px 4px, #2c2317 4px 7px, transparent 7px 9px, #2c2317 9px 10px, transparent 10px 14px);
}
.r-thanks { font-size: 10px; letter-spacing: 2px; color: #8a7a5f; margin-bottom: 4px; }

.result-buttons { display: flex; gap: 12px; margin-top: 18px; animation: menuFade 0.8s 0.5s ease both; }
.big-btn {
  font-family: var(--font-display); font-size: 18px; letter-spacing: 1px;
  background: linear-gradient(180deg, var(--tomato), var(--tomato-dark));
  color: #fff; border: none; border-radius: 999px;
  padding: 12px 32px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(214,69,48,0.4), inset 0 2px 0 rgba(255,255,255,0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}
.big-btn:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 10px 28px rgba(214,69,48,0.55), inset 0 2px 0 rgba(255,255,255,0.3); }
.big-btn:active { transform: translateY(0) scale(0.98); }
.big-btn.ghost {
  background: transparent; color: var(--paper);
  border: 2px solid rgba(253,246,227,0.4);
  box-shadow: none;
}
.big-btn.ghost:hover { border-color: var(--paper); box-shadow: none; }

/* ==========================================================================
   START GATE — a one-tap splash so audio can begin (autoplay needs a gesture)
   ========================================================================== */

#start-gate {
  position: absolute; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(255, 180, 90, 0.16), transparent 60%),
    radial-gradient(ellipse at 50% 115%, rgba(214, 69, 48, 0.12), transparent 55%),
    rgba(9, 6, 4, 0.72);
  backdrop-filter: blur(2px);
  transition: opacity 0.5s ease;
  animation: menuFade 0.6s ease both;
}
#start-gate.gate-out { opacity: 0; pointer-events: none; }

.gate-inner {
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 20px;
  animation: cardIn 0.7s cubic-bezier(.2,1.4,.35,1) both;
}
.gate-est { font-size: 11px; letter-spacing: 4px; color: var(--paper); opacity: 0.7; font-weight: 700; }
.gate-btn { margin-top: 6px; font-size: 20px; animation: gatePulse 1.8s ease-in-out infinite; }
@keyframes gatePulse {
  0%, 100% { transform: translateY(0) scale(1); box-shadow: 0 6px 20px rgba(214,69,48,0.4), inset 0 2px 0 rgba(255,255,255,0.3); }
  50%      { transform: translateY(-3px) scale(1.04); box-shadow: 0 12px 30px rgba(214,69,48,0.6), inset 0 2px 0 rgba(255,255,255,0.35); }
}
.gate-hint { font-size: 12px; color: var(--paper); opacity: 0.6; font-style: italic; letter-spacing: 0.5px; }

/* ==========================================================================
   OVERLAYS
   ========================================================================== */

#vignette {
  position: absolute; inset: 0; z-index: 10; pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, transparent 52%, rgba(10, 6, 3, 0.5) 100%);
}

/* ---- victory flash ---- */
#victory-flash {
  position: absolute; inset: 0; z-index: 55; pointer-events: none;
  background: radial-gradient(circle at 50% 46%, rgba(255,224,130,0.55), rgba(255,180,70,0.18) 38%, transparent 68%);
  mix-blend-mode: screen;
}
#victory-flash.play { animation: victoryGlow 1.5s ease-out both; }
@keyframes victoryGlow {
  0%   { opacity: 0; transform: scale(0.6); }
  18%  { opacity: 1; transform: scale(1.04); }
  100% { opacity: 0; transform: scale(1.25); }
}

#letterbox { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
.lb { position: absolute; left: 0; right: 0; height: 9vh; background: #0a0603; transition: transform 0.35s ease; }
.lb.top { top: 0; transform: translateY(-100%); }
.lb.bot { bottom: 0; transform: translateY(100%); }
#letterbox.on .lb { transform: translateY(0); }

/* placement cursor state */
body.placing #game-canvas { cursor: grabbing; }
body.aiming #game-canvas { cursor: crosshair; }

@media (max-width: 760px) {
  #ticket { transform: scale(0.82) rotate(-1.2deg); transform-origin: top left; }
  #power-widget { width: 42vw; }
}
