/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE — Landscape-first bartender game layout
   Inspired by War Drone: left-thumb tools, right-thumb action, center play field
═══════════════════════════════════════════════════════════════════════════ */

/* Force landscape on phone */
@media screen and (max-width: 900px) and (orientation: portrait) {
  body::before {
    content: 'Rotate your phone to landscape to play 🍸';
    position: fixed; inset: 0;
    background: var(--c-bg);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-ui); font-size: 18px; color: var(--c-gold);
    z-index: 9999; padding: 40px; text-align: center;
  }
}

/* ── Game screen base ─────────────────────────────────────────────────────── */
#screen-game {
  position: fixed; inset: 0;
  overflow: hidden;
  background: #0d0804;
  touch-action: none;
}

/* ── Ticket pile background ──────────────────────────────────────────────── */
#ticket-pile-bg {
  position: absolute; inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.bg-ticket {
  position: absolute;
  background: var(--c-ticket);
  border-radius: 3px;
  opacity: 0.06;
  font-family: var(--font-ticket);
  font-size: 8px;
  color: #000;
  padding: 4px 6px;
  pointer-events: none;
  line-height: 1.4;
}

/* ── Layer Viewport (clips the sliding layer stack) ──────────────────────── */
#layer-viewport {
  position: absolute;
  inset: calc(44px + env(safe-area-inset-top)) 0 68px 0; /* top = hud-top, bottom = ticket rail */
  overflow: hidden;
  z-index: 1;
}

/* The container that slides up/down to reveal layers */
#layer-container {
  position: absolute;
  left: 0; right: 0;
  top: 0;
  height: 300%;          /* 3 layers × 100% each */
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
/* Layer 0 (well) = default transform 0 shows WELL */
/* We start at layer 1 (workspace) = translateY(-33.333%) */
#layer-container.layer-0 { transform: translateY(0%); }
#layer-container.layer-1 { transform: translateY(-33.333%); }
#layer-container.layer-2 { transform: translateY(-66.666%); }

/* Each game layer fills exactly 1/3 of the container (= 100vh) */
.game-layer {
  height: 33.333%;
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ── Layer: Well (ingredients) ───────────────────────────────────────────── */
#layer-well {
  background: linear-gradient(to bottom, #150e06 0%, #0d0804 100%);
  padding: 0 10px 8px 130px; /* left margin for tool area */
  padding-top: 45px; /* shift bottles down so tool circles don't clip the top row */
  overflow: hidden;
}

/* Sub-well navigation tab strip — large tap targets */
#well-subwell-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  flex-shrink: 0;
  height: 52px;
}
#well-nav-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: none;
}
#well-position-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}
.sw-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  transition: background 0.2s, transform 0.2s;
}
/* Center dot (speed well) always has a faint gold tint so it reads as "home" */
.sw-dot[data-sw="1"] {
  background: rgba(200,168,50,0.35);
}
.sw-dot.active {
  background: var(--c-gold);
  transform: scale(1.5);
}
#well-subwell-label {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--c-gold);
  letter-spacing: 0.06em;
  text-align: center;
}
#well-return-hint {
  font-family: var(--font-ui);
  font-size: 9px;
  color: rgba(200,168,50,0.65);
  text-align: center;
  letter-spacing: 0.03em;
  min-height: 12px;
}
#btn-subwell-prev, #btn-subwell-next {
  background: none;
  border: none;
  color: var(--c-text-dim);
  font-size: 20px;
  /* Large hit area — fills the side thirds of the nav strip */
  width: 80px; height: 48px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
}
#btn-subwell-prev:active, #btn-subwell-next:active {
  color: var(--c-gold);
}

#well-bottles-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  padding-right: 164px; /* right margin for vessel selector */
  overflow: hidden;
}
/* Speed well — 2 rows, standard bottle size */
#well-bottles-grid.two-rows {
  grid-template-rows: repeat(2, 1fr);
}
/* Left / Right wells — 3 rows, compact bottle size */
#well-bottles-grid.three-rows {
  grid-template-rows: repeat(3, 1fr);
}
#well-bottles-grid.three-rows .well-bottle {
  min-height: 48px;
  padding: 5px 3px;
  gap: 2px;
}
#well-bottles-grid.three-rows .wb-icon {
  height: 28px;
}
#well-bottles-grid.three-rows .wb-icon svg {
  height: 28px;
}
#well-bottles-grid.three-rows .wb-name {
  font-size: 8px;
}
.well-bottle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-sm);
  cursor: pointer;
  min-height: 68px;
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.well-bottle:active { background: rgba(200,168,50,0.15); border-color: var(--c-gold); }
.well-bottle.held   { border-color: var(--c-gold); background: rgba(200,168,50,0.2); }
/* .wb-color replaced by .wb-icon (SVG bottle shapes) */
.wb-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  flex-shrink: 0;
}
.wb-icon svg {
  height: 38px;
  width: auto;
  overflow: visible;
}
.wb-name {
  font-family: var(--font-ui); font-size: 9px;
  color: var(--c-text-dim); text-align: center;
  line-height: 1.2; max-width: 64px;
}

