/* Rush Hour: the full screen fountain game. Plus the shared overflow spill used by every glass on the site. */
.hero__play { margin: var(--s-3) 0 0; display: flex; justify-content: center; }
.hero__play .btn { min-height: 44px; padding: 0 18px; font-size: 0.74rem; }
body.rush-open { overflow: hidden; }

.rush { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); gap: 6px; padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0); background:
  radial-gradient(70vmax 50vmax at 50% 105%, color-mix(in srgb, var(--served, #6E1030) 34%, transparent), transparent 62%),
  linear-gradient(180deg, #0E0A08, #17100D 55%, #120D0B); color: var(--pc-cream); --served: #3B1A10; }
.rush[hidden] { display: none; }

/* hud */
.rush__hud { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 10px var(--gutter) 6px; border-bottom: var(--frame-hair); }
.rush__stat { display: grid; justify-items: center; line-height: 1; min-width: 56px; }
.rush__stat b { font-family: var(--ff-mono); font-weight: 400; font-size: 1.15rem; color: var(--pc-cream); font-variant-numeric: tabular-nums; }
.rush__stat b small { font-size: 0.75rem; color: var(--pc-cream-faint); }
.rush__stat i { font-family: var(--ff-caps); font-style: normal; font-size: 0.56rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--pc-cream-faint); margin-top: 3px; }
.rush__stat--tips b { color: var(--pc-gold-lt); }
.rush__hearts span { color: rgba(244,234,213,0.18); font-size: 1.1rem; }
.rush__hearts span.is-full { color: #D93A55; }
.rush__close { width: 40px; height: 40px; border: 1px solid var(--pc-cream-faint); background: transparent; color: var(--pc-cream); font-size: 0.9rem; cursor: pointer; }
.rush__close:hover { border-color: var(--pc-gold); color: var(--pc-gold-lt); }

/* the hint line */
.rush__hint { margin: 0; padding: 0 var(--gutter); text-align: center; font-family: var(--ff-caps); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--pc-gold-lt); min-height: 1.4em; }

/* the play area: the counter with customers, then the fountain */
.rush__bar { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: clamp(8px, 3vw, 28px); padding: 6px var(--gutter) 16px; min-height: 150px; }
.rush__counter { position: absolute; left: 0; right: 0; bottom: 0; height: 12px; background: linear-gradient(180deg, #3A2619, #2A1B14 40%, #1A1210); border-top: 1px solid var(--pc-gold); }
.cust { position: relative; display: grid; justify-items: center; gap: 4px; width: clamp(96px, 26vw, 150px); --c: #3B1A10; animation: cust-in 420ms var(--ease-out) both; transition: transform 400ms var(--ease-in-out), opacity 400ms; }
.cust.is-gone { opacity: 0; transform: translateX(120px); }
.cust.is-served { opacity: 0; transform: translateY(-16px) scale(0.92); }
.cust__face { width: 46px; height: 46px; }
.cust__skin { fill: #F1D3B5; stroke: var(--pc-ink); stroke-width: 2; }
.cust__eye { fill: var(--pc-ink); }
.cust__mouth { fill: none; stroke: var(--pc-ink); stroke-width: 2.6; stroke-linecap: round; transition: d 300ms; }
.cust__hat { fill: var(--pc-oxblood); }
.cust:nth-child(3n) .cust__hat { fill: var(--pc-green); } .cust:nth-child(3n+1) .cust__hat { fill: var(--pc-navy); } .cust:nth-child(4n) .cust__skin { fill: #C68B5B; } .cust:nth-child(5n) .cust__skin { fill: #8D5A3C; }
.cust.is-meh .cust__mouth { d: path("M22 44 L42 44"); }
.cust.is-mad .cust__mouth { d: path("M21 47 Q32 38 43 47"); }
.cust.is-mad .cust__face { animation: cust-shake 400ms ease-in-out infinite; }
.cust.is-served .cust__mouth { d: path("M20 40 Q32 54 44 40"); }
.cust__name { font-family: var(--ff-caps); font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--pc-cream-dim); }
.cust__bubble { display: flex; align-items: center; gap: 8px; background: var(--pc-cream); color: var(--pc-ink); padding: 6px 10px; border: 2px solid var(--pc-ink); box-shadow: 3px 3px 0 var(--pc-ink); position: relative; width: 100%; }
.cust__bubble::before { content: ""; position: absolute; left: 50%; top: -10px; width: 12px; height: 12px; background: var(--pc-cream); border-left: 2px solid var(--pc-ink); border-top: 2px solid var(--pc-ink); transform: translateX(-50%) rotate(45deg); }
.cust__glass { position: relative; width: 16px; height: 26px; border: 2px solid var(--pc-ink); border-top-width: 1px; border-radius: 0 0 3px 3px; overflow: hidden; flex: 0 0 auto; background: rgba(255,255,255,0.4); }
.cust__glass i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--c); height: 45%; }
.cust__glass--regular i { height: 62%; } .cust__glass--large i { height: 82%; }
.cust__order { display: grid; line-height: 1.05; min-width: 0; }
.cust__order b { font-family: var(--ff-caps); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust__order i { font-family: var(--ff-mono); font-style: normal; font-size: 0.68rem; color: var(--pc-ink-soft); }
.cust__patience { width: 100%; height: 5px; background: rgba(244,234,213,0.14); overflow: hidden; }
.cust__patience i { display: block; height: 100%; background: linear-gradient(90deg, var(--pc-gold), var(--pc-gold-lt)); transform-origin: left; transform: scaleX(1); }
.cust.is-meh .cust__patience i { background: #E39A3B; } .cust.is-mad .cust__patience i { background: #D93A55; }
@keyframes cust-in { from { opacity: 0; transform: translateX(80px); } to { opacity: 1; transform: none; } }
@keyframes cust-shake { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }

/* the fountain: taps directly above the glass */
.rush__fountain { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 6px; min-height: 0; padding: 0 var(--gutter) 8px; }
.rush__taps { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 8px; border: var(--frame-hair); background: linear-gradient(180deg, rgba(20,57,43,0.55), rgba(11,35,27,0.7)); }
.rtap { position: relative; flex: 0 1 132px; display: grid; justify-items: center; gap: 5px; padding: 8px 6px 7px; background: color-mix(in srgb, var(--c) 22%, rgba(244,234,213,0.04)); border: 1.5px solid rgba(244,234,213,0.28); color: var(--pc-cream); font: inherit; cursor: pointer; min-height: 78px; transition: border-color var(--dur-ui), background var(--dur-ui), transform var(--dur-ui), box-shadow var(--dur-ui); }
.rtap__handle { width: 36px; height: 38px; display: grid; justify-items: center; align-items: end; }
.rtap__handle i { display: block; width: 32px; height: 36px; border-radius: 11px 11px 5px 5px; background: radial-gradient(circle at 35% 28%, color-mix(in srgb, var(--c) 55%, white 20%), var(--c) 55%, color-mix(in srgb, var(--c) 65%, black) 100%); box-shadow: 0 4px 10px rgba(0,0,0,0.5), inset 0 -3px 0 rgba(0,0,0,0.35); border: 1px solid rgba(244,234,213,0.3); transition: transform var(--dur-move) var(--ease-out); }
.rtap__name { font-family: var(--ff-caps); font-weight: 600; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; text-align: center; line-height: 1.1; }
.rtap__key { position: absolute; top: 3px; right: 5px; font-family: var(--ff-mono); font-size: 0.55rem; color: var(--pc-cream-faint); }
.rtap:hover { border-color: var(--pc-cream-dim); background: color-mix(in srgb, var(--c) 32%, rgba(244,234,213,0.06)); }
.rtap:hover .rtap__handle i { transform: translateY(-2px); }
.rtap.is-on { border-color: var(--pc-gold-lt); border-width: 2px; background: color-mix(in srgb, var(--c) 40%, rgba(244,234,213,0.08)); box-shadow: 0 0 0 3px rgba(201,162,39,0.22), 0 10px 26px rgba(0,0,0,0.45); transform: translateY(-2px); }
.rtap.is-on .rtap__handle i { transform: rotate(-22deg) translateY(-2px); box-shadow: 0 0 0 3px rgba(201,162,39,0.25), 0 6px 14px color-mix(in srgb, var(--c) 70%, transparent); }
.rtap.is-on::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 10px; height: 10px; background: var(--pc-gold); transform: translateX(-50%) rotate(45deg); }

.rush__stage { position: relative; justify-self: center; align-self: stretch; display: grid; justify-items: center; min-height: 0; height: 100%; padding-top: 34px; width: 100%; overflow: hidden; }
.rush__spout { position: absolute; top: 0; left: calc(50% + 2.5%); transform: translateX(-50%); width: 40px; height: 42px; z-index: 2; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6)); --c: #1E0C06; }
.rush__spout-drop { fill: var(--c); }
.rush__glass { position: relative; height: 100%; min-height: 0; aspect-ratio: 10 / 17; width: auto; max-width: 100%; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.rush__glass.is-pouring { cursor: grabbing; }
.rush__glass > canvas { display: block; width: 100%; height: 100%; }
.rush__line { position: absolute; left: 50%; width: min(58%, 210px); transform: translateX(-50%); top: 50%; height: 0; border-top: 2px dashed rgba(244,234,213,0.9); transition: top 260ms var(--ease-out); pointer-events: none; z-index: 3; }
.rush__line[hidden] { display: none; }
.rush__line span { position: absolute; left: 50%; transform: translateX(-50%); top: -1.5em; font-family: var(--ff-caps); font-size: 0.56rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--pc-ink); background: var(--pc-cream); padding: 2px 8px; white-space: nowrap; }
.rush__stamp { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) rotate(-7deg); font-family: var(--ff-display); font-size: clamp(1.3rem, 4vw, 2rem); line-height: 1; color: var(--pc-cream); text-shadow: 0 2px 0 rgba(0,0,0,0.6); white-space: nowrap; text-align: center; animation: stamp 1000ms var(--ease-out) both; pointer-events: none; z-index: 4; }
.rush__stamp small { display: block; font-family: var(--ff-caps); font-size: 0.66rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--pc-cream-dim); margin-top: 6px; }
.rush__stamp[hidden] { display: none; }
.rush__stamp.is-great { color: var(--pc-gold-lt); }
.rush__stamp.is-bad { color: #F2A2B5; }
.rush__stamp.is-meh { color: var(--pc-cream-dim); }
@keyframes stamp { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-7deg) scale(1.5); } 18% { opacity: 1; transform: translate(-50%, -50%) rotate(-7deg) scale(0.96); } 30% { transform: translate(-50%, -50%) rotate(-7deg) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -64%) rotate(-7deg); } }

/* tooltips on first play */
.rush.is-tut::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,0.55); z-index: 5; }
.rush .is-spot { position: relative; z-index: 6; box-shadow: 0 0 0 3px var(--pc-gold), 0 0 40px rgba(201,162,39,0.35); }
.rush__tip { position: fixed; z-index: 7; width: min(340px, calc(100vw - 24px)); background: var(--pc-cream); color: var(--pc-ink); padding: 14px 14px 12px; border: 2px solid var(--pc-ink); box-shadow: 4px 6px 0 rgba(0,0,0,0.5); --arrow-x: 50%; }
.rush__tip--inside::after { display: none; }
.rush__tip::after { content: ""; position: absolute; left: var(--arrow-x); bottom: -9px; width: 14px; height: 14px; background: var(--pc-cream); border-right: 2px solid var(--pc-ink); border-bottom: 2px solid var(--pc-ink); transform: translateX(-50%) rotate(45deg); }
.rush__tip--below::after { bottom: auto; top: -9px; border: 0; border-left: 2px solid var(--pc-ink); border-top: 2px solid var(--pc-ink); }
.rush__tip[hidden] { display: none; }
.rush__tip p { margin: 0 0 10px; font-family: var(--ff-body); font-size: 0.95rem; line-height: 1.45; }
.rush__tip .btn { min-height: 38px; font-size: 0.7rem; padding: 0 14px; border-color: var(--pc-ink); color: var(--pc-ink); }
.rush__tip .btn:hover { background: var(--pc-ink); color: var(--pc-gold-lt); }

