/* Thirsty Tower page styles. Palette and fonts match the Thirsty Maze modal and the 80s Drink Slots page. */
:root {
  --bg: #070114;
  --pink: #FF3CAC;
  --teal: #2AF5E4;
  --gold: #FFD166;
  --orange: #FF7A45;
  --foam: #FFF4FA;
  --ink: #160430;
  --btn: clamp(64px, 15vw, 120px);
  --jump: clamp(96px, 28vw, 170px);
  --board-ratio: 0.6207; /* 360 / 580 */
  --chrome: calc(172px + 2 * var(--btn));
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--bg); color: var(--foam);
  font-family: "Archivo", system-ui, sans-serif;
  overflow-x: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
/* While a run is on, the page itself must not scroll, pan or zoom under the player's fingers. */
html.is-playing, html.is-playing body { overflow: hidden; touch-action: none; }

/* ---------- sunset backdrop ---------- */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(circle at 50% 18%, rgba(255,122,69,0.28) 0%, rgba(255,60,172,0.22) 28%, transparent 56%),
    linear-gradient(180deg, #09011D 0%, #24064E 46%, #3A0A5E 58%, #070116 100%); }
.backdrop__sun { position: absolute; left: 50%; top: 8%; width: min(62vw, 420px); aspect-ratio: 1; transform: translateX(-50%);
  border-radius: 50%; opacity: 0.55;
  background: repeating-linear-gradient(to bottom, #FFD166 0%, #FFD166 54%, transparent 54%, transparent 57%, #FF7A45 57%, #FF7A45 66%,
    transparent 66%, transparent 70%, #FF3CAC 70%, #FF3CAC 80%, transparent 80%, transparent 85%, #D61A86 85%, #D61A86 100%); }
.backdrop__ocean { position: absolute; left: 0; right: 0; top: 56%; height: 14%;
  background: linear-gradient(180deg, rgba(42,245,228,0.22), rgba(255,60,172,0.16), transparent); border-top: 2px solid rgba(42,245,228,0.5); }
.backdrop__grid { position: absolute; left: -24%; right: -24%; bottom: -14%; height: 46%; opacity: 0.5;
  background-image: linear-gradient(to right, rgba(42,245,228,0.3) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,60,172,0.38) 1px, transparent 1px);
  background-size: 48px 34px; transform: perspective(360px) rotateX(64deg); transform-origin: bottom center; }

/* ---------- page frame ---------- */
.stage { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: 100%; max-width: 1280px; margin: 0 auto; padding: 8px 10px 16px; padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
.bar { width: 100%; max-width: 760px; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.bar__title { margin: 0; font-family: "Bungee", sans-serif; font-weight: 400; font-size: clamp(1.15rem, 5vw, 1.9rem); letter-spacing: 0.02em;
  color: var(--gold); text-shadow: 0 0 18px rgba(255,209,102,0.55), 0 2px 0 rgba(90,10,80,0.7); white-space: nowrap; }
.bar__btns { display: flex; gap: 8px; }
.chip { font-family: "Bungee", sans-serif; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--foam);
  min-height: 44px; min-width: 64px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  background: linear-gradient(180deg, #2B0954, #120229); border: 2px solid var(--teal); box-shadow: 0 0 14px rgba(42,245,228,0.3); }
.chip:hover { border-color: var(--gold); }
.chip[aria-pressed="false"] { border-color: rgba(246,241,255,0.4); color: rgba(246,241,255,0.7); box-shadow: none; }
.chip:focus-visible, .ov__btn:focus-visible, .ctl:focus-visible, .links a:focus-visible, .fun-note a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.hud { width: 100%; max-width: 760px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 5px 8px; border-radius: 12px;
  background: rgba(5,0,16,0.88); border: 1px solid rgba(42,245,228,0.4); box-shadow: inset 0 2px 8px rgba(0,0,0,0.8); }
.hud__i { display: flex; flex-direction: column; align-items: center; min-width: 0; line-height: 1.15; }
.hud__l { font-family: "DM Mono", monospace; font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(246,241,255,0.6); }
.hud__v { font-family: "DM Mono", monospace; font-weight: 600; font-size: 0.95rem; color: var(--teal); text-shadow: 0 0 10px rgba(42,245,228,0.6); }
.hud__lives { display: inline-flex; gap: 4px; align-items: center; min-height: 1.1rem; }
.life { width: 11px; height: 14px; border-radius: 2px 2px 5px 5px; background: var(--pink); border: 1px solid #fff; box-shadow: 0 0 8px rgba(255,60,172,0.8); }
.life--off { background: transparent; border-color: rgba(246,241,255,0.3); box-shadow: none; }

/* ---------- board + controls ---------- */
.cab { width: 100%; display: grid; gap: 8px; justify-items: center; align-items: center;
  grid-template-columns: 1fr 1fr; grid-template-areas: "board board" "move jump"; }
.board { grid-area: board; position: relative; aspect-ratio: 360 / 580;
  width: min(100%, calc((100vh - var(--chrome)) * var(--board-ratio)));
  width: min(100%, calc((100dvh - var(--chrome)) * var(--board-ratio)));
  border-radius: 16px; border: 3px solid rgba(42,245,228,0.75); background: #0A0220;
  box-shadow: 0 0 0 3px rgba(255,60,172,0.45), 0 18px 50px rgba(0,0,0,0.8), 0 0 40px rgba(42,245,228,0.28); }
.board::before { content: ""; position: absolute; left: 16px; right: 16px; top: -3px; height: 4px; border-radius: 999px; z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, var(--gold), var(--pink), var(--teal), var(--gold)); box-shadow: 0 0 16px rgba(255,60,172,0.8); }
#tower { display: block; width: 100%; height: 100%; border-radius: 13px; touch-action: none; cursor: grab; }

.pad { display: flex; }
.pad--move { grid-area: move; justify-self: start; margin-left: 6px; display: grid; grid-template-columns: repeat(3, var(--btn)); grid-template-rows: repeat(2, var(--btn)); gap: 6px; touch-action: none; }
.pad--jump { grid-area: jump; justify-self: end; margin-right: 6px; align-items: center; justify-content: center; touch-action: none; }
.ctl { position: relative; display: grid; place-items: center; padding: 0; width: var(--btn); height: var(--btn); border-radius: 18px; cursor: pointer;
  font-family: "Bungee", sans-serif; color: var(--foam); touch-action: none;
  background: linear-gradient(180deg, #34106A 0%, #170433 100%); border: 3px solid var(--teal);
  box-shadow: 0 0 16px rgba(42,245,228,0.35), inset 0 2px 8px rgba(255,255,255,0.14);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.ctl.is-down { background: linear-gradient(180deg, #6B1FB0 0%, #2B0954 100%); border-color: var(--gold); box-shadow: 0 0 22px rgba(255,209,102,0.7), inset 0 2px 10px rgba(0,0,0,0.5); }
.ctl--up { grid-column: 2; grid-row: 1; }
.ctl--left { grid-column: 1; grid-row: 2; }
.ctl--down { grid-column: 2; grid-row: 2; }
.ctl--right { grid-column: 3; grid-row: 2; }
.ctl--jump { width: var(--jump); height: var(--jump); border-radius: 50%; font-size: clamp(0.95rem, 3.4vw, 1.4rem); letter-spacing: 0.08em; text-transform: uppercase;
  background: radial-gradient(circle at 35% 28%, #FF9AD9 0%, #FF3CAC 45%, #B01272 100%); border: 4px solid #FFD6F0; color: #fff;
  text-shadow: 0 2px 0 rgba(90,10,80,0.8); box-shadow: 0 0 26px rgba(255,60,172,0.65), inset 0 3px 10px rgba(255,255,255,0.35); }
.ctl--jump.is-down { background: radial-gradient(circle at 40% 35%, #FFD166 0%, #FF7A45 55%, #C4177A 100%); border-color: #fff; box-shadow: 0 0 34px rgba(255,209,102,0.85), inset 0 3px 12px rgba(0,0,0,0.4); }
.ico { display: block; width: 46%; height: 46%; background: currentColor; filter: drop-shadow(0 0 6px rgba(42,245,228,0.8)); color: var(--teal); }
.ico--up { clip-path: polygon(50% 8%, 94% 88%, 6% 88%); }
.ico--down { clip-path: polygon(6% 12%, 94% 12%, 50% 92%); }
.ico--left { clip-path: polygon(8% 50%, 88% 6%, 88% 94%); }
.ico--right { clip-path: polygon(92% 50%, 12% 6%, 12% 94%); }
.ctl.is-down .ico { color: var(--gold); }

/* ---------- overlay (title, pause, between towers, game over) ---------- */
.ov { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 16px; text-align: center; border-radius: 13px; overflow: hidden;
  background: radial-gradient(circle at 50% 30%, rgba(60,10,100,0.72), rgba(7,1,20,0.88) 72%); }
.ov--soft { background: radial-gradient(circle at 50% 62%, rgba(40,6,70,0.8), rgba(7,1,20,0.32) 78%); justify-content: flex-end; padding-bottom: 14%; }
.ov[hidden], .ov__stats[hidden], .ov__help[hidden] { display: none; }
.ov__title { margin: 0; font-family: "Bungee", sans-serif; font-weight: 400; font-size: clamp(1.5rem, 8vw, 2.5rem); line-height: 1.05;
  color: var(--gold); text-shadow: 0 0 20px rgba(255,209,102,0.6), 0 3px 0 rgba(90,10,80,0.8); }
.ov__text { margin: 0; font-size: clamp(0.9rem, 3.6vw, 1.1rem); font-weight: 600; color: var(--foam); max-width: 30ch; }
.ov__stats { margin: 0; font-family: "DM Mono", monospace; font-size: clamp(0.85rem, 3.4vw, 1.05rem); color: var(--teal); letter-spacing: 0.04em; line-height: 1.5; }
.ov__help { margin: 0; padding: 0; list-style: none; text-align: left; font-size: clamp(0.74rem, 3vw, 0.9rem); line-height: 1.35; color: rgba(255,244,250,0.88); max-width: 34ch; }
.ov__help li { padding-left: 14px; position: relative; margin: 0 0 5px; }
.ov__help li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 7px; height: 7px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 8px var(--pink); }
.ov__help b { color: var(--gold); }
.ov__btn { font-family: "Bungee", sans-serif; font-size: clamp(1.05rem, 4.6vw, 1.4rem); letter-spacing: 0.06em; text-transform: uppercase; color: #fff; cursor: pointer;
  min-height: 64px; min-width: 190px; padding: 0 28px; border-radius: 999px; border: 3px solid #FFD6F0;
  background: linear-gradient(180deg, #FF5DBD 0%, #FF3CAC 45%, #C4177A 100%); text-shadow: 0 2px 0 rgba(90,10,80,0.8);
  box-shadow: 0 0 26px rgba(255,60,172,0.6), inset 0 2px 8px rgba(255,255,255,0.3); }
.ov__btn:hover { border-color: var(--gold); }

/* ---------- the honest line + page links ---------- */
.fun-note { width: 100%; max-width: 760px; margin: 0 auto; padding: 8px 14px; border-radius: 14px; text-align: center;
  border: 2px solid rgba(255,209,102,0.7); background: rgba(14,3,34,0.92); box-shadow: 0 0 18px rgba(255,209,102,0.25);
  font-size: 0.9rem; font-weight: 700; line-height: 1.35; color: var(--foam); }
.fun-note a { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; max-width: 760px; padding-top: 2px; }
.links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; text-decoration: none;
  font-family: "DM Mono", monospace; font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal);
  border: 1px solid rgba(42,245,228,0.5); background: rgba(5,0,16,0.7); }
.links a:hover { color: #fff; border-color: var(--pink); }

/* ---------- wide screens (desktop, kiosk landscape): pads sit either side of the board ---------- */
@media (min-aspect-ratio: 1/1) and (min-width: 700px) {
  :root { --chrome: 236px; }
  .cab { grid-template-columns: 1fr auto 1fr; grid-template-areas: "move board jump"; align-items: end; gap: 18px; }
  .board { width: calc((100vh - var(--chrome)) * var(--board-ratio)); width: calc((100dvh - var(--chrome)) * var(--board-ratio)); max-width: 100%; }
  .pad--move { justify-self: end; margin-bottom: 8px; }
  .pad--jump { justify-self: start; margin-bottom: 8px; }
  .bar, .hud { max-width: 560px; }
}
@media (min-height: 1300px) and (max-aspect-ratio: 1/1) {
  :root { --chrome: calc(240px + 2 * var(--btn)); }
}
@media (max-height: 520px) and (min-aspect-ratio: 1/1) {
  :root { --btn: 64px; --jump: 96px; --chrome: 132px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
