:root {
  color-scheme: dark;
  --ink: #101114;
  --ink-soft: #1a1c22;
  --paper: #f6f3ea;
  --silver: #c7cbd2;
  --silver-dark: #858b96;
  --blue: #1649a4;
  --blue-bright: #2769de;
  --gold: #ffd047;
  --orange: #f58220;
  --teal: #29c1bd;
  --pink: #e94d8a;
  --green: #52d273;
  --red: #ff5f56;
  --shadow: 0 18px 50px rgba(0, 0, 0, .32);
  --radius: 22px;
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--ink);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--paper);
  background:
    radial-gradient(circle at 8% 8%, rgba(41, 193, 189, .17), transparent 28rem),
    radial-gradient(circle at 92% 4%, rgba(233, 77, 138, .14), transparent 26rem),
    linear-gradient(145deg, #151820 0%, #0c0d10 58%, #17191f 100%);
  overflow-x: hidden;
}

button {
  font: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

button:focus-visible {
  outline: 4px solid var(--gold);
  outline-offset: 4px;
}

.page-texture {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image:
    linear-gradient(90deg, transparent 49%, rgba(255,255,255,.05) 50%, transparent 51%),
    linear-gradient(transparent 49%, rgba(255,255,255,.04) 50%, transparent 51%);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 84%);
}

.app-shell {
  position: relative;
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: var(--paper);
  background: none;
  border: 0;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(.92rem, 2vw, 1.1rem);
  letter-spacing: .055em;
  text-align: left;
}

.brand strong {
  color: var(--gold);
  font-weight: inherit;
}

.mini-ball {
  position: relative;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 2px solid #080808;
  border-radius: 50%;
  background: var(--orange);
  transform: rotate(-18deg);
  overflow: hidden;
}

.mini-ball::before,
.mini-ball::after {
  content: "";
  position: absolute;
  background: #161616;
}

.mini-ball::before {
  width: 2px;
  height: 34px;
  left: 13px;
  top: -3px;
}

.mini-ball::after {
  width: 40px;
  height: 15px;
  left: -7px;
  top: 6px;
  border: 2px solid #161616;
  border-left: 0;
  border-right: 0;
  background: transparent;
  border-radius: 50%;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  min-height: 42px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--paper);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  transition: background .2s ease, transform .2s ease;
}

.icon-button:hover {
  background: rgba(255,255,255,.12);
  transform: translateY(-1px);
}

.sound-icon {
  color: var(--gold);
  font-weight: 900;
}

.game-frame {
  flex: 1;
  display: grid;
  align-items: center;
  padding: clamp(20px, 4vw, 48px) 0;
}

.screen {
  width: 100%;
}

.landing-screen {
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 28px;
  background: rgba(15, 17, 22, .82);
  box-shadow: var(--shadow);
}

.landing-copy {
  padding: clamp(34px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 10%, rgba(41,193,189,.2), transparent 16rem),
    linear-gradient(160deg, rgba(22,73,164,.6), rgba(15,17,22,.9) 70%);
}

.landing-copy h1 {
  font-size: clamp(3.5rem, 6vw, 5.8rem);
}

.landing-tagline {
  margin: 22px 0 10px;
  color: var(--gold);
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 900;
}

.landing-intro {
  max-width: 28rem;
  color: var(--silver);
  line-height: 1.5;
}

.landing-sticker {
  width: max-content;
  margin-top: 24px;
  padding: 10px 14px;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: var(--teal);
  box-shadow: 5px 5px 0 var(--pink);
  font-weight: 900;
}

.game-shelf {
  padding: clamp(28px, 4vw, 48px);
  background: rgba(255,255,255,.035);
}

.shelf-heading,
.leaderboard-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.shelf-heading {
  margin-bottom: 16px;
}

.shelf-heading h2 {
  margin: 4px 0 0;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: .95;
}