/* the end card */
.rush__end { position: absolute; inset: 0; z-index: 8; display: grid; align-content: center; justify-items: center; gap: 10px; text-align: center; padding: var(--s-6); background: rgba(14, 10, 8, 0.94); animation: end-in 420ms var(--ease-out) both; }
.rush__end[hidden] { display: none; }
.rush__end-k { font-family: var(--ff-caps); font-size: 0.66rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--pc-gold); }
.rush__end-h { font-family: var(--ff-display); font-size: clamp(1.5rem, 4vw, 2.6rem); line-height: 1.05; color: var(--pc-cream); max-width: 18ch; }
.rush__end-line { font-family: var(--ff-mono); font-size: 0.95rem; color: var(--pc-cream-dim); }
.rush__end-best { font-family: var(--ff-caps); font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--pc-gold-lt); }
.rush__end-links { display: grid; gap: 10px; margin-top: 10px; width: min(100%, 320px); }
@keyframes end-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* wide screens */
@media (min-width: 900px) and (min-height: 600px) {
  .rush__bar { min-height: 190px; }
  .cust { width: 170px; }
  .cust__face { width: 56px; height: 56px; }
  .rush__fountain { max-width: 1100px; width: 100%; justify-self: center; }
  .rtap { flex-basis: 140px; }
  .rush--many .rtap { flex-basis: 108px; }
  .rush__hint { font-size: 0.9rem; }
}
@media (max-width: 480px) {
  .rush__hud { padding: 8px 12px 6px; }
  .rush__stat { min-width: 44px; }
  .rush__stat b { font-size: 1rem; }
  .rush__bar { min-height: 132px; gap: 8px; }
  .cust { width: 30vw; }
  .cust__bubble { padding: 5px 6px; gap: 5px; }
  .cust__order b { font-size: 0.66rem; }
  .rush__fountain { padding: 0 10px 8px; }
  .rush__taps { gap: 4px; padding: 6px; }
  .rtap { flex: 1 1 22%; }
  .rush--many .rtap { flex: 1 1 17%; min-height: 50px; }
  .rtap { min-height: 54px; padding: 4px 2px; }
  .rtap__name { font-size: 0.52rem; }
  .rtap__key { display: none; }
  .rush__hint { font-size: 0.66rem; }
}
@media (max-height: 640px) {
  .rush__bar { min-height: 118px; }
  .cust__face { width: 38px; height: 38px; }
}

