/* MURRAY ST CROSSER — 1982 arcade cabinet, parked on Murray St. */

:root {
  --ink: #fdfdff;
  --void: #0a0618;
  --deep: #150a33;
  --panel: #1d0f45;
  --hot: #ff2d95;
  --cyan: #22e8ff;
  --gold: #ffd400;
  --lime: #63ff6b;
  --dead: #ff3b30;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; overflow-x: hidden; }

body {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: 10px 10px 22px;
  font-family: var(--mono);
  color: var(--ink);
  background:
    radial-gradient(ellipse 120% 70% at 50% -10%, #3d1078 0%, rgba(61,16,120,0) 60%),
    radial-gradient(ellipse 90% 60% at 50% 110%, #06304d 0%, rgba(6,48,77,0) 55%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.028) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(0deg, rgba(255,255,255,.028) 0 1px, transparent 1px 46px),
    var(--void);
}

.cab { width: min(100%, 720px); display: flex; flex-direction: column; gap: 10px; }

/* --------------------------------------------------------------- marquee -- */

.marquee {
  position: relative;
  padding: 12px 16px 10px;
  border-radius: 16px 16px 6px 6px;
  background: linear-gradient(180deg, #35116f 0%, #1b0a3f 60%, #120730 100%);
  border: 2px solid rgba(255,255,255,.16);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.28),
    0 0 0 3px rgba(255,45,149,.22),
    0 12px 40px rgba(255,45,149,.18);
  text-align: center;
  overflow: hidden;
}
.marquee::after {              /* glass sheen across the top of the marquee */
  content: ""; position: absolute; inset: 0 0 55% 0;
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,0));
  pointer-events: none;
}
.marquee__bolts i {
  position: absolute; width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e9e2ff, #6b5aa8);
  box-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.marquee__bolts i:nth-child(1) { top: 8px; left: 9px; }
.marquee__bolts i:nth-child(2) { top: 8px; right: 9px; }
.marquee__bolts i:nth-child(3) { bottom: 8px; left: 9px; }
.marquee__bolts i:nth-child(4) { bottom: 8px; right: 9px; }

.logo {
  margin: 0;
  font-size: clamp(26px, 8.2vw, 58px);
  line-height: .96;
  font-weight: 900;
  letter-spacing: .01em;
  font-family: "Arial Black", "Helvetica Neue", Impact, var(--mono);
  transform: skewX(-6deg);
}
.logo span { display: block; }
.logo__a {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(255,212,0,.55), 3px 3px 0 var(--hot), 6px 6px 0 rgba(0,0,0,.55);
}
.logo__b {
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(34,232,255,.6), 3px 3px 0 var(--hot), 6px 6px 0 rgba(0,0,0,.55);
}
.tag {
  margin: 8px 0 0; font-size: clamp(8px, 2.2vw, 11px); letter-spacing: .28em;
  color: var(--hot); text-shadow: 0 0 8px rgba(255,45,149,.7);
  animation: hue 6s linear infinite;
}
@keyframes hue { 50% { filter: hue-rotate(45deg); } }

/* ------------------------------------------------------------------- hud -- */

.hud { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hud__cell {
  border-radius: 10px;
  padding: 5px 9px;
  min-width: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(0,0,0,.35)), var(--panel);
  border: 2px solid rgba(255,255,255,.14);
  box-shadow: inset 0 0 14px rgba(0,0,0,.55);
}
.hud__cell span { display: block; font-size: 8px; letter-spacing: .18em; opacity: .72; }
.hud__cell b {
  display: block; font-size: clamp(13px, 3.4vw, 19px); letter-spacing: .04em;
  white-space: nowrap; overflow: hidden;
}
.hud__cell--score b { color: var(--gold); text-shadow: 0 0 9px rgba(255,212,0,.6); }
.hud__cell--hi b { color: var(--cyan); text-shadow: 0 0 9px rgba(34,232,255,.6); }
.hud__cell--lvl b { color: var(--lime); text-shadow: 0 0 9px rgba(99,255,107,.6); }
.hud__cell--life b { color: var(--hot); text-shadow: 0 0 9px rgba(255,45,149,.7); }

.meeting {
  border-radius: 10px; padding: 5px 9px 7px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(0,0,0,.35)), var(--panel);
  border: 2px solid rgba(255,255,255,.14);
}
.meeting__label { font-size: 8px; letter-spacing: .18em; color: var(--gold); }
.meeting__track {
  height: 11px; margin-top: 4px; border-radius: 6px; overflow: hidden;
  background: #07040f; box-shadow: inset 0 0 8px #000;
}
.meeting__track i {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--lime), var(--gold));
  box-shadow: 0 0 12px rgba(255,212,0,.7);
  transition: width .12s linear;
}
.meeting__track i[data-low="1"] {
  background: linear-gradient(90deg, var(--dead), var(--hot));
  animation: pulse .5s steps(2) infinite;
}
@keyframes pulse { 50% { opacity: .45; } }

/* ---------------------------------------------------------------- screen -- */