.shelf-kicker {
  color: var(--gold);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.shelf-count {
  color: var(--silver-dark);
  font-size: .75rem;
  font-weight: 900;
}

.game-card {
  display: grid;
  grid-template-columns: minmax(180px, .72fr) minmax(0, 1.28fr);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 18px;
  background: rgba(16,17,20,.82);
  box-shadow: 8px 8px 0 rgba(0,0,0,.24);
}

.game-card-art {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  background: linear-gradient(155deg, #f07c3d, #d64b7e 40%, #1649a4 100%);
}

.card-sun {
  position: absolute;
  top: 12%;
  right: 9%;
  width: 100px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 35px rgba(255,208,71,.45);
}

.card-mountain {
  position: absolute;
  left: -10%;
  width: 120%;
  clip-path: polygon(0 100%, 0 65%, 18% 55%, 32% 76%, 48% 26%, 64% 72%, 81% 43%, 100% 70%, 100% 100%);
}

.card-mountain-back {
  bottom: 22%;
  height: 50%;
  background: #34316a;
}

.card-mountain-front {
  bottom: 12%;
  height: 38%;
  background: #171b31;
}

.card-hoop {
  position: absolute;
  top: 24%;
  left: 50%;
  width: 72%;
  aspect-ratio: 1.5;
  transform: translateX(-50%) rotate(-5deg);
  display: grid;
  place-items: center;
  border: 6px solid var(--paper);
  background: rgba(20,24,35,.65);
  box-shadow: 8px 9px 0 rgba(0,0,0,.35);
}

.card-hoop span {
  color: var(--paper);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 1.5rem;
  line-height: .84;
  text-align: center;
}

.card-hoop i {
  position: absolute;
  bottom: -21%;
  left: 50%;
  width: 42%;
  height: 14%;
  transform: translateX(-50%);
  border: 5px solid var(--orange);
  border-radius: 50%;
}

.card-ball {
  position: absolute;
  right: 5%;
  bottom: 4%;
  font-size: 4.2rem;
  transform: rotate(16deg);
  filter: drop-shadow(4px 6px 0 rgba(0,0,0,.32));
}

.card-swoosh {
  position: absolute;
  left: 8%;
  bottom: 8%;
  color: var(--teal);
  font-family: "Comic Sans MS", cursive;
  font-size: 1.5rem;
  transform: rotate(-11deg);
  text-shadow: 2px 2px 0 var(--ink);
}

.game-card-copy {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.game-card-kicker {
  color: var(--teal);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.game-card-copy h3 {
  margin: 8px 0;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: .02em;
  line-height: .95;
}

.game-card-copy p {
  margin: 0 0 18px;
  color: var(--silver);
  line-height: 1.45;
}

.game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 22px;
}

.game-tags span {
  padding: 6px 8px;
  color: var(--ink);
  border-radius: 5px;
  background: var(--gold);
  font-size: .66rem;
  font-weight: 900;
}

.shelf-note {
  margin: 17px 0 0;
  color: var(--silver-dark);
  font-size: .77rem;
  font-weight: 800;
}

.start-screen {
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr);
  align-items: stretch;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 28px;
  background: rgba(15, 17, 22, .82);
  box-shadow: var(--shadow);
}

.start-copy {
  position: relative;
  z-index: 2;
  padding: clamp(32px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  color: var(--paper);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(4rem, 8vw, 7.3rem);
  font-weight: 900;
  line-height: .82;
  letter-spacing: -.025em;
  text-transform: uppercase;
  text-shadow: 5px 5px 0 rgba(0,0,0,.32);
}

h1 span {
  color: var(--gold);
  -webkit-text-stroke: 2px var(--paper);
}

.tagline {
  margin: 20px 0 26px;
  color: var(--silver);
  font-size: clamp(1rem, 2vw, 1.22rem);
  font-weight: 800;
  letter-spacing: .035em;
}

.noun-cheat-sheet {
  margin-bottom: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.noun-rule {
  position: relative;
  min-height: 118px;
  padding: 17px 14px 14px;
  display: flex;
  gap: 12px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.15);
  border-radius: 16px;
  background: rgba(255,255,255,.055);
}

.noun-rule::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -28px;
  width: 80px;
  height: 80px;
  border: 12px solid rgba(255,255,255,.045);
  border-radius: 50%;
}

.noun-rule-common {
  border-top-color: var(--teal);
}

.noun-rule-proper {
  border-top-color: var(--gold);
}

.rule-number {
  color: var(--silver-dark);
  font-family: Impact, sans-serif;
  font-size: 1.35rem;
}

.noun-rule div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.noun-rule strong {
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 1.25rem;
  letter-spacing: .06em;
}

.noun-rule span:not(.rule-number) {
  color: var(--silver);
  font-size: .86rem;
}

.noun-rule small {
  margin-top: 7px;
  color: rgba(255,255,255,.52);
  font-size: .72rem;
}

.primary-button,
.secondary-button {
  min-height: 54px;
  border-radius: 13px;
  font-weight: 900;
  letter-spacing: .035em;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.primary-button {
  width: 100%;
  padding: 14px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #101114;
  border: 2px solid #101114;
  background: var(--gold);
  box-shadow: 6px 6px 0 var(--blue);
  text-transform: uppercase;
}

.primary-button:hover {
  filter: brightness(1.06);
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--blue);
}

.primary-button:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--blue);
}