/* Jigger station — workspace overlay when bottle dragged to jigger vessel */
#jigger-station {
  display: none;
  position: absolute; inset: 0;
  background: rgba(13,8,4,0.94);
  align-items: center; justify-content: center;
  gap: 16px;
  padding: 6px 170px 6px 140px;
  z-index: 20;
  overflow: hidden;
}
#jigger-station.active { display: flex; }
.jig-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.jig-body {
  width: 36px; height: 56px;
  position: relative;
  clip-path: polygon(10% 0%, 90% 0%, 78% 50%, 78% 50%, 90% 100%, 10% 100%, 22% 50%);
  background: var(--c-steel-dark);
  border: 1px solid var(--c-steel);
}
.jig-fill {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(100,180,240,0.7);
  transition: height 0.2s;
}
.jig-target-line {
  position: absolute; left: 0; right: 0; height: 2px;
  background: var(--c-gold);
}
.jig-marks {
  display: flex; flex-direction: column;  /* normal order — array reversed in JS so 2oz is first/top */
  gap: 3px; width: 100%;
  overflow-y: auto;
  flex: 1;
  min-height: 0;   /* allow flex shrink so parent constrains height */
  padding-top: 4px;
}
.jig-mark {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  min-height: 32px;
  flex-shrink: 0;
}
.jig-mark:active, .jig-mark.target { background: rgba(200,168,50,0.2); border-color: var(--c-gold); }
.jig-mark .jml { font-family: var(--font-mono); font-size: 12px; color: var(--c-gold); min-width: 42px; }
.jig-mark .jmbar { flex: 1; height: 2px; background: rgba(255,255,255,0.2); }
.jig-info { font-family: var(--font-ui); font-size: 10px; color: var(--c-text-dim); text-align: center; }

/* ── Layer: Workspace (active build area) ────────────────────────────────── */
#layer-workspace {
  background: linear-gradient(135deg, #1a0e06 0%, #0d0804 100%);
  padding: 8px 0 8px 130px;
  overflow: hidden;
}

/* ── 3-slot workspace grid ───────────────────────────────────────────────── */
#workspace-slots {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px 168px 4px 4px; /* right pad clears vessel selector */
  height: 100%;
  overflow: hidden;
}

.ws-slot {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 4px 4px;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
  min-height: 0;
}
.ws-slot.slot-active {
  border-color: rgba(200,168,50,0.4);
  background: rgba(200,168,50,0.04);
}
.ws-slot.slot-empty {
  opacity: 0.5;
}
.ws-slot.slot-drag-over {
  border-color: #fff;
  background: rgba(255,255,255,0.07);
}

/* Slot header */
.ws-slot-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 2px 3px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.ssh-num {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: bold;
  color: var(--c-gold);
}
.ssh-orders {
  font-family: var(--font-ui);
  font-size: 8px;
  color: var(--c-text-dim);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
  min-width: 0;
}
.ssh-order-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}
.ssh-order-done {
  color: var(--c-pour-on);
  text-decoration: line-through;
  opacity: 0.6;
}
.ssh-empty {
  font-family: var(--font-ui);
  font-size: 9px;
  color: rgba(255,255,255,0.15);
  flex: 1;
  text-align: center;
}
.ssh-clear, .ssh-return {
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--c-text-dim);
  font-size: 10px;
  width: 20px; height: 20px;
  border-radius: 4px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.ssh-clear:active { border-color: var(--c-amber); color: var(--c-amber); }
.ssh-return:active { border-color: var(--c-red); color: var(--c-red); }

/* × remove button on each vessel */
.vessel-remove {
  position: absolute;
  top: -4px; right: -4px;
  width: 16px; height: 16px;
  background: rgba(13,8,4,0.85);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: rgba(255,255,255,0.5);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}
.vessel-remove:active { border-color: var(--c-red); color: var(--c-red); }

/* Slot body: flex column — summary strip at top, vessels fill the rest */
.slot-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
  overflow: hidden;
}

