@font-face {
  font-family: "Arena Display";
  src: url("./fonts/bureau-text.woff") format("woff");
  font-display: swap;
}

@font-face {
  font-family: "Arena Sans";
  src: url("./fonts/noto-cjk-ui-regular.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Arena Sans";
  src: url("./fonts/noto-cjk-ui-bold.woff") format("woff");
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: #101611;
  --ink-raised: #182219;
  --ink-soft: #223025;
  --paper: #f0f2e7;
  --paper-muted: rgba(236, 238, 228, 0.64);
  --paper-faint: rgba(236, 238, 228, 0.36);
  --acid: #d8ff3e;
  --orange: #ff7043;
  --cyan: #63c8d6;
  --line: rgba(236, 238, 228, 0.16);
  --line-strong: rgba(236, 238, 228, 0.3);
  --display: "Arena Display", "Avenir Next Condensed", "DIN Condensed", "PingFang SC", sans-serif;
  --body: "Arena Sans", "Avenir Next", "PingFang SC", sans-serif;
  --mono: "SFMono-Regular", "Menlo", "PingFang SC", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  color-scheme: dark;
  background: var(--ink);
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow: hidden;
  color: var(--paper);
  background:
    radial-gradient(circle at 72% -10%, rgba(216, 255, 62, 0.085), transparent 31rem),
    radial-gradient(circle at 7% 100%, rgba(99, 200, 214, 0.075), transparent 30rem),
    #141d16;
  font-family: var(--body);
}

body.is-playing {
  overflow: hidden;
}

.locale-switcher {
  position: fixed;
  z-index: 600;
  top: 16px;
  right: 18px;
  display: grid;
  width: 46px;
  height: 30px;
  place-items: center;
  color: var(--paper);
  border: 1px solid rgba(99, 200, 214, 0.55);
  background: rgba(24, 35, 27, 0.92);
  font: 700 10px/1 var(--mono);
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.locale-switcher:hover {
  color: var(--ink);
  border-color: var(--acid);
  background: var(--acid);
}

.workspace-bar {
  padding-right: 82px;
}

body[data-active-alias="0"] {
  --active-model-color: var(--acid);
}

body[data-active-alias="1"] {
  --active-model-color: var(--orange);
}

button,
textarea,
input {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 999;
  top: 9px;
  left: 9px;
  padding: 9px 12px;
  color: var(--ink);
  border: 0;
  background: var(--acid);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

.ambient-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(236, 238, 228, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 238, 228, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(105deg, transparent 2%, black 34%, black 100%);
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: clamp(280px, 20vw, 340px) minmax(0, 1fr);
  height: 100vh;
  height: 100svh;
}

.sidebar {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(29, 42, 31, 0.96), rgba(17, 25, 19, 0.97));
  backdrop-filter: blur(18px);
}

.brand-block {
  display: flex;
  min-height: 98px;
  align-items: center;
  gap: 15px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  position: relative;
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--acid);
  color: var(--acid);
  transform: rotate(-3deg);
}

.brand-mark::after {
  position: absolute;
  right: -22px;
  bottom: -22px;
  width: 44px;
  height: 44px;
  background: var(--acid);
  content: "";
  transform: rotate(45deg);
}

.brand-mark span {
  position: absolute;
  top: 7px;
  left: 8px;
  color: rgba(216, 255, 62, 0.58);
  font: 700 10px/1 var(--mono);
}

.brand-mark strong {
  font: 900 34px/1 var(--display);
}

.brand-copy {
  display: grid;
  gap: 5px;
}

.brand-copy strong {
  font: 800 25px/1 var(--display);
  letter-spacing: 0.08em;
}

.brand-copy small {
  color: var(--paper-faint);
  font: 8px/1 var(--mono);
  letter-spacing: 0.16em;
}

.library-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.library-stats > div {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 14px 7px;
  text-align: center;
}

.library-stats > div + div {
  border-left: 1px solid var(--line);
}

.library-stats strong {
  color: var(--acid);
  font: 800 23px/1 var(--display);
}

.library-stats span,
.index-heading span,
.index-heading output,
.cloud-note,
.workspace-bar,
.game-position,
.game-meta,
.game-footline output,
.section-heading > span,
.section-heading div > span,
.build-card,
.action-dock,
.score-heading > div > span,
.player-bar,
.result-stage > span,
.board-lock span,
.section-nav {
  font-family: var(--mono);
}

.library-stats span {
  color: var(--paper-faint);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.section-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.section-nav a {
  position: relative;
  display: grid;
  min-height: 48px;
  place-content: center;
  gap: 3px;
  color: var(--paper-faint);
  border-right: 1px solid var(--line);
  text-align: center;
  text-decoration: none;
}

.section-nav a:last-child {
  border-right: 0;
}

.section-nav a:hover,
.section-nav a.is-active,
.section-nav a[aria-current="page"] {
  color: var(--paper);
  background: rgba(236, 238, 228, 0.06);
}

.section-nav a.is-active::after,
.section-nav a[aria-current="page"]::after {
  position: absolute;
  right: 9px;
  bottom: 0;
  left: 9px;
  height: 2px;
  content: "";
  background: var(--acid);
}

.section-nav span {
  color: var(--orange);
  font-size: 7px;
}

.section-nav b {
  font-size: 9px;
  letter-spacing: 0.06em;
}

.section-nav i {
  position: absolute;
  top: 5px;
  right: 7px;
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  color: var(--ink);
  background: var(--acid);
  font: normal 8px/1 var(--body);
}

.game-index {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.index-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 19px 13px;
}

.index-heading span {
  display: block;
  margin-bottom: 6px;
  color: var(--orange);
  font-size: 8px;
  letter-spacing: 0.16em;
}

.index-heading h2 {
  margin: 0;
  font: 800 22px/1 var(--display);
  letter-spacing: 0.04em;
}

.index-heading output {
  color: var(--paper-faint);
  font-size: 8px;
}

.game-list {
  min-height: 0;
  margin: 0;
  padding: 0 9px 14px;
  overflow-y: auto;
  list-style: none;
  scrollbar-color: rgba(216, 255, 62, 0.45) transparent;
  scrollbar-width: thin;
}

.game-placeholder {
  padding: 20px 10px;
  color: var(--paper-faint);
  font: 10px/1.6 var(--mono);
}

.game-item + .game-item {
  margin-top: 5px;
}

.game-item {
  margin: 0;
  padding: 0;
}

.game-item > button,
.game-button {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 72px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px 9px 7px;
  overflow: hidden;
  border: 1px solid transparent;
  color: var(--paper-muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.game-item > button::before,
.game-button::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  content: "";
  background: var(--acid);
  transform: scaleY(0);
  transition: transform 160ms ease;
}

.game-item > button:hover,
.game-button:hover {
  color: var(--paper);
  background: rgba(236, 238, 228, 0.045);
}

.game-item > button.is-active,
.game-item.is-active > button,
.game-button.is-active {
  color: var(--paper);
  border-color: var(--line-strong);
  background: rgba(236, 238, 228, 0.075);
}

.game-item > button.is-active::before,
.game-item.is-active > button::before,
.game-button.is-active::before {
  transform: scaleY(1);
}

.game-number {
  color: var(--paper-faint);
  font: 800 22px/1 var(--display);
}

.is-active .game-number,
.game-button.is-active .game-number {
  color: var(--acid);
}

.game-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.game-copy strong {
  overflow: hidden;
  font: 700 13px/1.15 var(--display);
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-copy small {
  overflow: hidden;
  color: var(--paper-faint);
  font: 8px/1 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-count,
.game-progress-mini {
  min-width: 30px;
  color: var(--paper-faint);
  font: 8px/1 var(--mono);
  text-align: right;
}

.is-complete .game-count,
.is-complete .game-progress-mini {
  color: var(--acid);
}

.cloud-note {
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 11px;
  padding: 12px 20px;
  color: var(--paper-faint);
  border-top: 1px solid var(--line);
  font-size: 8px;
  line-height: 1.55;
  letter-spacing: 0.05em;
}

.live-dot,
.state-light,
.player-notice i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 0 5px rgba(216, 255, 62, 0.08);
  animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse {
  50% { box-shadow: 0 0 0 9px rgba(216, 255, 62, 0); }
}

.workspace {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
}

.workspace-bar {
  position: relative;
  z-index: 6;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(20px, 3vw, 46px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(216, 255, 62, 0.08), transparent 42%, rgba(99, 200, 214, 0.07)),
    rgba(24, 35, 27, 0.94);
  backdrop-filter: blur(16px);
}

.catalog-state {
  display: flex;
  align-items: center;
  gap: 13px;
}

.catalog-state div {
  display: grid;
  gap: 5px;
}

.catalog-state strong {
  font-size: 9px;
  letter-spacing: 0.06em;
}

.catalog-state small {
  color: var(--paper-muted);
  font-size: 8px;
}

.workspace-totals {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--paper-faint);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.workspace-totals strong {
  color: var(--paper);
  font: 800 18px/1 var(--display);
}

.workspace-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-inline-end: 70px;
}

.account-badge {
  display: grid;
  min-width: 220px;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 5px 5px 5px 7px;
  border: 1px solid rgba(216, 255, 62, 0.36);
  background: rgba(236, 238, 228, 0.09);
  box-shadow: 4px 4px 0 rgba(216, 255, 62, 0.08);
}

.account-badge__mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--acid);
  border: 1px solid rgba(216, 255, 62, 0.7);
  background: rgba(216, 255, 62, 0.06);
  font: 800 9px/1 var(--mono);
  letter-spacing: 0.08em;
}

.account-badge__copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.account-badge__copy strong,
.account-badge__copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-badge__copy strong {
  color: var(--paper);
  font: 800 11px/1 var(--display);
}

.account-badge__copy small {
  color: var(--paper-faint);
  font: 7px/1 var(--mono);
}

.account-badge > button {
  min-height: 42px;
  padding: 0 9px;
  border: 0;
  color: var(--paper-muted);
  background: rgba(236, 238, 228, 0.13);
  cursor: pointer;
  font: 8px/1 var(--mono);
}

.account-badge > button:hover {
  color: var(--ink);
  background: var(--acid);
}

.account-badge:hover {
  border-color: rgba(216, 255, 62, 0.7);
  background: rgba(236, 238, 228, 0.13);
}

.header-progress strong {
  color: var(--acid);
}

.workspace-scroll {
  min-height: 0;
  padding: clamp(22px, 3.2vw, 48px);
  overflow-y: auto;
  scrollbar-color: rgba(216, 255, 62, 0.4) transparent;
  scrollbar-width: thin;
}

.view {
  animation: view-in 240ms ease-out both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(7px); }
}

.game-stage,
.result-stage {
  position: relative;
  min-height: 250px;
  padding: clamp(24px, 3vw, 42px);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(112deg, rgba(236, 238, 228, 0.055), transparent 46%),
    rgba(10, 12, 10, 0.72);
  isolation: isolate;
}

.game-stage::before,
.result-stage::before {
  position: absolute;
  top: -86%;
  right: -10%;
  z-index: -1;
  width: 54%;
  aspect-ratio: 1;
  border: 1px solid rgba(216, 255, 62, 0.22);
  border-radius: 50%;
  content: "";
  box-shadow:
    0 0 0 44px rgba(216, 255, 62, 0.018),
    0 0 0 94px rgba(216, 255, 62, 0.012);
}

.game-stage::after,
.result-stage::after {
  position: absolute;
  right: 22px;
  bottom: 17px;
  z-index: -1;
  width: 92px;
  height: 7px;
  content: "";
  background: repeating-linear-gradient(90deg, var(--acid) 0 3px, transparent 3px 8px);
  opacity: 0.48;
}

.game-stage-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.game-position {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.game-position span {
  color: var(--orange);
  font-size: 8px;
  letter-spacing: 0.16em;
}

.game-position strong {
  font: 800 20px/1 var(--display);
}

.game-nav {
  display: flex;
  gap: 5px;
}

.game-nav button,
.build-stepper button {
  border: 1px solid var(--line-strong);
  color: var(--paper-muted);
  background: rgba(236, 238, 228, 0.045);
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.game-nav button {
  min-height: 37px;
  padding: 0 13px;
  font: 9px/1 var(--mono);
}

.game-nav button:hover,
.build-stepper button:hover {
  color: var(--acid);
  border-color: var(--acid);
  background: rgba(216, 255, 62, 0.07);
}

.game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 27px;
}

.game-meta span {
  padding: 5px 8px;
  color: var(--paper-muted);
  border: 1px solid var(--line);
  background: rgba(11, 13, 12, 0.62);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.game-meta span:first-child {
  color: var(--acid);
  border-color: rgba(216, 255, 62, 0.42);
}

.game-stage h1,
.result-stage h1 {
  max-width: 20ch;
  margin: 16px 0 0;
  text-wrap: balance;
  font: 800 clamp(42px, 5vw, 76px)/0.92 var(--display);
  letter-spacing: -0.035em;
}

.game-footline {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-top: 24px;
}

.game-footline p {
  max-width: 62ch;
  margin: 0;
  color: var(--paper-muted);
  font-size: 12px;
  line-height: 1.6;
}

.game-footline output {
  color: var(--paper-faint);
  font-size: 9px;
  white-space: nowrap;
}

.builds-section,
.duels-section,
.overall-section {
  margin-top: clamp(28px, 3vw, 44px);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.section-heading div > span {
  display: block;
  margin-bottom: 6px;
  color: var(--orange);
  font-size: 8px;
  letter-spacing: 0.16em;
}

.section-heading h2 {
  margin: 0;
  font: 800 clamp(25px, 2.3vw, 36px)/1 var(--display);
  letter-spacing: 0.02em;
}

.section-heading > span {
  color: var(--paper-faint);
  font-size: 9px;
}

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

.build-card {
  --model-color: var(--acid);
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 260px;
  grid-template-columns: 40px minmax(0, 1fr);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  color: var(--paper);
  background: rgba(17, 20, 17, 0.82);
  cursor: pointer;
  text-align: left;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.build-card[data-alias-index="1"],
.build-card.alias-second {
  --model-color: var(--orange);
}

.build-card::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 16px;
  height: 16px;
  border-left: 1px solid var(--model-color);
  content: "";
  opacity: 0.7;
  transform: rotate(-45deg) translate(-5px, -2px);
  transform-origin: center;
}

.build-card:hover {
  z-index: 2;
  border-color: color-mix(in srgb, var(--model-color) 72%, transparent);
  background: rgba(24, 28, 23, 0.96);
  transform: translateY(-4px);
}

.build-card.is-active,
.build-card.is-selected {
  border-color: var(--model-color);
  background:
    linear-gradient(150deg, color-mix(in srgb, var(--model-color) 11%, transparent), transparent 54%),
    rgba(22, 26, 21, 0.98);
  box-shadow: inset 0 -3px 0 var(--model-color);
}

.build-card.is-sealed,
.build-card[data-state="sealed"] {
  border-color: color-mix(in srgb, var(--model-color) 55%, var(--line));
}

.build-rail,
.model-rail {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: space-between;
  padding: 15px 0 13px;
  color: var(--model-color);
  border-right: 1px solid color-mix(in srgb, var(--model-color) 42%, transparent);
  background: color-mix(in srgb, var(--model-color) 5%, transparent);
}

.build-rail .lane-label,
.model-rail .lane-label {
  font-size: 7px;
  letter-spacing: 0.15em;
  writing-mode: vertical-rl;
}

.build-rail strong,
.model-rail strong {
  font: 800 18px/1 var(--display);
}

.build-content,
.model-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 16px 16px 14px;
}

.build-card-top,
.model-card-top {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.build-status {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: var(--paper-faint);
  font-size: 7px;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.build-status i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--model-color);
}

.build-attempt,
.attempt {
  color: var(--paper-faint);
  font-size: 7px;
}

.alias-identity,
.build-identity {
  display: grid;
  min-width: 0;
  gap: 7px;
  margin-top: 30px;
}

.alias-identity strong,
.build-identity strong {
  color: var(--model-color);
  font: 800 clamp(25px, 2.4vw, 40px)/0.96 var(--display);
  letter-spacing: 0.02em;
}

.alias-identity small,
.build-identity small {
  color: var(--paper-faint);
  font-size: 8px;
  line-height: 1.5;
}

.build-card-title,
.build-title {
  display: -webkit-box;
  margin-top: 24px;
  overflow: hidden;
  font: 700 16px/1.2 var(--display);
  letter-spacing: 0.015em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.build-card-footer,
.model-card-footer {
  display: flex;
  min-width: 0;
  align-items: end;
  justify-content: space-between;
  gap: 7px;
  margin-top: auto;
  padding-top: 18px;
  color: var(--paper-faint);
  font-size: 7px;
}

.build-card.is-played .played-mark,
.build-card.is-sealed .played-mark {
  color: var(--model-color);
}

.action-dock {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: grid;
  min-height: 86px;
  grid-template-columns: auto minmax(0, 1fr) minmax(210px, 270px);
  align-items: stretch;
  margin-top: 20px;
  border: 1px solid var(--line-strong);
  background: rgba(10, 12, 10, 0.94);
  box-shadow: 0 -16px 36px rgba(5, 7, 5, 0.34);
  backdrop-filter: blur(18px);
}

.build-stepper {
  display: grid;
  grid-template-columns: 44px minmax(96px, auto) 44px;
  border-right: 1px solid var(--line);
}

.build-stepper button {
  border-width: 0;
  font: 20px/1 var(--display);
}

.build-stepper button + div,
.build-stepper div + button {
  border-left: 1px solid var(--line);
}

.build-stepper div {
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 0 12px;
  text-align: center;
}

.build-stepper div span {
  font-size: 8px;
}

.build-stepper div small {
  color: var(--paper-faint);
  font-size: 7px;
}

.selected-build {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 7px;
  padding: 12px 20px;
}

.selected-build span {
  color: var(--active-model-color, var(--acid));
  font-size: 8px;
}

.selected-build strong {
  overflow: hidden;
  font: 800 18px/1.05 var(--display);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.play-button {
  --active-color: var(--active-model-color, var(--acid));
  display: flex;
  min-height: 84px;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px 0 23px;
  border: 0;
  color: var(--ink);
  background: var(--active-color);
  cursor: pointer;
  transition: filter 150ms ease, transform 150ms ease;
}

.play-button:hover:not(:disabled) {
  filter: brightness(1.12);
}

.play-button:active:not(:disabled) {
  transform: translateY(2px);
}

.play-button span {
  font: 800 22px/1 var(--display);
  letter-spacing: 0.04em;
}

.play-button strong {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(11, 13, 12, 0.34);
  font: 25px/1 var(--display);
}

.score-panel {
  margin-top: clamp(30px, 4vw, 54px);
  border: 1px solid var(--line-strong);
  background: rgba(17, 20, 17, 0.84);
}

.score-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.score-heading > div > span {
  display: block;
  margin-bottom: 7px;
  color: var(--orange);
  font-size: 8px;
  letter-spacing: 0.14em;
}

.score-heading h2 {
  margin: 0;
  font: 800 27px/1 var(--display);
}

.score-heading p {
  max-width: 460px;
  margin: 0;
  color: var(--paper-faint);
  font: 8px/1.6 var(--mono);
  text-align: right;
}

#score-form {
  padding: 0 22px 22px;
}

.recording-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  margin: 22px 0 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(115deg, rgba(216, 255, 62, 0.055), transparent 48%),
    rgba(8, 10, 8, 0.72);
}

.recording-card::before {
  grid-column: 1 / -1;
  height: 3px;
  background: var(--paper-faint);
  content: "";
}

.recording-card[data-state="ready"]::before,
.recording-card[data-state="saved"]::before {
  background: var(--acid);
}

.recording-card[data-state="recording"]::before,
.recording-card[data-state="saving"]::before {
  background: var(--orange);
}

.recording-card[data-state="failed"]::before {
  background: #ff4f58;
}

.recording-card__heading {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 112px;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}

.recording-card__mark {
  position: relative;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--paper-faint);
  font: 800 11px/1 var(--mono);
  letter-spacing: 0.12em;
}

.recording-card__mark i {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.recording-card[data-state="ready"] .recording-card__mark,
.recording-card[data-state="saved"] .recording-card__mark {
  color: var(--acid);
  border-color: var(--acid);
}

.recording-card[data-state="recording"] .recording-card__mark,
.recording-card[data-state="saving"] .recording-card__mark,
.recording-card[data-state="failed"] .recording-card__mark {
  color: var(--orange);
  border-color: var(--orange);
}

.recording-card[data-state="recording"] .recording-card__mark i {
  animation: rec-blink 1s steps(1, end) infinite;
}

@keyframes rec-blink {
  50% { opacity: 0.22; }
}

.recording-card__heading > div:last-child > span {
  color: var(--orange);
  font: 8px/1 var(--mono);
  letter-spacing: 0.13em;
}

.recording-card__heading h3 {
  margin: 7px 0 6px;
  font: 800 20px/1.05 var(--display);
}

.recording-card__heading p {
  margin: 0;
  color: var(--paper-faint);
  font-size: 9px;
  line-height: 1.55;
}

.recording-card__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.recording-card__facts > div {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
  padding: 18px;
}

.recording-card__facts > div + div {
  border-left: 1px solid var(--line);
}

.recording-card__facts span {
  color: var(--paper-faint);
  font: 8px/1 var(--mono);
  letter-spacing: 0.08em;
}

.recording-card__facts strong {
  overflow: hidden;
  color: var(--active-model-color, var(--acid));
  font: 800 15px/1.15 var(--display);
  text-overflow: ellipsis;
}

.ballot-step {
  padding-top: 26px;
}

.ballot-step + .ballot-step {
  margin-top: 4px;
  border-top: 1px solid var(--line-strong);
}

.ballot-step__heading {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding-bottom: 8px;
}

.ballot-step__heading > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--ink);
  background: var(--orange);
  font: 800 10px/1 var(--mono);
}

.ballot-step__heading h3 {
  margin: 0;
  font: 800 22px/1.05 var(--display);
}

.ballot-step__heading p {
  margin: 6px 0 0;
  color: var(--paper-faint);
  font-size: 9px;
  line-height: 1.55;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 28px;
}

.metric {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 19px 0 20px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.metric:disabled {
  opacity: 0.42;
}

.metric legend {
  display: grid;
  width: 100%;
  grid-template-columns: 27px minmax(0, 1fr);
  padding: 0 58px 0 0;
}

.metric legend > span {
  grid-row: 1 / 3;
  color: var(--paper-faint);
  font: 8px/1.5 var(--mono);
}

.metric legend b {
  font-size: 12px;
}

.metric legend small {
  margin-top: 4px;
  color: var(--paper-faint);
  font-size: 8px;
}

.score-scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
  margin-top: 13px;
}

.score-scale button {
  display: grid;
  min-width: 0;
  min-height: 50px;
  align-content: center;
  gap: 5px;
  padding: 6px 3px;
  border: 1px solid var(--line-strong);
  color: var(--paper-faint);
  background: rgba(236, 238, 228, 0.03);
  cursor: pointer;
  font: 9px/1 var(--mono);
}

.score-scale button small {
  font: 7px/1 var(--mono);
  opacity: 0.64;
}

.score-scale button strong {
  overflow: hidden;
  font: 800 10px/1 var(--display);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-scale button:hover:not(:disabled),
.score-scale button.is-selected,
.score-scale button[aria-pressed="true"] {
  color: var(--ink);
  border-color: var(--active-model-color, var(--acid));
  background: var(--active-model-color, var(--acid));
}

.score-scale button:disabled {
  cursor: not-allowed;
}

.metric output {
  position: absolute;
  top: 21px;
  right: 12px;
  min-width: 36px;
  color: var(--active-model-color, var(--acid));
  font: 800 20px/1 var(--display);
  text-align: right;
}

.rubric-description {
  min-height: 42px;
  margin: 8px 0 0;
  padding: 9px 11px;
  color: var(--paper-faint);
  border-left: 2px solid var(--line-strong);
  background: rgba(236, 238, 228, 0.025);
  font-size: 9px;
  line-height: 1.55;
}

.metric[data-selected-tier] .rubric-description,
.metric[data-state="selected"] .rubric-description {
  color: var(--paper-muted);
  border-left-color: var(--active-model-color, var(--acid));
}

.rubric-description strong {
  color: var(--active-model-color, var(--acid));
}

.task-checklist {
  display: grid;
  gap: 1px;
  margin-top: 12px;
  border: 1px solid var(--line-strong);
  background: var(--line);
}

.task-checklist__empty {
  margin: 0;
  padding: 20px;
  color: var(--paper-faint);
  background: rgba(8, 10, 8, 0.9);
  font-size: 9px;
  text-align: center;
}

.task-row,
.task-checklist fieldset {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-width: 0;
  margin: 0;
  padding: 14px 16px;
  border: 0;
  background: #0b0e0b;
}

.task-row__copy,
.task-checklist legend {
  min-width: 0;
  color: var(--paper);
  font-size: 11px;
  line-height: 1.5;
}

.task-controls,
.task-checklist fieldset > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(76px, 1fr));
  gap: 5px;
}