.button-arrow {
  font-size: 1.4rem;
}

.microcopy {
  margin: 16px 0 0;
  color: var(--silver-dark);
  font-size: .78rem;
  text-align: center;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: .45;
  filter: grayscale(.35);
  box-shadow: 3px 3px 0 var(--blue);
}

.back-shelf {
  width: max-content;
  min-height: 40px;
  margin-bottom: 19px;
  padding: 8px 12px;
  color: var(--silver);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  font-size: .75rem;
  font-weight: 900;
}

.back-shelf:hover {
  background: rgba(255,255,255,.12);
}

.name-entry {
  margin: 0 0 23px;
  padding: 15px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  background: rgba(255,255,255,.05);
}

.name-entry label {
  display: block;
  margin-bottom: 7px;
  color: var(--gold);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.name-entry input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  color: var(--paper);
  border: 2px solid rgba(255,255,255,.24);
  border-radius: 8px;
  outline: none;
  background: rgba(16,17,20,.72);
  font: inherit;
  font-weight: 800;
}

.name-entry input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255,208,71,.22);
}

.name-entry input::placeholder {
  color: var(--silver-dark);
}

.name-entry span {
  display: block;
  margin-top: 7px;
  color: var(--silver-dark);
  font-size: .7rem;
}

.hero-art {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(16,17,20,.08), rgba(16,17,20,.3)),
    linear-gradient(155deg, #f07c3d 0%, #d64b7e 31%, #35459c 68%, #17244c 100%);
}

.hero-art::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .28;
  background-image: radial-gradient(rgba(255,255,255,.85) 1px, transparent 1px);
  background-size: 8px 8px;
  mask-image: linear-gradient(to bottom, black 0 55%, transparent 86%);
}

.hero-art::after {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -10%;
  height: 50%;
  z-index: -1;
  transform: perspective(320px) rotateX(58deg);
  border-top: 9px solid rgba(255,255,255,.34);
  background:
    linear-gradient(90deg, transparent 49.5%, rgba(255,255,255,.25) 50%, transparent 50.5%),
    #1d212b;
}