/* Summary row: drink name + reveal-recipe button */
.slot-summary {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 3px 3px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.stc-name {
  flex: 1;
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: bold;
  color: rgba(200,168,50,0.85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-reveal-recipe {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 3px;
  color: var(--c-text-dim);
  font-size: 9px;
  padding: 1px 4px;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
.btn-reveal-recipe:active { border-color: var(--c-gold); color: var(--c-gold); }

/* Vessel area — fills remaining slot space, vessels sit at the bottom */
.slot-vessels {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: flex-end;
  justify-content: center;
  padding: 3px 2px 2px;
  min-height: 0;
  overflow: hidden;
}
.slot-drop-hint {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-size: 8px;
  color: rgba(255,255,255,0.1);
  text-align: center;
  line-height: 1.6;
  pointer-events: none;
}
.slot-vessel-hint {
  font-family: var(--font-ui);
  font-size: 8px;
  color: rgba(255,255,255,0.15);
  text-align: center;
  padding: 4px 2px;
  width: 100%;
}

/* Recipe overlay — absolute, covers slot-body when visible */
.slot-recipe-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(10,6,2,0.97);
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 5px 6px;
  overflow-y: auto;
  touch-action: pan-y;
}
.slot-recipe-overlay.visible { display: flex; }
.rpo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
  flex-shrink: 0;
}
.rpo-glass {
  font-family: var(--font-ui);
  font-size: 8px;
  color: var(--c-text-dim);
}
.btn-recipe-close {
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 3px;
  color: var(--c-text-dim);
  font-size: 9px;
  padding: 1px 5px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-recipe-close:active { border-color: var(--c-red); color: var(--c-red); }
.stc-ing {
  display: flex;
  gap: 3px;
  font-family: var(--font-ticket);
  font-size: 8px;
  color: rgba(200,180,130,0.9);
  line-height: 1.4;
}
.stc-ing.done {
  opacity: 0.3;
  text-decoration: line-through;
}
/* Dilution row — silent water ingredient, shown faintly */
.stc-ing.dilution {
  color: rgba(160,210,255,0.55);
  font-style: italic;
  margin-top: 2px;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 2px;
}
.stc-method {
  font-family: var(--font-ui);
  font-size: 7px;
  color: rgba(255,255,255,0.25);
  margin-top: 3px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.stc-glass {
  font-family: var(--font-ui);
  font-size: 7.5px;
  color: rgba(255,255,255,0.3);
  margin-bottom: 2px;
}
.ws-vessel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  min-width: 42px;
  max-width: 52px;
}
.ws-vessel-gfx {
  position: relative;
  display: flex; align-items: flex-end; justify-content: center;
}
.ws-vessel-label {
  font-family: var(--font-ui); font-size: 8px;
  color: var(--c-text-dim); text-align: center;
  line-height: 1.2;
}
.ws-vessel.target-highlight .ws-vessel-gfx { filter: drop-shadow(0 0 8px var(--c-gold)); }
.ws-vessel.ready-to-send { animation: ready-pulse 1s ease infinite; }
@keyframes ready-pulse {
  0%,100% { filter: drop-shadow(0 0 4px var(--c-perfect)); }
  50%      { filter: drop-shadow(0 0 14px var(--c-perfect)); }
}
/* Drag-pour hover glow */
.ws-vessel.pour-target .ws-vessel-gfx {
  filter: drop-shadow(0 0 10px var(--c-gold));
}
.ws-vessel.pour-target {
  transform: scale(1.06);
  transition: transform 0.1s;
}
/* Beat pulse flash — large ring that extends well beyond the thumb */
.ws-vessel.pour-beat {
  animation: none; /* cancel ready-pulse if active */
}
.ws-vessel.pour-beat::before {
  content: '';
  position: absolute;
  inset: -28px;           /* extends 28px beyond vessel edge — visible past a thumb */
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,220,80,0.65) 0%, rgba(255,220,80,0.25) 40%, rgba(255,220,80,0) 70%);
  animation: beat-ring 0.28s ease-out forwards;
  pointer-events: none;
  z-index: 10;
}
.ws-vessel.pour-beat .ws-vessel-gfx {
  filter: drop-shadow(0 0 18px rgba(255,220,80,1));
}
@keyframes beat-ring {
  0%   { transform: scale(0.4); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Green flash — on beat, accurate pour (≥90%) */
.ws-vessel.pour-flash-perfect::before {
  content: '';
  position: absolute;
  inset: -32px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(60,255,100,0.75) 0%, rgba(60,255,100,0.3) 45%, rgba(60,255,100,0) 70%);
  animation: flash-perfect-ring 0.45s ease-out forwards;
  pointer-events: none;
  z-index: 11;
}
.ws-vessel.pour-flash-perfect .ws-vessel-gfx {
  animation: flash-perfect-gfx 0.45s ease-out forwards;
}
@keyframes flash-perfect-ring {
  0%   { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}
@keyframes flash-perfect-gfx {
  0%,30% { filter: drop-shadow(0 0 24px rgba(60,255,100,1)); }
  100%   { filter: drop-shadow(0 0 4px rgba(60,255,100,0)); }
}

/* Red flash — way off pour (>0.25 oz delta) */
.ws-vessel.pour-flash-miss::before {
  content: '';
  position: absolute;
  inset: -28px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,60,60,0.7) 0%, rgba(255,60,60,0.25) 45%, rgba(255,60,60,0) 70%);
  animation: flash-miss-ring 0.45s ease-out forwards;
  pointer-events: none;
  z-index: 11;
}
.ws-vessel.pour-flash-miss .ws-vessel-gfx {
  animation: flash-miss-gfx 0.45s ease-out forwards;
}
@keyframes flash-miss-ring {
  0%   { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}
@keyframes flash-miss-gfx {
  0%,30% { filter: drop-shadow(0 0 24px rgba(255,60,60,1)); }
  100%   { filter: drop-shadow(0 0 4px rgba(255,60,60,0)); }
}

/* ── Ticket switcher tabs (inside ws-recipe-pin) ─────────────────────────── */
#ticket-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.ts-tab {
  background: rgba(26,18,8,0.9);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--r-sm);
  padding: 3px 7px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 1px;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s, background 0.15s;
}
.ts-tab.active {
  border-color: var(--c-gold);
  background: rgba(200,168,50,0.15);
}
.ts-tab.done {
  opacity: 0.5;
  border-color: var(--c-perfect);
}
.ts-num  { font-family: var(--font-ui); font-size: 9px; color: var(--c-gold); font-weight: bold; }
.ts-drinks { font-family: var(--font-ui); font-size: 8px; color: var(--c-text-dim); }