#task-checklist button[data-task-id] {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  color: var(--paper-faint);
  background: rgba(236, 238, 228, 0.03);
  cursor: pointer;
  font-size: 9px;
}

#task-checklist button[data-task-id]:hover:not(:disabled),
#task-checklist button[data-task-id].is-selected,
#task-checklist button[data-task-id][aria-pressed="true"] {
  color: var(--ink);
  border-color: var(--active-model-color, var(--acid));
  background: var(--active-model-color, var(--acid));
}

.overall-score-control {
  margin-top: 14px;
  padding: 18px 20px 16px;
  border: 1px solid var(--line-strong);
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), rgba(236, 238, 228, 0.045) 25%),
    rgba(8, 10, 8, 0.78);
}

.overall-score-readout {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.overall-score-readout label {
  display: grid;
  gap: 5px;
}

.overall-score-readout label strong {
  font: 800 15px/1 var(--display);
}

.overall-score-readout label small {
  color: var(--paper-faint);
  font: 8px/1 var(--mono);
}

.overall-score-readout output {
  color: var(--active-model-color, var(--acid));
  font: 800 38px/0.9 var(--display);
}

#overall-score {
  width: 100%;
  height: 26px;
  margin: 20px 0 0;
  accent-color: var(--active-model-color, var(--acid));
  cursor: pointer;
}

