:root {
  color-scheme: dark;
  --ink-950: #06131a;
  --ink-900: #0b2027;
  --ink-800: #11323a;
  --field-700: #0e5a3f;
  --field-600: #147a54;
  --cream-100: #f7f1df;
  --muted-300: #a8b7b7;
  --orange-500: #ff6b2c;
  --orange-300: #ffad6f;
  --cyan-400: #36d6d0;
  --gold-400: #f2c14e;
  --red-500: #e4463f;
  --line: rgb(247 241 223 / 20%);
  --stage-width: 460px;
  --motion-press: 90ms;
  --motion-enter: 260ms;
  --motion-result: 420ms;
  font-family: Arial, "Helvetica Neue", sans-serif;
  color: var(--cream-100);
  background: var(--ink-950);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% -20%, #1d5f50 0, transparent 45%),
    var(--ink-950);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--cyan-400);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.page-field {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.page-field::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(115deg, transparent 0 22%, rgb(255 255 255 / 3%) 22% 22.2%, transparent 22.2%),
    linear-gradient(65deg, transparent 0 70%, rgb(255 255 255 / 3%) 70% 70.2%, transparent 70.2%);
}

.page-field__grain {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
}

.floodlight {
  position: absolute;
  top: -28vh;
  width: 42vw;
  height: 115vh;
  background: linear-gradient(to bottom, rgb(255 228 176 / 21%), transparent 75%);
  filter: blur(8px);
  transform-origin: top;
}

.floodlight--left {
  left: 5vw;
  transform: rotate(19deg);
}

.floodlight--right {
  right: 5vw;
  transform: rotate(-19deg);
}

.site-frame {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(280px, 390px) var(--stage-width);
  gap: clamp(40px, 7vw, 110px);
  align-items: center;
  justify-content: center;
  width: min(1200px, 100%);
  height: 100dvh;
  margin: 0 auto;
  padding: 20px;
}

.field-note {
  max-width: 390px;
}

