@font-face {
  font-family: "Geist";
  src: url("/web/fonts/Geist-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  /* The font is local and preloaded by every page. Blocking its first paint
     avoids a visible fallback-font reflow in the navigation and card grids. */
  font-display: block;
}

@font-face {
  font-family: "Geist";
  src: url("/web/fonts/Geist-Variable-Italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 100 900;
  font-display: block;
}

:root {
  color-scheme: dark;
  --bg-page: #080909;
  --bg-surface: #0e0f0f;
  --bg-elevated: #151616;
  --border-subtle: #343633;
  --border-strong: #4a4d47;
  --brand-yellow: #efd900;
  --brand-hover: #ffe51a;
  --brand-pressed: #ccb900;
  --text-primary: #f4f1d8;
  --text-secondary: #b5b397;
  --text-muted: #797c68;
  --success: #9dce55;
  --danger: #e26755;
  --shadow-offset: 3px 3px 0 rgba(0, 0, 0, 0.38);
  --shadow-offset-small: 2px 2px 0 rgba(0, 0, 0, 0.32);
  --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.18);

  /* Shared semantic aliases keep every surface on the same formal palette. */
  --ink: var(--text-primary);
  --cream: var(--text-primary);
  --muted: var(--text-secondary);
  --panel: var(--bg-surface);
  --panel-light: var(--bg-elevated);
  --line: var(--border-subtle);
  --gold: var(--brand-yellow);
  --green: var(--success);
  --red: var(--danger);
  --black: var(--bg-page);
  --font-geist: "Geist", sans-serif;
  --mono: var(--font-geist);
  --sans: var(--font-geist);
  --radius-surface: 8px;
  --radius-control: 6px;
  --radius-compact: 4px;
  --control-cluster-gap: 8px;
  --replay-action-height: 44px;
  --page-context-bar-height: 48px;
  --page-max-width: 2560px;
  --page-background: var(--bg-page);
}

html {
  scrollbar-gutter: stable;
}

html.playground-preview-root {
  overflow: hidden;
  scrollbar-gutter: auto;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--page-background);
  color: var(--ink);
  font-family: var(--mono);
}

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

code,
kbd,
pre,
samp {
  font-family: inherit;
}

button {
  color: inherit;
}

/* Every primary page starts with one equally weighted context selector or
   task banner. Content may differ, but its desktop footprint never does. */
.page-context-bar {
  height: var(--page-context-bar-height);
  min-height: var(--page-context-bar-height);
}

.page-context-bar > button {
  height: 100%;
}

.topbar {
  position: relative;
  min-height: 88px;
  padding: 14px clamp(18px, 3.5vw, 56px);
  border-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(9, 9, 10, 0.94);
  backdrop-filter: blur(12px);
}

.topbar::after,
.site-footer-card::before {
  position: absolute;
  height: 1.5px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--border-subtle) 70%, var(--bg-page)) 4%,
    color-mix(in srgb, var(--border-subtle) 70%, var(--bg-page)) 96%,
    transparent
  );
  content: "";
  pointer-events: none;
}

.topbar::after {
  right: clamp(8px, 1vw, 14px);
  bottom: 0;
  left: clamp(8px, 1vw, 14px);
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  color: var(--ink);
  text-decoration: none;
}

.brand-lockup {
  display: block;
  flex: 0 0 auto;
  width: 278px;
  max-width: 24vw;
  height: auto;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.32));
}

main {
  width: min(var(--page-max-width), calc(100% - 32px));
  margin: 0 auto;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font: 900 clamp(42px, 7vw, 86px) / 0.84 var(--sans);
  letter-spacing: -0.065em;
  text-transform: uppercase;
}

.arena {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--control-cluster-gap);
}

.replay-card-mount {
  position: relative;
  min-width: 0;
}

.replay-card-mount:empty {
  contain: layout paint style;
  overflow: hidden;
  border: 2px solid var(--border-strong);
  background:
    linear-gradient(
      to bottom,
      #a8d9ea 0,
      #a8d9ea calc(100% - 104px),
      var(--panel) calc(100% - 104px),
      var(--panel) 100%
    );
  box-shadow: var(--shadow-soft);
}

.replay-card-mount:empty::after {
  position: absolute;
  right: 8px;
  bottom: 48px;
  left: 8px;
  height: 1px;
  background: var(--line);
  content: "";
}

.arena-comparison .replay-card-mount:empty {
  min-height: 360px;
  aspect-ratio: 1.18;
}

.challenge-replay-panel .replay-card-mount:empty {
  min-height: clamp(510px, calc(100vh - 210px), 750px);
}

.replay-card-mount > .replay-card {
  width: 100%;
}

.run-card {
  min-width: 0;
  border: 2px solid var(--border-strong);
  background: var(--panel);
  box-shadow: none;
}

.run-letter,
.versus {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--black);
  color: var(--black);
  background: var(--gold);
  box-shadow: var(--shadow-offset);
  font-size: 20px;
  font-weight: 900;
}

.versus {
  width: 44px;
  height: 32px;
  border-color: var(--brand-yellow);
  border-radius: var(--radius-surface);
  color: var(--brand-yellow);
  background: var(--bg-elevated);
  box-shadow: none;
  font-size: 15px;
}

.replay-model-select {
  width: min(220px, 54vw);
  max-width: none;
  min-height: 38px;
  padding: 10px 32px 10px 13px;
  border: 1px solid var(--gold);
  border-radius: 0;
  background: var(--bg-page);
  color: var(--cream);
  box-shadow: none;
  font: 800 9px/1 var(--mono);
  letter-spacing: 0.06em;
  cursor: pointer;
}

.replay-model-select-shell {
  display: inline-flex;
  align-items: stretch;
  gap: 6px;
}

.model-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2.25em;
  height: 1.55em;
  border: 1px solid currentColor;
  color: var(--gold);
  background: var(--bg-page);
  font-size: 0.68em;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.04em;
}

.model-identity {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  min-width: 0;
}

.replay-model-select-shell > .model-icon {
  width: 38px;
  height: 38px;
  border-color: var(--gold);
  box-shadow: var(--shadow-offset-small);
  font-size: 11px;
}

.replay-model-select:hover,
.replay-model-select:focus-visible {
  border-color: var(--gold);
  color: var(--gold);
  outline: none;
}

.replay-card-corner {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 8px;
}

.diorama-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  margin: 8px;
  border: 1px solid rgba(244, 234, 202, 0.28);
  border-radius: 8px;
  background: linear-gradient(#67baf0 0%, #a9ddf7 55%, #ecf7dc 100%);
  box-shadow: var(--shadow-soft);
}

.scene-viewport,
.scene-viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: 0;
}

.scene-viewport canvas {
  border-radius: 7px;
}

.replay-loading-status {
  position: absolute;
  z-index: 7;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 5px 10px;
  transform: translateX(-50%);
  border: 1px solid rgba(244, 234, 202, 0.42);
  border-radius: var(--radius-control);
  color: var(--cream);
  background: rgba(8, 9, 6, 0.78);
  font: 800 10px/1 var(--sans);
  letter-spacing: 0.08em;
  white-space: nowrap;
  pointer-events: none;
}

.replay-loading-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-yellow);
  animation: replay-loading-pulse 1.1s ease-in-out infinite;
  content: "";
}

.replay-loading-status[hidden] {
  display: none;
}

.replay-card-loading {
  top: 50%;
  transform: translate(-50%, -50%);
}

@keyframes replay-loading-pulse {
  50% {
    opacity: 0.45;
    transform: scale(1.45);
  }
}

@media (prefers-reduced-motion: reduce) {
  .replay-loading-status::before {
    animation: none;
  }
}

.replay-card-unavailable {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 24px;
  color: var(--cream);
  background:
    linear-gradient(var(--gold), var(--gold)) left 18px top 18px / 12px 2px no-repeat,
    linear-gradient(var(--gold), var(--gold)) left 18px top 18px / 2px 12px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right 18px top 18px / 12px 2px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right 18px top 18px / 2px 12px no-repeat,
    linear-gradient(var(--gold), var(--gold)) left 18px bottom 18px / 12px 2px no-repeat,
    linear-gradient(var(--gold), var(--gold)) left 18px bottom 18px / 2px 12px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right 18px bottom 18px / 12px 2px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right 18px bottom 18px / 2px 12px no-repeat,
    color-mix(in srgb, var(--bg-page) 96%, transparent);
  text-align: center;
}

.replay-card-unavailable-card {
  display: grid;
  justify-items: center;
  width: min(430px, calc(100% - 32px));
  padding: 28px 34px 24px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-surface);
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
}

.replay-card-unavailable-mark {
  width: 74px;
  height: 74px;
  margin-bottom: 12px;
  color: var(--gold);
}

.replay-card-unavailable-mark svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 3;
}

.replay-card-unavailable-title {
  color: var(--cream);
  font-size: clamp(15px, 1.8vw, 22px);
  font-weight: 900;
  letter-spacing: 0.08em;
}