/* Well ticket display — multiple tickets */
.wt-ticket { margin-right: 8px; }
.wt-ticket.focus .wt-name { color: var(--c-text); }
.wt-ticket.wt-hanging { opacity: 0.65; font-style: italic; }
.wt-name { font-family: var(--font-ui); font-size: 9px; color: var(--c-text-dim); margin-right: 4px; }
.wt-name.done { text-decoration: line-through; opacity: 0.5; }

/* ── Vessel graphics — each vessel has its own shaped silhouette ────────────── */
/* Shared base for all clip-path shaped vessels */
[class^="gfx-big-"] {
  position: relative;
  overflow: hidden;
}

/* ── Mixing vessels (metallic look) ──────────────────────────────────────── */
.gfx-big-tin {
  /* Shaker tin — wider at top, slight taper */
  width: 40px; height: 64px;
  clip-path: polygon(0% 0%, 100% 0%, 92% 100%, 8% 100%);
  background: linear-gradient(160deg, rgba(200,208,214,0.28), rgba(184,196,204,0.08));
  border: 1.5px solid rgba(190,200,210,0.55);
}
.gfx-big-mixing {
  /* Mixing glass — tall, very slight taper, with horizontal cut lines */
  width: 34px; height: 62px;
  clip-path: polygon(4% 0%, 96% 0%, 91% 100%, 9% 100%);
  background: repeating-linear-gradient(
    180deg,
    rgba(140,200,255,0.04) 0px, rgba(140,200,255,0.04) 7px,
    rgba(140,200,255,0.10) 7px, rgba(140,200,255,0.10) 8px
  );
  border: 1.5px solid rgba(140,200,255,0.4);
}
/* Jigger — hourglass silhouette */
.gfx-big-jigger {
  width: 28px; height: 48px;
  clip-path: polygon(8% 0%, 92% 0%, 75% 50%, 92% 100%, 8% 100%, 25% 50%);
  background: linear-gradient(135deg, rgba(200,168,50,0.35), rgba(200,168,50,0.12));
  border: 1.5px solid rgba(200,168,50,0.55);
}

/* ── Short / wide glasses (rocks family) ─────────────────────────────────── */
.gfx-big-rocks {
  width: 44px; height: 40px;
  clip-path: polygon(5% 0%, 95% 0%, 87% 100%, 13% 100%);
  background: rgba(140,200,255,0.05);
  border: 1.5px solid rgba(140,200,255,0.38);
}
.gfx-big-dbl-rocks {
  width: 44px; height: 50px;
  clip-path: polygon(5% 0%, 95% 0%, 87% 100%, 13% 100%);
  background: rgba(140,200,255,0.05);
  border: 1.5px solid rgba(140,200,255,0.38);
}
.gfx-big-shot {
  width: 26px; height: 22px;
  clip-path: polygon(6% 0%, 94% 0%, 88% 100%, 12% 100%);
  background: rgba(140,200,255,0.05);
  border: 1.5px solid rgba(140,200,255,0.38);
}
.gfx-big-copper-mug {
  width: 38px; height: 46px;
  clip-path: polygon(5% 0%, 95% 0%, 90% 100%, 10% 100%);
  background: rgba(184,115,51,0.18);
  border: 1.5px solid rgba(184,115,51,0.55);
}
.gfx-big-copper-mug::after {
  content: '';
  position: absolute;
  right: -10px; top: 25%;
  width: 10px; height: 40%;
  border: 1.5px solid rgba(184,115,51,0.55);
  border-left: none;
  border-radius: 0 6px 6px 0;
}