.screen {
  position: relative; line-height: 0;
  border-radius: 14px;
  padding: 8px;
  background: linear-gradient(180deg, #2a1160, #120730);
  border: 2px solid rgba(255,255,255,.16);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.22),
    0 0 0 3px rgba(34,232,255,.18),
    0 14px 44px rgba(34,232,255,.14);
}

canvas {
  display: block; width: 100%; height: auto;
  max-height: 62dvh; margin: 0 auto;
  border-radius: 6px;
  background: #000;
  image-rendering: pixelated;
  touch-action: none;
}

.crt {
  position: absolute; inset: 8px; border-radius: 6px; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,.22) 0 1px, rgba(0,0,0,0) 1px 3px),
    radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,.5) 100%);
  mix-blend-mode: multiply;
}

/* --------------------------------------------------------------- overlay -- */

.overlay {
  position: absolute; inset: 8px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  padding: 10px; text-align: center; line-height: 1.45;
  background: radial-gradient(ellipse at center, rgba(20,6,50,.72), rgba(6,3,16,.93));
}
.overlay[data-show="none"] { display: none; }
.panel { display: none; max-width: 460px; }
.overlay[data-show="title"] [data-panel="title"],
.overlay[data-show="paused"] [data-panel="paused"],
.overlay[data-show="clear"] [data-panel="clear"],
.overlay[data-show="over"] [data-panel="over"] { display: block; }