.sun-disc {
  position: absolute;
  top: 8%;
  right: 7%;
  width: clamp(130px, 19vw, 220px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 70px rgba(255, 208, 71, .46);
}

.mountain {
  position: absolute;
  left: -10%;
  width: 120%;
  clip-path: polygon(0 100%, 0 64%, 9% 72%, 19% 43%, 27% 62%, 39% 18%, 48% 48%, 58% 31%, 71% 60%, 79% 43%, 92% 70%, 100% 55%, 100% 100%);
}

.mountain-back {
  bottom: 22%;
  height: 52%;
  background: rgba(28, 31, 68, .58);
}

.mountain-front {
  bottom: 18%;
  height: 43%;
  background: #171b31;
}

.hero-backboard {
  position: absolute;
  top: 14%;
  left: 19%;
  width: min(55%, 320px);
  aspect-ratio: 1.5;
  display: grid;
  place-items: center;
  border: clamp(6px, 1vw, 10px) solid var(--paper);
  background: rgba(20,24,35,.68);
  box-shadow: 12px 14px 0 rgba(16,17,20,.72);
  transform: rotate(-3deg);
}

.hero-backboard span {
  color: var(--paper);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(2.3rem, 5vw, 4.2rem);
  line-height: .84;
  text-align: center;
  text-shadow: 4px 4px 0 var(--blue);
}

.hero-rim {
  position: absolute;
  left: 50%;
  bottom: -23%;
  width: 50%;
  height: 15%;
  transform: translateX(-50%);
  border: 8px solid var(--orange);
  border-radius: 50%;
  background: transparent;
}

.hero-net {
  position: absolute;
  left: 50%;
  bottom: -57%;
  width: 37%;
  height: 39%;
  transform: translateX(-50%);
  clip-path: polygon(0 0, 100% 0, 77% 100%, 23% 100%);
  background:
    repeating-linear-gradient(67deg, transparent 0 12px, rgba(255,255,255,.8) 13px 15px),
    repeating-linear-gradient(-67deg, transparent 0 12px, rgba(255,255,255,.8) 13px 15px);
}

.hero-ball {
  position: absolute;
  left: 58%;
  bottom: 8%;
  width: clamp(124px, 18vw, 210px);
  aspect-ratio: 1;
  overflow: hidden;
  border: 7px solid #111;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #ffb149 0%, var(--orange) 45%, #bd4218 100%);
  box-shadow: 18px 22px 0 rgba(0,0,0,.28);
  transform: rotate(18deg);
  animation: ball-float 3.2s ease-in-out infinite;
}

.hero-ball::before,
.hero-ball::after,
.hero-ball i,
.hero-ball b {
  content: "";
  position: absolute;
  display: block;
  border-color: #17120e;
}

.hero-ball::before {
  inset: -14% 43%;
  border-left: 6px solid;
}

.hero-ball::after {
  left: -12%;
  top: 42%;
  width: 124%;
  height: 12%;
  border-top: 6px solid;
  border-radius: 50%;
}

.hero-ball i {
  left: -18%;
  top: 8%;
  width: 68%;
  height: 88%;
  border-right: 6px solid;
  border-radius: 50%;
}

.hero-ball b {
  right: -18%;
  top: 8%;
  width: 68%;
  height: 88%;
  border-left: 6px solid;
  border-radius: 50%;
}

.graffiti-mark {
  position: absolute;
  z-index: 2;
  font-family: "Comic Sans MS", cursive;
  font-weight: 900;
  text-shadow: 3px 3px 0 #101114;
}

.graffiti-one {
  top: 57%;
  left: 8%;
  color: var(--teal);
  font-size: clamp(1.6rem, 3.5vw, 3.2rem);
  transform: rotate(-12deg);
}

.graffiti-two {
  right: 4%;
  bottom: 4%;
  color: var(--paper);
  font-size: clamp(1rem, 2.2vw, 1.8rem);
  transform: rotate(4deg);
}

.paint-splash {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 40% 60% 32% 68%;
  box-shadow: 23px -13px 0 -7px currentColor, -18px 18px 0 -9px currentColor, 13px 28px 0 -11px currentColor;
}

.splash-one {
  top: 12%;
  left: 7%;
  color: var(--teal);
  background: currentColor;
}

.splash-two {
  top: 48%;
  right: 6%;
  color: var(--pink);
  background: currentColor;
}

@keyframes ball-float {
  0%, 100% { transform: translateY(0) rotate(18deg); }
  50% { transform: translateY(-14px) rotate(12deg); }
}

/* Game screen */
.play-screen {
  width: min(980px, 100%);
  margin: 0 auto;
}

.hud {
  position: relative;
  min-height: 70px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 18px 18px 0 0;
  background: rgba(23,25,31,.96);
  overflow: hidden;
}

.hud-stat,
.hud-score {
  padding: 10px clamp(12px, 3vw, 26px) 14px;
  display: flex;
  flex-direction: column;
}

.hud-score {
  align-items: center;
  border-right: 1px solid rgba(255,255,255,.11);
  border-left: 1px solid rgba(255,255,255,.11);
}

.hud-clock-stat,
.hud-stat-right {
  align-items: flex-end;
}

.hud-clock-stat {
  align-items: center;
  border-left: 1px solid rgba(255,255,255,.11);
}

.hud-stat-right {
  border-left: 1px solid rgba(255,255,255,.11);
}

.hud-label {
  color: var(--silver-dark);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hud strong {
  margin-top: 2px;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 900;
  letter-spacing: .05em;
  white-space: nowrap;
}

.hud-score strong {
  color: var(--gold);
}

.hud-clock-stat strong {
  color: var(--teal);
}

.hud-clock-stat.is-warning strong {
  color: var(--gold);
}

.hud-clock-stat.is-danger strong {
  color: var(--red);
}

.run-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 5px;
  background: rgba(255,255,255,.08);
}

.run-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width .35s ease;
}