/* ── Tall / narrow glasses ───────────────────────────────────────────────── */
.gfx-big-highball {
  width: 28px; height: 62px;
  clip-path: polygon(5% 0%, 95% 0%, 90% 100%, 10% 100%);
  background: rgba(140,200,255,0.05);
  border: 1.5px solid rgba(140,200,255,0.38);
}
.gfx-big-collins {
  width: 24px; height: 70px;
  clip-path: polygon(5% 0%, 95% 0%, 90% 100%, 10% 100%);
  background: rgba(140,200,255,0.05);
  border: 1.5px solid rgba(140,200,255,0.38);
}
.gfx-big-hurricane {
  /* Tulip — wider at top, pinches in middle, flares at bottom */
  width: 34px; height: 62px;
  clip-path: polygon(22% 0%, 78% 0%, 90% 28%, 80% 55%, 76% 100%, 24% 100%, 20% 55%, 10% 28%);
  background: rgba(140,200,255,0.05);
  border: 1.5px solid rgba(140,200,255,0.38);
}
.gfx-big-pint {
  /* Slightly flared at top */
  width: 36px; height: 58px;
  clip-path: polygon(8% 0%, 92% 0%, 84% 55%, 80% 100%, 20% 100%, 16% 55%);
  background: rgba(140,200,255,0.05);
  border: 1.5px solid rgba(140,200,255,0.38);
}

/* ── Stemmed glasses — bowl only (stem + foot added via .gfx-stemmed-wrap) ── */
.gfx-stemmed-wrap {
  display: flex; flex-direction: column; align-items: center;
}
.gfx-stem {
  width: 2px; height: 18px;
  background: rgba(140,200,255,0.45);
}
.gfx-foot {
  width: 24px; height: 2px;
  background: rgba(140,200,255,0.45);
  border-radius: 1px;
}

.gfx-big-coupe {
  /* Wide shallow bowl */
  width: 50px; height: 30px;
  clip-path: polygon(0% 0%, 100% 0%, 66% 100%, 34% 100%);
  background: rgba(140,200,255,0.05);
  border: 1.5px solid rgba(140,200,255,0.38);
}
.gfx-big-martini {
  /* Sharp V */
  width: 52px; height: 36px;
  clip-path: polygon(0% 0%, 100% 0%, 56% 100%, 44% 100%);
  background: rgba(140,200,255,0.05);
  border: 1.5px solid rgba(140,200,255,0.38);
}
.gfx-big-nick-nora {
  /* Rounder egg bowl */
  width: 42px; height: 34px;
  clip-path: polygon(4% 0%, 96% 0%, 68% 100%, 32% 100%);
  background: rgba(140,200,255,0.05);
  border: 1.5px solid rgba(140,200,255,0.38);
}
.gfx-big-flute {
  /* Tall very narrow */
  width: 20px; height: 52px;
  clip-path: polygon(8% 0%, 92% 0%, 72% 100%, 28% 100%);
  background: rgba(140,200,255,0.05);
  border: 1.5px solid rgba(140,200,255,0.38);
}
.gfx-big-wine {
  /* Rounded medium bowl */
  width: 44px; height: 40px;
  clip-path: polygon(4% 0%, 96% 0%, 66% 100%, 34% 100%);
  background: rgba(140,200,255,0.05);
  border: 1.5px solid rgba(140,200,255,0.38);
}
.gfx-big-irish-coffee {
  /* Tall handled mug on stem */
  width: 34px; height: 50px;
  clip-path: polygon(5% 0%, 95% 0%, 90% 100%, 10% 100%);
  background: rgba(140,200,255,0.05);
  border: 1.5px solid rgba(140,200,255,0.38);
}

