:root {
  /* Strict 60-30-10 Teenage Engineering / Playdate Hardware System */
  --bg-putty: #ECE8DF;       /* 60%: Anodised Warm Aluminum Chassis */
  --bg-putty-deep: #E2DDD2;
  --seam: #CFC8B8;
  --seam-dark: #B5AD9C;

  --surface-ivory: #FAF8F3;  /* 30%: Tactile Keycaps & Cartridge Shells */
  --surface-crt: #161514;    /* 30%: Recessed Matte Obsidian Bay */
  --surface-crt-elev: #22201E;
  --ink-primary: #171615;
  --ink-secondary: #57534E;
  --ink-muted: #78716C;

  --accent-orange: #FF4F00;  /* 10%: International Signal Orange */
  --accent-orange-hover: #E64600;
  --accent-orange-deep: #B83700;
  --led-green: #22C55E;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --shadow-keycap: 0 2px 0 #C8C1B2, 0 4px 10px rgba(23, 22, 21, 0.06);
  --shadow-orange: 0 3px 0 #B53600, 0 8px 18px rgba(255, 79, 0, 0.22);
  --shadow-card: 0 2px 0 #D3CCC0, 0 8px 20px rgba(23, 22, 21, 0.05);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

::selection {
  background: var(--accent-orange);
  color: #FFFFFF;
}

html {
  background-color: var(--bg-putty);
  color: var(--ink-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background-color: var(--bg-putty);
  background-image: radial-gradient(#CFC8B8 1px, transparent 1px);
  background-size: 20px 20px;
}

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

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

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

.hidden {
  display: none !important;
}

.icon-svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}

.icon-svg-sm {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}

/* Main Chassis Container */
.chassis-shell {
  max-width: 1360px;
  margin: 0 auto;
  padding: 14px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Top Hardware Rail */
.top-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-ivory);
  border: 1.5px solid var(--seam);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink-primary);
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: block;
}

.brand-meta {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.brand-rev {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
}

.telemetry-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: var(--bg-putty);
  border: 1px solid var(--seam);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.tele-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tele-val {
  font-weight: 700;
  color: var(--ink-primary);
}

.tele-lbl, .tele-sep {
  color: var(--ink-muted);
  font-size: 11px;
}

.led-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.led-dot.live {
  background: var(--led-green);
}

.led-dot.orange {
  background: var(--accent-orange);
}

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

/* Tactile Mechanical Keycap Buttons */
.keycap-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  background: var(--surface-ivory);
  border: 1.5px solid var(--seam-dark);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-keycap);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-primary);
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms cubic-bezier(0.16, 1, 0.3, 1), background-color 120ms ease;
}

.keycap-btn:hover:not(:disabled) {
  background: #FFFFFF;
}

.keycap-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 0 0 #C8C1B2;
}

.keycap-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.keycap-btn.icon-only {
  width: 36px;
  padding: 0;
}

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

/* Primary Signal Orange Trigger */
.btn-burn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  background: var(--accent-orange);
  border: 1.5px solid var(--accent-orange-deep);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-orange);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #FFFFFF;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms cubic-bezier(0.16, 1, 0.3, 1), background-color 120ms ease;
}

.btn-burn:hover:not(:disabled) {
  background: var(--accent-orange-hover);
}

.btn-burn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--accent-orange-deep);
}

.btn-burn:disabled {
  opacity: 0.65;
  cursor: progress;
}

.btn-burn.btn-sm {
  height: 36px;
  padding: 0 16px;
  font-size: 12px;
}

/* Split Hero Hardware Deck */
.hero-deck {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr);
  gap: 18px;
  align-items: stretch;
}

.burner-bay {
  position: relative;
  background: var(--surface-ivory);
  border: 1.5px solid var(--seam);
  border-radius: var(--radius-lg);
  padding: 26px 26px 22px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.screw {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-putty-deep);
  border: 1.5px solid var(--seam-dark);
}
.screw::after {
  content: '';
  position: absolute;
  left: 1px;
  top: 3px;
  width: 5px;
  height: 1.5px;
  background: var(--ink-muted);
  transform: rotate(-32deg);
}
.screw-tl { top: 12px; left: 12px; }
.screw-tr { top: 12px; right: 12px; }
.screw-bl { bottom: 12px; left: 12px; }
.screw-br { bottom: 12px; right: 12px; }