#overall-score:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.overall-score-ticks {
  display: flex;
  justify-content: space-between;
  color: var(--paper-faint);
  font: 7px/1 var(--mono);
}

.overall-anchor {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  min-height: 42px;
  align-items: center;
  margin: 13px 0 0;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  color: var(--paper-faint);
  font-size: 9px;
}

.overall-anchor strong {
  color: var(--paper);
  white-space: nowrap;
}

.perfect-confirm-wrap {
  padding-top: 9px;
}

.perfect-confirm {
  display: flex;
  width: 100%;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px 10px 16px;
  border: 1px solid var(--orange);
  color: var(--paper);
  background: rgba(255, 112, 67, 0.06);
  cursor: pointer;
  text-align: left;
}

.perfect-confirm > span {
  display: grid;
  gap: 5px;
}

.perfect-confirm > span strong {
  font-size: 11px;
}

.perfect-confirm > span small {
  color: var(--paper-faint);
  font-size: 8px;
}

.perfect-confirm > b {
  min-width: 76px;
  padding: 10px;
  color: var(--ink);
  background: var(--orange);
  font: 800 9px/1 var(--mono);
  text-align: center;
}

.perfect-confirm > b span:last-child,
.perfect-confirm[aria-pressed="true"] > b span:first-child {
  display: none;
}