.field-note__kicker {
  margin: 0 0 22px;
  color: var(--orange-300);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.field-note h2 {
  margin: 0;
  color: var(--cream-100);
  font-family: "Arial Narrow", Bahnschrift, Impact, sans-serif;
  font-size: clamp(52px, 6vw, 82px);
  font-stretch: condensed;
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.88;
  text-transform: uppercase;
}

.field-note > p:not(.field-note__kicker) {
  max-width: 34ch;
  margin: 28px 0 36px;
  color: #c7d1cd;
  font-size: 17px;
  line-height: 1.65;
}

.field-note dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 320px;
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.field-note dl div {
  padding: 16px 8px 14px 0;
}

.field-note dl div + div {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.field-note dt {
  color: var(--cyan-400);
  font-family: "Arial Narrow", Bahnschrift, Impact, sans-serif;
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
}

.field-note dd {
  margin: 5px 0 0;
  color: var(--muted-300);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.game-shell {
  position: relative;
  width: min(var(--stage-width), 100%);
  aspect-ratio: 9 / 16;
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgb(247 241 223 / 24%);
  border-radius: 24px;
  background: var(--ink-900);
  box-shadow:
    0 34px 80px rgb(0 0 0 / 48%),
    0 0 0 7px rgb(255 255 255 / 3%);
}

#field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.field-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgb(2 10 14 / 42%), transparent 28%),
    radial-gradient(ellipse at center, transparent 45%, rgb(1 9 12 / 62%) 100%);
}

.hud {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 12px;
  padding:
    calc(15px + env(safe-area-inset-top))
    17px
    14px;
  background: linear-gradient(to bottom, rgb(1 10 14 / 86%), rgb(1 10 14 / 0%));
  transition:
    opacity var(--motion-enter) ease,
    translate var(--motion-enter) ease;
}

.game-shell[data-screen="home"] .hud,
.game-shell[data-screen="result"] .hud {
  pointer-events: none;
  opacity: 0;
  translate: 0 -12px;
  visibility: hidden;
}

.hud__target,
.hud__score {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.hud__target span {
  color: var(--muted-300);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hud__target strong {
  margin-top: 3px;
  color: var(--orange-300);
  font-family: "Arial Narrow", Bahnschrift, Impact, sans-serif;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}

.hud__score {
  align-items: center;
  min-width: 84px;
}

.hud__score > span {
  font-family: "Arial Narrow", Bahnschrift, Impact, sans-serif;
  font-size: 42px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 0.9;
  text-shadow: 0 3px 16px rgb(0 0 0 / 48%);
}

.hud__score small {
  margin-top: 3px;
  color: var(--muted-300);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hud__tools {
  display: flex;
  justify-content: end;
  gap: 8px;
}

.icon-button {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgb(5 18 23 / 54%);
  transition:
    background var(--motion-press) ease,
    border-color var(--motion-press) ease;
}

.icon-button:hover {
  border-color: rgb(247 241 223 / 45%);
  background: rgb(17 50 58 / 82%);
}

.icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-button[aria-pressed="true"] {
  color: var(--cyan-400);
}

.icon-button[aria-pressed="false"] .sound-wave {
  opacity: 0.25;
}

.hud__innings {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -3px;
}

.ball-track,
.wicket-track {
  display: flex;
  gap: 6px;
}

.ball-dot,
.wicket-dot {
  width: 9px;
  height: 9px;
  border: 1px solid rgb(247 241 223 / 42%);
  border-radius: 50%;
  background: rgb(6 19 26 / 45%);
}

.ball-dot[data-result="runs"] {
  border-color: var(--cyan-400);
  background: var(--cyan-400);
}

.ball-dot[data-result="boundary"] {
  border-color: var(--gold-400);
  background: var(--gold-400);
  box-shadow: 0 0 9px rgb(242 193 78 / 55%);
}

.ball-dot[data-result="wicket"],
.wicket-dot[data-result="lost"] {
  border-color: var(--red-500);
  background: var(--red-500);
}

.panel {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  padding:
    calc(30px + env(safe-area-inset-top))
    24px
    calc(22px + env(safe-area-inset-bottom));
  animation: panel-enter var(--motion-enter) ease both;
}

.panel[hidden],
.match-panel[hidden] {
  display: none;
}

@keyframes panel-enter {
  from {
    opacity: 0;
    translate: 0 16px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

.home-panel {
  justify-content: end;
  background:
    linear-gradient(to bottom, rgb(4 17 22 / 2%) 20%, rgb(4 17 22 / 76%) 52%, rgb(4 17 22 / 96%) 72%);
}

.home-panel__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 11px;
}

.home-panel__brand p {
  margin: 0;
  color: var(--muted-300);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.brand-mark {
  display: flex;
  align-items: end;
  gap: 2px;
  height: 19px;
  padding: 3px;
  border: 1px solid rgb(255 255 255 / 32%);
  border-radius: 3px;
}

.brand-mark i {
  display: block;
  width: 2px;
  background: var(--cream-100);
}

.brand-mark i:nth-child(1) {
  height: 11px;
}

.brand-mark i:nth-child(2) {
  height: 8px;
}

.brand-mark i:nth-child(3) {
  height: 5px;
}

.home-panel h1 {
  margin: 0;
  font-family: "Arial Narrow", Bahnschrift, Impact, sans-serif;
  font-size: clamp(58px, 18vw, 82px);
  font-stretch: condensed;
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.82;
  text-transform: uppercase;
}

.home-panel h1 span {
  color: var(--orange-500);
}

.home-panel__promise {
  max-width: 33ch;
  margin: 13px 0 20px;
  color: #d4dcd7;
  font-size: 16px;
  line-height: 1.42;
}

.challenge-banner {
  display: grid;
  gap: 4px;
  margin-bottom: 15px;
  padding: 13px 14px;
  border: 1px solid rgb(54 214 208 / 42%);
  border-left: 4px solid var(--cyan-400);
  border-radius: 8px;
  background: rgb(7 35 37 / 72%);
}

.challenge-banner p {
  margin: 0;
  color: var(--cyan-400);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.challenge-banner strong {
  font-size: 17px;
}

.challenge-banner span {
  color: var(--muted-300);
  font-size: 13px;
}

.name-field {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
}

.name-field span {
  color: var(--muted-300);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.name-field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--cream-100);
  background: rgb(5 18 23 / 54%);
  font-size: 16px;
  transition: border-color var(--motion-press) ease;
}

.name-field input:hover {
  border-color: rgb(247 241 223 / 43%);
}

.primary-action,
.secondary-action,
.text-action,
.pause-button {
  border: 0;
  transition:
    background var(--motion-press) ease,
    border-color var(--motion-press) ease,
    color var(--motion-press) ease,
    translate var(--motion-press) ease;
}

.primary-action {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 13px 17px;
  border-radius: 8px;
  color: #1b1105;
  background: var(--orange-500);
  font-size: 16px;
  font-weight: 900;
}

.primary-action:hover {
  background: var(--orange-300);
  translate: 0 -1px;
}

.primary-action:active,
.secondary-action:active,
.shot-button:active {
  translate: 0 1px;
}

.primary-action svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.home-panel__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.home-panel__footer p {
  margin: 0;
  color: var(--muted-300);
  font-size: 11px;
}

.home-panel__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 12px;
  margin-left: auto;
}

.text-action {
  min-height: 48px;
  padding: 8px 0;
  color: #d2dcd7;
  background: transparent;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.match-panel {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding:
    96px
    16px
    calc(18px + env(safe-area-inset-bottom));
  pointer-events: none;
}

.delivery-callout {
  position: absolute;
  top: 24%;
  left: 50%;
  display: grid;
  justify-items: center;
  gap: 4px;
  width: min(260px, 75%);
  text-align: center;
  translate: -50% 0;
  text-shadow: 0 2px 18px rgb(0 0 0 / 70%);
}

.delivery-callout span {
  color: var(--cyan-400);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.delivery-callout strong {
  font-family: "Arial Narrow", Bahnschrift, Impact, sans-serif;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1;
  text-transform: uppercase;
}

.timing-cluster {
  position: relative;
  width: min(310px, 84%);
  height: 34px;
  margin: 0 auto 12px;
  overflow: hidden;
  border: 1px solid rgb(247 241 223 / 34%);
  border-radius: 999px;
  background: rgb(2 14 18 / 82%);
  box-shadow: 0 4px 18px rgb(0 0 0 / 28%);
}

.timing-zone {
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: 66%;
  width: 12%;
  border-inline: 1px solid rgb(255 255 255 / 48%);
  background: linear-gradient(90deg, transparent, rgb(54 214 208 / 55%), transparent);
}

.timing-needle {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: 4px;
  border-radius: 999px;
  background: var(--cream-100);
  box-shadow: 0 0 18px var(--cyan-400);
  will-change: left;
}

.timing-cluster__copy {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  color: rgb(247 241 223 / 74%);
  font-size: 9px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  translate: -50% 0;
}

.shot-deck {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  pointer-events: auto;
}

.shot-button {
  display: grid;
  min-height: 76px;
  align-content: center;
  justify-items: center;
  gap: 2px;
  padding: 9px 5px;
  border: 1px solid rgb(247 241 223 / 24%);
  border-radius: 9px;
  background: rgb(7 28 33 / 88%);
  box-shadow: inset 0 1px rgb(255 255 255 / 8%);
}

.shot-button:hover {
  border-color: rgb(247 241 223 / 58%);
  background: rgb(17 50 58 / 96%);
}

.shot-button:active {
  border-color: var(--cyan-400);
}

.shot-button--safe {
  border-bottom: 3px solid #9cccb6;
}

.shot-button--balanced {
  border-bottom: 3px solid var(--cyan-400);
}

.shot-button--risky {
  border-bottom: 3px solid var(--orange-500);
}

.shot-button__icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
}

.shot-button__icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.shot-button__label {
  font-size: 14px;
  font-weight: 900;
}

.shot-button__risk {
  color: var(--muted-300);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pause-button {
  align-self: center;
  min-height: 44px;
  margin-top: 10px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-300);
  background: rgb(2 14 18 / 52%);
  font-size: 11px;
  pointer-events: auto;
}

.result-panel {
  overflow-y: auto;
  justify-content: start;
  background:
    linear-gradient(to bottom, rgb(4 17 22 / 93%), rgb(4 17 22 / 98%));
  scrollbar-width: thin;
}

.result-panel__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted-300);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.result-panel__topline span:first-child {
  color: var(--gold-400);
}

.result-panel h2 {
  margin: 14px 0 6px;
  font-family: "Arial Narrow", Bahnschrift, Impact, sans-serif;
  font-size: clamp(43px, 13vw, 63px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.88;
  text-transform: uppercase;
}

.result-panel > p {
  margin: 0;
  color: #d0dbd5;
  font-size: 15px;
  line-height: 1.45;
}

.result-panel > p.share-copy {
  margin: 10px 0 13px;
  padding: 11px 12px;
  border-left: 3px solid var(--cyan-400);
  color: var(--cream-100);
  background: rgb(14 35 38 / 75%);
  font-size: 13px;
}

.copy-shuffle {
  align-self: start;
  min-height: 44px;
  padding: 6px 0;
  border: 0;
  color: var(--cyan-400);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.share-preview-wrap {
  position: relative;
  width: min(250px, 72%);
  margin: 17px auto 0;
  border: 1px solid rgb(247 241 223 / 30%);
  border-radius: 11px;
  overflow: hidden;
  box-shadow: 0 22px 45px rgb(0 0 0 / 38%);
}

#share-preview {
  display: block;
  width: 100%;
  height: auto;
}

.share-preview__flag {
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 5px 7px;
  border-radius: 4px;
  color: var(--ink-950);
  background: var(--gold-400);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.result-actions {
  display: grid;
  gap: 8px;
  margin-top: 13px;
}

.secondary-action {
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgb(9 31 36 / 72%);
  font-size: 14px;
  font-weight: 800;
}

.secondary-action:hover {
  border-color: rgb(247 241 223 / 52%);
  background: rgb(17 50 58 / 84%);
}

.toast {
  position: absolute;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  left: 16px;
  z-index: 10;
  padding: 11px 13px;
  border: 1px solid rgb(54 214 208 / 50%);
  border-radius: 7px;
  color: var(--cream-100);
  background: rgb(5 30 33 / 94%);
  font-size: 13px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  translate: 0 10px;
  transition:
    opacity 180ms ease,
    translate 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  translate: 0 0;
}

.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;
}

@media (max-width: 900px) {
  .site-frame {
    display: block;
    width: 100%;
    height: 100dvh;
    padding: 0;
  }

  .field-note {
    display: none;
  }

  .game-shell {
    width: 100%;
    height: 100dvh;
    max-height: none;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

@media (max-width: 370px) {
  .panel {
    padding-inline: 17px;
  }

  .home-panel {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .home-panel__promise {
    margin-block: 10px 14px;
    font-size: 15px;
  }

  .shot-button {
    min-height: 70px;
  }

  .delivery-callout {
    top: 20%;
  }
}

@media (max-height: 720px) {
  .home-panel {
    padding-top: calc(23px + env(safe-area-inset-top));
  }

  .home-panel h1 {
    font-size: 56px;
  }

  .home-panel__promise {
    margin-block: 8px 12px;
    font-size: 14px;
  }

  .challenge-banner {
    margin-bottom: 9px;
    padding: 8px 10px;
  }

  .name-field {
    gap: 4px;
    margin-bottom: 8px;
  }

  .home-panel__footer {
    margin-top: 7px;
  }

  .result-panel {
    padding-top: calc(16px + env(safe-area-inset-top));
  }

  .result-panel h2 {
    margin-top: 8px;
    font-size: 40px;
  }

  .share-preview-wrap {
    width: min(188px, 60%);
    margin-top: 10px;
  }

  .result-panel > p.share-copy {
    margin-block: 7px 9px;
  }
}

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

