:root {
  color-scheme: dark;
  --bg: #080a0f;
  --panel: #10131b;
  --panel-2: #151923;
  --ink: #f4f5ef;
  --muted: #8d93a1;
  --line: #2b303c;
  --line-bright: #4b5261;
  --accent: #c7ff45;
  --accent-rgb: 199, 255, 69;
  --accent-2: #ff5c35;
  --accent-2-rgb: 255, 92, 53;
  --black: #050609;
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    var(--bg);
  background-size: 42px 42px;
  color: var(--ink);
}

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

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

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient::before,
.ambient::after {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  content: "";
  filter: blur(130px);
  opacity: 0.09;
}

.ambient::before {
  top: -260px;
  left: 28%;
  background: var(--accent);
}

.ambient::after {
  right: -250px;
  bottom: -290px;
  background: var(--accent-2);
}

.topbar {
  display: flex;
  width: min(1500px, calc(100% - 56px));
  min-height: 78px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  color: var(--ink);
  align-items: center;
  gap: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-bright);
  background: var(--ink);
  color: var(--black);
  place-items: center;
  font-size: 11px;
  letter-spacing: -0.08em;
}

.brand sup {
  padding: 3px 5px;
  background: var(--accent);
  color: var(--black);
  font-size: 8px;
  letter-spacing: 0.09em;
  transform: translateY(-6px);
}

.topbar-actions,
.local-note {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 20px;
}

.local-note {
  gap: 8px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.local-note i,
.cabinet-bar i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.85);
}

.text-button {
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid var(--line-bright);
  background: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-transform: uppercase;
}

.text-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

main {
  width: min(1500px, calc(100% - 56px));
  margin: 0 auto;
}

.upload-view {
  display: grid;
  min-height: calc(100svh - 79px);
  padding: clamp(48px, 7vh, 90px) 0 58px;
  grid-template-columns: minmax(0, 0.9fr) minmax(440px, 0.75fr);
  gap: clamp(50px, 8vw, 135px);
  align-items: center;
}

.eyebrow {
  display: flex;
  margin: 0 0 22px;
  color: var(--muted);
  align-items: center;
  gap: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.eyebrow span {
  padding: 5px 7px 4px;
  background: var(--accent);
  color: var(--black);
}

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

.hero-copy h1,
.game-heading h1,
.game-overlay h2 {
  margin-bottom: 0;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.84;
  text-transform: uppercase;
}

.hero-copy h1 {
  max-width: 780px;
  font-size: clamp(76px, 9.2vw, 150px);
}

.hero-copy h1 em,
.game-heading h1 em {
  color: var(--accent);
  font-style: normal;
}

.hero-deck {
  max-width: 640px;
  margin: 32px 0 35px;
  color: #c9cdd5;
  font-size: clamp(17px, 1.45vw, 22px);
  line-height: 1.48;
}

.proof-grid {
  display: grid;
  max-width: 660px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  grid-template-columns: repeat(3, 1fr);
}

.proof-grid > div {
  display: flex;
  min-height: 93px;
  padding: 17px 18px 15px 0;
  flex-direction: column;
  justify-content: center;
}

.proof-grid > div + div {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.proof-grid strong {
  color: var(--ink);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 30px;
  letter-spacing: 0.03em;
}

.proof-grid span {
  margin-top: 4px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.drop-shell {
  position: relative;
  min-width: 0;
}

.drop-index {
  position: absolute;
  z-index: 2;
  top: -12px;
  left: 20px;
  padding: 4px 7px;
  background: var(--accent);
  color: var(--black);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.drop-zone {
  position: relative;
  display: flex;
  width: 100%;
  min-height: min(555px, 62vh);
  padding: 48px 28px 32px;
  overflow: hidden;
  border: 1px solid var(--line-bright);
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.07), transparent 36%),
    radial-gradient(circle at 76% 80%, rgba(var(--accent-2-rgb), 0.09), transparent 30%),
    var(--panel);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.drop-zone::before {
  position: absolute;
  inset: 12px;
  border: 1px dashed #3a404e;
  content: "";
  pointer-events: none;
}

.drop-zone:hover,
.drop-zone.dragging {
  border-color: var(--accent);
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.13), transparent 43%),
    radial-gradient(circle at 76% 80%, rgba(var(--accent-2-rgb), 0.12), transparent 34%),
    var(--panel-2);
  transform: translateY(-3px);
}

.corner {
  position: absolute;
  z-index: 2;
  width: 18px;
  height: 18px;
  border-color: var(--accent);
  pointer-events: none;
}

.corner-a { top: 11px; left: 11px; border-top: 2px solid; border-left: 2px solid; }
.corner-b { top: 11px; right: 11px; border-top: 2px solid; border-right: 2px solid; }
.corner-c { right: 11px; bottom: 11px; border-right: 2px solid; border-bottom: 2px solid; }
.corner-d { bottom: 11px; left: 11px; border-bottom: 2px solid; border-left: 2px solid; }

.drop-visual {
  position: relative;
  display: grid;
  width: 174px;
  height: 174px;
  margin-bottom: 30px;
  padding: 10px;
  border: 1px solid #3d4350;
  background: #090b10;
  box-shadow: 13px 13px 0 rgba(var(--accent-rgb), 0.14);
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 5px;
  transform: rotate(-2deg);
  transition: transform 180ms ease;
}

.drop-zone:hover .drop-visual,
.drop-zone.dragging .drop-visual {
  transform: rotate(1deg) scale(1.025);
}

.drop-visual i {
  display: block;
  background: linear-gradient(135deg, #232837, #10141c);
}

.drop-visual i:nth-child(2),
.drop-visual i:nth-child(6) {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.86), rgba(var(--accent-rgb), 0.22));
}