.perfect-confirm[aria-pressed="true"] > b span:last-child {
  display: inline;
}

.perfect-confirm[aria-pressed="true"] {
  border-color: var(--acid);
  background: rgba(216, 255, 62, 0.06);
}

.perfect-confirm[aria-pressed="true"] > b {
  background: var(--acid);
}

.score-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 20px;
  align-items: end;
  padding-top: 21px;
}

.note-field {
  position: relative;
  display: grid;
  gap: 8px;
  font-size: 10px;
}

.note-field > span {
  display: flex;
  justify-content: space-between;
}

.note-field small {
  color: var(--paper-faint);
  font: 8px/1 var(--mono);
}

.note-field textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  padding: 12px 14px 30px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  color: var(--paper);
  background: rgba(8, 10, 8, 0.72);
  font-size: 11px;
  line-height: 1.55;
}

.comment-count {
  position: absolute;
  right: 11px;
  bottom: 9px;
  padding: 3px 5px;
  color: var(--paper-faint);
  background: rgba(8, 10, 8, 0.82);
  font: 8px/1 var(--mono);
}

.submit-stack {
  display: grid;
  gap: 10px;
}

.submit-stack > p {
  display: grid;
  gap: 5px;
  margin: 0;
  color: var(--paper-faint);
  font-size: 8px;
  line-height: 1.5;
}

