/* Thirsty Blaster: 1986 neon beach cabinet. Standalone page styles (does not load the site stylesheet). */
:root {
  --void: #09010F;
  --deep: #1B0538;
  --magenta: #FF3CAC;
  --cyan: #2AF5E4;
  --purple: #8A3FFC;
  --amber: #FF7A45;
  --yellow: #FFD166;
  --foam: #FFF4FA;
  --ink: #14032E;
  /* board width: as big as fits the screen height next to the HUD and buttons, never wider than the column */
  --board-w: clamp(260px, calc((100svh - 330px) * 0.6667), 520px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--foam);
  font-family: "Archivo", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -8%, rgba(255, 60, 172, 0.34), transparent 52%),
    radial-gradient(circle at 50% 108%, rgba(42, 245, 228, 0.22), transparent 55%),
    linear-gradient(180deg, #12033A 0%, #09010F 70%);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }

.tb-page { max-width: 1060px; margin: 0 auto; padding: max(10px, env(safe-area-inset-top)) 14px 28px; }

/* ---- top links ---- */
.tb-nav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 0 12px; }
.tb-nav__a {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 16px; border-radius: 999px; text-decoration: none;
  font-family: "Bungee", sans-serif; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--foam); background: linear-gradient(180deg, #2B0954, #120229); border: 2px solid var(--cyan);
  box-shadow: 0 0 16px rgba(42, 245, 228, 0.3);
}
.tb-nav__a:hover { border-color: var(--yellow); background: linear-gradient(180deg, var(--magenta), #C4177A); }

/* ---- layout: cabinet, plus a how-to-play column on wide screens ---- */
.tb-stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; justify-items: center; }
@media (min-width: 900px) {
  .tb-stage { grid-template-columns: minmax(0, 1fr) 300px; justify-items: stretch; }
}

/* ---- cabinet (same neon bezel as the Thirsty Maze box) ---- */
.tb-cab {
  position: relative; width: min(100%, calc(var(--board-w) + 38px)); margin: 0 auto;
  padding: 12px 12px 12px; border-radius: 24px; text-align: center;
  background: linear-gradient(180deg, #24064B 0%, #120229 55%, #090118 100%);
  border: 3px solid rgba(42, 245, 228, 0.75);
  box-shadow: 0 0 0 3px rgba(255, 60, 172, 0.45), 0 24px 64px rgba(0, 0, 0, 0.85), 0 0 46px rgba(42, 245, 228, 0.32), inset 0 2px 14px rgba(255, 255, 255, 0.14);
}
.tb-cab::before {
  content: ""; position: absolute; left: 18px; right: 18px; top: -2px; height: 4px; border-radius: 999px;
  background: linear-gradient(90deg, var(--yellow), var(--magenta), var(--cyan), var(--yellow));
  box-shadow: 0 0 18px rgba(255, 60, 172, 0.8);
}
.tb-bulbs { display: flex; justify-content: space-between; gap: 6px; padding: 4px 6px 0; }
.tb-bulbs i {
  width: 8px; height: 8px; border-radius: 50%; display: block; background: var(--yellow); box-shadow: 0 0 8px var(--yellow);
  animation: tbBulb 1.2s ease-in-out infinite;
}
.tb-bulbs i:nth-child(3n+2) { background: var(--magenta); box-shadow: 0 0 8px var(--magenta); animation-delay: 0.4s; }
.tb-bulbs i:nth-child(3n) { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); animation-delay: 0.8s; }
@keyframes tbBulb { 0%, 100% { opacity: 1; transform: scale(1.1); } 50% { opacity: 0.35; transform: scale(0.84); } }

.tb-title {
  margin: 6px 0 8px; font-family: "Bungee", sans-serif; font-weight: 400; line-height: 1.05;
  font-size: clamp(1.25rem, 5.4vw, 1.75rem); color: var(--yellow);
  text-shadow: 0 0 20px rgba(255, 225, 77, 0.6), 0 2px 0 rgba(143, 10, 83, 0.9);
}

.tb-hud {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; padding: 6px 10px; border-radius: 10px;
  font-family: "DM Mono", monospace; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cyan);
  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);
  text-shadow: 0 0 10px rgba(42, 245, 228, 0.7);
}
.tb-hud__cell b { color: var(--foam); font-weight: 600; margin-left: 2px; }
.tb-lives { display: inline-flex; gap: 5px; }
.tb-drop {
  width: 12px; height: 16px; display: block; background: var(--cyan); box-shadow: 0 0 8px rgba(42, 245, 228, 0.8);
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; transform: rotate(0deg);
  clip-path: polygon(50% 0, 100% 62%, 92% 82%, 72% 98%, 28% 98%, 8% 82%, 0 62%);
}
.tb-drop.is-lost { background: #3a2a55; box-shadow: none; }

/* ---- board ---- */
.tb-board {
  position: relative; width: 100%; aspect-ratio: 2 / 3; border: 3px solid #2a1850; border-radius: 14px; overflow: hidden; background: #000;
  box-shadow: 0 0 0 2px #0a0420, 0 0 50px rgba(123, 47, 247, 0.4), inset 0 0 40px rgba(0, 0, 0, 0.8);
}
#tbCanvas {
  display: block; width: 100%; height: 100%; touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: crosshair;
}
.tb-overlay {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 20px; text-align: center; background: rgba(8, 1, 28, 0.6);
}
.tb-overlay__title {
  margin: 0; font-family: "Bungee", sans-serif; font-weight: 400; font-size: clamp(1.6rem, 8vw, 2.3rem); line-height: 1;
  background: linear-gradient(180deg, #FFF3B0, #FFD166 45%, #FF3CAC 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 14px rgba(255, 209, 102, 0.5));
}
.tb-overlay__text { margin: 0; max-width: 26ch; font-size: 0.95rem; color: #E9DEF7; }

/* ---- buttons ---- */
.tb-btn {
  min-height: 48px; min-width: 96px; padding: 0 18px; border-radius: 999px; cursor: pointer; touch-action: manipulation;
  font-family: "Bungee", sans-serif; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--foam); background: linear-gradient(180deg, #2B0954, #120229); border: 2px solid var(--cyan);
  box-shadow: 0 0 16px rgba(42, 245, 228, 0.3);
}
.tb-btn:hover:not(:disabled) { border-color: var(--yellow); background: linear-gradient(180deg, var(--magenta), #C4177A); }
.tb-btn:disabled { opacity: 0.45; cursor: default; }
.tb-btn[aria-pressed="true"] { border-color: var(--yellow); }
.tb-btn--go {
  min-height: 56px; min-width: 170px; font-size: 1rem; color: var(--ink); border-color: #FFF4FA;
  background: linear-gradient(180deg, #FFE48F 0%, #FFD166 40%, #FF7A45 75%, #FF3CAC 100%); box-shadow: 0 4px 0 #8F0A53, 0 0 24px rgba(255, 60, 172, 0.55);
}
.tb-btn--go:hover:not(:disabled) { color: var(--ink); border-color: #FFF4FA; background: linear-gradient(180deg, #FFE48F 0%, #FFD166 40%, #FF7A45 75%, #FF3CAC 100%); filter: brightness(1.07); }

.tb-controls { display: grid; gap: 8px; margin-top: 10px; }
.tb-flavors { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tb-flavor {
  --fc: var(--magenta);
  min-height: 52px; min-width: 44px; padding: 4px 2px; border-radius: 12px; cursor: pointer; touch-action: manipulation;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-family: "DM Mono", monospace; font-size: 0.62rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--foam);
  background: rgba(246, 241, 255, 0.07); border: 2px solid rgba(255, 244, 250, 0.25);
}
.tb-flavor--cherry { --fc: #FF3CAC; }
.tb-flavor--wave { --fc: #2AF5E4; }
.tb-flavor--mango { --fc: #FFB02E; }
.tb-flavor--grape { --fc: #A56BFF; }
.tb-flavor__dot {
  width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-family: "Archivo", sans-serif; font-weight: 700; font-size: 0.72rem; color: var(--ink); background: var(--fc); border: 1.5px solid var(--ink);
}
.tb-flavor[aria-pressed="true"] { border-color: var(--fc); background: rgba(255, 255, 255, 0.12); box-shadow: 0 0 16px var(--fc), inset 0 0 10px rgba(255, 255, 255, 0.12); }
.tb-row { display: flex; gap: 8px; justify-content: center; }
.tb-row .tb-btn { flex: 1 1 0; max-width: 180px; }

.tb-hint { margin: 2px 0 0; font-family: "DM Mono", monospace; font-size: 0.66rem; letter-spacing: 0.08em; color: rgba(246, 241, 255, 0.7); }
.tb-fun { margin: 4px 0 0; }
.tb-fun__a {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 6px 10px; border-radius: 12px;
  font-family: "DM Mono", monospace; font-size: 0.7rem; letter-spacing: 0.04em; line-height: 1.35; color: var(--yellow); text-decoration: underline dotted; text-underline-offset: 3px;
}
.tb-fun__a:hover { color: var(--foam); }

/* ---- how to play ---- */
.tb-how {
  width: 100%; max-width: 560px; padding: 16px 18px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(36, 6, 75, 0.85), rgba(9, 1, 24, 0.9)); border: 2px solid rgba(255, 60, 172, 0.45);
}
.tb-how__h { margin: 0 0 8px; font-family: "Bungee", sans-serif; font-weight: 400; font-size: 1.1rem; color: var(--cyan); }
.tb-how__list { margin: 0; padding-left: 1.1rem; display: grid; gap: 8px; font-size: 0.9rem; color: #E9DEF7; }
.tb-how__list b { color: var(--yellow); }
@media (min-width: 900px) {
  .tb-how { position: sticky; top: 12px; max-width: none; }
}


/* ---- wide screens: flavor and pause/sound buttons sit beside the board so the board can be taller ---- */
@media (min-width: 900px) {
  :root { --board-w: clamp(260px, calc((100svh - 285px) * 0.6667), 560px); }
  .tb-cab {
    width: calc(var(--board-w) + 190px); display: grid; grid-template-columns: minmax(0, 1fr) 138px; column-gap: 12px; align-items: start;
  }
  .tb-bulbs, .tb-title, .tb-hud, .tb-fun { grid-column: 1 / -1; }
  .tb-controls { margin-top: 0; align-content: start; gap: 12px; }
  .tb-flavors { grid-template-columns: 1fr; gap: 8px; }
  .tb-flavor { flex-direction: row; justify-content: flex-start; gap: 8px; padding: 4px 10px; min-height: 56px; font-size: 0.7rem; }
  .tb-row { flex-direction: column; }
  .tb-row .tb-btn { max-width: none; flex: none; }
  .tb-hint { font-size: 0.6rem; letter-spacing: 0.04em; }
}

@media (max-width: 420px) {
  .tb-page { padding-left: 10px; padding-right: 10px; }
  .tb-cab { padding: 10px 8px 10px; }
  .tb-nav__a { padding: 0 12px; font-size: 0.66rem; }
  .tb-hud { font-size: 0.66rem; letter-spacing: 0.04em; padding: 6px 8px; }
}

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