.replay-card-unavailable-detail {
  max-width: 42ch;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.replay-card-unavailable[hidden] {
  display: none;
}

.is-replay-unavailable .scene-transport {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.solution-drawer {
  overflow: hidden;
  margin: var(--control-cluster-gap);
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--bg-surface);
}

.solution-drawer summary {
  min-height: var(--replay-action-height);
  padding: 6px 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.solution-drawer summary::-webkit-details-marker {
  display: none;
}

.solution-drawer summary:hover,
.solution-drawer summary:focus-visible {
  color: var(--gold);
  background: var(--bg-elevated);
  outline: none;
}

.solution-drawer[open] summary {
  border-bottom: 1px solid var(--line);
}

.solution-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  white-space: nowrap;
}

.solution-label::before {
  color: var(--gold);
  content: "✦";
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.solution-drawer summary strong {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 400;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.solution-now {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
}

.solution-now-intent {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.solution-now-time {
  width: 44px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.solution-drawer summary .solution-disclosure {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: var(--text-primary);
}

.solution-drawer summary .solution-disclosure::before {
  box-sizing: border-box;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(45deg);
  transition: transform 140ms ease;
}

.solution-drawer[open] summary .solution-disclosure::before {
  transform: rotate(225deg);
}

.solution-loadout {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-page);
}

.solution-loadout-label {
  flex: 0 0 auto;
  color: var(--gold);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.solution-loadout-choices {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.solution-loadout-choice {
  padding: 3px 6px 3px 3px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.solution-loadout-choice strong {
  color: var(--text-primary);
  font-size: 8px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.solution-loadout-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #706949;
  background: #3a3527;
  color: #d9bd76;
  font: 11px/1 var(--sans);
}

.solution-loadout-icon[data-item-type="crate"],
.solution-loadout-icon[data-item-type="barrel"],
.solution-loadout-icon[data-item-type="plank"] {
  border-color: #8d6c3f;
  background: #765331;
  color: #e7c27c;
}

.solution-loadout-icon[data-item-type="rock"] {
  border-radius: 50%;
  border-color: #77786d;
  background: #595b54;
  color: #babcb0;
}

.solution-loadout-icon[data-item-type="stone_block"],
.solution-loadout-icon[data-item-type="spring"] {
  border-color: #77786d;
  background: #62645c;
  color: #c3c5ba;
}

.solution-loadout-icon[data-item-type="rope"] {
  border-radius: 50%;
}

.solution-loadout-icon[data-item-type="tarp"] {
  border-color: #668e86;
  background: #486d68;
  color: #c8e2db;
}

.solution-loadout-icon[data-item-type="none"] {
  border-color: #5c5f51;
  background: #292c24;
  color: #929681;
}

.solution-code {
  max-height: 430px;
  overflow: auto;
  padding: 0 8px 8px;
  border-top: 1px solid var(--line);
}

.solution-step {
  --step-progress: 0%;
  position: relative;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-page);
  opacity: 0.58;
}

.solution-step-progress {
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 1;
  width: var(--step-progress);
  height: 2px;
  background: var(--gold);
}

.solution-step-meta {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 7px;
  letter-spacing: 0.1em;
}

.solution-step-intent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  margin: 0;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--text-secondary);
  font-size: 8px;
  line-height: 1.45;
}

.solution-step-intent strong {
  color: var(--gold);
  font-size: 7px;
  letter-spacing: 0.1em;
}

.solution-step-intent span {
  min-width: 0;
}

.solution-step pre {
  margin: 0;
  padding: 9px 8px 11px;
  overflow-x: auto;
  color: var(--text-secondary);
  font: 8px/1.55 var(--mono);
  white-space: pre;
}

.solution-step.is-complete {
  opacity: 0.82;
}

.solution-step.is-complete .solution-step-meta span {
  color: var(--green);
}

.solution-step.is-current {
  border-color: var(--gold);
  background: var(--bg-elevated);
  opacity: 1;
}

.solution-step.is-current .solution-step-meta span,
.solution-step.is-current pre {
  color: var(--gold);
}

.versus {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 47%;
  transform: translate(-50%, -50%);
}

.scene-transport {
  position: absolute;
  z-index: 6;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) max-content 28px;
  gap: var(--control-cluster-gap);
  align-items: center;
  padding: 0 6px 2px;
  pointer-events: none;
  background: none;
}

.scene-transport > * {
  pointer-events: auto;
}

.scene-transport-play,
.vote-actions button,
.card-vote {
  border: 1px solid var(--border-strong);
  cursor: pointer;
  background: var(--panel-light);
}

.scene-transport-play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 0;
  min-height: 26px;
  padding: 0;
  color: var(--gold);
  background: color-mix(in srgb, var(--bg-elevated) 82%, transparent);
  font: 800 7px/1 var(--mono);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.scene-transport-play:hover,
.scene-transport-play:focus-visible {
  border-color: var(--brand-hover);
  color: var(--brand-hover);
  outline: none;
  background: var(--bg-elevated);
}

.card-vote-row {
  position: relative;
  margin: 0 8px 8px;
}

.card-vote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  min-height: var(--replay-action-height);
  margin: 0;
  border: 1px solid var(--border-strong);
  color: var(--bg-page);
  cursor: pointer;
  background: var(--gold);
}

.card-vote[data-vote="a"] {
  padding-right: 52px;
}

.card-vote[data-vote="b"] {
  padding-left: 52px;
}

.card-vote:hover {
  border-color: var(--brand-hover);
  background: var(--brand-hover);
}

.card-vote:active {
  border-color: var(--brand-pressed);
  background: var(--brand-pressed);
}

.card-vote span {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.card-vote .model-icon {
  width: 1.7em;
  height: 1.7em;
  color: currentColor;
  background: transparent;
  font-size: 10px;
}

.card-vote .vote-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 24px;
  font-size: 34px;
  font-weight: 900;
  line-height: 24px;
  letter-spacing: 0;
  transform: translateY(-1px);
}

.card-vote[hidden] {
  display: none;
}

.card-vote.is-vote-result {
  flex-direction: column;
  gap: 3px;
}

.card-vote.is-vote-result small {
  color: #4a4025;
  font-size: 7px;
  letter-spacing: 0.08em;
}

.card-vote.is-vote-result small.model-identity {
  display: inline-flex;
}

.card-vote.is-vote-result.is-muted {
  color: #9f9677;
  background: var(--bg-elevated);
}

.card-vote.is-vote-result.is-muted small {
  color: #777058;
}

.card-vote.is-vote-result.is-failed {
  color: #d7c9a2;
  background: #412921;
}

.scene-transport-play span {
  font: 900 12px/1 var(--sans);
}

.scene-timeline {
  --progress: 0%;
  width: 100%;
  height: 24px;
  min-width: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background:
    linear-gradient(
        90deg,
        var(--brand-yellow) 0,
        var(--brand-yellow) var(--progress),
        var(--border-strong) var(--progress),
        var(--border-strong) 100%
      )
      center / 100% 6px no-repeat;
}

.scene-timeline::-webkit-slider-runnable-track {
  height: 6px;
  background: transparent;
}

.scene-timeline::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -6px;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 50%;
  background: var(--brand-yellow);
}

.scene-timeline::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: var(--border-strong);
}

.scene-timeline::-moz-range-progress {
  height: 6px;
  border-radius: 3px;
  background: var(--brand-yellow);
}

.scene-timeline::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: var(--brand-yellow);
}

.scene-timecode {
  text-align: right;
  color: #a8a58e;
  font-size: 7px;
  white-space: nowrap;
}

.vote-panel {
  display: block;
  margin-top: 9px;
  padding: 0;
}

.vote-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.vote-actions button {
  min-height: 48px;
  padding: 10px;
  color: #eee2c3;
  border-color: #8d8257;
  background:
    linear-gradient(180deg, rgba(239, 217, 0, 0.065), transparent),
    var(--bg-elevated);
}

.vote-actions button:hover {
  border-color: var(--gold);
  background: var(--bg-elevated);
}

.vote-actions button:disabled {
  cursor: default;
  opacity: 0.35;
}

.vote-actions button[data-vote="tie"] {
  grid-column: 1;
  grid-row: 1;
  min-height: 48px;
}

.vote-actions .fail-vote {
  grid-column: 1;
  grid-row: 2;
  min-height: 42px;
  color: var(--muted);
  background: var(--bg-surface);
}

.vote-actions kbd {
  display: block;
  width: max-content;
  margin: 0 auto 6px;
  padding: 2px 5px;
  border: 1px solid var(--border-strong);
  color: var(--gold);
  background: var(--bg-page);
  font: 9px var(--mono);
}

.vote-actions span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.rating-table {
  border: 1px solid var(--line);
}

.rating-row {
  display: grid;
  grid-template-columns: 48px 1.2fr 0.55fr 0.55fr 0.65fr;
  align-items: center;
  min-height: 52px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  font-size: 10px;
}

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