.submit-stack > p strong {
  color: var(--orange);
  font: 800 9px/1 var(--mono);
  letter-spacing: 0.08em;
}

.submit-button {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 20px;
  border: 0;
  color: var(--ink);
  background: var(--active-model-color, var(--acid));
  cursor: pointer;
}

.submit-button span {
  font: 800 17px/1 var(--display);
}

.submit-button strong {
  font: 24px/1 var(--display);
}

.submit-button:disabled {
  color: var(--paper-faint);
  background: rgba(236, 238, 228, 0.08);
  cursor: not-allowed;
}

.resubmit-button {
  width: 100%;
  margin-top: 10px;
  min-height: 44px;
  border: 1px solid var(--acid);
  color: var(--paper);
  background: transparent;
  font: 700 13px/1 var(--display);
  cursor: pointer;
}

.resubmit-button:hover,
.resubmit-button:focus-visible {
  background: rgba(210, 255, 61, 0.14);
}

.result-stage > span {
  color: var(--orange);
  font-size: 8px;
  letter-spacing: 0.16em;
}

.result-stage p {
  max-width: 58ch;
  margin: 22px 0 0;
  color: var(--paper-muted);
  font-size: 12px;
  line-height: 1.6;
}

.board-lock {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  align-items: center;
  gap: clamp(28px, 6vw, 90px);
  margin-top: 28px;
  padding: clamp(28px, 5vw, 70px);
  border: 1px solid var(--line-strong);
  background: rgba(17, 20, 17, 0.8);
}

.lock-mark {
  position: relative;
  display: grid;
  width: min(220px, 100%);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--orange);
  color: var(--orange);
  transform: rotate(-4deg);
}

.lock-mark::after {
  position: absolute;
  inset: 15px;
  border: 1px solid rgba(255, 112, 67, 0.48);
  content: "";
  transform: rotate(8deg);
}

.lock-mark span {
  position: absolute;
  top: 28px;
  font-size: 8px;
  letter-spacing: 0.18em;
}

.lock-mark strong {
  font: 800 86px/1 var(--display);
}

.board-lock > div:last-child > span {
  color: var(--orange);
  font-size: 8px;
  letter-spacing: 0.15em;
}

.board-lock h2 {
  max-width: 680px;
  margin: 13px 0 0;
  font: 800 clamp(34px, 4.4vw, 64px)/0.95 var(--display);
}

.board-lock p {
  max-width: 610px;
  margin: 20px 0;
  color: var(--paper-muted);
  font-size: 11px;
  line-height: 1.7;
}

.board-lock a {
  color: var(--acid);
  font-size: 11px;
  text-decoration: none;
}

.game-duels,
.overall-board {
  display: grid;
  gap: 12px;
}

.duel-card {
  border: 1px solid var(--line-strong);
  background: rgba(17, 20, 17, 0.78);
}

.duel-card > header,
.duel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 60px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.duel-card > header h2,
.duel-card > header h3,
.duel-heading h3 {
  margin: 0;
  font: 800 23px/1 var(--display);
}

.duel-card > header span,
.duel-heading span {
  color: var(--paper-faint);
  font: 8px/1 var(--mono);
}

.duel-row,
.overall-row {
  --model-color: var(--acid);
  display: grid;
  grid-template-columns: 56px minmax(190px, 0.9fr) minmax(260px, 1.4fr) 100px;
  align-items: center;
  gap: 20px;
  min-height: 132px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.duel-row:last-child {
  border-bottom: 0;
}

.duel-row[data-alias-index="1"],
.overall-row[data-alias-index="1"] {
  --model-color: var(--orange);
}

.duel-rank,
.overall-rank,
.leader-rank {
  color: var(--paper-faint);
}

.leader-rank strong {
  display: block;
  font: 800 38px/1 var(--display);
}

.leader-rank small {
  display: block;
  margin-top: 7px;
  font: 7px/1.2 var(--mono);
}

.duel-identity,
.overall-identity,
.leader-identity {
  display: grid;
  gap: 7px;
}

.duel-identity > span,
.overall-identity > span,
.duel-alias,
.overall-alias,
.leader-model {
  color: var(--model-color);
  font: 800 20px/1 var(--display);
}

.duel-identity strong,
.overall-identity strong,
.revealed-model {
  font-size: 11px;
}

.duel-identity small,
.overall-identity small {
  color: var(--paper-faint);
  font: 8px/1.45 var(--mono);
}

.metric-bars {
  display: grid;
  gap: 7px;
}

.metric-bar {
  display: grid;
  grid-template-columns: 62px 1fr 20px;
  align-items: center;
  gap: 8px;
  color: var(--paper-faint);
  font-size: 8px;
}

.metric-bar i {
  height: 6px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
}

.metric-bar i::after {
  display: block;
  width: 0;
  height: 100%;
  content: "";
  background: var(--model-color);
}

.metric-bar i[data-score="1"]::after { width: 10%; }
.metric-bar i[data-score="2"]::after { width: 20%; }
.metric-bar i[data-score="3"]::after { width: 30%; }
.metric-bar i[data-score="4"]::after { width: 40%; }
.metric-bar i[data-score="5"]::after { width: 50%; }
.metric-bar i[data-score="6"]::after { width: 60%; }
.metric-bar i[data-score="7"]::after { width: 70%; }
.metric-bar i[data-score="8"]::after { width: 80%; }
.metric-bar i[data-score="9"]::after { width: 90%; }
.metric-bar i[data-score="10"]::after { width: 100%; }

.metric-bar i[data-score]::after { width: var(--score-width, 0); }

.task-row__copy {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.task-row__copy p {
  margin: 0;
}

.task-number {
  color: var(--orange);
  font: 8px/1 var(--mono);
}

.duel-total,
.overall-total,
.leader-total {
  text-align: right;
}

.duel-total strong,
.overall-total strong,
.leader-total strong {
  display: block;
  color: var(--model-color);
  font: 800 38px/1 var(--display);
}

.duel-total span,
.overall-total span,
.duel-total small,
.overall-total small,
.leader-total small {
  color: var(--paper-faint);
  font: 8px/1 var(--mono);
}

.overall-board {
  margin-bottom: 30px;
  border: 1px solid var(--line-strong);
}

.overall-row {
  grid-template-columns: 56px minmax(180px, 0.85fr) minmax(155px, 0.65fr) minmax(240px, 1.2fr) 100px;
  background: rgba(17, 20, 17, 0.78);
}

.overall-row__games {
  display: grid;
  gap: 7px;
  color: var(--paper-faint);
  font: 8px/1.45 var(--mono);
}

.overall-row__games span {
  display: block;
}

.leader-note {
  grid-column: 2 / -1;
  margin: -5px 0 0;
  padding-top: 12px;
  color: var(--paper-muted);
  border-top: 1px solid var(--line);
  font-size: 9px;
  line-height: 1.6;
}

.duels-section:has(#game-duels[hidden]),
.overall-section:has(#overall-board[hidden]) {
  display: none;
}

.overall-row:first-child {
  background: rgba(216, 255, 62, 0.055);
}

.rules-stage::before {
  border-color: rgba(255, 112, 67, 0.24);
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 28px;
}

.rules-grid article {
  min-height: 280px;
  padding: 20px;
  border: 1px solid var(--line-strong);
  background: rgba(17, 20, 17, 0.78);
}

.rules-grid article > span {
  display: block;
  margin-bottom: 70px;
  color: var(--acid);
  font: 800 38px/1 var(--display);
}

.rules-grid article:nth-child(even) > span {
  color: var(--orange);
}

.rules-grid h2 {
  margin: 0;
  font: 800 22px/1 var(--display);
}

.rules-grid p {
  margin: 13px 0 0;
  color: var(--paper-muted);
  font-size: 10px;
  line-height: 1.75;
}

.rules-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line-strong);
}

.rules-actions p {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  font: 8px/1 var(--mono);
}

.rules-actions p span {
  color: var(--paper-faint);
}

.rules-actions button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--orange);
  color: var(--orange);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}