.word-board {
  position: relative;
  z-index: 6;
  min-height: 126px;
  padding: 15px 18px 17px;
  color: var(--ink);
  text-align: center;
  background:
    radial-gradient(circle at 15% 30%, rgba(22,73,164,.09) 0 3px, transparent 4px),
    radial-gradient(circle at 85% 70%, rgba(233,77,138,.1) 0 3px, transparent 4px),
    var(--paper);
  background-size: 24px 24px, 28px 28px, auto;
  box-shadow: 0 9px 22px rgba(0,0,0,.24);
}

.word-kicker {
  margin: 0;
  color: #5e626b;
  font-size: .69rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.word-board h2 {
  margin: 2px 0 3px;
  color: var(--blue);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(2.35rem, 7vw, 4.25rem);
  line-height: 1;
  letter-spacing: .035em;
  text-transform: none;
}

.word-board h2.is-long {
  font-size: clamp(1.9rem, 5vw, 3.2rem);
}

.word-board h2.is-extra-long {
  font-size: clamp(1.55rem, 4vw, 2.55rem);
}

.word-board p:last-child {
  margin: 0;
  color: #3d4048;
  font-size: clamp(.87rem, 2vw, 1.02rem);
  font-weight: 700;
}

.word-board mark {
  padding: 0 .15em;
  color: inherit;
  border-radius: 4px;
  background: rgba(255,208,71,.72);
}

.shot-clock-track {
  width: min(310px, 78%);
  height: 7px;
  margin: 11px auto 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(16,17,20,.14);
}

.shot-clock-track span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue-bright));
  transition: width .1s linear, background .2s ease;
}

.shot-clock-track.is-warning span {
  background: linear-gradient(90deg, var(--gold), var(--orange));
}

.shot-clock-track.is-danger span {
  background: linear-gradient(90deg, var(--orange), var(--red));
}

.court-shell {
  border: 1px solid rgba(255,255,255,.13);
  border-top: 0;
  border-radius: 0 0 24px 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.court {
  position: relative;
  height: clamp(400px, 58vh, 590px);
  min-height: 400px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  background: #25283a;
}

#courtCanvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
}

.hoop-target {
  position: absolute;
  z-index: 3;
  top: 6.5%;
  width: min(30%, 230px);
  min-width: 112px;
  min-height: 72px;
  padding: 10px 12px 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--paper);
  border: 3px solid var(--paper);
  border-radius: 9px;
  background: rgba(15,17,22,.86);
  box-shadow: 7px 7px 0 rgba(0,0,0,.42);
  transform: rotate(-1.5deg);
  transition: transform .18s ease, filter .18s ease, opacity .18s ease;
}

.hoop-target::after {
  content: "";
  position: absolute;
  right: 9px;
  bottom: 7px;
  left: 9px;
  height: 3px;
  background: currentColor;
  opacity: .38;
}

.hoop-target-common {
  left: 5%;
  border-top-color: var(--teal);
}

.hoop-target-proper {
  right: 5%;
  border-top-color: var(--gold);
  transform: rotate(1.5deg);
}

.hoop-target:hover:not(:disabled) {
  filter: brightness(1.15);
  transform: rotate(0) translateY(-4px) scale(1.02);
}

.hoop-target:disabled {
  cursor: default;
  opacity: .58;
}

.hoop-title {
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(1.08rem, 3vw, 1.55rem);
  letter-spacing: .08em;
}

.hoop-target-common .hoop-title {
  color: var(--teal);
}

.hoop-target-proper .hoop-title {
  color: var(--gold);
}

.hoop-subtitle {
  color: var(--silver);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.key-hint {
  position: absolute;
  top: calc(100% + 10px);
  padding: 4px 8px;
  color: var(--paper);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 6px;
  background: rgba(16,17,20,.7);
  font-size: .63rem;
  font-weight: 900;
  white-space: nowrap;
}

.gesture-coach {
  position: absolute;
  z-index: 3;
  bottom: 4%;
  left: 50%;
  min-height: 42px;
  padding: 9px 13px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--paper);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  background: rgba(16,17,20,.82);
  box-shadow: 0 7px 20px rgba(0,0,0,.26);
  font-size: .75rem;
  font-weight: 800;
  white-space: nowrap;
  transform: translateX(-50%);
  transition: opacity .25s ease;
  pointer-events: none;
}

.gesture-coach.is-hidden {
  opacity: 0;
}