.drop-visual i:nth-child(4),
.drop-visual i:nth-child(8) {
  background: linear-gradient(135deg, rgba(var(--accent-2-rgb), 0.88), rgba(var(--accent-2-rgb), 0.18));
}

.drop-visual b {
  position: absolute;
  display: grid;
  width: 52px;
  height: 52px;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 8px rgba(8, 10, 15, 0.7);
  color: var(--black);
  place-items: center;
  font-family: Arial, sans-serif;
  font-size: 31px;
  font-weight: 400;
  transform: translate(-50%, -50%);
}

.drop-label {
  margin-bottom: 8px;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(31px, 3.1vw, 48px);
  letter-spacing: 0.015em;
}

.drop-or {
  margin-bottom: 13px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.choose-button,
.primary-button {
  display: inline-flex;
  min-width: 225px;
  min-height: 48px;
  padding: 9px 10px 9px 16px;
  background: var(--accent);
  color: var(--black);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.choose-button b,
.primary-button span {
  display: grid;
  width: 30px;
  height: 30px;
  background: var(--black);
  color: var(--ink);
  place-items: center;
}

.drop-meta {
  margin-top: 24px;
  color: #6f7685;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.drop-footer {
  display: flex;
  min-height: 45px;
  padding: 0 3px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
}

.drop-footer button {
  padding: 0 0 4px;
  border: 0;
  border-bottom: 1px solid var(--line-bright);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.drop-footer button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.drop-footer > span {
  color: var(--muted);
}

.drop-footer kbd {
  margin-left: 5px;
}

kbd {
  display: inline-grid;
  min-width: 25px;
  min-height: 23px;
  padding: 3px 5px;
  border: 1px solid var(--line-bright);
  border-bottom-width: 3px;
  border-radius: 3px;
  background: var(--panel-2);
  color: var(--ink);
  place-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 900;
}

.upload-error {
  min-height: 16px;
  margin: 8px 0 0;
  color: #ff7c62;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  text-align: center;
}

/* Game */
.game-view {
  padding: 34px 0 22px;
}

.game-heading {
  display: flex;
  margin-bottom: 22px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}

.game-heading .eyebrow {
  margin-bottom: 11px;
}

.game-heading h1 {
  font-size: clamp(50px, 5.6vw, 88px);
}

.game-heading > p {
  max-width: 370px;
  margin-bottom: 3px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.55;
  text-transform: uppercase;
}

.game-grid {
  display: grid;
  grid-template-columns: 220px minmax(460px, 1fr) 220px;
  gap: 14px;
  align-items: start;
}

.panel,
.cabinet {
  border: 1px solid var(--line-bright);
  background: rgba(16, 19, 27, 0.93);
}

.panel-title,
.cabinet-bar {
  display: flex;
  min-height: 38px;
  padding: 0 11px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.panel-title span,
.cabinet-bar span {
  color: var(--muted);
}

.panel-title b {
  padding: 3px 5px;
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
  font-size: 7px;
}

.source-preview {
  position: relative;
  display: grid;
  height: 165px;
  margin: 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(45deg, #151923 25%, transparent 25%),
    linear-gradient(-45deg, #151923 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #151923 75%),
    linear-gradient(-45deg, transparent 75%, #151923 75%),
    #0d1016;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  place-items: center;
}

.source-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.source-preview span {
  position: absolute;
  right: 5px;
  bottom: 5px;
  padding: 3px 5px;
  background: var(--black);
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.source-details {
  display: flex;
  margin: 0 11px;
  padding: 2px 0 13px;
  border-bottom: 1px solid var(--line);
  flex-direction: column;
  gap: 5px;
}

.source-details strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-details span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  line-height: 1.4;
}

.fidelity-list {
  margin: 0;
  padding: 8px 11px 10px;
}

.fidelity-list div {
  display: flex;
  min-height: 29px;
  border-bottom: 1px dashed var(--line);
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.fidelity-list dt {
  color: var(--muted);
}

.fidelity-list dd {
  margin: 0;
  color: var(--accent);
  font-weight: 900;
}

.ghost-button,
.restart-button {
  display: flex;
  width: calc(100% - 22px);
  min-height: 38px;
  margin: 0 11px 11px;
  padding: 0 10px;
  border: 1px solid var(--line-bright);
  background: transparent;
  align-items: center;
  justify-content: space-between;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.ghost-button:hover,
.restart-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.cabinet {
  min-width: 0;
  border-color: #555d6d;
  box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.34);
}

.cabinet-bar {
  min-height: 39px;
  background: #0b0d12;
}

.cabinet-bar > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cabinet-bar strong {
  overflow: hidden;
  color: var(--accent);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cabinet-bar i {
  background: #565c69;
  box-shadow: none;
}

.cabinet-bar i.live {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.9);
  animation: blink 1.2s steps(2) infinite;
}

@keyframes blink {
  50% { opacity: 0.38; }
}

.canvas-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #05070a;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.canvas-wrap::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.42);
  content: "";
  pointer-events: none;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.game-overlay,
.processing {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: flex;
  padding: 28px;
  background: rgba(5, 7, 10, 0.82);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.game-overlay::before,
.game-overlay::after {
  position: absolute;
  width: 52px;
  height: 52px;
  border-color: var(--accent);
  content: "";
}

.game-overlay::before {
  top: 18px;
  left: 18px;
  border-top: 2px solid;
  border-left: 2px solid;
}

.game-overlay::after {
  right: 18px;
  bottom: 18px;
  border-right: 2px solid;
  border-bottom: 2px solid;
}

.overlay-kicker {
  margin-bottom: 13px;
  padding: 4px 7px;
  background: var(--accent);
  color: var(--black);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.11em;
}

.game-overlay h2 {
  max-width: 800px;
  margin-top: 0;
  font-size: clamp(46px, 5.2vw, 82px);
}

.game-overlay > p:not(.overlay-kicker) {
  max-width: 520px;
  margin: 14px 0 0;
  color: #c0c5cf;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.5;
  text-transform: uppercase;
}

.primary-button,
.secondary-button {
  border: 0;
  cursor: pointer;
}

.primary-button {
  min-width: 245px;
  margin-top: 23px;
  box-shadow: 6px 6px 0 rgba(255, 255, 255, 0.15);
  transition: transform 100ms ease, box-shadow 100ms ease;
}

.primary-button:hover {
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 rgba(255, 255, 255, 0.15);
}

.game-overlay small {
  margin-top: 18px;
  color: #747b88;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.compact-overlay h2 {
  font-size: clamp(50px, 6vw, 90px);
}

.result-overlay {
  background: rgba(5, 7, 10, 0.72);
}

.result-score {
  display: flex;
  min-width: 230px;
  margin-top: 18px;
  padding: 9px 12px;
  border: 1px solid var(--line-bright);
  background: rgba(5, 7, 10, 0.72);
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.result-score span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.result-score strong {
  color: var(--accent);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 27px;
  letter-spacing: 0.06em;
}

.result-actions {
  display: flex;
  align-items: stretch;
  gap: 11px;
}

.secondary-button {
  min-width: 110px;
  margin-top: 23px;
  padding: 0 14px;
  border: 1px solid var(--line-bright);
  background: rgba(5, 7, 10, 0.8);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.secondary-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.processing {
  background: #080a0ff0;
}

.processing-grid {
  display: grid;
  width: 78px;
  height: 78px;
  margin-bottom: 23px;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  transform: rotate(45deg);
}

.processing-grid i {
  background: var(--line-bright);
  animation: tile-pulse 800ms steps(2) infinite;
}

.processing-grid i:nth-child(2) { animation-delay: 100ms; }
.processing-grid i:nth-child(3) { animation-delay: 300ms; }
.processing-grid i:nth-child(4) { animation-delay: 500ms; }

@keyframes tile-pulse {
  50% { background: var(--accent); }
}

.processing strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
}

.processing small {
  margin-top: 9px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.cabinet-controls {
  display: flex;
  min-height: 54px;
  padding: 7px 9px;
  border-top: 1px solid var(--line);
  background: #0b0d12;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.control-hint {
  display: flex;
  align-items: center;
  gap: 5px;
}

.control-hint span {
  margin-left: 4px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 7px;
  font-weight: 900;
}

#hold-preview {
  display: flex;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  align-items: center;
  gap: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.08em;
  cursor: pointer;
}

#hold-preview:hover,
#hold-preview.held {
  border-color: var(--accent);
  color: var(--accent);
}

.eye-icon {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 9px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.eye-icon::after {
  position: absolute;
  width: 3px;
  height: 3px;
  top: 2px;
  left: 4px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.cabinet-buttons {
  display: flex;
  gap: 6px;
}

.cabinet-buttons button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line-bright);
  background: transparent;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.cabinet-buttons button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.score-block {
  margin: 11px;
  padding: 13px 12px 11px;
  background: var(--accent);
  color: var(--black);
}

.score-block span,
.stat-pair span,
.progress-block span,
.difficulty-picker legend,
.progress-block small {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.score-block strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0.06em;
}

.stat-pair {
  display: grid;
  margin: 0 11px 11px;
  grid-template-columns: 1fr 1.2fr;
  gap: 7px;
}

.stat-pair > div {
  min-width: 0;
  min-height: 59px;
  padding: 10px 9px;
  border: 1px solid var(--line);
}

.stat-pair span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
}

.stat-pair strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  white-space: nowrap;
}

#lives-value {
  color: var(--accent-2);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.progress-block {
  margin: 0 11px 13px;
  padding: 12px 10px 10px;
  border: 1px solid var(--line);
}

.progress-block > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.progress-block > div:first-child span {
  color: var(--muted);
}

.progress-block > div:first-child strong {
  color: var(--accent);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 25px;
}

.progress-track {
  height: 6px;
  margin: 10px 0 8px;
  overflow: hidden;
  background: #292e39;
}

.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 180ms ease;
}

.progress-block small {
  color: #6d7481;
}

.difficulty-picker {
  display: grid;
  margin: 0 11px 12px;
  padding: 0;
  border: 0;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.difficulty-picker legend {
  width: 100%;
  margin-bottom: 8px;
  color: var(--muted);
}

.difficulty-picker button {
  display: flex;
  min-width: 0;
  min-height: 48px;
  padding: 7px 3px;
  border: 1px solid var(--line);
  background: transparent;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
}

.difficulty-picker button span {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 6px;
  font-weight: 900;
}

.difficulty-picker button small {
  color: var(--muted);
  font-size: 7px;
}

.difficulty-picker button:hover,
.difficulty-picker button.active {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
}

.restart-button {
  justify-content: center;
}

.game-footer {
  display: flex;
  width: 100%;
  height: 33px;
  margin-top: 18px;
  overflow: hidden;
  border-top: 1px solid var(--line-bright);
  border-bottom: 1px solid var(--line-bright);
  background: var(--panel);
  align-items: stretch;
  white-space: nowrap;
}

.game-footer > span {
  position: relative;
  z-index: 1;
  display: flex;
  padding: 0 14px;
  background: var(--accent);
  color: var(--black);
  align-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.game-footer > div {
  width: max-content;
  padding: 9px 0 0 15px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.08em;
  animation: ticker 30s linear infinite;
}

@keyframes ticker {
  to { transform: translateX(-50%); }
}

.global-drop {
  position: fixed;
  z-index: 100;
  inset: 18px;
  display: flex;
  border: 2px solid var(--accent);
  background: rgba(8, 10, 15, 0.93);
  box-shadow: inset 0 0 0 10px rgba(var(--accent-rgb), 0.08);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.global-drop strong {
  color: var(--accent);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(40px, 6vw, 92px);
  letter-spacing: 0.01em;
}

.global-drop span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.toast {
  position: fixed;
  z-index: 120;
  right: 20px;
  bottom: 20px;
  max-width: min(340px, calc(100vw - 40px));
  padding: 11px 14px;
  border: 1px solid var(--line-bright);
  background: var(--ink);
  color: var(--black);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.07em;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .game-grid {
    grid-template-columns: 185px minmax(430px, 1fr) 185px;
    gap: 9px;
  }

  .source-preview {
    height: 135px;
  }

  .score-block strong {
    font-size: 29px;
  }

  .panel-title,
  .cabinet-bar {
    padding-inline: 8px;
  }

  .difficulty-picker button span {
    font-size: 5.5px;
  }
}

@media (max-width: 900px) {
  .topbar,
  main {
    width: min(100% - 30px, 760px);
  }

  .upload-view {
    min-height: auto;
    padding: 55px 0;
    grid-template-columns: 1fr;
    gap: 52px;
  }

  .hero-copy h1 {
    font-size: clamp(72px, 16vw, 122px);
  }

  .drop-zone {
    min-height: 500px;
  }

  .game-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .game-heading > p {
    max-width: 520px;
  }

  .game-grid {
    display: flex;
    flex-wrap: wrap;
  }

  .cabinet {
    width: 100%;
    order: 1;
  }

  .source-panel,
  .run-panel {
    width: calc(50% - 5px);
    order: 2;
  }

  .source-preview {
    height: 210px;
  }
}

@media (max-width: 600px) {
  .topbar,
  main {
    width: calc(100% - 22px);
  }

  .topbar {
    min-height: 64px;
  }

  .brand sup,
  .local-note {
    display: none;
  }

  .upload-view {
    padding: 43px 0 35px;
    gap: 42px;
  }

  .eyebrow {
    margin-bottom: 16px;
    font-size: 8px;
  }

  .hero-copy h1 {
    font-size: clamp(59px, 20vw, 92px);
  }

  .hero-deck {
    margin: 24px 0 28px;
    font-size: 16px;
  }

  .proof-grid > div {
    min-height: 82px;
    padding-inline: 9px;
  }

  .proof-grid > div:first-child {
    padding-left: 0;
  }

  .proof-grid > div + div {
    padding-left: 10px;
  }

  .proof-grid strong {
    font-size: 25px;
  }

  .proof-grid span {
    font-size: 7px;
  }

  .drop-zone {
    min-height: 440px;
    padding-inline: 18px;
  }

  .drop-visual {
    width: 142px;
    height: 142px;
    margin-bottom: 25px;
  }

  .drop-label {
    font-size: 31px;
  }

  .drop-footer {
    min-height: 58px;
    padding-top: 11px;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .game-view {
    padding-top: 25px;
  }

  .game-heading h1 {
    font-size: clamp(47px, 15vw, 70px);
  }

  .canvas-wrap {
    aspect-ratio: 4 / 4.3;
  }

  .cabinet-bar {
    grid-template-columns: auto 1fr;
  }

  .cabinet-bar > span:last-child {
    display: none;
  }

  .cabinet-bar strong {
    text-align: right;
  }

  .game-overlay {
    padding: 24px 18px;
  }

  .game-overlay::before,
  .game-overlay::after {
    width: 32px;
    height: 32px;
  }

  .game-overlay h2 {
    font-size: clamp(43px, 14vw, 65px);
  }

  .game-overlay > p:not(.overlay-kicker) {
    max-width: 290px;
    font-size: 8px;
  }

  .primary-button {
    min-width: min(250px, 82vw);
    margin-top: 18px;
  }

  .game-overlay small {
    display: none;
  }

  .result-actions {
    width: min(320px, 90%);
  }

  .result-actions .primary-button {
    min-width: 0;
    flex: 1;
  }

  .control-hint {
    display: none;
  }

  #hold-preview {
    margin-right: auto;
  }

  .source-panel,
  .run-panel {
    width: 100%;
  }

  .source-preview {
    height: 230px;
  }

  .game-footer {
    margin-top: 12px;
  }

  .game-footer > span {
    display: none;
  }
}

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