.rating-row.header {
  min-height: 34px;
  color: var(--muted);
  background: var(--bg-page);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.rating-rank {
  position: relative;
  width: 100%;
  display: grid;
  place-items: center;
  justify-self: stretch;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.rating-name {
  color: #ddd1ae;
  font-weight: 700;
}

.rating-name .model-icon {
  font-size: 8px;
}

.rating-value {
  color: var(--gold);
  font-weight: 700;
}

.rating-delta.positive {
  color: var(--green);
}

.rating-delta.negative {
  color: var(--red);
}

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

@media (max-width: 820px) {
  .vote-panel {
    grid-template-columns: 1fr;
  }

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

  .versus {
    top: calc(50% - 40px);
  }

  .card-vote[data-vote="a"],
  .card-vote[data-vote="b"] {
    padding-right: 10px;
    padding-left: 10px;
  }

}

@media (max-width: 560px) {
  main {
    width: min(100% - 18px, 1280px);
  }

  h1 {
    font-size: 46px;
  }

  .solution-drawer summary strong {
    font-size: 7px;
  }

  .scene-transport {
    grid-template-columns: 28px minmax(0, 1fr) max-content 28px;
    gap: var(--control-cluster-gap);
    padding: 0 5px 2px;
  }

  .scene-transport-play {
    min-height: 26px;
    padding: 0;
  }

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

  .vote-actions .fail-vote {
    grid-column: 1;
  }

  .rating-row {
    grid-template-columns: 34px 1fr 0.5fr;
  }

  .rating-row > :nth-child(4),
  .rating-row > :nth-child(5) {
    display: none;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}

.top-actions {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.6vw, 28px);
}

.top-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 14px;
  border: 0;
  border-radius: var(--radius-control);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.045em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 120ms ease, background-color 120ms ease, outline-color 120ms ease;
}

.top-link-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  color: var(--brand-yellow);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.top-link-coffee-icon {
  position: relative;
  display: inline-block;
}

.top-link-coffee-icon::before {
  position: absolute;
  top: 7px;
  left: 2px;
  box-sizing: border-box;
  width: 14px;
  height: 10px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 4px 4px;
  content: "";
}

.top-link-coffee-icon::after {
  position: absolute;
  top: 9px;
  left: 15px;
  box-sizing: border-box;
  width: 6px;
  height: 7px;
  border: 2px solid currentColor;
  border-left: 0;
  border-radius: 0 5px 5px 0;
  content: "";
}

.top-link-coffee-icon > i,
.top-link-coffee-icon > i::after {
  position: absolute;
  top: 1px;
  left: 6px;
  width: 2px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.top-link-coffee-icon > i::after {
  top: 0;
  left: 5px;
}

.top-link[href="/support"] {
  outline: 1px solid color-mix(in srgb, var(--brand-yellow) 32%, transparent);
  outline-offset: -1px;
}

.top-link:hover,
.top-link:focus-visible {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.045);
}

.top-link[href="/support"]:hover,
.top-link[href="/support"]:focus-visible {
  outline-color: color-mix(in srgb, var(--brand-yellow) 56%, transparent);
}

.top-link:focus-visible {
  outline: 1px solid color-mix(in srgb, var(--brand-yellow) 72%, transparent);
  outline-offset: 2px;
}

.top-link.is-active {
  color: var(--brand-yellow);
  background: color-mix(in srgb, var(--brand-yellow) 7%, transparent);
}

.top-link:active {
  color: var(--brand-pressed);
  background: color-mix(in srgb, var(--brand-yellow) 11%, transparent);
}

.site-footer {
  position: relative;
  z-index: 7;
  min-height: 94px;
  padding: 14px clamp(20px, 3.5vw, 56px) 0;
  border-top: 0;
  background: transparent;
  overflow: hidden;
  text-align: left;
  isolation: isolate;
}

.site-footer::after {
  position: absolute;
  z-index: -1;
  right: clamp(20px, 3.5vw, 56px);
  bottom: 0;
  left: clamp(20px, 3.5vw, 56px);
  height: 34px;
  background-image: radial-gradient(
    circle,
    color-mix(in srgb, var(--brand-yellow) 25%, transparent) 1.15px,
    transparent 1.5px
  );
  background-size: 8px 8px;
  clip-path: polygon(
    0 66%, 7% 48%, 14% 70%, 23% 40%, 31% 62%, 40% 28%,
    49% 58%, 58% 42%, 67% 68%, 76% 34%, 85% 56%, 93% 44%,
    100% 62%, 100% 100%, 0 100%
  );
  content: "";
  opacity: 0.52;
  pointer-events: none;
}

.site-footer-card {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(var(--page-max-width), 100%);
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
  padding: 16px 8px 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.site-footer-card::before {
  top: 0;
  right: 0;
  left: 0;
}

.site-footer-notice {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
}

.site-footer-notice:hover,
.site-footer-notice:focus-visible {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer-socials {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 18px;
  padding-left: 0;
  border-left: 0;
}

.site-footer-social {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0;
  color: var(--text-secondary);
  background: transparent;
  transition: color 120ms ease, transform 120ms ease;
}

.site-footer-social:hover {
  color: var(--brand-yellow);
  transform: translateY(-1px);
}

.site-footer-social-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-footer-social-icon.is-discord {
  fill: currentColor;
  stroke: none;
}

.site-footer-social-icon.is-x {
  fill: currentColor;
  stroke: none;
}

@media (max-width: 1100px) {
  .topbar {
    padding-inline: 18px;
  }

  .brand-lockup {
    width: 220px;
    max-width: 24vw;
  }

  .top-actions {
    gap: 2px;
  }

  .top-link {
    gap: 7px;
    padding: 11px 8px;
    font-size: 10px;
  }

  .top-link-icon {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 820px) {
  .topbar {
    gap: 12px;
  }

  .brand-lockup {
    width: 220px;
    max-width: 32vw;
  }

  .top-actions {
    min-width: 0;
    flex: 1;
    justify-content: space-between;
    gap: 4px;
    overflow: visible;
  }

  .topbar .top-link {
    width: 44px;
    min-height: 44px;
    justify-content: center;
    padding: 10px;
  }

  .topbar .top-link-icon {
    width: 22px;
    height: 22px;
  }

  .top-link > span:last-child {
    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: 520px) {
  .site-footer-card {
    min-height: 92px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 4px 26px;
  }

  .site-footer-socials {
    gap: 12px;
  }
}

/* Handbook */

.pedia-body {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  overflow-x: hidden;
}

#handbook-canvas {
  position: fixed;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.pedia-topbar {
  position: sticky;
  top: 0;
  z-index: 8;
}

.pedia-browser {
  position: relative;
  z-index: 2;
  display: grid;
  flex: 1 0 auto;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 20px;
  width: min(1720px, calc(100% - 24px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.pedia-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  overflow: visible;
}

.pedia-sections button {
  position: relative;
  display: grid;
  grid-template-columns: 20px auto;
  justify-content: center;
  gap: 8px;
  align-items: center;
  min-height: var(--page-context-bar-height);
  padding: 6px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-surface) 78%, transparent);
  color: var(--muted);
  font: 800 10px/1 var(--mono);
  letter-spacing: 0.08em;
  text-align: left;
  cursor: pointer;
}

.pedia-sections button:last-child {
  border-right: 0;
}

.pedia-section-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.pedia-sections button:hover,
.pedia-sections button:focus-visible {
  color: var(--bg-page);
  background: var(--brand-hover);
  outline: none;
}

.pedia-sections button.is-active {
  color: var(--bg-page);
  background: var(--gold);
  outline: none;
}

.pedia-content {
  min-width: 0;
}

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

.pedia-about {
  box-sizing: border-box;
  width: 100%;
  padding: clamp(26px, 4vw, 56px);
  border: 1px solid var(--line);
  background: var(--panel);
}

.pedia-about-inner {
  width: min(980px, 100%);
  margin: 0 auto;
}

.about-intro {
  padding-bottom: clamp(28px, 4vw, 44px);
}

.pedia-about h1 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1;
  letter-spacing: -0.03em;
}

.pedia-about p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.pedia-about .about-lede {
  max-width: 760px;
  color: var(--ink);
  font-size: clamp(14px, 1.7vw, 17px);
  line-height: 1.65;
}

.about-section {
  padding: clamp(26px, 3.5vw, 38px) 0;
  border-top: 1px solid var(--line);
}

.about-section h2 {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 20px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.08em;
}

.about-section h2::before {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--gold);
  box-shadow: 0 0 12px rgba(244, 196, 48, 0.3);
  content: "";
  transform: rotate(45deg);
}

.about-support-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-surface);
  background: var(--bg-elevated);
}

.about-support-card > img {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-control);
  image-rendering: pixelated;
}

.about-support-copy {
  min-width: 0;
}

.about-support-copy > strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.about-support-copy p {
  margin: 0;
  max-width: 610px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.about-support-copy small {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.4;
}

.about-support-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--gold);
  border-radius: var(--radius-control);
  color: var(--bg-page);
  background: var(--gold);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-decoration: none;
  white-space: nowrap;
}

.about-support-link:hover,
.about-support-link:focus-visible {
  color: var(--bg-page);
  background: var(--brand-hover);
  outline: none;
}

.about-support-link:active {
  background: var(--brand-pressed);
}

.support-body {
  display: grid;
  min-height: 100vh;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow-x: hidden;
}

.support-page-main {
  width: min(var(--page-max-width), calc(100% - 24px));
  margin: 0 auto;
  padding: clamp(48px, 8vw, 110px) 0;
}

.support-page-panel {
  width: min(980px, 100%);
  margin: 0 auto;
}

.support-page-panel h1 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  color: var(--ink);
  font-size: clamp(20px, 2.5vw, 28px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.support-page-panel h1::before {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--gold);
  box-shadow: 0 0 12px rgba(244, 196, 48, 0.3);
  content: "";
  transform: rotate(45deg);
}

.pedia-legal-notice {
  scroll-margin-top: 88px;
}

.pedia-legal-notice:focus {
  outline: none;
}

.pedia-legal-notice p {
  max-width: 780px;
}

@media (max-width: 760px) {
  .about-support-card {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 16px;
    padding: 18px;
  }

  .about-support-card > img {
    width: 56px;
    height: 56px;
  }

  .about-support-link {
    grid-column: 1 / -1;
    width: 100%;
  }

}

@media (max-width: 460px) {
  .pedia-about {
    padding: 24px 18px;
  }

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

  .about-support-card > img {
    display: none;
  }
}

/* About */

.pedia-about {
  padding: clamp(28px, 4vw, 52px);
}

.pedia-about-inner {
  width: min(1100px, 100%);
}

.about-intro {
  padding-bottom: clamp(30px, 4vw, 46px);
}

.pedia-about h1 {
  margin-bottom: 16px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-transform: none;
}

.pedia-about .about-lede {
  max-width: 820px;
  font-size: clamp(14px, 1.5vw, 17px);
  line-height: 1.65;
}

.about-section {
  padding: clamp(30px, 4vw, 46px) 0;
}

.about-section h2 {
  display: block;
  margin-bottom: 22px;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
}

.about-section h2::before {
  display: none;
}

.about-mode-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 36px;
  margin: 0;
}