.feedback-burst {
  position: absolute;
  z-index: 5;
  top: 51%;
  left: 50%;
  width: min(84%, 560px);
  padding: 15px 18px;
  color: var(--ink);
  border: 4px solid var(--ink);
  border-radius: 13px;
  background: var(--paper);
  box-shadow: 9px 9px 0 rgba(16,17,20,.72);
  text-align: center;
  transform: translate(-50%, -50%) rotate(-1deg);
  animation: burst-in .28s cubic-bezier(.2, .9, .3, 1.35) both;
}

.feedback-burst.is-correct {
  background: var(--gold);
}

.feedback-burst.is-wrong {
  background: #ffdad7;
}

.feedback-burst.is-timeout {
  color: var(--paper);
  background: #3a4b8f;
}

.feedback-burst strong {
  display: block;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(1.8rem, 5vw, 3rem);
  letter-spacing: .05em;
  line-height: 1;
}

.feedback-burst small {
  display: block;
  margin-top: 6px;
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.feedback-burst span {
  display: block;
  margin-top: 5px;
  font-size: clamp(.78rem, 2vw, .95rem);
  font-weight: 800;
}

@keyframes burst-in {
  from { opacity: 0; transform: translate(-50%, -40%) rotate(-5deg) scale(.72); }
  to { opacity: 1; transform: translate(-50%, -50%) rotate(-1deg) scale(1); }
}

.keyboard-help {
  margin: 13px 0 0;
  color: var(--silver-dark);
  font-size: .75rem;
  text-align: center;
}

/* Results */
.results-screen {
  width: min(760px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 26px;
  background: rgba(22,24,30,.94);
  box-shadow: var(--shadow);
}

.result-banner {
  position: relative;
  padding: clamp(30px, 6vw, 54px) 24px 35px;
  overflow: hidden;
  text-align: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,208,71,.22), transparent 30%),
    linear-gradient(135deg, #173a83, #13151c 70%);
}

.result-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .18;
  background-image: radial-gradient(var(--paper) 1px, transparent 1px);
  background-size: 11px 11px;
  pointer-events: none;
}

.result-ball {
  position: relative;
  z-index: 1;
  margin-bottom: 5px;
  font-size: 3.2rem;
  filter: drop-shadow(4px 6px 0 rgba(0,0,0,.3));
}

.result-banner .eyebrow,
.result-banner h2,
.result-banner p {
  position: relative;
  z-index: 1;
}

.result-banner .eyebrow {
  margin-bottom: 6px;
}

.result-banner h2 {
  margin: 0;
  color: var(--gold);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(2.8rem, 8vw, 5.4rem);
  letter-spacing: .035em;
  line-height: .95;
  text-shadow: 5px 5px 0 rgba(0,0,0,.3);
}

.result-banner p:last-child {
  margin: 12px auto 0;
  max-width: 34rem;
  color: var(--silver);
  font-weight: 700;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.result-stats div {
  min-width: 0;
  padding: 21px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result-stats div + div {
  border-left: 1px solid rgba(255,255,255,.12);
}

.result-stats span {
  color: var(--silver-dark);
  font-size: .69rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.result-stats strong {
  margin-top: 5px;
  color: var(--paper);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(1.45rem, 4vw, 2.15rem);
  letter-spacing: .04em;
}

.leaderboard-panel {
  margin: 0;
  padding: 24px clamp(18px, 4vw, 34px) 5px;
  border-top: 1px solid rgba(255,255,255,.12);
}

.leaderboard-heading {
  margin-bottom: 12px;
}

.leaderboard-heading h3 {
  margin: 4px 0 0;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 1.35rem;
  letter-spacing: .05em;
}

.leaderboard-player-note {
  color: var(--teal);
  font-size: .7rem;
  font-weight: 900;
  text-align: right;
}

.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-left: 4px solid rgba(255,255,255,.2);
  border-radius: 6px;
  background: rgba(255,255,255,.05);
}

.leaderboard-row.is-current {
  border-left-color: var(--gold);
  background: rgba(255,208,71,.12);
}

.leader-rank {
  color: var(--silver-dark);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 1.15rem;
}

.leader-copy {
  min-width: 0;
}

.leader-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}

.leader-meta {
  display: block;
  color: var(--silver-dark);
  font-size: .68rem;
}

.leader-score {
  color: var(--gold);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 1.25rem;
  white-space: nowrap;
}

.leaderboard-empty {
  padding: 16px;
  color: var(--silver-dark);
  border-radius: 8px;
  background: rgba(255,255,255,.05);
  font-weight: 800;
}

.review-panel {
  padding: 24px clamp(18px, 4vw, 34px) 5px;
}

.review-panel h3 {
  margin: 0 0 12px;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 1.35rem;
  letter-spacing: .05em;
}

.review-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.review-item {
  padding: 11px 12px;
  border-left: 4px solid var(--teal);
  border-radius: 6px;
  background: rgba(255,255,255,.06);
}

.review-item.proper {
  border-left-color: var(--gold);
}

.review-item strong,
.review-item span {
  display: block;
}

.review-item strong {
  font-size: .9rem;
}

.review-item span {
  margin-top: 2px;
  color: var(--silver-dark);
  font-size: .7rem;
}

.perfect-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 16px;
  color: var(--ink);
  border-radius: 8px;
  background: var(--gold);
  font-weight: 900;
  text-align: center;
}