/* shared: foam over the rim and the spill down the screen (used by every glass on the site) */
.game__foam { position: absolute; left: 22%; right: 22%; top: 12%; height: 9%; pointer-events: none; z-index: 4; background: radial-gradient(circle at 20% 60%, #FFF7E6 0 18%, transparent 19%), radial-gradient(circle at 42% 30%, #FFF7E6 0 22%, transparent 23%), radial-gradient(circle at 66% 62%, #FFF7E6 0 20%, transparent 21%), radial-gradient(circle at 86% 36%, #FFF7E6 0 16%, transparent 17%); filter: drop-shadow(0 6px 6px rgba(0,0,0,0.4)); animation: foam-over 1400ms var(--ease-out) both; }
@keyframes foam-over { 0% { opacity: 0; transform: translateY(-10px) scaleY(0.4); } 25% { opacity: 1; transform: translateY(0) scaleY(1); } 70% { opacity: 1; transform: translateY(18px) scaleY(1.2); } 100% { opacity: 0; transform: translateY(44px) scaleY(1.3); } }
.game__spill { position: fixed; z-index: 70; pointer-events: none; --spill: #6E1030; --spill-lt: color-mix(in srgb, var(--spill) 62%, #FFF1D6 38%); }
.game__spill-lip { position: absolute; left: -8%; right: -8%; top: -10px; height: 26px; background: radial-gradient(circle at 12% 45%, #FFF7E6 0 30%, transparent 31%), radial-gradient(circle at 36% 70%, #FFF7E6 0 36%, transparent 37%), radial-gradient(circle at 62% 40%, #FFF7E6 0 30%, transparent 31%), radial-gradient(circle at 88% 65%, #FFF7E6 0 28%, transparent 29%), linear-gradient(var(--spill-lt), var(--spill-lt)); animation: spill-lip 500ms var(--ease-out) both; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5)); }
.game__spill-run { position: absolute; top: 6px; bottom: 0; left: -5%; width: 11%; border-radius: 40% 40% 50% 50% / 6px 6px 16px 16px; background: linear-gradient(90deg, rgba(255,255,255,0.55), var(--spill-lt) 28%, var(--spill) 62%, color-mix(in srgb, var(--spill) 55%, black) 100%); box-shadow: 0 0 22px color-mix(in srgb, var(--spill-lt) 70%, transparent), inset 0 0 0 1px rgba(255,255,255,0.12); transform-origin: top; animation: spill-run 1300ms cubic-bezier(0.3, 0, 0.6, 1) 120ms both; }
.game__spill-run--2 { left: 93%; width: 13%; animation-delay: 240ms; animation-duration: 1500ms; }
.game__spill-run--3 { left: 8%; width: 84%; opacity: 0.28; box-shadow: none; border-radius: 0 0 30% 30% / 0 0 20px 20px; background: linear-gradient(180deg, var(--spill-lt), var(--spill) 40%, transparent 92%); animation-delay: 60ms; animation-duration: 1100ms; }
.game__spill-pool { position: absolute; left: -45%; right: -45%; bottom: -10px; height: 90px; background: radial-gradient(ellipse at 50% 100%, var(--spill-lt) 0 40%, transparent 72%); opacity: 0; animation: spill-pool 900ms var(--ease-out) 1000ms both; }
@keyframes spill-lip { from { opacity: 0; transform: translateY(-6px) scaleY(0.3); } to { opacity: 1; transform: none; } }
@keyframes spill-run { 0% { transform: scaleY(0); opacity: 0.95; } 100% { transform: scaleY(1); opacity: 1; } }
@keyframes spill-pool { from { opacity: 0; transform: scaleX(0.4); } to { opacity: 0.95; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .cust, .rush__stamp, .rush__end, .game__foam, .game__spill-lip, .game__spill-run, .game__spill-pool { animation: none; opacity: 1; transform: none; }
  .cust.is-mad .cust__face { animation: none; }
  .rush__line { transition: none; }
}