.module-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.kicker-tag {
  display: inline-block;
  padding: 3px 9px;
  background: var(--bg-putty);
  border: 1px solid var(--seam);
  border-radius: 999px;
  color: var(--ink-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.kicker-spec {
  color: var(--ink-muted);
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.3vw, 44px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.035em;
  color: var(--ink-primary);
  text-wrap: balance;
}

.accent-line {
  color: var(--accent-orange);
}

.hero-sub {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-secondary);
  max-width: 52ch;
}

.burn-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prompt-well {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #FFFFFF;
  border: 1.5px solid var(--seam-dark);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: border-color 150ms ease;
}

.prompt-well:focus-within {
  border-color: var(--accent-orange);
}

.prompt-chevron {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  color: var(--accent-orange);
  line-height: 1.45;
}

.prompt-well textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-primary);
}

.prompt-well textarea::placeholder {
  color: #9C9589;
}

.burn-meta-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.callsign-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: var(--bg-putty);
  border: 1.5px solid var(--seam);
  border-radius: var(--radius-sm);
}

.callsign-box label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-muted);
  white-space: nowrap;
}

.callsign-box input {
  width: 82px;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-primary);
}

.burn-form .btn-burn {
  flex: 1;
}

/* Compile Progress Indicator */
.burn-progress {
  background: var(--surface-crt);
  color: var(--surface-ivory);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.burn-progress-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #FAF8F3;
}

.burn-track {
  width: 100%;
  height: 6px;
  background: #2E2B28;
  border-radius: 99px;
  overflow: hidden;
}

.burn-fill {
  height: 100%;
  width: 14%;
  background: var(--accent-orange);
  transition: width 260ms ease;
}

/* 1-Tap Prompt Seeds */
.preset-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--seam);
}

.preset-heading {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.seed-chip {
  padding: 6px 11px;
  background: var(--bg-putty);
  border: 1px solid var(--seam-dark);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-primary);
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.seed-chip:hover {
  background: #FFFFFF;
  border-color: var(--accent-orange);
}

/* Right Console Bay */
.console-bay {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.crt-housing {
  background: var(--surface-crt);
  border: 3px solid #CFC8B8;
  border-radius: var(--radius-lg);
  padding: 14px;
  color: var(--surface-ivory);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-card);
}

.crt-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.crt-slot-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.crt-genre {
  padding: 2px 7px;
  background: #292624;
  border-radius: 4px;
  font-size: 10px;
  color: #FF7A33;
  font-weight: 700;
}

.crt-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.crt-mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 9px;
  background: #252321;
  border: 1px solid #3D3935;
  border-radius: 6px;
  color: #E7E5E4;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.crt-mini-btn:hover {
  background: #322F2C;
  border-color: var(--accent-orange);
}

.crt-bezel {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #100F0E;
  border: 2px solid #2A2725;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.crt-bezel iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.crt-Control-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #A8A29E;
  font-variant-numeric: tabular-nums;
}

.crc-label {
  color: #78716C;
}

/* Mobile Hardware Gamepad (Shown on touch / <= 860px) */
.mobile-gamepad {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid #292624;
  gap: 12px;
}

.dpad-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dpad-vert {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.action-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pad-key {
  min-width: 44px;
  height: 42px;
  padding: 0 10px;
  background: #292624;
  border: 1.5px solid #44403C;
  border-radius: 8px;
  box-shadow: 0 2px 0 #0C0B0A;
  color: #FAF8F3;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

.pad-key:active {
  transform: translateY(2px);
  box-shadow: none;
}

.pad-act {
  min-width: 66px;
  height: 48px;
  background: var(--accent-orange);
  border-color: var(--accent-orange-deep);
  color: #FFFFFF;
}

/* High-Score Strip */
.board-strip {
  background: var(--surface-ivory);
  border: 1.5px solid var(--seam);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.board-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.board-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  background: var(--surface-crt);
  color: #FAF8F3;
  border-radius: 4px;
  flex-shrink: 0;
}

.board-prompt {
  font-size: 12px;
  color: var(--ink-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}

.player-tag-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-putty);
  border: 1px solid var(--seam);
  border-radius: 6px;
  padding: 3px 8px;
}

.player-tag-inline label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-muted);
}

.player-tag-inline input {
  width: 74px;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.score-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.score-chip {
  background: var(--bg-putty);
  border: 1px solid var(--seam);
  border-radius: 7px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.score-chip.rank-1 {
  border-color: var(--accent-orange);
  background: #FFF6F2;
}

.score-rank-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--ink-muted);
}

.score-chip.rank-1 .score-rank-row {
  color: var(--accent-orange);
  font-weight: 700;
}

.score-pts {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-primary);
}

.score-skeleton {
  height: 44px;
  border-radius: 7px;
  background: var(--bg-putty-deep);
}

/* Cartridge Rack */
.rack-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 8px;
}

