/* ============================================================
   THE WITHFEELING ARMS — styles
   Palette: a warm traditional boozer (wood, brass, burgundy,
   amber lamplight) with WithFeeling electric blue as the one
   brand accent on the sign and the primary buttons.
   ============================================================ */

:root {
  --night:    #0b1622;
  --night-2:  #16304a;
  --wood:     #2a1a12;
  --wood-2:   #3d2417;
  --wood-3:   #4f2f1c;
  --burgundy: #5a1e22;
  --brass:    #c79a3f;
  --brass-hi: #eccd76;
  --amber:    #f4b860;
  --amber-glow: rgba(244,184,96,.55);
  --cream:    #f3e9d2;
  --green:    #1f3d2e;
  --wf-blue:  #24a1de;
  --wf-blue-d:#1782b6;
  --ok:       #43b35e;
  --no:       #d2453f;

  --font-sign: "Cinzel Decorative", Georgia, serif;
  --font-ui:   "Poppins", system-ui, -apple-system, sans-serif;
}

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

html, body { height: 100%; }

body {
  font-family: var(--font-ui);
  color: var(--cream);
  background: #07101a;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.stage { position: fixed; inset: 0; }

button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; font-family: var(--font-ui); }
input { -webkit-tap-highlight-color: transparent; }

/* ---- scene base: full-viewport stacked layers ---- */
.scene {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.02);
  transition: opacity .5s ease, transform .5s ease, visibility 0s linear .5s;
  padding: clamp(16px, 4vw, 48px);
  overflow: hidden;
}
.scene.is-active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition: opacity .5s ease, transform .5s ease;
}

/* ============ MUTE BUTTON ============ */
.mute-btn {
  position: fixed;
  top: max(14px, env(safe-area-inset-top, 0px));
  right: max(14px, env(safe-area-inset-right, 0px));
  z-index: 50;
  border-radius: 999px;
  border: 1px solid rgba(236,205,118,.35);
  background: rgba(11,22,34,.6);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  padding: 7px 14px;
  min-width: 9.5em; box-sizing: border-box; text-align: center;
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 700; font-size: 12px; letter-spacing: 1px;
  /* SOUND ON = blue */
  color: var(--wf-blue);
  transition: transform .15s ease, border-color .15s ease, color .15s ease;
}
.mute-btn:hover { transform: scale(1.06); border-color: var(--brass-hi); }
.mute-btn .mute-off { display: none; }
.mute-btn.is-muted .mute-on { display: none; }
.mute-btn.is-muted .mute-off { display: inline; }
/* SOUND OFF = darker, muted white */
.mute-btn.is-muted { color: rgba(226,231,238,.5); }

/* ===========================================================
   SCENE 1 — EXTERIOR
   =========================================================== */
.scene--exterior { justify-content: flex-end; }