.player {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #050705;
  animation: player-in 180ms ease-out both;
}

@keyframes player-in {
  from { opacity: 0; transform: translateY(10px); }
}

.player-bar {
  position: relative;
  z-index: 3;
  display: grid;
  min-height: 74px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(216, 255, 62, 0.42);
  background: #10130f;
}

.exit-button {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 0;
  color: var(--ink);
  background: var(--acid);
  cursor: pointer;
}

.exit-button > span {
  font: 30px/1 var(--display);
}

.exit-button strong {
  font: 800 16px/1 var(--display);
}

kbd {
  padding: 4px 5px;
  border: 1px solid rgba(11, 13, 12, 0.35);
  background: rgba(11, 13, 12, 0.08);
  font: 8px/1 var(--mono);
}

.player-identity {
  display: grid;
  min-width: 0;
  gap: 4px;
  text-align: center;
}

.player-identity span {
  overflow: hidden;
  color: var(--paper-faint);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-identity strong {
  overflow: hidden;
  color: var(--active-model-color, var(--acid));
  font: 800 17px/1 var(--display);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-identity small {
  overflow: hidden;
  color: var(--paper-muted);
  font: 10px/1 var(--display);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 12px;
  color: var(--paper-faint);
  font-size: 8px;
  line-height: 1.45;
}

.player-notice > span {
  display: grid;
  gap: 4px;
}

.player-notice strong {
  color: var(--paper);
  font: 800 10px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.player-notice small {
  color: var(--paper-faint);
  font: 8px/1.25 var(--mono);
  white-space: nowrap;
}

.player-notice small b {
  color: var(--active-model-color, var(--acid));
  font-weight: 800;
}

.player-notice[data-state="recording"] i {
  background: #ff4f58;
  box-shadow: 0 0 0 5px rgba(255, 79, 88, 0.12);
  animation: rec-blink 1s steps(1, end) infinite;
}

.player-notice[data-state="recording"] strong {
  color: #ff737a;
}

.player-notice[data-state="saving"] i {
  background: var(--orange);
  box-shadow: 0 0 0 5px rgba(255, 112, 67, 0.1);
}

.player-notice[data-state="failed"] i {
  background: #ff4f58;
}

.player-notice[data-state="failed"] strong {
  color: #ff737a;
}

.frame-shell {
  position: relative;
  min-height: 0;
}

#game-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.frame-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--acid);
  background:
    repeating-linear-gradient(-42deg, transparent 0 24px, rgba(216, 255, 62, 0.035) 25px 26px),
    #080a08;
  font: 8px/1 var(--mono);
  letter-spacing: 0.1em;
}

.frame-loading.is-done {
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}

.player-saving {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 28px;
  color: var(--paper);
  background:
    radial-gradient(circle at 50% 35%, rgba(216, 255, 62, 0.09), transparent 24rem),
    repeating-linear-gradient(-42deg, transparent 0 24px, rgba(216, 255, 62, 0.025) 25px 26px),
    rgba(5, 7, 5, 0.98);
  text-align: center;
}

.player-saving__mark {
  position: relative;
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  margin-bottom: 24px;
  border: 1px solid var(--acid);
  color: var(--acid);
  font: 800 9px/1 var(--mono);
  letter-spacing: 0.12em;
  transform: rotate(-3deg);
}

.player-saving__mark i {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: rec-blink 1s steps(1, end) infinite;
}

.player-saving__kicker {
  color: var(--orange);
  font: 8px/1 var(--mono);
  letter-spacing: 0.15em;
}

.player-saving h2 {
  margin: 13px 0 14px;
  font: 800 clamp(40px, 6vw, 74px)/0.9 var(--display);
  letter-spacing: -0.02em;
}

.player-saving p {
  max-width: 54ch;
  margin: 0;
  color: var(--paper-muted);
  font-size: 11px;
  line-height: 1.65;
}

.player-saving__progress {
  width: min(420px, 76vw);
  height: 4px;
  margin-top: 26px;
  overflow: hidden;
  background: var(--line-strong);
}

.player-saving__progress i {
  display: block;
  width: var(--save-progress, 36%);
  height: 100%;
  background: var(--acid);
  animation: save-progress 1.1s ease-in-out infinite alternate;
}

.player-saving__progress-label {
  display: block;
  margin-top: 9px;
  color: var(--paper-muted);
  font: 9px/1.2 var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

@keyframes save-progress {
  from { transform: translateX(-100%); }
  to { transform: translateX(260%); }
}

.player-saving[data-state="failed"] .player-saving__mark {
  color: #ff737a;
  border-color: #ff4f58;
}

.player-saving[data-state="failed"] .player-saving__mark i,
.player-saving[data-state="failed"] .player-saving__progress i {
  background: #ff4f58;
  animation: none;
}

.player-saving__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.player-saving__actions button {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  color: var(--paper);
  background: transparent;
  cursor: pointer;
  font: 800 10px/1 var(--display);
}

.player-saving__actions button:first-child {
  color: var(--ink);
  border-color: var(--acid);
  background: var(--acid);
}

#player-save-discard {
  color: #ff8d92;
  border-color: #ff4f58;
}

.loader-mark {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(216, 255, 62, 0.2);
  border-top: 4px solid var(--acid);
  border-right-color: rgba(216, 255, 62, 0.75);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 150;
  max-width: min(420px, calc(100% - 36px));
  padding: 13px 16px;
  color: var(--ink);
  border: 1px solid var(--ink);
  background: var(--acid);
  box-shadow: 6px 6px 0 var(--orange);
  font-size: 11px;
  font-weight: 700;
}

noscript {
  position: fixed;
  inset: 20px;
  z-index: 200;
  display: grid;
  place-items: center;
  border: 1px solid var(--orange);
  background: var(--ink);
}

.account-gate {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  grid-template-columns: minmax(360px, 1.05fr) minmax(440px, 0.95fr);
  overflow: auto;
  background:
    linear-gradient(90deg, rgba(216, 255, 62, 0.025) 1px, transparent 1px),
    linear-gradient(rgba(216, 255, 62, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 14% 78%, rgba(99, 200, 214, 0.11), transparent 28rem),
    #080a08;
  background-size: 44px 44px, 44px 44px, auto, auto;
}

.account-gate__intro {
  position: relative;
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  justify-content: center;
  padding: clamp(40px, 7vw, 108px);
  overflow: hidden;
  border-right: 1px solid var(--line-strong);
}

.account-gate__intro::after {
  position: absolute;
  right: -9vw;
  bottom: -18vw;
  width: 34vw;
  height: 34vw;
  border: 1px solid rgba(216, 255, 62, 0.18);
  content: "";
  transform: rotate(23deg);
}

.account-gate__eyebrow {
  color: var(--acid);
  font: 8px/1 var(--mono);
  letter-spacing: 0.17em;
}

.account-gate__number {
  position: absolute;
  top: clamp(28px, 5vw, 72px);
  right: clamp(24px, 5vw, 72px);
  color: rgba(236, 238, 228, 0.06);
  font: 800 clamp(96px, 15vw, 220px)/0.75 var(--display);
}

.account-gate__intro h1 {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 28px 0 20px;
  font: 800 clamp(3.25rem, 6vw, 5.5rem)/0.9 var(--display);
  letter-spacing: -0.035em;
}

.account-gate__intro > p {
  position: relative;
  z-index: 1;
  max-width: 58ch;
  margin: 0;
  color: var(--paper-muted);
  font-size: 11px;
  line-height: 1.8;
}

.account-gate__privacy {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
  color: var(--paper-faint);
  font: 8px/1.5 var(--mono);
  letter-spacing: 0.06em;
}

.account-gate__privacy i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 0 7px rgba(216, 255, 62, 0.08);
}

.account-panel {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: clamp(26px, 5vw, 76px);
  background: rgba(12, 15, 12, 0.84);
}

.account-checking {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--paper-muted);
}

.account-checking > div {
  display: grid;
  gap: 7px;
}

.account-checking strong {
  color: var(--paper);
  font: 800 22px/1 var(--display);
}

.account-checking small {
  color: var(--paper-faint);
  font: 8px/1 var(--mono);
}

.account-entry {
  width: min(100%, 560px);
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid var(--line-strong);
  background: rgba(17, 20, 17, 0.94);
  box-shadow: 20px 20px 0 rgba(216, 255, 62, 0.025);
}

.account-panel__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.account-panel__header > div {
  display: grid;
  gap: 7px;
}

.account-panel__header span {
  color: var(--orange);
  font: 8px/1 var(--mono);
  letter-spacing: 0.14em;
}

.account-panel__header h2 {
  margin: 0;
  font: 800 32px/0.95 var(--display);
}

.account-panel__header a {
  color: var(--paper-faint);
  font: 8px/1 var(--mono);
  text-decoration: none;
}

.account-panel__header a:hover {
  color: var(--acid);
}

.account-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
  border: 1px solid var(--line);
}