.vessel-liquid-fill {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex;
  flex-direction: column;
  transition: height 0.4s ease;
  border-radius: 0;   /* clip-path on container handles shaping */
  overflow: hidden;
}
/* Each ingredient is a colored band */
.vlf-layer {
  width: 100%;
  transition: flex 0.35s ease;
  opacity: 0.78;
}
/* Individual ice cubes inside vessel — generated by _iceHtml() */
.ice-cube {
  position: absolute;
  background: rgba(195, 232, 255, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 3px;
  pointer-events: none;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.45), 0 1px 3px rgba(0,0,0,0.25);
}
/* Keep .vlf-ice defined but unused (vessels use .ice-cube now) */
.vlf-ice { display: none; }
.vessel-strainer-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  font-size: 18px;
}
.vessel-state-badge {
  position: absolute; bottom: -16px;
  font-family: var(--font-ui); font-size: 9px;
  color: var(--c-gold); white-space: nowrap;
}
.vessel-content-dots {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 3px; max-width: 70px;
}
.vcd { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.2); }
.vessel-serve-label {
  font-family: var(--font-ui); font-size: 10px; color: var(--c-perfect);
  font-weight: bold; animation: blink 1s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* Shake animation — on the gfx wrapper inside a .vessel-shaking slot */
.ws-shaking { animation: ws-shake 0.12s ease infinite; }
.vessel-shaking .ws-vessel-gfx { animation: ws-shake-active 0.16s ease-in-out infinite; }
@keyframes ws-shake {
  0%   { transform: rotate(-8deg) translateX(-4px); }
  50%  { transform: rotate(8deg)  translateX(4px); }
  100% { transform: rotate(-8deg) translateX(-4px); }
}
@keyframes ws-shake-active {
  0%   { transform: rotate(-6deg) translateX(-5px) scaleY(0.97); }
  25%  { transform: rotate(4deg)  translateX(5px)  scaleY(1.02); }
  50%  { transform: rotate(-6deg) translateX(-4px) scaleY(0.97); }
  75%  { transform: rotate(5deg)  translateX(4px)  scaleY(1.01); }
  100% { transform: rotate(-6deg) translateX(-5px) scaleY(0.97); }
}

/* Stir animation — spinning spoon overlay */
.vessel-stir-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  z-index: 5;
}
.stir-spoon {
  font-size: 1.3rem;
  display: block;
  transform-origin: 50% 80%;
  animation: stir-spin 1.4s cubic-bezier(0.4,0,0.6,1) infinite;
  opacity: 0.85;
}
@keyframes stir-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Countdown badge on shaking/stirring vessels */
.vessel-countdown {
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  background: rgba(13,8,4,0.85);
  border: 1px solid var(--c-gold);
  border-radius: 10px;
  padding: 1px 7px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: bold;
  color: var(--c-gold);
  white-space: nowrap;
  pointer-events: none;
  z-index: 8;
  animation: count-pulse 1s ease infinite;
}
@keyframes count-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

/* Free pour overlay (center of workspace) */
#fp-overlay-mobile {
  display: none;
  position: absolute; inset: 0;
  background: rgba(13,8,4,0.9);
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px;
  z-index: 20;
  padding: 8px 130px 8px 130px;
  touch-action: none;
}
#fp-overlay-mobile.active { display: flex; }
.fpm-title  { color: var(--c-gold); font-family: var(--font-ui); font-size: 16px; font-weight: bold; }
.fpm-sub    { color: var(--c-text-dim); font-family: var(--font-ui); font-size: 12px; }
.fpm-bar-wrap {
  width: 48px; height: 160px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--c-steel-dark);
  border-radius: 6px;
  position: relative; overflow: hidden;
}
.fpm-fill {
  position: absolute; bottom: 0; left: 0; right: 0; height: 0;
  background: linear-gradient(to top, var(--c-blue), var(--c-steel));
  border-radius: 0 0 4px 4px;
}
.fpm-target-line {
  position: absolute; left: 0; right: 0; height: 3px;
  background: var(--c-gold);
  pointer-events: none;
}
.fpm-oz-label {
  position: absolute; right: calc(100% + 8px);
  font-family: var(--font-mono); font-size: 11px; color: var(--c-gold);
  white-space: nowrap;
}
.fpm-hold-hint { color: var(--c-text-dim); font-family: var(--font-ui); font-size: 11px; }
.fpm-pulse {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--c-gold);
  animation: fpm-beat 1s ease infinite;
}
@keyframes fpm-beat { 0%,100%{opacity:0.3;transform:scale(0.8)} 50%{opacity:1;transform:scale(1.2)} }

/* (Recipe pin replaced by slot-summary + slot-recipe-overlay inside each ws-slot) */

/* ── Layer: Bar Top ───────────────────────────────────────────────────────── */
#layer-bartop {
  background: linear-gradient(to bottom, #221408 0%, #150e06 100%);
  padding: 8px 10px 8px 130px;
}
#bartop-surface {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 8px 160px 8px 0;
  overflow-x: auto;
  border-bottom: 3px solid var(--c-wood-light);
  background: linear-gradient(to bottom, var(--c-bar-top) 0%, var(--c-wood-dark) 100%);
  border-radius: var(--r-sm);
  min-height: 80px;
}
.bartop-drink {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  opacity: 0.5; font-size: 1.8rem; animation: serve-arrive 0.4s ease;
  flex-shrink: 0; padding: 4px;
}
@keyframes serve-arrive {
  from { transform: translateY(-30px); opacity: 0; }
  to   { transform: translateY(0); opacity: 0.5; }
}
#bartop-ticket-display {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 6px 160px 6px 0;
  overflow-y: auto; flex: 1;
}
.bartop-ticket {
  background: var(--c-ticket);
  border: 1px solid #c8b890;
  border-radius: 3px;
  padding: 6px 8px;
  font-family: var(--font-ticket);
  font-size: 9px;
  color: var(--c-ink);
  animation: ticket-arrive 0.5s ease;
  min-width: 90px;
}
@keyframes ticket-arrive {
  from { transform: scale(0.8) rotate(-5deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg); opacity: 1; }
}
.bartop-ticket.cleared { animation: ticket-cleared 0.6s ease forwards; }
@keyframes ticket-cleared {
  0%   { transform: scale(1); opacity: 1; }
  50%  { transform: scale(1.1) translateY(-8px); }
  100% { transform: scale(0.5) translateY(-40px) rotate(10deg); opacity: 0; }
}