.sky {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% 120%, rgba(36,161,222,.10), transparent 60%),
    linear-gradient(180deg, #060d16 0%, #0b1c2e 45%, #133049 100%);
}
.moon {
  position: absolute; top: 8%; right: 16%;
  width: 70px; height: 70px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff7e0, #e9d9a8);
  box-shadow: 0 0 50px 12px rgba(244,232,184,.35);
}
.stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 22% 32%, #fff, transparent),
    radial-gradient(1px 1px at 38% 12%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 62% 22%, #fff, transparent),
    radial-gradient(1px 1px at 78% 14%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 88% 30%, #fff, transparent),
    radial-gradient(1px 1px at 50% 8%, #fff, transparent),
    radial-gradient(1px 1px at 8% 40%, #fff, transparent);
  opacity: .8;
}

/* hanging sign */
.sign-rig {
  position: absolute;
  top: 6%; left: 9%;
  transform-origin: top center;
  z-index: 6;
  display: flex; flex-direction: column; align-items: center;
  animation: swing 5.5s ease-in-out infinite;
}
.sign-bracket {
  width: 8px; height: 38px;
  background: linear-gradient(var(--brass-hi), var(--brass));
  border-radius: 3px;
}
.sign-board {
  width: 220px;
  padding: 16px 14px 12px;
  background:
    radial-gradient(120% 80% at 50% 0%, #20384e, #0e2336 70%);
  border: 4px solid var(--brass);
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(0,0,0,.5), inset 0 0 24px rgba(0,0,0,.55);
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  text-align: center;
}
.sign-bolt {
  width: 34px; height: 34px;
  fill: var(--wf-blue);
  filter: drop-shadow(0 0 8px rgba(36,161,222,.8));
  margin-bottom: 2px;
}
.sign-line1, .sign-line3 {
  font-family: var(--font-sign);
  font-weight: 700;
  letter-spacing: 5px;
  font-size: 13px;
  color: var(--brass-hi);
}
.sign-line2 {
  font-family: var(--font-sign);
  font-weight: 900;
  font-size: 26px;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 10px rgba(36,161,222,.5);
}
.sign-est {
  margin-top: 6px;
  font-size: 8px; letter-spacing: 2px;
  color: rgba(236,205,118,.7);
}

/* building */
.building {
  position: relative;
  width: min(560px, 92vw);
  z-index: 4;
  margin-bottom: -2px;
}
.roof {
  height: 46px;
  background:
    repeating-linear-gradient(90deg, #241019 0 14px, #2e141c 14px 28px);
  clip-path: polygon(4% 100%, 0 0, 100% 0, 96% 100%);
  box-shadow: inset 0 -8px 14px rgba(0,0,0,.5);
}
.facade {
  position: relative;
  background:
    linear-gradient(180deg, #6e2329, #4d181d 60%, #3a1216);
  border-left: 6px solid #2c0e12;
  border-right: 6px solid #2c0e12;
  padding: 30px 26px 0;
  min-height: 270px;
  box-shadow: inset 0 0 60px rgba(0,0,0,.45);
}
.window {
  position: absolute;
  top: 26px;
  width: 92px; height: 96px;
  border: 5px solid #2c0e12;
  border-radius: 6px 6px 2px 2px;
  background:
    linear-gradient(180deg, #ffd98a, #f4b860 55%, #d98f3c);
  box-shadow: 0 0 26px 6px var(--amber-glow), inset 0 0 10px rgba(120,60,0,.4);
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  animation: flicker 6s ease-in-out infinite;
}
.win-left  { left: 24px; }
.win-right { right: 24px; animation-delay: 1.6s; }
.window span {
  border-right: 3px solid rgba(44,14,18,.5);
  border-bottom: 3px solid rgba(44,14,18,.5);
}
.window span:nth-child(2) { border-right: none; }

/* the door */
.door {
  position: absolute;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 132px; height: 196px;
  border: 6px solid #2c0e12;
  border-bottom: none;
  border-radius: 66px 66px 0 0;
  background: linear-gradient(180deg, #6b4524, #4a2f17);
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  padding: 22px 16px;
  box-shadow: 0 0 0 0 rgba(36,161,222,0), inset 0 0 30px rgba(0,0,0,.5);
  transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
  z-index: 5;
}
.door:hover, .door:focus-visible {
  outline: none;
  transform: translateX(-50%) scale(1.03);
  box-shadow: 0 0 0 4px rgba(36,161,222,.55), 0 0 40px rgba(36,161,222,.4), inset 0 0 30px rgba(0,0,0,.4);
  filter: brightness(1.08);
}
.door-panel {
  border: 3px solid rgba(0,0,0,.35);
  border-radius: 6px;
  background: linear-gradient(160deg, rgba(255,220,160,.12), rgba(0,0,0,.2));
  box-shadow: inset 0 0 12px rgba(0,0,0,.4);
}
.door-panel.top-l, .door-panel.top-r { border-radius: 30px 30px 6px 6px; }
.door-handle {
  position: absolute;
  right: 16px; top: 50%;
  width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--brass-hi), var(--brass));
  box-shadow: 0 0 8px rgba(236,205,118,.6);
}
.door-plate {
  position: absolute;
  left: 50%; bottom: 30px; transform: translateX(-50%);
  font-size: 11px; letter-spacing: 3px; font-weight: 700;
  color: var(--brass-hi);
  background: rgba(0,0,0,.3);
  padding: 3px 10px; border-radius: 4px;
  border: 1px solid rgba(236,205,118,.4);
}
.facade-name {
  position: absolute;
  left: 0; right: 0; bottom: 8px;
  text-align: center;
  font-size: 10px; letter-spacing: 3px;
  color: rgba(236,205,118,.5);
}
.lamp {
  position: absolute; bottom: 8px;
  width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle, #fff2cf, var(--amber));
  box-shadow: 0 0 24px 8px var(--amber-glow);
}
.lamp-left { left: -2px; }
.lamp-right { right: -2px; }

.pavement {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 80px;
  background:
    repeating-linear-gradient(90deg, #1a1410 0 38px, #211a14 38px 40px),
    linear-gradient(180deg, #241c15, #14100b);
  box-shadow: inset 0 14px 30px rgba(0,0,0,.5);
  z-index: 3;
}

.enter-hint {
  position: absolute;
  bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 7;
  font-size: 13px; letter-spacing: 1px;
  color: var(--cream);
  background: rgba(11,22,34,.55);
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid rgba(236,205,118,.3);
  animation: bob 2.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes swing { 0%,100% { transform: rotate(-2.4deg); } 50% { transform: rotate(2.4deg); } }
@keyframes flicker {
  0%,100% { filter: brightness(1); }
  48% { filter: brightness(1.04); }
  50% { filter: brightness(.82); }
  52% { filter: brightness(1.06); }
}
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -6px); } }

/* ===========================================================
   SCENE 1 — EXTERIOR PHOTO (flat image + press / glow entrance)
   =========================================================== */
.scene--exterior { padding: 0; justify-content: center; }

.pub-stage {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: radial-gradient(120% 100% at 50% 25%, #0c1830, #050a14 80%);
}
.pub-photo {
  position: relative;
  width: 100%; height: 100%;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0,0,0,.6);
  transform-origin: 51% 63%;
  transition: transform .5s cubic-bezier(.2,.75,.2,1), filter .5s ease;
}
.pub-photo-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  -webkit-user-drag: none; user-select: none;
}

/* warm light spilling out of the doorway */
.pub-glow {
  position: absolute;
  left: 50%; top: 66%;
  width: 30%; height: 50%;
  transform: translate(-50%, -50%) scale(.55);
  background: radial-gradient(closest-side, rgba(255,200,120,.9), rgba(255,168,72,.35) 55%, transparent 72%);
  mix-blend-mode: screen;
  opacity: 0; pointer-events: none; z-index: 3;
  transition: opacity .5s ease, transform .5s ease;
}

/* ---- ambient animation overlays on the exterior photo ---- */
.pub-fx {
  position: absolute; inset: 0;
  z-index: 2; pointer-events: none; overflow: hidden;
}
/* twinkling stars — placed in sky areas (top band + the street margins),
   avoiding the central building so they read as sky, not on the bricks */
.twinkle {
  position: absolute; inset: 0;
  background-repeat: no-repeat;
  opacity: .55;
}
.twinkle--a {
  background-image:
    radial-gradient(1.6px 1.6px at 6% 5%,  #fff, transparent),
    radial-gradient(1.4px 1.4px at 30% 4%, #fff, transparent),
    radial-gradient(1.6px 1.6px at 58% 5%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 84% 4%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 50% 3%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 14% 30%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 90% 18%, #fff, transparent),
    radial-gradient(1.3px 1.3px at 95% 36%, #fff, transparent);
  animation: twinkleA 4.2s ease-in-out infinite;
}
.twinkle--b {
  background-image:
    radial-gradient(1.4px 1.4px at 16% 8%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 44% 7%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 70% 8%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 92% 7%, #fff, transparent),
    radial-gradient(1.3px 1.3px at 8% 20%, #fff, transparent),
    radial-gradient(1.3px 1.3px at 5% 38%, #fff, transparent),
    radial-gradient(1.3px 1.3px at 84% 28%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 78% 21%, #fff, transparent),
    radial-gradient(1.3px 1.3px at 20% 15%, #fff, transparent);
  animation: twinkleB 5.6s ease-in-out infinite;
}
@keyframes twinkleA { 0%,100% { opacity: .25; } 50% { opacity: .95; } }
@keyframes twinkleB { 0%,100% { opacity: .9; } 50% { opacity: .2; } }

/* gentle warm flicker over the lit windows/lamps */
.lamp-glow {
  position: absolute; width: 32%; height: 30%; top: 42%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,190,110,.5), rgba(255,170,80,.16) 55%, transparent 75%);
  mix-blend-mode: screen; filter: blur(3px); opacity: .4;
}
.lamp-glow--l { left: 16%; animation: lampFlicker 4.3s ease-in-out infinite; }
.lamp-glow--r { right: 16%; animation: lampFlicker 5.7s ease-in-out infinite .9s; }
@keyframes lampFlicker {
  0%,100% { opacity: .42; }
  20% { opacity: .5; }
  43% { opacity: .3; }
  47% { opacity: .56; }
  55% { opacity: .36; }
  78% { opacity: .48; }
}

/* invisible click target over the door in the artwork */
.door-hotspot {
  position: absolute;
  background: transparent; border: 0; padding: 0;
  cursor: pointer; z-index: 4; border-radius: 14px;
  -webkit-tap-highlight-color: transparent;
  left: 44%; top: 46%; width: 13%; height: 44%;
}
.door-hotspot:focus-visible {
  outline: 2px solid rgba(36,161,222,.75); outline-offset: 3px;
}

/* phones get the tall mobile artwork — full-bleed; safe margins keep the sign in view */
@media (max-width: 768px) {
  .door-hotspot { left: 44%; top: 52%; width: 12%; height: 22%; }
  .pub-glow { left: 50%; top: 62%; }
}

/* on-screen pub buttons, sitting on the pavement */
.pub-actions {
  position: absolute; left: 50%; bottom: 4.5%; transform: translateX(-50%);
  z-index: 5; display: flex; gap: 14px; flex-wrap: wrap; justify-content: center;
  max-width: 92%;
}

/* tiny "made by" credit, tucked at the very top of the entrance scene */
.made-by {
  position: absolute; left: 50%; top: calc(6px + env(safe-area-inset-top, 0px));
  transform: translateX(-50%);
  z-index: 5;
  font-family: var(--font-ui); font-size: 10px; letter-spacing: .3px;
  color: rgba(243,233,210,.45); text-decoration: none; white-space: nowrap;
  transition: color .15s ease;
}
.made-by:hover, .made-by:focus-visible { color: var(--brass-hi); }
@media (max-width: 768px) {
  .made-by {
    font-size: 8px; letter-spacing: .2px;
    top: auto; bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  }
}

/* live pub pulse — rounds ticker (all sizes) + Discord-style latest punter (phones) */
.pub-pulse {
  position: absolute; left: 0; right: 0; bottom: 15%;
  z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 0 16px; pointer-events: none;
}
.pulse-ticker {
  display: none; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .2px; color: #f4e9d6;
  background: rgba(20,12,6,.62); border: 1px solid rgba(212,175,110,.42);
  padding: 7px 14px; border-radius: 999px; backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0,0,0,.4);
}
.pulse-ticker.is-ready { display: none; }
.pulse-ticker strong { color: #ffd98a; }
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #6fe089; box-shadow: 0 0 8px #6fe089;
  animation: pulseDot 1.8s ease-in-out infinite;
}
@keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* Discord-style latest-player card — the live "last punter + score" feed,
   now shown on every screen size. One tidy card: latest punter on top,
   rounds-played as a quiet footer. Base = desktop; phones shrink it below. */
.pulse-card {
  display: none; flex-direction: column; gap: 5px; width: min(300px, 90vw);
  background: rgba(43,45,49,.9); border: 1px solid rgba(255,255,255,.06); border-left: 3px solid #5865f2;
  border-radius: 11px; padding: 9px 12px; box-shadow: 0 8px 20px rgba(0,0,0,.45);
  backdrop-filter: blur(4px); animation: pop .35s ease; text-align: left;
}
.pulse-card.is-ready { display: flex; }
.pulse-row { display: flex; align-items: center; gap: 9px; width: 100%; }
.pulse-foot {
  display: flex; align-items: center; gap: 5px; width: 100%;
  padding-top: 5px; border-top: 1px solid rgba(255,255,255,.07);
  font-size: 11px; font-weight: 600; color: #b5bac1;
}
.pulse-foot strong { color: #ffd98a; }
.pulse-foot .pulse-dot { width: 6px; height: 6px; }
.pulse-avatar {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  background: #5865f2; color: #fff; font-weight: 800; font-size: 13px;
  display: grid; place-items: center; text-transform: uppercase;
}
.pulse-body { min-width: 0; flex: 1; }
.pulse-head { display: flex; align-items: baseline; gap: 7px; }
.pulse-name {
  color: #fff; font-weight: 700; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pulse-time { color: #b5bac1; font-size: 11px; flex: 0 0 auto; }
.pulse-msg { color: #dbdee1; font-size: 12.5px; line-height: 1.25; }
.pulse-msg strong { color: #ffd98a; }
@media (max-width: 768px) {
  /* phones: tuck the card up near the top — sat just below the mute button
     (44px tall at top:max(14px,safe-area)) so the two never collide. */
  .pub-pulse { top: calc(max(14px, env(safe-area-inset-top, 0px)) + 54px); bottom: auto; }
  /* shrink the card back down to the tidy phone size */
  .pulse-card { width: min(250px, 72vw); gap: 4px; border-left-width: 2px; border-radius: 9px; padding: 6px 9px; box-shadow: 0 5px 14px rgba(0,0,0,.4); }
  .pulse-row { gap: 7px; }
  .pulse-foot { gap: 4px; padding-top: 4px; font-size: 9.5px; }
  .pulse-foot .pulse-dot { width: 5px; height: 5px; }
  .pulse-avatar { width: 22px; height: 22px; font-size: 10px; }
  .pulse-head { gap: 6px; }
  .pulse-name { font-size: 11px; }
  .pulse-time { font-size: 9px; }
  .pulse-msg { font-size: 10px; line-height: 1.2; }
}
.pub-btn {
  font-family: Poppins, system-ui, sans-serif; font-weight: 700;
  font-size: clamp(13px, 1.7vmin, 17px); letter-spacing: .2px; white-space: nowrap;
  padding: 12px 22px; border-radius: 999px; cursor: pointer; border: 1px solid transparent;
  box-shadow: 0 12px 30px rgba(0,0,0,.5);
  position: relative; overflow: hidden; isolation: isolate;
  transition: transform .22s cubic-bezier(.2,.8,.25,1), filter .2s ease,
              box-shadow .25s ease, border-color .25s ease;
}
/* sweeping glint that crosses the button on hover */
.pub-btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,.55) 50%, transparent 80%);
  transform: translateX(-130%); opacity: 0;
  transition: transform .6s ease, opacity .3s ease; pointer-events: none;
}
.pub-btn:active { transform: translateY(0) scale(.98); transition-duration: .05s; }
.pub-btn:focus-visible { outline: 2px solid rgba(36,161,222,.85); outline-offset: 3px; }
.pub-btn--brass { background: linear-gradient(180deg, #f0d49a, #d6b27a); color: #2a1a08; }
.pub-btn--ghost {
  background: rgba(20,12,8,.74); color: #f3e7d2; border-color: rgba(214,178,122,.45);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}

@media (hover: hover) {
  .pub-btn:hover { transform: translateY(-3px); filter: brightness(1.06); }
  .pub-btn:hover::after { transform: translateX(130%); opacity: 1; }
  .pub-btn--brass:hover {
    box-shadow: 0 16px 34px rgba(0,0,0,.55), 0 0 22px rgba(240,212,154,.55);
  }
  .pub-btn--ghost:hover {
    border-color: rgba(240,212,154,.85); color: #fff;
    box-shadow: 0 16px 34px rgba(0,0,0,.55), 0 0 18px rgba(214,178,122,.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pub-btn, .pub-btn::after { transition: none; }
  .pub-btn:hover { transform: none; }
  .pub-btn:hover::after { transform: translateX(-130%); opacity: 0; }
}

/* desktop hover: a hint of warmth leaking from the door */
@media (hover: hover) {
  .door-hotspot:hover ~ .pub-glow { opacity: .45; transform: translate(-50%, -50%) scale(.85); }
}

/* the "it opened" moment: lean in + warm flood */
.scene--exterior.is-entering .pub-photo {
  transform: scale(1.07);
  filter: brightness(1.12) saturate(1.04);
}
.scene--exterior.is-entering .pub-glow {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.35);
}
@media (prefers-reduced-motion: reduce) {
  .pub-photo, .pub-glow { transition: opacity .25s ease; }
  .scene--exterior.is-entering .pub-photo { transform: none; }
  .twinkle--a, .twinkle--b, .lamp-glow--l, .lamp-glow--r { animation: none; }
}

/* ===========================================================
   SCENE 2 — THE BAR
   =========================================================== */
.scene--bar { justify-content: flex-end; gap: 0; }

/* the interior photo carries the shelves, chalkboard, taps and the barman
   himself, so the CSS-drawn versions are retired in favour of the artwork */
.scene--bar .shelf,
.scene--bar .chalkboard,
.scene--bar .taps,
.scene--bar .bar-counter,
.scene--bar .bartender { display: none; }

.bar-wall {
  position: absolute;
  inset: 0;
  background: #1a1008 center/cover no-repeat;
  background-image: url("../img/barman-1-desktop.jpg");
  box-shadow: inset 0 0 90px rgba(0,0,0,.45);
  overflow: hidden;
}
/* phones get the tall portrait barman artwork (placed after the base rule so it wins the cascade) */
@media (max-width: 768px) {
  .bar-wall { background-image: url("../img/barman-1-mobile.jpg"); }
}
/* Basil — the alternate barman, chosen at random per visit to the bar */
.bar-wall.barman--basil { background-image: url("../img/basil-desktop.png"); }
@media (max-width: 768px) {
  .bar-wall.barman--basil { background-image: url("../img/basil-mobile.png"); }
}
.bar-wall::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 48%, rgba(15,9,5,.62) 100%);
  pointer-events: none;
}
.shelf {
  position: absolute; top: 16%; left: 6%; right: 6%;
  height: 56px;
  border-bottom: 6px solid #160d08;
  display: flex; align-items: flex-end; gap: clamp(6px, 2vw, 18px);
  padding: 0 12px;
}
.shelf i {
  display: block;
  width: clamp(12px, 2.4vw, 20px);
  height: calc(34px + (var(--h, 0) * 1px));
  height: 40px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 80%, #fff 0%), var(--c));
  background: var(--c);
  border-radius: 3px 3px 1px 1px;
  box-shadow: 0 6px 8px rgba(0,0,0,.4), inset 0 6px 6px rgba(255,255,255,.15);
}
.shelf i:nth-child(odd) { height: 48px; }
.shelf i:nth-child(3n) { height: 36px; }

.chalkboard {
  position: absolute;
  top: 40%; left: 50%; transform: translateX(-50%);
  width: min(420px, 80%);
  background: #10171a;
  border: 8px solid #3a2417;
  border-radius: 6px;
  box-shadow: 0 12px 26px rgba(0,0,0,.5), inset 0 0 30px rgba(0,0,0,.6);
  padding: 14px 18px;
  text-align: center;
  display: flex; flex-direction: column; gap: 4px;
}
.chalk-top { font-size: 12px; letter-spacing: 4px; color: var(--brass-hi); }
.chalk-big {
  font-family: var(--font-sign); font-weight: 900;
  font-size: clamp(22px, 5vw, 34px);
  color: #f6f1e6;
  text-shadow: 0 1px 0 rgba(255,255,255,.15);
}
.chalk-sub { font-size: 11px; color: rgba(243,233,210,.7); letter-spacing: .5px; }

.taps {
  position: absolute; bottom: 6px; left: 8%;
  display: flex; gap: 16px;
}
.taps b {
  width: 12px; height: 40px;
  background: linear-gradient(var(--brass-hi), var(--brass));
  border-radius: 6px 6px 2px 2px;
  box-shadow: 0 4px 8px rgba(0,0,0,.4);
}

.bar-counter {
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 42%;
  background:
    linear-gradient(180deg, #6b4524 0%, #4a2f17 18%, #3a2515 100%);
  border-top: 8px solid #2a1810;
  box-shadow: inset 0 16px 30px rgba(0,0,0,.4);
}
.bar-counter::before {
  content: "";
  position: absolute; top: 8px; left: 0; right: 0; height: 8px;
  background: linear-gradient(rgba(255,220,160,.35), transparent);
}

.barman-speech {
  position: relative;
  z-index: 3;
  margin-bottom: clamp(16px, 4vh, 36px);
  max-width: 460px;
  background: var(--cream);
  color: #2a1a12;
  padding: 14px 20px;
  border-radius: 16px;
  font-size: clamp(14px, 2.4vw, 17px);
  line-height: 1.4;
  box-shadow: 0 16px 30px rgba(0,0,0,.45);
  animation: pop .4s ease;
}
.barman-speech::after {
  content: "";
  position: absolute; bottom: -12px; left: 40px;
  border: 12px solid transparent;
  border-top-color: var(--cream);
  border-bottom: 0;
}

.drinks {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 1.6vw, 14px);
  width: min(560px, 94vw);
  margin-bottom: clamp(10px, 4vh, 30px);
}
.drink {
  background: linear-gradient(180deg, #fffaf0, #efe2c8);
  border: 2px solid #2a1a12;
  border-radius: 14px;
  padding: 14px 8px 12px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: #2a1a12;
  box-shadow: 0 8px 0 #2a1a12, 0 10px 18px rgba(0,0,0,.35);
  transition: transform .12s ease, box-shadow .12s ease;
}
.drink:hover, .drink:focus-visible {
  outline: none;
  transform: translateY(-3px);
  box-shadow: 0 11px 0 #2a1a12, 0 14px 22px rgba(0,0,0,.4);
}
.drink:active { transform: translateY(4px); box-shadow: 0 4px 0 #2a1a12, 0 6px 12px rgba(0,0,0,.4); }
.drink-emoji { font-size: clamp(26px, 6vw, 36px); line-height: 1; }
.drink-name { font-weight: 700; font-size: clamp(12px, 2.4vw, 15px); }

/* bartender + conversation */
.bar-stage {
  position: relative;
  z-index: 3;
  width: min(640px, 94vw);
  margin-bottom: clamp(14px, 4vh, 32px);
  display: flex;
  align-items: flex-end;
  gap: 14px;
}
.bartender { flex: 0 0 auto; width: 120px; display: flex; justify-content: center; }
.bartender-img { width: 120px; height: 150px; object-fit: contain; display: none; filter: drop-shadow(0 8px 14px rgba(0,0,0,.5)); }
.bartender-emoji {
  width: 110px; height: 110px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 56px;
  background: radial-gradient(circle at 50% 35%, #fff7e6, #e9d3a0);
  border: 4px solid var(--brass);
  box-shadow: 0 10px 20px rgba(0,0,0,.5), inset 0 0 20px rgba(120,80,20,.2);
}
.bar-dialogue { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.bar-dialogue .barman-speech { margin-bottom: 0; max-width: none; animation: pop .35s ease; }

.dlg-response { display: flex; flex-direction: column; gap: 8px; }
.dlg-btn {
  background: linear-gradient(180deg, #fffaf0, #efe2c8);
  border: 2px solid #2a1a12;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  color: #2a1a12;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 15px;
  text-align: center;
  box-shadow: 0 5px 0 #2a1a12;
  transition: transform .1s ease, box-shadow .1s ease;
}
.dlg-btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 #2a1a12; }
.dlg-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #2a1a12; }
.dlg-btn--go { background: linear-gradient(180deg, var(--wf-blue), var(--wf-blue-d)); color: #fff; border-color: #0f6593; box-shadow: 0 5px 0 #0f6593; }
.dlg-btn--go:active { box-shadow: 0 2px 0 #0f6593; }
.dlg-btn--ghost { background: transparent; color: rgba(243,233,210,.8); border: 1px solid rgba(236,205,118,.3); box-shadow: none; font-weight: 600; }
.dlg-btn--ghost:hover { box-shadow: none; border-color: var(--brass-hi); transform: translateY(-1px); }
.dlg-btn--ghost:active { box-shadow: none; }

.dlg-input-row { display: flex; gap: 8px; }
.dlg-input {
  flex: 1 1 auto; min-width: 0;
  background: rgba(0,0,0,.32);
  border: 1.5px solid rgba(236,205,118,.4);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--cream);
  font-family: var(--font-ui);
  font-size: 16px;
}
.dlg-input:focus { outline: none; border-color: var(--wf-blue); box-shadow: 0 0 0 3px rgba(36,161,222,.2); }
.dlg-input::placeholder { color: rgba(243,233,210,.4); }
.dlg-input-row .dlg-btn { flex: 0 0 auto; }

.dlg-response .drinks { width: auto; margin-bottom: 0; }

/* ===========================================================
   SCENE 3 — QUIZ
   =========================================================== */
.scene--quiz {
  justify-content: flex-start;
  background-color: #140c08;
  background-image:
    linear-gradient(rgba(13,8,5,.62), rgba(13,8,5,.74)),
    url("../img/quiz-bg.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.quiz-hud {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: clamp(40px, 6vh, 60px);
  margin-bottom: clamp(16px, 3vh, 30px);
}
.lives { display: flex; gap: 6px; font-size: 24px; }
.life { transition: opacity .35s ease, transform .35s ease, filter .35s ease; }
.life.lost { opacity: .2; filter: grayscale(1); transform: translateY(4px) rotate(-12deg); }
.score-pill, .diff-pill {
  font-size: 13px; font-weight: 600;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(236,205,118,.3);
}
.score-pill b { color: var(--brass-hi); }
.diff-pill { color: var(--wf-blue); border-color: rgba(36,161,222,.4); }

.your-drink {
  position: absolute;
  right: clamp(14px, 4vw, 40px);
  bottom: clamp(14px, 4vh, 30px);
  width: 58px; height: 58px;
  display: grid; place-items: center;
  font-size: 30px;
  background: radial-gradient(circle at 50% 40%, rgba(255,220,160,.18), transparent 70%);
  border-radius: 50%;
  border: 2px dashed rgba(236,205,118,.35);
  z-index: 2;
}

.quiz-body {
  width: 100%;
  display: flex; flex-direction: column;
  gap: clamp(16px, 3vh, 26px);
}

/* layout: quiz column, with the live board beside it on wide screens */
.quiz-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}
.quiz-main { width: 100%; max-width: 720px; min-width: 0; }

/* the live top 10 */
.quiz-board { display: none; }
.board-toggle { display: none; }

.scene--quiz.board-on .board-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  position: fixed;
  top: max(14px, env(safe-area-inset-top, 0px));
  left: 14px;
  z-index: 46;
  background: rgba(11,22,34,.62);
  border: 1px solid var(--brass);
  color: var(--brass-hi);
  border-radius: 999px;
  padding: 9px 14px;
  font-family: var(--font-ui);
  font-weight: 700; font-size: 13px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.scene--quiz.board-on .quiz-board {
  display: block;
  position: fixed; left: 8px; right: 8px; bottom: 8px;
  z-index: 45;
  max-height: 72vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, #241a14, #160d08);
  border: 1px solid var(--brass);
  border-radius: 18px;
  padding: 14px 14px 10px;
  box-shadow: 0 -10px 40px rgba(0,0,0,.6);
  transform: translateY(125%);
  transition: transform .32s ease;
}
.scene--quiz.board-on .quiz-board.open { transform: translateY(0); }

.qb-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.qb-title { font-family: var(--font-sign); font-weight: 700; color: var(--brass-hi); font-size: 17px; }
.qb-close {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,.4); border: 1px solid rgba(236,205,118,.35);
  color: var(--cream); cursor: pointer; font-size: 12px;
}
.qb-list { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; overflow-y: auto; padding-right: 4px; }
.qb-row {
  display: grid; grid-template-columns: 26px 1fr auto;
  align-items: center; gap: 8px;
  padding: 7px 9px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(236,205,118,.1);
  border-radius: 9px;
  font-size: 13px;
}
.qb-row .qb-rk { text-align: center; font-weight: 800; color: var(--brass-hi); }
.qb-row .qb-nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.qb-row .qb-sc { font-weight: 800; }
.qb-row.you {
  border-color: var(--wf-blue);
  background: linear-gradient(90deg, rgba(36,161,222,.2), rgba(0,0,0,.25));
  box-shadow: 0 0 14px rgba(36,161,222,.3);
}
.qb-row.you .qb-rk, .qb-row.you .qb-sc, .qb-row.you .qb-nm { color: #bfe6fb; }
.qb-you { margin-top: 10px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.qb-you-live { font-weight: 800; font-size: 14px; color: var(--wf-blue); }
.qb-you-note { font-size: 12px; color: rgba(243,233,210,.7); }
.qb-justin { animation: goodpulse .5s ease; }

@media (min-width: 1100px) {
  .quiz-layout { max-width: 1040px; }
  .quiz-main { flex: 1 1 auto; }
  .scene--quiz.board-on .board-toggle { display: none; }
  .scene--quiz.board-on .quiz-board {
    position: static; transform: none; left: auto; right: auto; bottom: auto;
    flex: 0 0 280px; max-height: none; box-shadow: none;
    margin-top: clamp(40px, 6vh, 60px);
  }
  .scene--quiz.board-on .qb-close { display: none; }
  .scene--quiz.board-on .your-drink { display: none; }
}
.q-card {
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.18));
  border: 1px solid rgba(236,205,118,.25);
  border-radius: 18px;
  padding: clamp(18px, 3.5vw, 30px);
  text-align: center;
  box-shadow: 0 16px 36px rgba(0,0,0,.4);
}
.q-cat {
  display: inline-block;
  font-size: 11px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--wf-blue);
  margin-bottom: 12px;
}

/* countdown timer */
.q-timerwrap {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.q-timer-track {
  flex: 1 1 auto;
  height: 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.4);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.5);
}
.q-timer-fill {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--wf-blue), var(--brass-hi));
}
.q-timer-num {
  flex: 0 0 auto;
  min-width: 22px;
  text-align: center;
  font-weight: 800;
  font-size: 15px;
  color: var(--brass-hi);
  font-variant-numeric: tabular-nums;
}
.q-timerwrap.danger .q-timer-fill { background: linear-gradient(90deg, #e0633a, var(--no)); }
.q-timerwrap.danger .q-timer-num { color: var(--no); animation: pulseNum .5s ease-in-out infinite; }
@keyframes pulseNum { 0%,100% { transform: scale(1); } 50% { transform: scale(1.25); } }
.q-text {
  font-weight: 700;
  font-size: clamp(18px, 3.4vw, 26px);
  line-height: 1.3;
  color: #fdf8ee;
}

.answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(10px, 1.8vw, 16px);
}
.answer {
  display: flex; align-items: center; gap: 12px;
  text-align: left;
  background: linear-gradient(180deg, #143047, #0e2236);
  border: 2px solid rgba(36,161,222,.5);
  color: #eaf6ff;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: clamp(14px, 2.4vw, 16px);
  font-weight: 500;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease, box-shadow .12s ease;
  min-height: 60px;
}
/* Only light up on real hover/keyboard focus (desktop). Touch devices have no
   hover, and iOS keeps a tapped button "focused", which made one answer look
   permanently brighter than the rest — so we gate this to hover-capable pointers. */
@media (hover: hover) and (pointer: fine) {
  .answer:hover:not(:disabled), .answer:focus-visible:not(:disabled) {
    outline: none;
    border-color: var(--wf-blue);
    background: linear-gradient(180deg, #1a3e5a, #123049);
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(36,161,222,.25);
  }
}
.ans-letter {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(236,205,118,.18);
  border: 1px solid rgba(236,205,118,.5);
  color: var(--brass-hi);
  font-weight: 700; font-size: 14px;
}
.answer:disabled { cursor: default; opacity: .96; }
.answer.correct {
  border-color: var(--ok);
  background: linear-gradient(180deg, #1d5b33, #134023);
  box-shadow: 0 0 24px rgba(67,179,94,.45);
  animation: goodpulse .5s ease;
}
.answer.correct .ans-letter { background: var(--ok); border-color: var(--ok); color: #06210f; }
.answer.wrong {
  border-color: var(--no);
  background: linear-gradient(180deg, #5b1d1d, #401313);
  animation: shake .4s ease;
}
.answer.wrong .ans-letter { background: var(--no); border-color: var(--no); color: #240606; }

@keyframes goodpulse { 0% { transform: scale(1); } 40% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ===========================================================
   SCENE 4 — LAST ORDERS (capture)
   =========================================================== */
.scene--over {
  background: #160d08 center/cover no-repeat;
  background-image: url("../img/wall-bg-desktop.png");
}
/* phones get the portrait wallpaper (after base rule so it wins the cascade) */
@media (max-width: 768px) {
  .scene--over { background-image: url("../img/wall-bg-mobile.png"); }
}
.over-card {
  width: min(460px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(13,18,26,.92), rgba(6,9,14,.95));
  backdrop-filter: blur(8px);
  border: 1px solid rgba(236,205,118,.3);
  border-radius: 22px;
  padding: clamp(22px, 4vw, 34px);
  text-align: center;
  box-shadow: 0 24px 50px rgba(0,0,0,.5);
}
.over-bell { font-size: 38px; animation: ring 1.2s ease infinite; }
.over-title {
  font-family: var(--font-sign); font-weight: 900;
  font-size: clamp(28px, 6vw, 40px);
  color: var(--brass-hi);
  margin-top: 4px;
}
.over-flavour { color: rgba(243,233,210,.8); font-size: 15px; margin: 8px 0 14px; line-height: 1.4; }
.final-score { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin-bottom: 20px; }
.final-num { font-size: clamp(48px, 12vw, 72px); font-weight: 800; color: var(--wf-blue); line-height: 1; }
.final-label { font-size: 16px; color: rgba(243,233,210,.7); }

.capture-lead { font-size: 13px; color: rgba(243,233,210,.75); margin-bottom: 14px; }
.field { display: block; text-align: left; margin-bottom: 12px; }
.field > span { display: block; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--brass-hi); margin-bottom: 5px; }
.field input {
  width: 100%;
  background: rgba(0,0,0,.3);
  border: 1.5px solid rgba(236,205,118,.3);
  border-radius: 11px;
  padding: 12px 14px;
  color: var(--cream);
  font-family: var(--font-ui); font-size: 16px;
}
.field input:focus { outline: none; border-color: var(--wf-blue); box-shadow: 0 0 0 3px rgba(36,161,222,.2); }
.field input::placeholder { color: rgba(243,233,210,.35); }
.insta-wrap { display: flex; align-items: center; background: rgba(0,0,0,.3); border: 1.5px solid rgba(236,205,118,.3); border-radius: 11px; overflow: hidden; }
.insta-wrap:focus-within { border-color: var(--wf-blue); box-shadow: 0 0 0 3px rgba(36,161,222,.2); }
.insta-wrap i { padding: 0 4px 0 14px; color: var(--brass-hi); font-style: normal; font-weight: 700; }
.insta-wrap input { border: none; box-shadow: none; background: transparent; padding-left: 2px; }
.insta-wrap input:focus { box-shadow: none; }

.capture-err { color: var(--no); font-size: 13px; min-height: 18px; margin: 2px 0 6px; }

/* phones: tighten the Last Orders card so it reads less bulky */
@media (max-width: 768px) {
  .over-card { padding: 18px 16px; border-radius: 18px; }
  .over-bell { font-size: 30px; }
  .over-title { font-size: clamp(26px, 8vw, 34px); }
  .over-flavour { font-size: 13px; margin: 6px 0 10px; }
  .final-score { margin-bottom: 12px; }
  .final-num { font-size: clamp(42px, 14vw, 60px); }
  .capture-lead { font-size: 12px; margin-bottom: 10px; }
  .field { margin-bottom: 10px; }
  .field input { padding: 10px 13px; }
  .capture-err { min-height: 14px; margin: 0 0 4px; }
}

.btn-primary {
  width: 100%;
  background: linear-gradient(180deg, var(--wf-blue), var(--wf-blue-d));
  color: #fff; font-weight: 700; font-size: 16px;
  border: none; border-radius: 12px;
  padding: 14px; cursor: pointer;
  box-shadow: 0 8px 0 #0f6593, 0 12px 22px rgba(36,161,222,.35);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 0 #0f6593, 0 16px 26px rgba(36,161,222,.4); }
.btn-primary:active { transform: translateY(4px); box-shadow: 0 4px 0 #0f6593; }
.btn-primary:disabled { opacity: .6; cursor: default; transform: none; box-shadow: 0 8px 0 #0f6593; }

.btn-ghost {
  width: 100%;
  margin-top: 10px;
  background: transparent;
  color: rgba(243,233,210,.7);
  border: 1px solid rgba(236,205,118,.25);
  border-radius: 12px; padding: 11px; cursor: pointer;
  font-family: var(--font-ui); font-size: 14px;
  transition: border-color .12s ease, color .12s ease;
}
.btn-ghost:hover { border-color: var(--brass-hi); color: var(--cream); }

@keyframes ring { 0%,100% { transform: rotate(0); } 25% { transform: rotate(14deg); } 75% { transform: rotate(-14deg); } }

/* ===========================================================
   SCENE 5 — WALL OF FAME
   =========================================================== */
.scene--wall {
  background: #160d08 center/cover no-repeat;
  background-image: url("../img/wall-bg-desktop.png");
}
/* phones get the portrait wallpaper (after base rule so it wins the cascade) */
@media (max-width: 768px) {
  .scene--wall { background-image: url("../img/wall-bg-mobile.png"); }
}
.wall-card {
  width: min(560px, 96vw);
  max-height: 88vh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(26,16,9,.92), rgba(12,7,4,.95));
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(236,205,118,.3);
  border-radius: 22px;
  padding: clamp(20px, 4vw, 30px);
  box-shadow: 0 24px 50px rgba(0,0,0,.6);
}
.wall-title {
  font-family: var(--font-sign); font-weight: 900;
  font-size: clamp(26px, 6vw, 38px);
  color: var(--brass-hi); text-align: center;
}
.wall-sub { text-align: center; color: rgba(243,233,210,.7); font-size: 13px; margin: 4px 0 16px; }
.wall-standing {
  display: none;
  text-align: center;
  margin: -8px 0 14px;
  padding: 8px 12px;
  background: linear-gradient(90deg, rgba(36,161,222,.16), rgba(0,0,0,.2));
  border: 1px solid rgba(36,161,222,.4);
  border-radius: 999px;
  color: #bfe6fb;
  font-size: 13px;
  font-weight: 700;
}

.board {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
  padding-right: 6px;
}
.board-loading, .board-empty { text-align: center; color: rgba(243,233,210,.6); padding: 30px 0; font-size: 14px; }
.row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center; gap: 12px;
  padding: 11px 16px;
  background: rgba(0,0,0,.5);
  border: 1px solid rgba(236,205,118,.18);
  border-radius: 12px;
}
.row.you {
  border-color: var(--wf-blue);
  background: linear-gradient(90deg, rgba(36,161,222,.28), rgba(0,0,0,.55));
  box-shadow: 0 0 18px rgba(36,161,222,.25);
}
.row .rk { font-weight: 900; color: var(--brass-hi); text-align: center; font-size: 18px; }
.row.top1 .rk, .row.top2 .rk, .row.top3 .rk { font-size: 22px; }
.row .who { min-width: 0; }
.row .nm { font-weight: 800; font-size: 18px; color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { font-size: 13px; color: rgba(243,233,210,.65); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.row .meta a { color: var(--wf-blue); text-decoration: none; }
.row .sc { font-weight: 900; font-size: 22px; color: var(--cream); }
.row.you .sc { color: var(--wf-blue); }

/* phones: slimmer leaderboard rows so more names fit on screen */
@media (max-width: 768px) {
  .board { gap: 5px; }
  .row { grid-template-columns: 30px 1fr auto; gap: 9px; padding: 7px 12px; border-radius: 10px; }
  .row .rk { font-size: 14px; }
  .row.top1 .rk, .row.top2 .rk, .row.top3 .rk { font-size: 17px; }
  .row .nm { font-size: 14px; }
  .row .meta { font-size: 11px; margin-top: 1px; }
  .row .sc { font-size: 17px; }
}

.wall-actions { display: flex; gap: 10px; margin-top: 16px; }
.wall-actions .btn-primary, .wall-actions .btn-ghost { width: 50%; margin-top: 0; }
.wall-note { text-align: center; font-size: 12px; color: rgba(243,233,210,.55); margin-top: 10px; min-height: 16px; }

/* phones: slim the wall buttons — flatten the chunky shadow, smaller padding,
   full-width single-line "Save" so the bottom reads far less bulky */
@media (max-width: 768px) {
  .wall-actions { margin-top: 12px; gap: 8px; }
  .wall-actions .btn-primary { padding: 11px; font-size: 15px; box-shadow: 0 4px 0 #0f6593, 0 7px 14px rgba(36,161,222,.3); }
  .wall-actions .btn-ghost { padding: 10px; font-size: 13px; }
  .share-row { margin-top: 8px; }
  .share-row .btn-share { width: 100%; margin-top: 0; padding: 10px; font-size: 14px; }
  .wall-note { margin-top: 8px; }
}

/* ===========================================================
   HALL OF FAME NOTICE (exterior)
   =========================================================== */
.hof-notice {
  position: absolute;
  left: clamp(12px, 4vw, 36px);
  bottom: 22px;
  z-index: 7;
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(180deg, #3a2417, #2a1810);
  border: 2px solid var(--brass);
  border-radius: 10px;
  padding: 9px 14px;
  color: var(--brass-hi);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0,0,0,.45), inset 0 0 14px rgba(0,0,0,.4);
  transition: transform .15s ease, box-shadow .15s ease;
}
.hof-notice:hover, .hof-notice:focus-visible {
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 11px 22px rgba(0,0,0,.5), 0 0 18px rgba(236,205,118,.3);
}
.hof-trophy { font-size: 18px; }
.hof-text { font-weight: 700; font-size: 13px; letter-spacing: .5px; }

/* ===========================================================
   JUKEBOX CABINET (in the bar)
   =========================================================== */
.jukebox-cab {
  position: absolute;
  right: 4%; top: clamp(14px, 8vh, 80px); bottom: auto;
  z-index: 4;
  width: 62px; height: 92px;
  border: none;
  border-radius: 30px 30px 8px 8px;
  background: linear-gradient(180deg, #6b2a2f, #3a1418);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding-top: 8px;
  box-shadow: 0 8px 16px rgba(0,0,0,.5), inset 0 0 18px rgba(0,0,0,.4);
  animation: jukeGlow 3s ease-in-out infinite;
}
@keyframes jukeGlow {
  0%,100% { box-shadow: 0 8px 16px rgba(0,0,0,.5), inset 0 0 18px rgba(0,0,0,.4), 0 0 0 rgba(244,184,96,0); }
  50%     { box-shadow: 0 8px 16px rgba(0,0,0,.5), inset 0 0 18px rgba(0,0,0,.4), 0 0 16px rgba(244,184,96,.45); }
}
.jukebox-cab:hover { filter: brightness(1.1); }
.jb-arch {
  width: 70%; height: 22px;
  background: linear-gradient(180deg, var(--amber), #b5742f);
  border-radius: 20px 20px 4px 4px;
  box-shadow: inset 0 0 8px rgba(0,0,0,.4);
}
.jb-screen {
  width: 64%; height: 16px;
  background: #10171a; border-radius: 3px;
  display: flex; align-items: flex-end; justify-content: center; gap: 3px;
  padding: 2px;
}
.jb-screen i { width: 4px; background: var(--wf-blue); border-radius: 1px; animation: eqbar 1s ease-in-out infinite; }
.jb-screen i:nth-child(1){ height: 40%; }
.jb-screen i:nth-child(2){ height: 80%; animation-delay: .2s; }
.jb-screen i:nth-child(3){ height: 55%; animation-delay: .4s; }
@keyframes eqbar { 0%,100% { transform: scaleY(.4); } 50% { transform: scaleY(1); } }
.jb-speaker {
  width: 60%; height: 18px;
  background: repeating-linear-gradient(45deg, #2a1810 0 3px, #3a2417 3px 6px);
  border-radius: 4px;
}
.jb-label { font-size: 7px; letter-spacing: 1px; color: var(--brass-hi); font-weight: 700; }

/* ===========================================================
   JUKEBOX MODAL
   =========================================================== */
.jukebox {
  position: fixed; inset: 0; z-index: 60;
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.jukebox.is-open { display: flex; }
.jb-backdrop { position: absolute; inset: 0; background: rgba(5,10,16,.7); backdrop-filter: blur(4px); }
.jb-panel {
  position: relative;
  width: min(420px, 96vw);
  max-height: 86vh; overflow-y: auto;
  background: linear-gradient(180deg, #241a14, #160d08);
  border: 2px solid var(--brass);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 30px 60px rgba(0,0,0,.6);
}
.jb-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,0,0,.4); border: 1px solid rgba(236,205,118,.35);
  color: var(--cream); cursor: pointer; font-size: 14px;
}
.jb-title { font-family: var(--font-sign); font-weight: 700; color: var(--brass-hi); text-align: center; font-size: 24px; margin-bottom: 16px; }
.jb-player { display: none; margin-bottom: 16px; }
.jb-now { text-align: center; margin-bottom: 14px; }
.jb-now-track { font-weight: 700; font-size: 18px; color: var(--cream); }
.jb-now-artist { font-size: 13px; color: rgba(243,233,210,.6); margin-top: 2px; }
.jb-controls { display: flex; align-items: center; justify-content: center; gap: 18px; }
.jb-ctrl {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(0,0,0,.3); border: 1px solid rgba(236,205,118,.35);
  color: var(--cream); font-size: 18px; cursor: pointer;
  display: grid; place-items: center;
  transition: transform .12s ease, border-color .12s ease;
}
.jb-ctrl:hover { transform: scale(1.06); border-color: var(--brass-hi); }
.jb-ctrl--play {
  width: 60px; height: 60px;
  background: linear-gradient(180deg, var(--wf-blue), var(--wf-blue-d));
  border: none; color: #fff; font-size: 20px;
  box-shadow: 0 6px 0 #0f6593;
}
.jb-ctrl--play:hover { transform: translateY(-2px) scale(1.04); }
.jb-empty { text-align: center; color: rgba(243,233,210,.7); font-size: 14px; line-height: 1.5; padding: 10px 6px 4px; }
.jb-empty code { background: rgba(0,0,0,.4); padding: 2px 6px; border-radius: 4px; color: var(--brass-hi); font-size: 12px; }
.jb-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.jb-row {
  display: flex; align-items: center; gap: 12px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(236,205,118,.15);
  border-radius: 10px; padding: 10px 12px;
  color: var(--cream); cursor: pointer; text-align: left;
  transition: border-color .12s ease, background .12s ease;
}
.jb-row:hover { border-color: var(--brass-hi); background: rgba(0,0,0,.35); }
.jb-row.is-current { border-color: var(--wf-blue); }
.jb-row-i { width: 22px; text-align: center; color: var(--brass-hi); font-weight: 700; font-size: 13px; }
.jb-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.jb-row-main b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jb-row-main i { font-style: normal; font-size: 12px; color: rgba(243,233,210,.55); }
.jb-row-eq { display: flex; align-items: flex-end; gap: 2px; height: 16px; opacity: 0; }
.jb-row.is-playing .jb-row-eq { opacity: 1; }
.jb-row-eq span { width: 3px; background: var(--wf-blue); border-radius: 1px; height: 100%; animation: eqbar 1s ease-in-out infinite; }
.jb-row-eq span:nth-child(2){ animation-delay: .2s; }
.jb-row-eq span:nth-child(3){ animation-delay: .4s; }

/* ===========================================================
   SHARE BUTTON (wall)
   =========================================================== */
.btn-share {
  width: 100%;
  margin-top: 10px;
  background: linear-gradient(180deg, #2a1a12, #1a100b);
  color: var(--cream);
  border: 1.5px solid var(--brass);
  border-radius: 12px; padding: 12px; cursor: pointer;
  font-family: var(--font-ui); font-weight: 700; font-size: 15px;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.btn-share:hover { transform: translateY(-2px); border-color: var(--brass-hi); box-shadow: 0 8px 18px rgba(0,0,0,.4); }

.btn-insta {
  width: 100%;
  margin-top: 14px;
  background: linear-gradient(95deg, #feda75, #fa7e1e 25%, #d62976 55%, #962fbf 78%, #4f5bd5);
  color: #fff;
  border: none;
  border-radius: 12px; padding: 13px; cursor: pointer;
  font-family: var(--font-ui); font-weight: 800; font-size: 15px;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn-insta:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 8px 20px rgba(150,47,191,.4); }

/* Save + Share sit side by side; Brag (mobile only) drops below */
.share-row { display: flex; gap: 10px; }
.share-row .btn-share { width: 50%; }

/* "You didn't beat your best of X" banner above the wall */
.wall-msg {
  text-align: center;
  margin: 14px 0 2px;
  padding: 11px 15px;
  border-radius: 12px;
  border: 1px solid var(--brass);
  background: rgba(8,11,16,.82);
  color: #fdf6e6;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.4;
}

/* confirmation toast */
.wfa-toast {
  position: fixed;
  left: 50%; bottom: max(24px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(16px);
  background: rgba(20,12,8,.96);
  color: var(--cream);
  border: 1px solid var(--brass);
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 14px; font-weight: 600; text-align: center;
  box-shadow: 0 12px 30px rgba(0,0,0,.5);
  z-index: 80;
  max-width: 88vw;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.wfa-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 560px) {
  .hof-notice { left: 50%; transform: translateX(-50%); bottom: 16px; padding: 8px 11px; }
  .hof-notice:hover, .hof-notice:focus-visible { transform: translateX(-50%) translateY(-2px); }
  .hof-text { font-size: 12px; }
  .enter-hint { bottom: 66px; }
  .jukebox-cab { width: 54px; height: 80px; right: 5%; }
}

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 560px) {
  .sign-rig { left: 50%; transform: translateX(-50%); top: 4%; }
  .sign-rig { animation: swing-m 5.5s ease-in-out infinite; }
  @keyframes swing-m { 0%,100% { transform: translateX(-50%) rotate(-2.4deg);} 50% { transform: translateX(-50%) rotate(2.4deg);} }
  .answers { grid-template-columns: 1fr; }
  .drinks { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .moon { width: 50px; height: 50px; top: 5%; }
  .window { width: 70px; height: 78px; }
  .your-drink { width: 46px; height: 46px; font-size: 24px; bottom: 10px; right: 10px; }

  /* tighter HUD so it holds one line on small phones */
  .quiz-hud { gap: 8px; margin-top: 56px; }
  .lives { font-size: 20px; gap: 4px; }
  .score-pill, .diff-pill { font-size: 12px; padding: 6px 11px; }

  /* keep the question and answers comfortably tappable */
  .q-card { padding: 16px; }
  .answer { padding: 13px 14px; min-height: 56px; }

  /* bar scene: stop the menu crowding the chalkboard */
  .chalkboard { top: 34%; padding: 10px 14px; width: min(360px, 84%); }
  .chalk-sub { font-size: 10px; }
  .barman-speech { margin-bottom: 14px; font-size: 14px; padding: 11px 16px; }
  .shelf { top: 12%; }
  .drink { padding: 12px 6px 10px; }

  /* bartender conversation on small screens */
  .bar-stage { gap: 10px; }
  .bartender { width: 84px; }
  .bartender-emoji { width: 76px; height: 76px; font-size: 40px; border-width: 3px; }
  .bartender-img { width: 84px; height: 110px; }
  .dlg-response .drinks { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 380px) {
  .drinks { grid-template-columns: repeat(2, 1fr); }
  .diff-pill { display: none; } /* drop the label first on the very narrowest screens */
}

@media (max-height: 620px) {
  .quiz-hud { margin-top: 54px; }
}

/* ===========================================================
   REDUCED MOTION
   =========================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .scene { transition: opacity .2s ease; transform: none; }
}

/* ============================================================
   SHAREABLE SCORECARD — on-screen preview
   The artwork is the baked background image; only the dynamic
   text + stars are live HTML, positioned in the 1080x1920 space
   and scaled to fit by share.js (scaleCard()).
   ============================================================ */
.scorecard-frame {
  width: clamp(240px, 74vw, 320px);
  margin: 4px auto 18px;
  position: relative;
  aspect-ratio: 1080 / 1920;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
}
.scorecard {
  position: absolute;
  top: 0;
  left: 0;
  width: 1080px;
  height: 1920px;
  transform-origin: top left;
  background-image: url("/img/scorecard-bg.png");
  background-size: cover;
  background-position: center;
  overflow: hidden;
  font-family: 'Poppins', sans-serif;
  line-height: 1;
}
.sc-el {
  position: absolute;
  left: 0;
  width: 100%;
  text-align: center;
  transform: translateY(-50%);
}
/* position + size come from the shared L table via share.js render();
   only non-positional styling (weight / colour / glow) lives here. */
#sc-name { font-weight: 800; color: #fdf8ee; }
#sc-sub { font-weight: 600; }
#sc-sub .sc-h { color: #24a1de; }
#sc-sub .sc-sep { color: rgba(243, 234, 210, .55); }
#sc-sub .sc-loc { color: rgba(243, 234, 210, .85); }
#sc-score { font-weight: 800; color: #24a1de; text-shadow: 0 0 40px rgba(36, 161, 222, .55); }
#sc-correct { font-weight: 700; color: #ffe3a0; }
#sc-result { font-weight: 700; color: #d7a84b; }
#sc-tagline { font-weight: 700; color: #f3ead2; }
#sc-url { font-weight: 600; color: #24a1de; }
.sc-star { color: rgba(215, 168, 75, .26); }
.sc-star--on { color: #ffd970; text-shadow: 0 0 16px rgba(215, 168, 75, .6); }