.account-tabs button {
  min-height: 42px;
  border: 0;
  color: var(--paper-faint);
  background: transparent;
  cursor: pointer;
  font: 800 11px/1 var(--display);
}

.account-tabs button + button {
  border-left: 1px solid var(--line);
}

.account-tabs button[aria-selected="true"] {
  color: var(--ink);
  background: var(--acid);
}

.account-message {
  min-height: 34px;
  margin: 16px 0 12px;
  color: var(--paper-muted);
  font-size: 9px;
  line-height: 1.6;
}

.account-message[data-tone="error"] {
  color: #ff8b91;
}

.account-message[data-tone="success"] {
  color: var(--acid);
}

.account-form {
  display: grid;
  gap: 13px;
}

.account-form label {
  display: grid;
  gap: 7px;
  color: var(--paper-muted);
  font: 8px/1 var(--mono);
  letter-spacing: 0.06em;
}

.account-form label > small {
  color: var(--paper-faint);
  font-size: 7px;
  line-height: 1.45;
  letter-spacing: 0;
}

.account-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  color: var(--paper);
  background: #0b0e0b;
  font: 11px/1 var(--body);
}

.account-form input:hover {
  border-color: rgba(216, 255, 62, 0.42);
}

.account-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.account-code-row > button {
  min-width: 114px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--orange);
  color: var(--orange);
  background: transparent;
  cursor: pointer;
  font: 8px/1.25 var(--mono);
}

.account-code-row > button:hover:not(:disabled) {
  color: var(--ink);
  background: var(--orange);
}

.account-code-row > button:disabled {
  cursor: wait;
  opacity: 0.5;
}

.account-form__actions,
.account-form__backline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.account-form__backline {
  padding: 2px 0 6px;
  color: var(--paper-muted);
  font: 800 10px/1 var(--display);
}

.account-submit {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  border: 0;
  color: var(--ink);
  background: var(--acid);
  cursor: pointer;
  font: 800 14px/1 var(--display);
}

.account-form__actions .account-submit {
  flex: 1;
}