.pop {
  margin: 0 0 8px;
  font-family: "Arial Black", Impact, var(--mono);
  font-size: clamp(17px, 4.6vw, 28px);
  color: var(--gold);
  text-shadow: 2px 2px 0 var(--hot), 0 0 16px rgba(255,212,0,.6);
  transform: skewX(-6deg);
}
.pop--dead { color: var(--dead); text-shadow: 2px 2px 0 #000, 0 0 18px rgba(255,59,48,.7); }
.panel p { margin: 6px 0; font-size: clamp(10px, 2.5vw, 12px); }
.big { font-size: clamp(12px, 3vw, 15px) !important; letter-spacing: .1em; }

.rules {
  list-style: none; margin: 10px auto; padding: 8px 12px;
  display: inline-block; text-align: left;
  border: 2px dashed rgba(34,232,255,.5); border-radius: 8px;
}
.rules li { font-size: clamp(9px, 2.2vw, 11px); letter-spacing: .05em; padding: 2px 0; }
.rules li::before { content: "▸ "; color: var(--hot); }

.blink { color: var(--cyan); text-shadow: 0 0 12px rgba(34,232,255,.8); animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { opacity: .12; } }

/* -------------------------------------------------- the HAZID starburst -- */

/* A comic "spiky balloon": two stacked star polygons, the outer one showing
   through as the outline. --spikes is shared so they stay concentric. */
.burst {
  --spikes: polygon(50.0% 0.0%, 58.2% 13.9%, 71.7% 5.0%, 73.1% 21.1%, 89.1% 18.8%,
    83.3% 33.9%, 98.7% 38.9%, 87.0% 50.0%, 98.7% 61.1%, 83.3% 66.1%, 89.1% 81.2%,
    73.1% 78.9%, 71.7% 95.0%, 58.2% 86.1%, 50.0% 100.0%, 41.8% 86.1%, 28.3% 95.0%,
    26.9% 78.9%, 10.9% 81.2%, 16.7% 66.1%, 1.3% 61.1%, 13.0% 50.0%, 1.3% 38.9%,
    16.7% 33.9%, 10.9% 18.8%, 26.9% 21.1%, 28.3% 5.0%, 41.8% 13.9%);
  position: relative;
  display: grid; place-items: center;
  width: min(100%, 430px);
  margin: 0 auto;
  padding: clamp(38px, 11vw, 62px) clamp(36px, 10.5vw, 66px);
  clip-path: var(--spikes);
  background: linear-gradient(180deg, #ff5ab0, #b3134f);
  animation: throb 1.5s ease-in-out infinite;
}
.burst::before {
  content: ""; position: absolute; inset: 6px;
  clip-path: var(--spikes);
  background: radial-gradient(circle at 50% 38%, #fff6c9 0%, #ffd400 55%, #f0a800 100%);
}
.burst__text {
  position: relative; z-index: 1;
  margin: 0 !important;
  color: #2b0d02;
  font-weight: 800; line-height: 1.35;
  font-size: clamp(9px, 2.5vw, 13px) !important;
  text-shadow: 0 1px 0 rgba(255,255,255,.5);
}
.burst__text b {
  display: block;
  font-family: "Arial Black", Impact, var(--mono);
  font-size: clamp(20px, 6.4vw, 34px);
  line-height: 1; letter-spacing: -.01em;
  margin-bottom: 6px;
  color: #d51f1f;
  transform: skewX(-6deg);
  text-shadow: 1px 1px 0 #fff, 2px 3px 0 rgba(0,0,0,.28);
}
@keyframes throb {
  0%, 100% { transform: rotate(-1.5deg) scale(1); }
  50%      { transform: rotate(1.5deg) scale(1.045); }
}
@media (prefers-reduced-motion: reduce) {
  .blink, .burst, .tag, .meeting__track i[data-low="1"] { animation: none; }
}

/* ------------------------------------------------------------------- pad -- */

.pad { display: flex; align-items: center; justify-content: center; gap: 12px; }
.pad__col { display: flex; flex-direction: column; gap: 10px; }
.pad__btn {
  font-family: var(--mono); font-size: 20px; line-height: 1;
  width: 66px; height: 46px; border-radius: 12px;
  color: #12061f; cursor: pointer; touch-action: manipulation; user-select: none;
  background: linear-gradient(180deg, #ffffff 0%, #cfd3e4 48%, #98a0bd 100%);
  border: 2px solid rgba(0,0,0,.4);
  box-shadow: 0 5px 0 #3b2a63, 0 8px 18px rgba(0,0,0,.5);
}
.pad__btn--go {
  background: linear-gradient(180deg, #ffe98a 0%, var(--gold) 48%, #c99f00 100%);
  box-shadow: 0 5px 0 #7a5f00, 0 0 22px rgba(255,212,0,.5);
}
.pad__btn--side {
  background: linear-gradient(180deg, #ff9ccd 0%, var(--hot) 48%, #a8175f 100%);
  color: #fff; box-shadow: 0 5px 0 #6d0d3c, 0 0 22px rgba(255,45,149,.45);
}
.pad__btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #3b2a63; }

/* ----------------------------------------------------------- leaderboard -- */

.lb {
  border-radius: 12px; padding: 8px 12px 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(0,0,0,.35)), var(--panel);
  border: 2px solid rgba(255,255,255,.14);
  box-shadow: inset 0 0 16px rgba(0,0,0,.55);
}
.lb__title {
  margin: 0 0 6px; text-align: center;
  font-size: 11px; letter-spacing: .3em; color: var(--gold);
  text-shadow: 0 0 10px rgba(255,212,0,.6);
}
.lb__list { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.lb__list li {
  display: grid; grid-template-columns: 2.2em 1fr auto auto; gap: 8px; align-items: baseline;
  font-size: 11px; padding: 3px 4px; border-bottom: 1px dashed rgba(255,255,255,.09);
}
.lb__list li:last-child { border-bottom: 0; }
.lb__list li::before {
  counter-increment: rank; content: counter(rank) ".";
  color: var(--cyan); text-align: right;
}
.lb__name { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb__lvl { font-size: 9px; opacity: .6; }
.lb__score { color: var(--gold); font-variant-numeric: tabular-nums; }
.lb__list li.is-you { background: rgba(255,212,0,.14); border-radius: 6px; }
.lb__list li.is-you .lb__name { color: var(--gold); font-weight: 700; }
.lb__empty { display: block !important; text-align: center; opacity: .55; font-size: 10px; }
.lb__empty::before { content: none !important; }

.entry { margin: 10px auto 8px; max-width: 320px; }
.entry__label { display: block; font-size: 9px; letter-spacing: .12em; color: var(--cyan); margin-bottom: 5px; }
.entry__row { display: flex; gap: 6px; justify-content: center; }
.entry__input {
  flex: 1 1 auto; min-width: 0;
  font-family: var(--mono); font-size: 14px; letter-spacing: .18em; text-transform: uppercase;
  padding: 6px 9px; border-radius: 8px;
  background: #07040f; color: var(--gold);
  border: 2px solid var(--cyan); outline: none;
}
.entry__input:focus { box-shadow: 0 0 12px rgba(34,232,255,.6); }
.entry__go {
  font-family: var(--mono); font-weight: 700; font-size: 12px; letter-spacing: .1em;
  padding: 6px 14px; border-radius: 8px; cursor: pointer; color: #12061f;
  background: linear-gradient(180deg, #ffe98a, var(--gold));
  border: 2px solid rgba(0,0,0,.35); box-shadow: 0 3px 0 #7a5f00;
}
.entry__go:active { transform: translateY(2px); box-shadow: none; }
.entry__go:disabled { opacity: .5; cursor: default; }
.entry__msg { margin: 6px 0 0 !important; font-size: 9px !important; min-height: 1em; color: var(--lime); }
.entry__msg[data-bad="1"] { color: var(--dead); }

/* ------------------------------------------------------------------ foot -- */

.foot { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip {
  font-family: var(--mono); font-size: 9px; letter-spacing: .16em;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(255,255,255,.06); color: var(--ink);
  border: 1px solid rgba(255,255,255,.18);
}
.chip--btn { cursor: pointer; }
.chip--btn[aria-pressed="true"] {
  background: var(--lime); color: #06210a; border-color: #9dffa4;
  box-shadow: 0 0 14px rgba(99,255,107,.5);
}

@media (max-height: 700px) {
  .tag, .rules { display: none; }
  .logo { font-size: clamp(22px, 7vw, 34px); }
}
/* On a narrow screen the canvas is short, so the title panel loses the rules
   list before it can overflow the board. */
@media (max-width: 600px) {
  .rules { display: none; }
}