/* ── HUD Top Strip ────────────────────────────────────────────────────────── */
#hud-top {
  position: absolute; top: 0; left: 0; right: 0;
  height: calc(44px + env(safe-area-inset-top));
  background: rgba(13,8,4,0.92);
  border-bottom: 1px solid var(--c-wood-light);
  display: flex; align-items: center;
  padding: env(safe-area-inset-top) 10px 0;
  gap: 10px;
  z-index: 50;
}
#hud-top .hud-score { color: var(--c-gold); font-size: 13px; font-weight: bold; font-family: var(--font-ui); }
#hud-top .hud-timer { color: var(--c-text); font-family: var(--font-mono); font-size: 13px; }
#layer-indicator {
  display: flex; align-items: center; gap: 6px;
  position: absolute; left: 50%; transform: translateX(-50%);
}
.li-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: background 0.2s, transform 0.2s;
  cursor: pointer;
}
.li-dot.active { background: var(--c-gold); transform: scale(1.4); }
.li-emoji { font-size: 12px; line-height: 1; opacity: 0.5; }
.li-emoji.active { opacity: 1; }
#btn-menu-mobile {
  background: none; border: 1px solid rgba(255,255,255,0.2);
  color: var(--c-text); padding: 4px 8px; border-radius: var(--r-sm);
  font-size: 14px; cursor: pointer; margin-left: auto;
}
#hud-version {
  font-family: var(--font-ui);
  font-size: 8px;
  color: rgba(255,255,255,0.2);
  margin-left: 4px;
  letter-spacing: 0.04em;
}

/* ── Ticket Rail (bottom strip) ──────────────────────────────────────────── */
#ticket-rail {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 68px;
  background: linear-gradient(to bottom, var(--c-wood-dark) 0%, var(--c-rail) 100%);
  border-top: 2px solid var(--c-wood-light);
  display: flex; align-items: center;
  padding: 4px 8px 4px 130px;
  gap: 6px;
  overflow-x: auto;
  z-index: 50;
  -webkit-overflow-scrolling: touch;
}
.ticket-card {
  background: var(--c-ticket);
  border: 1px solid #c8b890;
  border-radius: 3px;
  padding: 5px 8px;
  min-width: 90px;
  max-width: 120px;
  flex-shrink: 0;
  cursor: pointer;
  color: var(--c-ink);
  font-family: var(--font-ticket);
  font-size: 9px;
  line-height: 1.4;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.4);
  animation: ticket-in 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.ticket-card:active { transform: scale(0.96); }
.ticket-card.urgent { border-color: var(--c-red); animation: ticket-in 0.3s ease, ticket-pulse 1s 0.3s infinite; }
.ticket-num { font-weight: bold; font-size: 10px; border-bottom: 1px dashed #8a7858; margin-bottom: 2px; padding-bottom: 2px; }
.ticket-drink { font-size: 8px; }
.ticket-age { position: absolute; top: 3px; right: 4px; font-size: 8px; color: var(--c-red); }

@keyframes ticket-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ticket-pulse { 0%,100%{box-shadow:none} 50%{box-shadow:0 0 8px rgba(204,34,34,0.7)} }

.ticket-printer-icon {
  min-width: 44px; height: 44px;
  background: var(--c-steel-dark); border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}

/* ── Tool Area (lower-left, left thumb) ──────────────────────────────────── */
#tool-area {
  position: absolute;
  bottom: 68px; left: 0;
  width: 140px;
  padding: 8px 8px 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  z-index: 40;
}

#btn-pull-all {
  font-size: 10px; font-family: var(--font-ui);
  width: 72px; margin-left: 4px;
}

/* Three circles in a zigzag triangle */
#tool-circles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tool-circle {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(26,18,8,0.88);
  border: 2px solid rgba(255,255,255,0.2);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  padding: 0;
  flex-shrink: 0;
}
/* Two-circle stagger: Ice slightly right, Spoon slightly left */
.tool-circle:nth-child(1) { margin-left: 4px; }
.tool-circle:nth-child(2) { margin-left: 32px; }

.tc-label { font-family: var(--font-ui); font-size: 8px; color: var(--c-text-dim); }
.tool-circle.active {
  border-color: var(--c-gold);
  background: rgba(200,168,50,0.15);
  box-shadow: 0 0 14px rgba(200,168,50,0.35);
}
.tool-circle:active { transform: scale(0.88); }