.account-link,
.account-retry {
  padding: 0;
  border: 0;
  color: var(--paper-faint);
  background: transparent;
  cursor: pointer;
  font: 8px/1 var(--mono);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.account-link:hover,
.account-retry:hover {
  color: var(--acid);
}

.account-retry {
  margin-top: 15px;
}

.account-discard {
  width: 100%;
  min-height: 42px;
  margin-top: 14px;
  border: 1px solid rgba(255, 139, 145, 0.5);
  color: #ff8b91;
  background: rgba(255, 139, 145, 0.04);
  cursor: pointer;
  font: 8px/1 var(--mono);
}

.account-discard:hover {
  color: var(--ink);
  background: #ff8b91;
}

.account-panel[data-busy="true"] .account-form button,
.account-panel[data-busy="true"] .account-tabs button {
  pointer-events: none;
  opacity: 0.55;
}

@media (max-width: 980px) {
  .account-gate {
    grid-template-columns: minmax(280px, 0.7fr) minmax(420px, 1.3fr);
  }

  .account-gate__intro {
    padding: 42px;
  }

  .account-gate__intro h1 {
    font-size: clamp(2.75rem, 6vw, 4.5rem);
  }

  .account-badge {
    min-width: 170px;
  }

}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .action-dock {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .play-button {
    grid-column: 1 / -1;
    min-height: 64px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .duel-row,
  .overall-row {
    grid-template-columns: 52px minmax(180px, 0.8fr) minmax(220px, 1fr) 80px;
  }

  .overall-row {
    grid-template-columns: 52px minmax(160px, 0.8fr) minmax(140px, 0.65fr) minmax(200px, 1fr) 80px;
    gap: 12px;
  }

  .rules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  body {
    overflow: auto;
  }

  .app-shell {
    display: block;
    height: auto;
    min-height: 100svh;
  }

  .sidebar {
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .brand-block {
    min-height: 78px;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
  }

  .brand-copy strong {
    font-size: 22px;
  }

  .library-stats {
    position: absolute;
    top: 0;
    right: 0;
    width: min(46vw, 300px);
    min-height: 78px;
    border-bottom: 0;
    border-left: 1px solid var(--line);
  }

  .section-nav {
    max-width: 340px;
    border-right: 1px solid var(--line);
  }

  .game-index {
    display: block;
  }

  .index-heading {
    padding: 14px 16px 10px;
  }

  .game-list {
    display: grid;
    grid-auto-columns: minmax(240px, 62vw);
    grid-auto-flow: column;
    padding: 0 14px 15px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .game-item + .game-item {
    margin-top: 0;
    margin-left: 5px;
  }

  .cloud-note {
    display: none;
  }

  .workspace {
    display: block;
  }

  .workspace-bar {
    min-height: 60px;
  }

  .workspace-scroll {
    overflow: visible;
  }

  .player-bar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .player-notice {
    display: flex;
    padding-right: 4px;
  }

  .score-footer {
    grid-template-columns: 1fr;
  }

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

  .recording-card__heading {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .duel-row,
  .overall-row {
    grid-template-columns: 52px 1fr 80px;
  }

  .leader-rank {
    grid-column: 1;
    grid-row: 1;
  }

  .leader-identity {
    grid-column: 2;
    grid-row: 1;
  }

  .leader-total {
    grid-column: 3;
    grid-row: 1;
  }

  .overall-row__games {
    grid-column: 2 / 4;
  }

  .metric-bars {
    grid-column: 2 / 4;
  }
}

@media (max-width: 620px) {
  .library-stats {
    display: none;
  }

  .brand-block {
    min-height: 72px;
  }

  .section-nav {
    max-width: none;
  }

  .workspace-totals {
    display: none;
  }

  .workspace-actions {
    margin-inline-end: 58px;
  }

  .workspace-scroll {
    padding: 18px 14px 28px;
  }

  .game-stage,
  .result-stage {
    min-height: 0;
    padding: 21px 17px;
  }

  .game-stage-topline {
    align-items: center;
  }

  .game-nav button {
    width: 44px;
    min-height: 44px;
    padding: 0;
    font-size: 0;
  }

  .game-nav button span {
    font-size: 17px;
  }

  .game-stage h1,
  .result-stage h1 {
    font-size: clamp(38px, 12vw, 56px);
  }

  .game-footline {
    align-items: start;
    flex-direction: column;
  }

  .build-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .build-card {
    min-height: 250px;
    grid-template-columns: 31px minmax(0, 1fr);
  }

  .build-content,
  .model-content {
    padding: 13px 10px 11px;
  }

  .alias-identity strong,
  .build-identity strong {
    font-size: clamp(20px, 6vw, 28px);
  }

  .action-dock {
    min-height: 66px;
    grid-template-columns: minmax(0, 1fr) minmax(145px, 42%);
  }

  .build-stepper {
    min-height: 66px;
    border-right: 1px solid var(--line);
  }

  .selected-build {
    display: none;
  }

  .play-button {
    grid-column: auto;
    min-height: 66px;
    padding-left: 16px;
  }

  .play-button span {
    font-size: 18px;
  }

  .score-heading {
    align-items: start;
    flex-direction: column;
  }

  .score-heading p {
    text-align: left;
  }

  #score-form {
    padding: 0 16px 16px;
  }

  .recording-card__heading {
    grid-template-columns: 50px minmax(0, 1fr);
    padding: 15px;
  }

  .recording-card__mark {
    width: 46px;
    height: 46px;
  }

  .recording-card__facts > div {
    padding: 14px;
  }

  .ballot-step__heading h3 {
    font-size: 19px;
  }

  .score-scale {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
  }

  .score-scale button {
    min-height: 48px;
  }

  .score-scale button strong {
    font-size: 9px;
  }

  .task-row,
  .task-checklist fieldset {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .task-controls,
  .task-checklist fieldset > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overall-score-control {
    padding: 15px;
  }

  .overall-anchor {
    align-items: start;
    flex-direction: column;
    gap: 5px;
  }

  .board-lock {
    grid-template-columns: 1fr;
  }

  .lock-mark {
    width: 160px;
  }

  .lock-mark strong {
    font-size: 62px;
  }

  .rules-grid {
    grid-template-columns: 1fr;
  }

  .rules-grid article {
    min-height: 220px;
  }

  .rules-grid article > span {
    margin-bottom: 45px;
  }

  .rules-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .player-bar {
    gap: 8px;
    padding: 7px;
  }

  .exit-button {
    min-height: 46px;
  }

  .exit-button kbd {
    display: none;
  }

  .player-identity span,
  .player-identity small {
    display: none;
  }

  .player-notice {
    gap: 7px;
  }

  .player-notice small {
    font-size: 0;
  }

  .player-notice small b {
    font-size: 8px;
  }

  .player-saving {
    padding: 20px;
  }
}

@media (max-width: 430px) {
  .catalog-state small {
    display: none;
  }

  .build-grid {
    grid-template-columns: 1fr;
  }

  .build-card {
    min-height: 215px;
  }

  .alias-identity,
  .build-identity {
    margin-top: 20px;
  }

  .duel-row,
  .overall-row {
    grid-template-columns: 44px 1fr 66px;
    gap: 11px;
    padding: 14px 11px;
  }

  .metric-bars {
    grid-column: 1 / 4;
  }

  .overall-row__games,
  .leader-note {
    grid-column: 1 / 4;
  }

  .exit-button {
    gap: 6px;
    padding: 0 9px;
  }

  .exit-button > span {
    font-size: 24px;
  }

  .exit-button strong {
    font-size: 13px;
  }

  .player-bar {
    grid-template-columns: auto minmax(46px, 1fr) auto;
  }

  .player-identity strong {
    font-size: 13px;
  }

  .player-notice strong {
    font-size: 8px;
  }

  .recording-card__facts {
    grid-template-columns: 1fr;
  }

  .recording-card__facts > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .ballot-step__heading {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .ballot-step__heading > span {
    width: 30px;
    height: 30px;
  }

  .score-scale {
    gap: 3px;
  }

  .score-scale button {
    min-height: 52px;
  }

  .score-scale button strong {
    font-size: 8px;
  }

  .overall-score-readout output {
    font-size: 32px;
  }

  .perfect-confirm {
    align-items: stretch;
    flex-direction: column;
  }

  .perfect-confirm > b {
    width: 100%;
  }

  .player-saving h2 {
    font-size: clamp(36px, 13vw, 52px);
  }
}

@media (max-width: 760px) {
  .account-gate {
    display: block;
  }

  .account-gate__intro {
    min-height: auto;
    padding: 34px 22px 30px;
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .account-gate__intro h1 {
    max-width: 520px;
    margin: 20px 0 14px;
    font-size: clamp(2.5rem, 10vw, 3.75rem);
  }

  .account-gate__intro > p {
    font-size: 10px;
  }

  .account-gate__number {
    top: 26px;
    right: 20px;
    font-size: 100px;
  }

  .account-gate__privacy {
    margin-top: 22px;
  }

  .account-panel {
    min-height: auto;
    place-items: start center;
    padding: 22px 14px 42px;
  }

  .account-entry {
    padding: 20px 16px;
    box-shadow: none;
  }

  .workspace-actions {
    min-width: 0;
  }

  .account-badge {
    min-width: 160px;
  }
}

@media (max-width: 430px) {
  .account-gate__intro {
    padding: 28px 17px 24px;
  }

  .account-gate__intro h1 {
    font-size: 2.5rem;
  }

  .account-code-row {
    grid-template-columns: 1fr;
  }

  .account-code-row > button {
    width: 100%;
  }

  .account-form__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .account-form__actions .account-link {
    min-height: 34px;
    text-align: left;
  }

  .account-badge {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .account-badge__mark {
    display: none;
  }
}

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