.result-actions {
  padding: 22px clamp(18px, 4vw, 34px) 30px;
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 12px;
}

.secondary-button {
  padding: 12px 15px;
  color: var(--paper);
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.06);
}

.secondary-button:hover {
  background: rgba(255,255,255,.12);
  transform: translateY(-2px);
}

footer {
  min-height: 46px;
  padding-top: 15px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  color: rgba(255,255,255,.38);
  font-size: .68rem;
  text-align: center;
}

/* Instructions dialog */
dialog {
  width: min(540px, calc(100% - 32px));
  padding: 31px clamp(22px, 5vw, 38px) 34px;
  color: var(--paper);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 21px;
  background: #1a1c22;
  box-shadow: 0 25px 80px rgba(0,0,0,.62);
}

dialog::backdrop {
  background: rgba(5,6,8,.78);
  backdrop-filter: blur(4px);
}

.dialog-topline {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 7px;
  border-radius: 21px 21px 0 0;
  background: linear-gradient(90deg, var(--teal) 0 33%, var(--pink) 33% 66%, var(--gold) 66%);
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  color: var(--silver);
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  font-size: 1.5rem;
}

dialog h2 {
  margin: 0 0 18px;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(2.2rem, 8vw, 3.7rem);
  letter-spacing: .035em;
}

dialog ol {
  margin: 0;
  padding-left: 23px;
}

dialog li {
  margin: 0 0 14px;
  padding-left: 6px;
  color: var(--silver);
  line-height: 1.45;
}

dialog li strong {
  color: var(--paper);
}

.coach-tip {
  margin: 21px 0;
  padding: 15px;
  color: #28230d;
  border-radius: 9px;
  background: var(--gold);
  line-height: 1.4;
}