.rack-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.rack-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.rack-title-wrap h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.rack-sub {
  font-size: 13px;
  color: var(--ink-secondary);
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-ivory);
  border: 1.5px solid var(--seam);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.tab-pill {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.tab-pill.active {
  background: var(--surface-crt);
  color: #FAF8F3;
}

.cart-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

/* Physical Notched ROM Cartridge Card */
.cart-card {
  position: relative;
  background: var(--surface-ivory);
  border: 1.5px solid var(--seam-dark);
  border-radius: 14px 26px 14px 14px;
  padding: 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  transition: transform 150ms cubic-bezier(0.16, 1, 0.3, 1), border-color 150ms ease;
}

.cart-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-orange);
}

.cart-card.inserted {
  border-color: var(--accent-orange);
  border-width: 2px;
  background: #FFFFFF;
}

.cart-ribs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rib-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rib-bars span {
  display: block;
  width: 34px;
  height: 3px;
  border-radius: 2px;
  background: var(--seam-dark);
}

.cart-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

.cart-genre {
  padding: 2px 7px;
  background: var(--bg-putty);
  border: 1px solid var(--seam);
  border-radius: 4px;
  color: var(--ink-primary);
}

.cart-ai-flag {
  padding: 2px 6px;
  background: var(--accent-orange);
  color: #FFFFFF;
  border-radius: 4px;
}

.cart-window {
  background: var(--surface-crt);
  color: var(--surface-ivory);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cart-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #FAF8F3;
}

.cart-prompt {
  font-size: 12px;
  line-height: 1.4;
  color: #A8A29E;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 33px;
}

.cart-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-secondary);
  padding-top: 4px;
}

.cart-hi {
  font-weight: 700;
  color: var(--ink-primary);
}

.cart-pins {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding-top: 2px;
}

.cart-pins span {
  width: 22px;
  height: 5px;
  border-radius: 2px;
  background: var(--surface-crt);
}

.cart-card.inserted .cart-pins span {
  background: var(--accent-orange);
}

.cart-skeleton {
  height: 212px;
  border-radius: 14px;
  background: var(--bg-putty-deep);
  border: 1px solid var(--seam);
}

/* Footer */
.chassis-footer {
  margin-top: 12px;
  padding: 16px 4px 0;
  border-top: 1.5px solid var(--seam);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-secondary);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

.footer-links a {
  color: var(--ink-primary);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent-orange);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(22, 21, 20, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-panel {
  width: 100%;
  max-width: 720px;
  max-height: 86vh;
  background: var(--surface-ivory);
  border: 2px solid var(--seam-dark);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-panel.modal-narrow {
  max-width: 480px;
}

.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--seam);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h3 {
  font-family: var(--font-display);
  font-size: 20px;
  margin-top: 4px;
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-copy {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-secondary);
}

.field-lbl {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-muted);
}

.text-field {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  background: #FFFFFF;
  border: 1.5px solid var(--seam-dark);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
}

.studio-status {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-putty);
  border: 1px solid var(--seam-dark);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
}

.code-viewer {
  background: var(--surface-crt);
  color: #FAF8F3;
  padding: 14px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
  max-height: 48vh;
}

.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--seam);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Custom Toast System */
.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
}

.toast-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--surface-crt);
  color: #FAF8F3;
  border: 1.5px solid #3D3935;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.35;
}

.toast-item.error {
  border-color: #EF4444;
}

.toast-item.success {
  border-color: var(--accent-orange);
}

/* 404 Page */
.notfound-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.notfound-shell {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: var(--surface-ivory);
  border: 2px solid var(--seam-dark);
  border-radius: var(--radius-lg);
  padding: 32px 26px;
}

.nf-screen {
  background: var(--surface-crt);
  color: #FAF8F3;
  border-radius: var(--radius-md);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.nf-code {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-orange);
}

.nf-screen h1 {
  font-family: var(--font-display);
  font-size: 30px;
}

.nf-screen p {
  font-size: 14px;
  line-height: 1.5;
  color: #A8A29E;
}

.nf-btn {
  margin-top: 6px;
}

/* Responsive Breakpoints (1440px -> 768px -> 375px) */
@media (max-width: 1080px) {
  .hero-deck {
    grid-template-columns: 1fr;
  }
  .cart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px), (hover: none) and (pointer: coarse) {
  .mobile-gamepad {
    display: flex;
  }
}

@media (max-width: 640px) {
  .chassis-shell {
    padding: 10px 12px 32px;
    gap: 14px;
  }
  .telemetry-strip,
  .hide-xs {
    display: none;
  }
  .burner-bay {
    padding: 20px 16px 16px;
  }
  .burn-meta-row {
    flex-direction: column;
  }
  .callsign-box {
    height: 40px;
    justify-content: space-between;
  }
  .score-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cart-grid {
    grid-template-columns: 1fr;
  }
  .board-prompt {
    max-width: 190px;
  }
}

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