/* Hoop Shot: an arcade basketball cabinet at night. Cobalt cage, chrome rim,
   an orange LED sign; the page round it stays dark and quiet so the cabinet
   carries the colour. Big Shoulders is stadium signage; Atkinson is for reading. */

:root {
  --night: #0d1433;
  --night-deep: #080c22;
  --cobalt: #2448c4;
  --chrome: #d6dce6;
  --led: #ff7b1c;
  --led-soft: #ffb071;
  --text: #eef1fb;
  --text-soft: #a7b1d6;

  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(50rem 36rem at 32% 45%, rgba(36, 72, 196, 0.22), transparent 70%),
    var(--night-deep);
  color: var(--text);
  font: 400 1.0625rem/1.55 var(--body);
}

/* desktop: the cabinet on the left, everything else stacked beside it */
.court {
  min-height: 100svh;
  display: grid;
  grid-template-columns: auto minmax(16rem, 23rem);
  grid-template-rows: auto auto 1fr;
  grid-template-areas: "stage head" "stage play" "stage info";
  column-gap: clamp(1.5rem, 4vw, 3.5rem);
  align-content: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2rem);
}

.head { grid-area: head; align-self: end; }
.cabinet { grid-area: stage; margin: 0; }
.play { grid-area: play; }
.info { grid-area: info; }

.back { display: inline-block; margin-bottom: 0.5rem; color: var(--text-soft); font-weight: 700; text-underline-offset: 3px; }
.back:hover { color: var(--text); }
.back:focus-visible { outline: 3px solid var(--led); outline-offset: 3px; border-radius: 2px; }

h1 {
  margin: 0 0 1rem;
  font: 900 clamp(3rem, 6vw, 4.5rem)/0.9 var(--display);
  letter-spacing: 0.01em;
  color: var(--text);
}

.cabinet canvas {
  display: block;
  height: min(calc(100svh - 4rem), 60rem);
  width: auto;
  aspect-ratio: 3 / 4;
  border-radius: 1rem;
  background: var(--night);
  box-shadow: 0 0 0 3px #1a2a6e, 0 1.5rem 4rem rgba(0, 0, 0, 0.55), 0 0 5rem rgba(255, 123, 28, 0.12);
  touch-action: none;
  cursor: grab;
}
.cabinet canvas:active { cursor: grabbing; }
.cabinet canvas:focus-visible { outline: 3px solid var(--led); outline-offset: 5px; }

.tally {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0;
  padding: 0.7rem 1rem;
  border-radius: 0.75rem;
  background: rgba(36, 72, 196, 0.16);
  box-shadow: inset 0 0 0 1px rgba(214, 220, 230, 0.14);
}
.tally dt { font-size: 0.875rem; color: var(--text-soft); }
.tally dd {
  margin: 0;
  font: 700 2.25rem/1 var(--display);
  font-variant-numeric: tabular-nums;
  color: var(--led-soft);
}

.hint { min-height: 3.1em; margin: 0.9rem 0 0.9rem; font-weight: 700; }

.go {
  min-height: 2.9rem;
  padding: 0.7rem 1.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--led);
  color: #2a1000;
  font: 700 1.3rem/1 var(--display);
  letter-spacing: 0.02em;
  cursor: pointer;
}
.go:hover { background: #ff9445; }
.go:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }

.lede { margin: 1.75rem 0 0; color: var(--text-soft); }
.keys { margin: 1rem 0 0; font-size: 0.875rem; color: var(--text-soft); }

/* phones: title, then the cabinet, then the score and button within reach */
@media (max-width: 900px) {
  .court {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas: "head" "stage" "play" "info";
    justify-items: center;
    align-content: start;
    padding: 0.75rem 1rem 2rem;
  }
  .head, .play, .info { width: 100%; max-width: 30rem; }
  .head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
  .back { margin: 0; }
  h1 { order: -1; margin: 0 0 0.5rem; font-size: 2.4rem; }
  .cabinet { width: min(100%, 30rem, calc((100svh - 13rem) * 0.75)); }
  .cabinet canvas { width: 100%; height: auto; }
  .play { display: grid; grid-template-columns: 1fr auto; gap: 0 0.75rem; align-items: center; margin-top: 0.75rem; }
  .tally { padding: 0.45rem 0.8rem; }
  .tally dd { font-size: 1.75rem; }
  .go { padding-inline: 1.1rem; }
  .hint { grid-column: 1 / -1; order: 2; min-height: 2.6em; margin: 0.6rem 0 0; font-size: 0.95rem; }
  .lede { margin-top: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* help text stays at reading size on phones */
@media (max-width: 760px) {
  #keys, .play .hint { font-size: 1rem; }
}