.coach-tip strong {
  display: block;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 1.15rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.compact-button {
  max-width: 290px;
  margin: 0 auto;
  justify-content: center;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 820px) {
  .landing-screen {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .landing-copy {
    min-height: 390px;
  }

  .game-card {
    grid-template-columns: 1fr;
  }

  .game-card-art {
    min-height: 250px;
  }

  .start-screen {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .start-copy {
    min-height: 560px;
  }

  .hero-art {
    min-height: 450px;
  }

  .hero-backboard {
    width: min(48%, 300px);
  }

  .hero-ball {
    left: 60%;
  }
}

@media (max-width: 600px) {
  .app-shell {
    padding-right: max(10px, env(safe-area-inset-right));
    padding-left: max(10px, env(safe-area-inset-left));
  }

  .topbar {
    min-height: 52px;
  }

  .icon-button {
    min-width: 44px;
    padding: 8px 10px;
    justify-content: center;
  }

  .icon-button > span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
  }

  .hud-stat,
  .hud-score {
    padding-right: 8px;
    padding-left: 8px;
  }

  .hud strong {
    font-size: clamp(1.05rem, 5vw, 1.4rem);
  }

  .game-frame {
    padding: 14px 0 22px;
  }

  .landing-copy {
    min-height: 430px;
    padding: 31px 21px;
  }

  .landing-copy h1 {
    font-size: clamp(3.1rem, 17vw, 4.6rem);
  }

  .game-shelf {
    padding: 25px 16px;
  }

  .shelf-heading {
    align-items: start;
    flex-direction: column;
    gap: 5px;
  }

  .game-card-copy {
    padding: 23px 18px;
  }

  .game-card-art {
    min-height: 230px;
  }

  .card-hoop {
    width: 58%;
  }

  .leaderboard-heading {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }

  .leaderboard-player-note {
    text-align: left;
  }

  .start-copy {
    min-height: 530px;
    padding: 31px 21px;
  }

  h1 {
    font-size: clamp(3.4rem, 19vw, 5.3rem);
  }

  .tagline {
    margin: 16px 0 20px;
  }

  .noun-cheat-sheet {
    gap: 7px;
  }

  .noun-rule {
    min-height: 111px;
    padding: 13px 9px;
    gap: 7px;
  }

  .rule-number {
    font-size: 1rem;
  }

  .noun-rule strong {
    font-size: 1.03rem;
  }

  .noun-rule small {
    font-size: .64rem;
  }

  .hero-art {
    min-height: 390px;
  }

  .word-board {
    min-height: 115px;
    padding-inline: 11px;
  }

  .court {
    height: 430px;
    min-height: 430px;
  }

  .hoop-target {
    top: 5%;
    width: 37%;
    min-width: 0;
    min-height: 68px;
    padding-inline: 5px;
  }

  .hoop-target-common {
    left: 4%;
  }

  .hoop-target-proper {
    right: 4%;
  }

  .key-hint,
  .keyboard-help {
    display: none;
  }

  .feedback-burst {
    top: 48%;
    width: 90%;
  }

  .review-list {
    grid-template-columns: 1fr;
  }

  .result-actions {
    grid-template-columns: 1fr;
  }

  footer {
    flex-wrap: wrap;
  }
}

@media (max-width: 380px) {
  .brand {
    font-size: .82rem;
  }

  .mini-ball {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
  }

  .mini-ball::before {
    left: 11px;
  }

  .start-copy {
    min-height: 510px;
  }

  .noun-rule span:not(.rule-number) {
    font-size: .73rem;
  }

  .word-board h2 {
    font-size: 2.2rem;
  }

  .word-board h2.is-long {
    font-size: 1.75rem;
  }

  .word-board h2.is-extra-long {
    font-size: 1.45rem;
  }

  .court {
    height: 405px;
    min-height: 405px;
  }

  .hoop-subtitle {
    font-size: .59rem;
  }

  .gesture-coach {
    font-size: .69rem;
  }
}

@media (max-height: 690px) and (min-width: 601px) {
  .game-frame {
    padding: 12px 0;
  }

  .court {
    height: 385px;
    min-height: 385px;
  }

  .word-board {
    min-height: 105px;
    padding-block: 10px;
  }

  .word-board h2 {
    font-size: 2.55rem;
  }
}

@media (max-width: 600px) and (max-height: 690px) {
  .game-frame {
    padding: 8px 0 16px;
  }

  .word-board {
    min-height: 96px;
    padding-block: 9px;
  }

  .word-board h2 {
    font-size: clamp(1.9rem, 10vw, 2.65rem);
  }

  .word-board p:last-child {
    font-size: .8rem;
  }

  .court {
    height: 330px;
    min-height: 330px;
  }
}

@media (max-width: 360px) and (max-height: 600px) {
  .court {
    height: 310px;
    min-height: 310px;
  }
}

@media (min-width: 601px) and (max-height: 500px) {
  .topbar {
    min-height: 44px;
  }

  .game-frame {
    padding: 4px 0 10px;
  }

  .hud {
    min-height: 56px;
  }

  .hud-stat,
  .hud-score {
    padding-block: 5px 9px;
  }

  .word-board {
    min-height: 70px;
    padding-block: 5px;
  }

  .word-kicker {
    display: none;
  }

  .word-board h2,
  .word-board h2.is-long,
  .word-board h2.is-extra-long {
    font-size: 1.8rem;
  }

  .word-board p:last-child {
    font-size: .76rem;
  }

  .court {
    height: 240px;
    min-height: 240px;
  }

  .keyboard-help {
    display: none;
  }

  .gesture-coach {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (prefers-contrast: more) {
  .icon-button,
  .start-screen,
  .hud,
  .court-shell,
  .results-screen {
    border-color: var(--paper);
  }

  .silver,
  .microcopy,
  .keyboard-help {
    color: var(--paper);
  }
}