/* ── Vessel/Glass Selector (lower-right, right thumb) ────────────────────── */
#vessel-selector {
  position: absolute;
  bottom: 68px; right: 0;
  width: 164px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 68px - 44px - env(safe-area-inset-top));
  background: rgba(13,8,4,0.6);
}

/* Mixing vessels (jigger + tin + mixing glass) — pinned to bottom, always visible */
#vs-mixing {
  order: 2;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  padding: 6px 5px 6px;
  border-top: 1px solid rgba(255,255,255,0.12);
}
#vs-mixing .vs-btn {
  height: 64px;
  font-size: 1.3rem;
}

/* Glasses — single-column scrollable list */
#vs-glasses {
  order: 1;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y; /* override game's touch-action:none so scroll works */
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 5px 5px 6px;
}

.vs-btn {
  background: rgba(26,18,8,0.88);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--r-sm);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s, background 0.15s;
  padding: 0;
}
#vs-glasses .vs-btn {
  height: 52px;
}
/* SVG icons in vessel selector */
.vs-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  padding: 3px 0 0;
}
.vs-icon svg {
  max-height: 34px;
  max-width: 36px;
  width: auto;
  height: auto;
  overflow: visible;
}
#vs-mixing .vs-icon svg { max-height: 38px; }
.vs-label { font-family: var(--font-ui); font-size: 8px; color: var(--c-text-dim); padding-bottom: 3px; }
.vs-btn:active, .vs-btn.selected { border-color: var(--c-gold); background: rgba(200,168,50,0.15); }

/* ── Drag Ghost (follows finger) ─────────────────────────────────────────── */
#drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  display: none;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 4px;
  background: rgba(26,18,8,0.92);
  border: 2px solid var(--c-gold);
  border-radius: var(--r-md);
  padding: 8px 12px;
  font-family: var(--font-ui); font-size: 12px;
  color: var(--c-text);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  transform: translate(-50%, -50%);
}
#drag-ghost.visible { display: flex; }
#drag-ghost .dg-icon  { font-size: 1.6rem; line-height: 1; }
#drag-ghost .dg-label { font-size: 11px; color: var(--c-text-dim); white-space: nowrap; }
#drag-ghost .dg-count { font-family: var(--font-mono); font-size: 13px; color: var(--c-gold); font-weight: bold; }
#drag-ghost.dg-beat   { border-color: #fff; box-shadow: 0 0 16px rgba(255,255,255,0.6); }

/* ── Well ticket display (center ticket strip) ───────────────────────────── */
#well-ticket-display {
  position: absolute; top: 44px; left: 130px; right: 0;
  height: 32px;
  background: rgba(13,8,4,0.85);
  border-bottom: 1px solid var(--c-wood-light);
  display: flex; align-items: center;
  padding: 0 160px 0 8px;
  gap: 8px;
  overflow-x: auto;
  z-index: 45;
  -webkit-overflow-scrolling: touch;
}
.wt-name { font-family: var(--font-ticket); font-size: 10px; color: var(--c-text); white-space: nowrap; }
.wt-name.done { text-decoration: line-through; color: var(--c-text-dim); }

/* ── Toast ───────────────────────────────────────────────────────────────── */
/* Positioned just below HUD in the top of the workspace — out of the vessel/pour area */
#toast-area {
  position: fixed; top: 48px;
  left: 80px;       /* anchored near the ice button left edge */
  width: 200px;     /* fixed narrow width — won't creep into workspace */
  right: auto;
  display: flex; flex-direction: column;
  gap: 3px; z-index: 100; pointer-events: none;
  max-height: 88px; overflow: hidden;
}
.toast {
  background: rgba(26,18,8,0.95);
  border-left: 3px solid var(--c-gold);
  border-radius: var(--r-sm);
  padding: 5px 10px;
  font-family: var(--font-ui); font-size: 11px;
  color: var(--c-text);
  animation: toast-in 0.2s ease, toast-out 0.3s ease 2.5s forwards;
}
.toast.perfect { border-color: var(--c-perfect); }
.toast.good    { border-color: var(--c-good); }
.toast.okay    { border-color: var(--c-okay); }
.toast.bad     { border-color: var(--c-bad); }
.toast.penalty { border-color: var(--c-red); }
.toast.hint    { border-color: var(--c-blue); }
.toast.info    { border-color: var(--c-steel-dark); }
@keyframes toast-in  { from { transform: translateX(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; } }

/* ── Summary modal ───────────────────────────────────────────────────────── */
#summary-modal {
  display: none; position: fixed; inset: 0;
  z-index: 200; background: var(--c-overlay);
  align-items: center; justify-content: center;
}
#summary-modal.visible { display: flex; }