.about-mode-list > div {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.about-mode-list dt {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.5;
}

.about-mode-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.about-mode-list dd {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.about-playground-note {
  margin-top: 16px !important;
  font-size: 11px !important;
}

.about-run-main {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  list-style: none;
}

.about-run-main li {
  position: relative;
  min-height: 154px;
  padding: 20px;
  border-right: 1px solid var(--line);
}

.about-run-main li:last-child {
  border-right: 0;
}

.about-run-main li:not(:last-child)::after {
  position: absolute;
  top: 50%;
  right: -8px;
  z-index: 1;
  width: 15px;
  color: var(--gold);
  background: var(--panel);
  content: "\2192";
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  transform: translateY(-50%);
}

.about-run-main span {
  display: block;
  margin-bottom: 24px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
}

.about-run-main strong {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.35;
}

.about-run-main p {
  font-size: 10px;
  line-height: 1.55;
}

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

.about-detail-columns > div {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.about-detail-columns h3 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0;
}

.about-detail-columns p + p {
  margin-top: 12px;
}

@media (max-width: 900px) {
  .about-run-main {
    grid-template-columns: 1fr;
  }

  .about-run-main li {
    display: grid;
    grid-template-columns: 24px 140px minmax(0, 1fr);
    gap: 14px;
    min-height: 0;
    padding: 15px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .about-run-main li:last-child {
    border-bottom: 0;
  }

  .about-run-main li:not(:last-child)::after {
    top: auto;
    right: auto;
    bottom: -9px;
    left: 5px;
    display: block;
    width: 14px;
    content: "\2193";
    font-size: 14px;
    line-height: 18px;
    transform: none;
  }

  .about-run-main span,
  .about-run-main strong {
    margin: 0;
  }

}

@media (max-width: 680px) {
  .about-mode-list,
  .about-detail-columns {
    grid-template-columns: 1fr;
  }

  .about-run-main li {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .about-run-main p {
    grid-column: 2;
  }
}

@media (max-width: 460px) {
  .about-mode-list > div {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
  }
}

.catalog-browser {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 520px);
  gap: 16px;
  align-items: start;
}

.catalog-item-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 10px;
  min-width: 0;
}

.catalog-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  min-height: 116px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  color: var(--ink);
  background: var(--panel);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.catalog-item:hover,
.catalog-item:focus-visible {
  border-color: var(--gold);
  background: var(--bg-elevated);
  outline: none;
}

.catalog-item.is-active {
  border-color: var(--gold);
}

.catalog-item-stage {
  position: relative;
  display: block;
  width: 92px;
  height: 96px;
  overflow: hidden;
  border-radius: var(--radius-control);
  background: #d3d2c1;
}

.catalog-item-copy {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 10px;
  min-width: 0;
}

.catalog-item-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-item-tag {
  max-width: 100%;
  padding: 3px 5px;
  overflow: hidden;
  border: 1px solid currentColor;
  border-radius: var(--radius-compact);
  font-size: 7px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0.07em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-item-tag[data-catalog-class="STRUCTURAL"] {
  color: #e0b64d;
  background: color-mix(in srgb, #e0b64d 9%, transparent);
}

.catalog-item-tag[data-catalog-class="NATURAL"] {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 9%, transparent);
}

.catalog-item-tag[data-catalog-class="INTERACTIVE"] {
  color: #58a8c8;
  background: color-mix(in srgb, #58a8c8 9%, transparent);
}

.catalog-item-tag[data-catalog-class="ACTOR"] {
  color: #c26ad3;
  background: color-mix(in srgb, #c26ad3 9%, transparent);
}

.catalog-detail {
  position: sticky;
  top: 84px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.catalog-detail-stage {
  position: relative;
  width: 100%;
  height: 320px;
  background: #d3d2c1;
}

.catalog-detail-copy {
  padding: 24px;
}

.catalog-detail-class {
  color: var(--gold);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.catalog-detail h1 {
  margin: 6px 0 8px;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.catalog-detail-facts {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px 18px;
  margin: 18px 0;
  padding: 14px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.catalog-detail-facts dt {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.catalog-detail-facts dd {
  margin: 0;
  color: var(--ink);
  font-size: 9px;
  font-weight: 700;
}

.catalog-detail-states h2 {
  margin: 0;
  color: var(--ink);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.catalog-state-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.catalog-state-list span {
  padding: 4px 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-compact);
  color: var(--text-secondary);
  font-size: 8px;
  line-height: 1;
}

@media (max-width: 1500px) {
  .catalog-browser {
    grid-template-columns: minmax(0, 1fr) minmax(390px, 460px);
  }

  .catalog-item-grid {
    grid-template-columns: repeat(3, minmax(190px, 1fr));
  }
}

@media (max-width: 1120px) {
  .catalog-browser {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
  }

  .catalog-item-grid {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }
}

@media (max-width: 860px) {
  .catalog-browser {
    grid-template-columns: minmax(0, 1fr);
  }

  .catalog-detail {
    position: static;
    display: grid;
    grid-template-columns: minmax(300px, 1.1fr) minmax(280px, 0.9fr);
    order: -1;
  }

  .catalog-detail-stage {
    height: auto;
    min-height: 300px;
  }

  .catalog-item-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .catalog-detail {
    display: block;
  }

  .catalog-detail-stage {
    height: 240px;
    min-height: 0;
  }

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

@media (max-width: 620px) {
  .page-context-bar {
    height: auto;
    min-height: 48px;
  }

  .brand-lockup {
    width: 184px;
    max-width: 45vw;
  }

  .pedia-topbar .top-actions {
    gap: 6px;
  }

  .pedia-browser {
    grid-template-columns: minmax(0, 1fr);
    width: calc(100% - 16px);
    gap: 8px;
  }

  .pedia-sections button {
    grid-template-columns: 22px auto;
    gap: 7px;
    min-height: 46px;
    padding: 9px 8px;
    text-align: center;
  }

  .pedia-section-icon {
    width: 20px;
    height: 20px;
  }

  .catalog-item {
    grid-template-columns: 82px minmax(0, 1fr);
    min-height: 102px;
    padding: 9px;
  }

  .catalog-item-stage {
    width: 82px;
    height: 82px;
  }

  .catalog-detail-copy {
    padding: 18px;
  }

  .catalog-detail h1 {
    font-size: 24px;
  }
}

@media (max-width: 520px) {
  .catalog-item-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .catalog-detail-stage {
    height: 220px;
  }
}

/* Shared corner system. Outer shells own clipping so their changing or
   scrolling contents follow the same silhouette without becoming pill-like. */
button,
select,
.top-link,
.replay-overlay-button,
.playground-launch-button,
.playground-back,
.replay-card-overlay-action,
.rating-replay-link,
.leaderboard-replay-close,
.replay-model-select {
  border-radius: var(--radius-control);
}

input,
textarea {
  border-radius: var(--radius-compact);
}

.replay-card-mount:empty,
.run-card,
.diorama-frame,
.rating-table,
.pedia-sections,
.pedia-about,
.playground-shell,
.playground-stage,
.spawn-supply,
.playground-control-overlay,
.challenge-levels,
.challenge-replay-panel,
.challenge-replay-card .replay-card-solution,
.leaderboard-sections,
.leaderboard-replay-dialog {
  border-radius: var(--radius-surface);
}

.replay-card-mount:empty,
.run-card,
.diorama-frame,
.pedia-sections,
.playground-shell,
.playground-stage,
.spawn-supply,
.playground-control-overlay,
.challenge-levels,
.challenge-replay-panel,
.challenge-replay-card .replay-card-solution,
.leaderboard-sections,
.leaderboard-replay-dialog {
  overflow: hidden;
}

.scene-viewport canvas {
  border-radius: calc(var(--radius-surface) - 1px);
}

.solution-step,
.touch-controls button {
  border-radius: var(--radius-control);
}

.model-icon,
.run-letter,
.camera-interaction-hint,
.solution-loadout-choice,
.solution-loadout-icon,
kbd {
  border-radius: var(--radius-compact);
}

/* Segmented selectors are one rounded control, not a stack of rounded rows. */
.challenge-levels > button,
.pedia-sections > button,
.leaderboard-sections > button,
.spawn-supply-items button {
  border-radius: 0;
}

.challenge-levels,
.pedia-sections,
.leaderboard-sections {
  overflow: visible;
}

.challenge-levels > button:first-child,
.pedia-sections > button:first-child,
.leaderboard-sections > button:first-child {
  border-radius: var(--radius-surface) 0 0 var(--radius-surface);
}

.challenge-levels > button:last-child,
.pedia-sections > button:last-child,
.leaderboard-sections > button:last-child {
  border-radius: 0 var(--radius-surface) var(--radius-surface) 0;
}

/* Playable JankEngine lab */

.playground-body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--page-background);
}

.playground-main {
  width: min(var(--page-max-width), calc(100% - 24px));
  margin: 0 auto;
  padding: 10px 0 20px;
}

.replay-overlay-button {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-height: 38px;
  padding: 10px 13px;
  border: 1px solid var(--black);
  box-shadow: var(--shadow-offset);
  font: 900 9px/1 var(--mono);
  letter-spacing: 0.09em;
  text-decoration: none;
}

/* Playground launches are secondary bonuses, not primary page actions. */
.playground-launch-button {
  gap: 7px;
  min-height: 30px;
  padding: 7px 9px;
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: var(--bg-elevated);
  box-shadow: none;
  font-size: 8px;
  letter-spacing: 0.075em;
}

.playground-launch-button > span:last-child {
  color: var(--gold);
}

.playground-launch-button:hover,
.playground-launch-button:focus-visible {
  border-color: var(--gold);
  color: var(--bg-page);
  background: var(--brand-hover);
  outline: none;
}

.playground-launch-button:hover > span:last-child,
.playground-launch-button:focus-visible > span:last-child {
  color: inherit;
}

.playground-launch-button:active {
  background: var(--brand-pressed);
}

.playground-back {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 7;
  border-color: var(--black);
  color: var(--gold);
  background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
  backdrop-filter: blur(7px);
}

.playground-back:hover,
.playground-back:focus-visible {
  border-color: var(--black);
  color: var(--black);
  background: var(--brand-hover);
  outline: none;
}

.playground-back:active {
  background: var(--brand-pressed);
}

.playground-shell {
  height: calc(100vh - 100px);
  height: calc(100dvh - 100px);
  min-height: 560px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.playground-game {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
  min-width: 0;
}

.playground-stage {
  --playground-controls-width: min(370px, calc(100% - 180px));
  --playground-overlay-height: 106px;
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #a8d9ea;
  outline: none;
}

.playground-stage[data-playground-orbit] {
  cursor: grab;
  touch-action: pan-y;
}

.playground-stage[data-playground-orbit].is-orbiting {
  cursor: grabbing;
}

.playground-stage[data-playground-orbit]:focus-visible,
.playground-stage[data-playground-orbit].is-orbiting {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

.playground-stage:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

.playground-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.scene-transition {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 1;
  transition: opacity 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.scene-transition.is-leaving {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .scene-transition {
    transition-duration: 1ms;
  }
}

.spawn-supply {
  position: absolute;
  right: calc(var(--playground-controls-width) + 20px);
  bottom: 10px;
  left: 10px;
  z-index: 7;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  width: auto;
  overflow: hidden;
  opacity: 1;
  visibility: visible;
}

.spawn-supply,
.playground-control-overlay {
  height: var(--playground-overlay-height);
  border: 1px solid rgba(242, 232, 204, 0.38);
  background: color-mix(in srgb, var(--bg-surface) 72%, transparent);
  backdrop-filter: blur(5px);
}

.spawn-supply-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  min-height: 0;
  height: 100%;
  padding: 7px 8px;
  border-right: 1px solid rgba(242, 232, 204, 0.2);
  color: var(--muted);
  font-size: 6px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.spawn-supply-head output {
  color: var(--gold);
  font: 800 6px var(--mono);
}

.spawn-supply-items {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  min-width: 0;
}

.spawn-supply-items button {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 4px;
  align-items: center;
  min-width: 0;
  min-height: 0;
  padding: 5px 7px;
  border: 0;
  border-right: 1px solid rgba(242, 232, 204, 0.2);
  border-bottom: 1px solid rgba(242, 232, 204, 0.2);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--mono);
  text-align: left;
  touch-action: manipulation;
}

.spawn-supply-items button:nth-child(4n) {
  border-right: 0;
}

.spawn-supply-items button:nth-child(n + 5) {
  border-bottom: 0;
}

.spawn-supply-items button:hover,
.spawn-supply-items button:focus-visible {
  background: var(--brand-hover);
  color: var(--black);
  outline: none;
}

.spawn-supply-items button:disabled {
  color: #656659;
  cursor: not-allowed;
  opacity: 0.58;
}

.spawn-supply-items button:disabled:hover {
  background: transparent;
}

.spawn-supply-items button span,
.spawn-supply-items button strong,
.spawn-supply-items button small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spawn-supply-items button strong {
  font-size: 7px;
  letter-spacing: 0.05em;
}

.spawn-supply-items button small {
  color: var(--muted);
  font-size: 6px;
}

.spawn-supply-items button:hover small,
.spawn-supply-items button:focus-visible small {
  color: var(--bg-page);
}

.spawn-item-icon {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  justify-self: center;
  transform-origin: center;
}

.spawn-item-icon::before,
.spawn-item-icon::after {
  position: absolute;
  box-sizing: border-box;
  content: "";
}

.spawn-item-icon.is-crate {
  width: 17px;
  height: 17px;
  border: 1px solid #d2a044;
  background:
    linear-gradient(90deg, transparent 26%, rgb(255 226 139 / 20%) 27% 31%, transparent 32% 68%, rgb(82 49 16 / 28%) 69% 73%, transparent 74%),
    linear-gradient(#a97728 0 23%, #8d5f20 24% 76%, #724719 77%);
  box-shadow: inset 0 0 0 2px rgb(244 192 83 / 22%);
}

.spawn-item-icon.is-crate::before,
.spawn-item-icon.is-crate::after {
  top: 2px;
  bottom: 2px;
  left: 7px;
  width: 2px;
  background: #d7a849;
  transform: rotate(45deg);
}

.spawn-item-icon.is-crate::after {
  transform: rotate(-45deg);
}

.spawn-item-icon.is-barrel {
  width: 14px;
  height: 19px;
  border: 1px solid #4f4d45;
  border-radius: 45% 45% 35% 35% / 16% 16% 22% 22%;
  background:
    linear-gradient(
      to bottom,
      #575b57 0 13%,
      #bd7d32 14% 40%,
      #555a56 41% 52%,
      #aa6829 53% 86%,
      #4e534f 87%
    );
  box-shadow: inset 2px 0 rgb(255 210 121 / 24%), inset -2px 0 rgb(55 30 13 / 20%);
}

.spawn-item-icon.is-barrel::before {
  top: 1px;
  right: 2px;
  left: 2px;
  height: 3px;
  border: 1px solid #474b48;
  border-radius: 50%;
  background: #8e5c29;
}

.spawn-item-icon.is-barrel::after {
  right: 2px;
  bottom: 1px;
  left: 2px;
  height: 3px;
  border-bottom: 1px solid #3e423f;
  border-radius: 50%;
}

.spawn-item-icon.is-plank {
  width: 20px;
  height: 7px;
  border: 1px solid #d3a45b;
  background: linear-gradient(#bd8846 0 45%, #98642e 46% 58%, #ae7839 59%);
  box-shadow: 0 1px 0 #67401f;
  transform: rotate(-5deg);
}

.spawn-item-icon.is-plank::before,
.spawn-item-icon.is-plank::after {
  top: 2px;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #5d3d21;
}

.spawn-item-icon.is-plank::before {
  left: 2px;
}

.spawn-item-icon.is-plank::after {
  right: 2px;
}

.spawn-item-icon.is-rock {
  width: 18px;
  height: 15px;
  background: linear-gradient(145deg, #a0a59b 0 32%, #7b8279 33% 67%, #636a64 68%);
  clip-path: polygon(18% 7%, 73% 0, 100% 38%, 87% 86%, 30% 100%, 0 64%);
  transform: rotate(-8deg);
}

.spawn-item-icon.is-rock::before {
  top: 3px;
  left: 4px;
  width: 7px;
  height: 4px;
  background: rgb(224 229 215 / 30%);
  clip-path: polygon(20% 0, 100% 22%, 72% 100%, 0 75%);
}

.spawn-item-icon.is-rope {
  width: 18px;
  height: 18px;
  border: 2px solid #c69a55;
  border-radius: 50%;
  background: #76512d;
  box-shadow:
    inset 0 0 0 2px #e0b96d,
    inset 0 0 0 4px #80592f,
    inset 0 0 0 5px #d4aa60;
}

.spawn-item-icon.is-rope::before {
  inset: 6px;
  border-radius: 50%;
  background: #403324;
}

.spawn-item-icon.is-rope::after {
  right: -1px;
  bottom: 1px;
  width: 6px;
  height: 3px;
  border-bottom: 2px solid #d6ac64;
  border-radius: 50%;
  transform: rotate(27deg);
}

.spawn-item-icon.is-spring {
  width: 16px;
  height: 19px;
  border: 0;
  background:
    repeating-linear-gradient(
      160deg,
      transparent 0 2px,
      #d5d7cd 2px 4px,
      #6d7473 4px 5px,
      transparent 5px 7px
    );
}

.spawn-item-icon.is-spring::before,
.spawn-item-icon.is-spring::after {
  right: 0;
  left: 0;
  height: 3px;
  border: 1px solid #626968;
  border-radius: 2px;
  background: linear-gradient(#d7d9cf, #858d8a);
}

.spawn-item-icon.is-spring::before {
  top: 0;
}

.spawn-item-icon.is-spring::after {
  bottom: 0;
}

.spawn-item-icon.is-tarp {
  width: 19px;
  height: 15px;
  border: 1px solid #244f4d;
  border-radius: 2px;
  background:
    linear-gradient(135deg, transparent 47%, #7fb2ad 48% 53%, transparent 54%),
    linear-gradient(165deg, #57938e 0 45%, #39736f 46%);
  box-shadow: inset 0 0 0 1px rgb(202 235 228 / 24%);
  clip-path: polygon(5% 0, 100% 0, 91% 100%, 0 100%);
  transform: skewX(-8deg);
}

.spawn-item-icon.is-tarp::before {
  top: 1px;
  right: 1px;
  width: 6px;
  height: 5px;
  border-left: 1px solid #2a5a57;
  border-bottom: 1px solid #2a5a57;
  background: #70aaa4;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.spawn-item-icon.is-stone-block {
  width: 18px;
  height: 16px;
  border: 1px solid #6e7269;
  background:
    linear-gradient(90deg, transparent 0 47%, #73776f 48% 54%, transparent 55%),
    linear-gradient(#b3b4a7 0 44%, #7e8278 45% 53%, #999b90 54%);
  box-shadow: inset -2px -2px rgb(49 52 48 / 28%);
}

.spawn-item-icon.is-stone-block::before {
  top: 2px;
  left: 2px;
  width: 6px;
  height: 3px;
  background: rgb(233 233 216 / 24%);
}

.spawn-item-icon.is-stone-block::after {
  right: 2px;
  bottom: 2px;
  width: 6px;
  height: 3px;
  background: rgb(48 52 48 / 16%);
}

.playground-control-overlay {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 7;
  width: var(--playground-controls-width);
}

.playground-keys {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  height: 100%;
  margin: 0;
}

.playground-player-controls {
  display: grid;
  grid-template-columns: 30px max-content;
  gap: 8px;
  align-items: center;
  min-height: 0;
  padding: 5px 7px;
  border-bottom: 1px solid rgba(242, 232, 204, 0.18);
}

.playground-player-label {
  display: flex;
  align-items: center;
}

.playground-keys dt,
.playground-keys dd {
  margin: 0;
}

.playground-player-avatar {
  width: 28px;
  height: 38px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.34));
}

.playground-control-groups {
  display: grid;
  grid-template-columns: repeat(4, max-content);
  gap: 8px;
  align-items: end;
  justify-content: start;
}

.playground-key-group {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.playground-key-group small {
  color: var(--muted);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.playground-key-cluster {
  display: flex;
  gap: 2px;
}


.playground-keys kbd {
  box-sizing: border-box;
  display: inline-grid;
  place-items: center;
  min-width: 29px;
  min-height: 27px;
  padding: 3px 5px;
  border: 1px solid #626650;
  border-bottom-width: 2px;
  background: var(--bg-elevated);
  color: var(--ink);
  font: 800 8px var(--mono);
  white-space: nowrap;
}

.touch-controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  display: none;
  grid-template-columns: repeat(4, 42px);
  grid-template-rows: repeat(2, 42px);
  gap: 4px;
}

.touch-controls[data-player="1"] {
  right: auto;
  left: 12px;
}

.touch-controls[data-player="0"] .touch-action,
.touch-controls[data-player="0"] .touch-special,
.touch-controls[data-player="0"] .touch-jump {
  border-color: #d65c49;
  color: #ff9d8d;
}

.touch-controls[data-player="1"] .touch-action,
.touch-controls[data-player="1"] .touch-special,
.touch-controls[data-player="1"] .touch-jump {
  border-color: #4e9fd1;
  color: #9bdcff;
}

.touch-controls button {
  border: 1px solid rgba(242, 232, 204, 0.5);
  background: color-mix(in srgb, var(--bg-surface) 78%, transparent);
  color: var(--ink);
  font: 700 16px var(--mono);
  touch-action: none;
}

.touch-controls [data-control="up"] {
  grid-column: 2;
}

.touch-controls [data-control="left"] {
  grid-column: 1;
}

.touch-controls [data-control="down"] {
  grid-column: 2;
}

.touch-controls [data-control="right"] {
  grid-column: 3;
}

.touch-controls .touch-action {
  grid-column: 3;
  grid-row: 1;
  border-color: var(--gold);
  color: var(--gold);
}

.touch-controls .touch-jump {
  grid-column: 4;
  grid-row: 1;
  border-color: #7bcbe8;
  color: #a9e6f7;
  font-size: 10px;
}

.touch-controls .touch-special {
  grid-column: 4;
  grid-row: 2;
  border-color: var(--gold);
  color: var(--gold);
  font-size: 9px;
}

@media (max-width: 900px) {
  .playground-shell {
    min-height: 520px;
  }
}

@media (max-width: 680px),
  (hover: none) and (pointer: coarse) and (max-width: 1024px) {
  .playground-main {
    width: min(100% - 16px, 1380px);
  }

  .playground-shell,
  .playground-game {
    height: auto;
  }

  .playground-game {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: 430px auto;
    gap: 8px;
  }

  .playground-stage {
    grid-column: 1 / -1;
    min-height: 430px;
  }

  .spawn-supply {
    right: 6px;
    bottom: 6px;
    left: 6px;
    grid-template-columns: 68px minmax(0, 1fr);
    width: auto;
  }

  .playground-control-overlay {
    display: none;
  }

  .touch-controls {
    position: static;
    display: grid;
    width: min(180px, 100%);
    grid-template-columns: repeat(4, minmax(0, 42px));
  }

  .touch-controls[data-player="0"] {
    grid-column: 2;
    justify-self: end;
  }

  .touch-controls[data-player="1"] {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
  }
}

@media (max-width: 360px) {
  .playground-game {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 430px repeat(2, auto);
  }

  .touch-controls[data-player="0"],
  .touch-controls[data-player="1"] {
    grid-column: 1;
  }

  .touch-controls[data-player="0"] {
    grid-row: 2;
  }

  .touch-controls[data-player="1"] {
    grid-row: 3;
  }
}

@media (hover: none) and (pointer: coarse) and (orientation: landscape) and
  (min-width: 361px) and (max-height: 500px) {
  .playground-game {
    grid-template-rows: 320px auto;
  }

  .playground-stage {
    min-height: 320px;
  }
}

/* Challenge browser */

.challenge-browser {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 20px;
  width: min(var(--page-max-width), calc(100% - 24px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.challenge-levels {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  overflow: visible;
}

.challenge-levels button {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, auto);
  justify-content: center;
  gap: 7px;
  align-items: center;
  min-height: var(--page-context-bar-height);
  padding: 6px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-surface) 78%, transparent);
  color: var(--muted);
  font: 800 9px/1.35 var(--mono);
  letter-spacing: 0.08em;
  text-align: left;
  cursor: pointer;
}

.challenge-levels button:last-child {
  border-right: 0;
}

.challenge-levels button strong {
  color: var(--text-muted);
  font: 900 24px/1 var(--sans);
}

.challenge-levels button:hover,
.challenge-levels button:focus-visible {
  background: var(--brand-hover);
  color: var(--bg-page);
  outline: none;
}

.challenge-levels button.is-active {
  background: var(--gold);
  color: var(--bg-page);
  outline: none;
}

.challenge-levels button.is-active::after {
  position: absolute;
  bottom: -8px;
  left: 50%;
  width: 16px;
  height: 16px;
  background: var(--gold);
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.challenge-levels button:hover strong,
.challenge-levels button:focus-visible strong,
.challenge-levels button.is-active strong {
  color: var(--bg-page);
}

.challenge-replay-panel {
  min-width: 0;
  border: 0;
  background: transparent;
}

.duel-browser {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
}

.duel-selector {
  position: absolute;
  z-index: 7;
  top: 18px;
  right: 18px;
  left: 18px;
  display: grid;
  grid-template-columns: 34px minmax(0, 456px) 34px;
  justify-content: center;
  align-items: center;
  gap: var(--control-cluster-gap);
  width: auto;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.duel-matchups {
  min-width: 0;
  width: 100%;
  max-width: none;
  display: flex;
  justify-content: safe center;
  gap: var(--control-cluster-gap);
  overflow-x: auto;
  padding: 1px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.duel-matchups::-webkit-scrollbar {
  display: none;
}

.duel-match-card {
  position: relative;
  flex: 0 0 220px;
  min-width: 0;
  max-width: 220px;
  height: 48px;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 4px 7px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  color: var(--text-primary);
  background: var(--bg-elevated);
  cursor: pointer;
  text-align: center;
  scroll-snap-align: center;
}

.duel-match-card:hover,
.duel-match-card:focus-visible {
  border-color: var(--brand-hover);
  outline: none;
}

.duel-match-card[aria-selected="true"] {
  border-color: var(--brand-yellow);
  color: var(--text-primary);
  background: color-mix(in srgb, var(--bg-elevated) 92%, var(--brand-yellow));
}

.duel-match-card-matchup {
  display: grid;
  justify-self: center;
  justify-items: center;
  gap: 0;
}

.duel-match-card-model {
  min-width: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  align-items: center;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.duel-match-card-model .model-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  font-size: 4px;
}

.duel-match-card-matchup > small {
  margin-left: 0;
  color: var(--text-muted);
  font-size: 6px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.12em;
}

.duel-match-card-duration {
  position: absolute;
  right: 7px;
  bottom: 4px;
  color: var(--text-secondary);
  font-size: 6px;
  white-space: nowrap;
}

.duel-matchups-status {
  flex: 1 0 100%;
  display: grid;
  place-items: center;
  min-height: 48px;
  margin: 0;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.duel-selector-nav {
  display: grid;
  place-items: center;
  width: 34px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  color: var(--gold);
  background: var(--bg-page);
  cursor: pointer;
  font-size: 24px;
  font-weight: 850;
  line-height: 1;
}

.duel-selector-nav:not(:disabled):hover,
.duel-selector-nav:not(:disabled):focus-visible {
  border-color: var(--brand-hover);
  color: var(--bg-page);
  background: var(--brand-hover);
  outline: none;
}

.duel-selector-nav:disabled {
  border-color: var(--border-subtle);
  color: var(--text-muted);
  background: var(--bg-elevated);
  cursor: not-allowed;
  opacity: 0.55;
}

.duel-solution-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: var(--control-cluster-gap);
  margin-top: var(--control-cluster-gap);
}

.challenge-replay-card .duel-solution-grid .replay-card-solution {
  min-width: 0;
  width: 100%;
  margin: 0;
}

.duel-solution-model {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  padding-left: 12px;
  border-left: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duel-solution-model .model-icon {
  width: 18px;
  height: 14px;
  flex: 0 0 18px;
  font-size: 5px;
}

@media (max-width: 760px) {
  .duel-solution-grid {
    grid-template-columns: 1fr;
  }
}

.challenge-replay-card .replay-card-frame {
  height: clamp(520px, calc(100vh - 286px), 980px);
  height: clamp(520px, calc(100dvh - 286px), 980px);
  aspect-ratio: auto;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-surface);
  background: transparent;
  box-shadow: none;
}

.challenge-replay-card .challenge-replay-embed {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: #a8d9ea;
  color-scheme: light;
}

.challenge-replay-card {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.challenge-replay-card .replay-card-corner {
  top: 12px;
  left: 12px;
}

.challenge-replay-card .replay-model-select {
  width: min(280px, 54vw);
  border-color: var(--border-strong);
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--bg-page) 88%, transparent);
}

.challenge-replay-card .replay-model-select-shell > .model-icon {
  border-color: var(--border-strong);
  box-shadow: none;
}

.challenge-replay-card .replay-card-unavailable {
  inset: 1px;
  border-radius: calc(var(--radius-surface) - 1px);
}

.challenge-replay-card .replay-card-unavailable-card {
  position: relative;
  z-index: 1;
}

.challenge-replay-card .scene-transport {
  grid-template-columns: 28px minmax(0, 1fr) max-content 28px;
  gap: var(--control-cluster-gap);
  right: 1px;
  bottom: 1px;
  left: 1px;
  padding: 26px 9px 9px;
  border-radius: 0 0 calc(var(--radius-surface) - 1px)
    calc(var(--radius-surface) - 1px);
  background: linear-gradient(transparent, rgba(8, 9, 9, 0.88));
}

.challenge-replay-card .scene-transport-restart {
  font-size: 13px;
}

.challenge-replay-card .replay-card-solution {
  margin: var(--control-cluster-gap) 0 0;
}

.replay-card-overlay-action {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 7;
}

.challenge-replay-card .replay-card-overlay-action {
  top: 12px;
  right: 12px;
  border-radius: var(--radius-control);
  box-shadow: none;
}

.replay-card-overlay-action:hover,
.replay-card-overlay-action:focus-visible {
  background: var(--brand-hover);
  outline: none;
}

.replay-card-overlay-action:active {
  background: var(--brand-pressed);
}

html:has(.playground-preview-body),
.playground-preview-body {
  height: 100%;
  overflow: hidden;
}

.playground-preview-body .topbar,
.playground-preview-body .playground-back,
.playground-preview-body .playground-control-overlay,
.playground-preview-body .spawn-supply,
.playground-preview-body .touch-controls {
  display: none;
}

.playground-preview-body .playground-main,
.playground-preview-body .playground-shell,
.playground-preview-body .playground-game {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.playground-preview-body .playground-main {
  padding: 0;
}

.playground-preview-body .playground-shell {
  display: block;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.playground-preview-body .playground-game {
  grid-template-rows: minmax(0, 1fr) auto;
  border: 0;
}

.playground-preview-body .playground-stage {
  min-height: 0;
  border-radius: 0;
}

.playground-preview-body .playground-stage[data-replay-loading="true"] > canvas:not(.scene-transition) {
  visibility: hidden;
}

.preview-replay-transport {
  display: none;
}

.preview-replay-status {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 18;
  display: grid;
  gap: 5px;
  width: min(280px, calc(100% - 32px));
  padding: 16px;
  border: 1px solid var(--gold);
  background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
  color: var(--ink);
  font: 700 10px/1.4 var(--mono);
  text-align: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.preview-replay-status[hidden] {
  display: none;
}

.preview-replay-status strong {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.preview-replay-status span {
  color: var(--muted);
}

.playground-preview-body .preview-replay-transport {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) max-content 28px;
  gap: var(--control-cluster-gap);
  padding: 20px 8px 8px;
  background: linear-gradient(transparent, rgba(8, 9, 6, 0.86));
}

.playground-preview-body.replay-card-embed .preview-replay-transport {
  display: none;
}

.playground-preview-body .scene-transport-restart {
  font-size: 13px;
}

.camera-interaction-hint {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 8;
  padding: 6px 9px;
  border: 1px solid rgba(242, 232, 204, 0.2);
  background: color-mix(in srgb, var(--bg-surface) 72%, transparent);
  color: rgba(242, 232, 204, 0.78);
  font: 500 11px/1.2 var(--sans);
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 180ms ease, transform 180ms ease;
  user-select: none;
  backdrop-filter: blur(6px);
}

.camera-interaction-hint.is-dismissing {
  opacity: 0;
  transform: translate(-50%, -3px);
}

@media (max-width: 720px) {
  .challenge-browser {
    grid-template-columns: minmax(0, 1fr);
    width: calc(100% - 16px);
    margin: 0 auto;
    padding-top: 8px;
  }

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

  .challenge-levels button {
    grid-template-columns: 28px minmax(0, 1fr);
    justify-content: start;
    min-height: 48px;
    padding: 7px 9px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    text-align: left;
  }

  .challenge-levels button:nth-child(2n) {
    border-right: 0;
  }

  .challenge-levels button:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

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

  .challenge-levels button.is-active::after {
    display: none;
  }

  .duel-selector {
    top: 10px;
    right: 10px;
    left: 10px;
    grid-template-columns: 30px minmax(0, 1fr) 30px;
    gap: var(--control-cluster-gap);
    height: 48px;
    min-height: 48px;
    padding: 0;
  }

  .duel-selector-nav {
    width: 30px;
    height: 40px;
    font-size: 22px;
  }

  .duel-match-card {
    flex-basis: min(220px, calc(100vw - 102px));
    max-width: min(220px, calc(100vw - 102px));
    height: 48px;
    min-height: 48px;
    padding: 4px 7px;
  }

  .duel-matchups {
    width: 100%;
    max-width: none;
    justify-content: flex-start;
  }

  .duel-matchups-status {
    min-height: 48px;
  }

  .challenge-replay-card .replay-card-frame {
    height: clamp(390px, calc(100vh - 250px), 620px);
    height: clamp(390px, calc(100dvh - 250px), 620px);
    padding: 0;
  }

  .challenge-replay-card .replay-card-unavailable {
    inset: 1px;
  }

  .challenge-replay-card .replay-card-unavailable-card {
    padding: 22px 16px 20px;
  }
}

/* Standalone leaderboard */

.leaderboard-page {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 20px;
  width: min(var(--page-max-width), calc(100% - 24px));
  min-height: calc(100vh - 68px);
  min-height: calc(100dvh - 68px);
  padding: 24px 0 36px;
}

.leaderboard-sections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  overflow: visible;
}

.leaderboard-sections button {
  position: relative;
  display: grid;
  grid-template-columns: 20px auto;
  justify-content: center;
  gap: 8px;
  align-items: center;
  min-height: var(--page-context-bar-height);
  padding: 6px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: color-mix(in srgb, var(--bg-surface) 78%, transparent);
  font: 800 10px/1 var(--mono);
  letter-spacing: 0.08em;
  text-align: left;
  cursor: pointer;
}

.leaderboard-sections button:last-child {
  border-right: 0;
}

.leaderboard-section-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.leaderboard-sections button:hover,
.leaderboard-sections button:focus-visible {
  color: var(--bg-page);
  background: var(--brand-hover);
  outline: none;
}

.leaderboard-sections button.is-active {
  color: var(--bg-page);
  background: var(--gold);
  outline: none;
}

.pedia-sections button.is-active {
  background: var(--gold);
}

.pedia-sections button.is-active::after,
.leaderboard-sections button.is-active::after {
  position: absolute;
  bottom: -8px;
  left: 50%;
  width: 16px;
  height: 16px;
  background: var(--gold);
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.leaderboard-content {
  min-width: 0;
}

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

.leaderboard-table-panel {
  min-width: 0;
}

.leaderboard-table-panel .rating-table {
  height: clamp(500px, calc(100vh - 182px), 1100px);
  height: clamp(500px, calc(100dvh - 182px), 1100px);
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-color: var(--gold) var(--bg-surface);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.leaderboard-table-panel .rating-table::-webkit-scrollbar {
  width: 10px;
}

.leaderboard-table-panel .rating-table::-webkit-scrollbar-track {
  background: var(--bg-surface);
}

.leaderboard-table-panel .rating-table::-webkit-scrollbar-thumb {
  border: 2px solid var(--bg-surface);
  background: var(--gold);
}

.leaderboard-table-panel .rating-row.header {
  position: sticky;
  top: 0;
  z-index: 2;
}

.arena-summary-row {
  grid-template-columns: 48px minmax(0, 1.2fr) minmax(54px, 0.5fr) minmax(54px, 0.5fr) minmax(54px, 0.55fr) 24px;
  column-gap: 8px;
}

.arena-drilldown .rating-drilldown-row {
  grid-template-columns: 48px minmax(108px, 1.2fr) 0.5fr 0.5fr 0.55fr 84px;
}

.objective-summary-row {
  grid-template-columns: 48px minmax(0, 1fr) minmax(72px, 0.3fr) 24px;
  column-gap: 10px;
}

.objective-drilldown .rating-drilldown-row {
  grid-template-columns: 48px minmax(108px, 1.2fr) minmax(78px, 0.55fr) minmax(68px, 0.55fr) minmax(118px, 0.72fr) 84px;
}

.duel-summary-row {
  grid-template-columns: 48px minmax(108px, 1.2fr) 0.45fr 0.45fr 84px 24px;
  column-gap: 8px;
}

.duel-drilldown .rating-drilldown-row {
  grid-template-columns: 48px minmax(108px, 1.2fr) 0.45fr 0.45fr 84px;
}

.leaderboard-table-panel .rating-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rating-entry {
  display: block;
  background: var(--bg-surface);
}

.rating-entry > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.rating-entry > summary::-webkit-details-marker {
  display: none;
}

.rating-entry > summary:hover {
  background: var(--bg-elevated);
}

.rating-entry > summary:focus-visible {
  z-index: 1;
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

.rating-entry[open] > summary {
  border-bottom-color: var(--border-strong);
  background: var(--bg-elevated);
}

.rating-disclosure {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  align-self: center;
  justify-self: center;
  color: var(--gold);
}

.rating-disclosure::before {
  box-sizing: border-box;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(45deg);
  transition: transform 120ms ease;
}

.rating-entry[open] .rating-disclosure::before {
  transform: rotate(225deg);
}

.rating-drilldown {
  padding: 7px 14px 11px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-page);
}

.rating-drilldown-row {
  display: grid;
  min-height: 32px;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--ink);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

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

.rating-drilldown-row.header {
  min-height: 25px;
  color: var(--muted);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.rating-replay-link {
  justify-self: start;
  padding: 4px 6px;
  border: 1px solid var(--border-strong);
  color: var(--ink);
  background: var(--bg-elevated);
  font: 800 7px/1 var(--sans);
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
}

.rating-replay-link:hover,
.rating-replay-link:focus-visible {
  border-color: var(--brand-hover);
  color: var(--bg-page);
  background: var(--brand-hover);
}

.rating-replay-unavailable {
  color: #777461 !important;
  font-size: 7px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.objective-time,
.objective-distance {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.objective-status {
  width: fit-content;
  border: 1px solid var(--border-strong);
  padding: 3px 6px;
  font-size: 7px;
  font-weight: 850;
  letter-spacing: 0.055em;
  line-height: 1;
  white-space: nowrap;
}

.objective-status.is-succeeded {
  border-color: var(--success);
  color: var(--success);
}

.objective-status.is-failed {
  border-color: var(--danger);
  color: var(--danger);
}

.objective-status.is-unplayed {
  color: var(--text-muted);
}

.objective-time.is-best {
  color: var(--gold);
  font-weight: 900;
}

.leaderboard-sort-button {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.leaderboard-sort-button i {
  color: #686651;
  font-size: 9px;
  font-style: normal;
}

.leaderboard-sort-button[data-direction="asc"],
.leaderboard-sort-button[data-direction="desc"] {
  color: var(--gold);
}

.leaderboard-sort-button[data-direction="asc"] i,
.leaderboard-sort-button[data-direction="desc"] i,
.leaderboard-sort-button:hover i,
.leaderboard-sort-button:focus-visible i {
  color: var(--gold);
}

.leaderboard-sort-button:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 3px;
}

.rating-row.header > span:first-child,
.rating-row.header > span:first-child .leaderboard-sort-button {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.rank-medal {
  position: absolute;
  right: calc(50% + 5px);
  width: 18px;
  height: 20px;
  display: grid;
  place-items: center;
}

.rank-medal svg {
  width: 18px;
  height: 20px;
  overflow: visible;
  fill: currentColor;
  stroke: var(--bg-surface);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.25;
}

.rank-medal-ribbon {
  opacity: 0.68;
}

.rank-medal.is-gold {
  color: var(--brand-yellow);
}

.rank-medal.is-silver {
  color: #c7cccf;
}

.rank-medal.is-bronze {
  color: #b97932;
}

.rating-rank-number {
  color: inherit;
  font: inherit;
  font-variant-numeric: inherit;
}

/* Leaderboard data stays quiet except for semantic rating movement and podium medals. */
.leaderboard-table-panel .rating-row > span,
.leaderboard-table-panel .rating-drilldown-row > span,
.leaderboard-table-panel .leaderboard-sort-button,
.leaderboard-table-panel .leaderboard-sort-button i,
.leaderboard-table-panel .model-icon {
  color: var(--ink);
}

.leaderboard-table-panel .rating-row > .rating-delta.positive,
.leaderboard-table-panel .rating-drilldown-row > .rating-delta.positive {
  color: var(--green);
}

.leaderboard-table-panel .rating-row > .rating-delta.negative,
.leaderboard-table-panel .rating-drilldown-row > .rating-delta.negative {
  color: var(--red);
}

.leaderboard-table-panel .rank-medal.is-gold {
  color: var(--brand-yellow);
}

.leaderboard-table-panel .rank-medal.is-silver {
  color: #c7cccf;
}

.leaderboard-table-panel .rank-medal.is-bronze {
  color: #b97932;
}

.leaderboard-replay-dialog {
  width: min(900px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line-bright);
  color: var(--ink);
  background: var(--bg-page);
  box-shadow: var(--shadow-soft);
}

.leaderboard-replay-dialog::backdrop {
  background: rgba(5, 6, 4, 0.82);
  backdrop-filter: blur(2px);
}

.leaderboard-replay-heading {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elevated);
}

.leaderboard-replay-heading > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.leaderboard-replay-heading strong {
  overflow: hidden;
  font: 900 13px/1 var(--sans);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-replay-heading .model-identity {
  color: var(--muted);
  font: 700 9px/1 var(--sans);
  white-space: nowrap;
}

.leaderboard-replay-close {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid var(--border-strong);
  color: var(--ink);
  background: var(--bg-page);
  font: 700 20px/1 var(--sans);
  cursor: pointer;
}

.leaderboard-replay-close:hover,
.leaderboard-replay-close:focus-visible {
  border-color: var(--brand-hover);
  color: var(--bg-page);
  background: var(--brand-hover);
}

.leaderboard-replay-frame {
  width: 100%;
  height: min(68vh, 590px);
  display: block;
  border: 0;
  background: #91bceb;
}

.leaderboard-replay-transport {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) max-content 28px;
  gap: var(--control-cluster-gap);
  align-items: center;
  padding: 8px;
  border-top: 1px solid var(--line);
  background: var(--bg-elevated);
}

.leaderboard-replay-transport .scene-transport-play {
  min-height: 28px;
}

.leaderboard-replay-transport .scene-timecode {
  text-align: right;
}

@media (max-width: 620px) {
  .leaderboard-page {
    grid-template-columns: minmax(0, 1fr);
    width: calc(100% - 16px);
    gap: 8px;
    padding-top: 9px;
  }

  .leaderboard-sections button {
    grid-template-columns: 18px minmax(0, auto);
    gap: 5px;
    min-height: 44px;
    padding: 8px 5px;
    text-align: center;
  }

  .leaderboard-section-icon {
    width: 17px;
    height: 17px;
  }

  .pedia-sections button.is-active::after,
  .leaderboard-sections button.is-active::after {
    display: none;
  }
}

/* Primary and selected controls share one tactile warning-label press state. */
.pedia-sections button:active,
.challenge-levels button:active,
.leaderboard-sections button:active {
  color: var(--bg-page);
  background: var(--brand-pressed);
}

/* On narrow phones the brand and navigation get their own rows, preserving
   six full-size touch targets without hiding destinations or scrolling. */
@media (max-width: 560px) {
  .topbar {
    min-height: 0;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 8px 10px;
  }

  .topbar .brand-lockup {
    width: min(184px, 60vw);
    max-width: none;
  }

  .topbar .top-actions {
    flex: 0 0 100%;
    justify-content: space-between;
    gap: 4px;
    overflow: visible;
  }

  .topbar .top-link {
    flex: 0 0 44px;
  }

  .arena-summary-row,
  .duel-summary-row {
    grid-template-columns: 32px minmax(0, 1fr) 52px 24px;
    column-gap: 6px;
  }

  .arena-summary-row > :nth-child(4),
  .arena-summary-row > :nth-child(5),
  .duel-summary-row > :nth-child(4),
  .duel-summary-row > :nth-child(5) {
    display: none;
  }

  .rating-drilldown {
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .rating-drilldown-row {
    min-width: 560px;
  }
}

@media (max-width: 340px) {
  .topbar {
    gap: 6px;
    padding-inline: 6px;
  }
}

/* Large desktop readability
   High-density and zoomed-out widescreen displays can make compact interface
   labels render below a comfortable reading size. Preserve the composition,
   but give navigation, supporting copy, controls and data rows one more step. */
@media (min-width: 1600px) {
  .top-link {
    font-size: 15px;
  }

  .site-footer-notice,
  .replay-card-unavailable-detail {
    font-size: 14px;
  }

  .solution-loadout-label,
  .solution-step-meta,
  .solution-step-intent strong,
  .scene-timecode,
  .card-vote.is-vote-result small {
    font-size: 9px;
  }

  .solution-drawer summary strong,
  .replay-model-select {
    font-size: 11px;
  }

  .solution-drawer summary,
  .rating-row {
    font-size: 12px;
  }

  .solution-loadout-choice strong,
  .solution-step-intent,
  .solution-step pre,
  .rating-row.header {
    font-size: 10px;
  }

  .pedia-sections button,
  .leaderboard-sections button {
    font-size: 13px;
  }

  .pedia-about-inner {
    width: min(1240px, 100%);
  }

  .pedia-about h1 {
    font-size: 46px;
  }

  .pedia-about .about-lede {
    max-width: 920px;
    font-size: 19px;
  }

  .about-section h2 {
    font-size: 18px;
  }

  .about-mode-list > div {
    grid-template-columns: 128px minmax(0, 1fr);
  }

  .about-mode-list dt,
  .about-detail-columns h3 {
    font-size: 13px;
  }

  .about-mode-list dd,
  .about-detail-columns p,
  .pedia-legal-notice p {
    font-size: 14px;
  }

  .about-playground-note {
    font-size: 13px !important;
  }

  .about-run-main li {
    min-height: 178px;
    padding: 22px;
  }

  .about-run-main span {
    font-size: 11px;
  }

  .about-run-main strong {
    font-size: 13px;
  }

  .about-run-main p {
    font-size: 12px;
  }

  .catalog-item-copy strong {
    font-size: 14px;
  }

  .catalog-item-tag {
    font-size: 9px;
  }

  .catalog-detail-class,
  .catalog-detail-facts dd,
  .catalog-detail-states h2 {
    font-size: 11px;
  }

  .catalog-detail-facts dt,
  .catalog-state-list span {
    font-size: 10px;
  }

  .replay-overlay-button,
  .playground-launch-button {
    font-size: 11px;
  }

  .spawn-supply-head,
  .spawn-supply-head output,
  .spawn-supply-items button small,
  .duel-match-card-matchup > small,
  .duel-match-card-duration {
    font-size: 9px;
  }

  .spawn-supply-items button strong,
  .playground-key-group small,
  .rating-drilldown-row.header,
  .rating-replay-link,
  .rating-replay-unavailable,
  .objective-status {
    font-size: 10px;
  }

  .playground-keys kbd,
  .duel-solution-model {
    font-size: 11px;
  }

  .challenge-levels button,
  .duel-matchups-status,
  .rating-drilldown-row,
  .leaderboard-sort-button i,
  .leaderboard-replay-heading .model-identity {
    font-size: 12px;
  }

  .scene-transport-play {
    font-size: 10px;
  }

  .vote-actions kbd {
    font-size: 11px;
  }

  .vote-actions span,
  .camera-interaction-hint {
    font-size: 13px;
  }

  .challenge-levels button {
    grid-template-columns: 46px minmax(0, auto);
  }

  .duel-match-card {
    flex: 0 0 320px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    max-width: 320px;
    height: 56px;
    min-height: 56px;
    padding: 6px 10px;
  }

  .duel-selector {
    grid-template-columns: 40px minmax(0, 648px) 40px;
    gap: 10px;
    height: 56px;
    min-height: 56px;
  }

  .duel-selector-nav {
    width: 40px;
    height: 50px;
  }

  .duel-matchups {
    max-width: 648px;
  }

  .duel-match-card-matchup {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .duel-match-card-model {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .duel-match-card-model:first-child {
    justify-content: flex-end;
  }

  .duel-match-card-model:last-child {
    justify-content: flex-start;
  }

  .duel-match-card-duration {
    position: static;
    align-self: center;
    justify-self: end;
  }

  .duel-match-card-model .model-icon {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
    font-size: 5px;
  }

  .rating-row {
    min-height: 60px;
  }

  .rating-row.header {
    min-height: 40px;
  }

  .rating-drilldown-row {
    min-height: 38px;
  }

  .rating-drilldown-row.header {
    min-height: 30px;
  }
}
