/* Optikyo Arcade
   Retro-arcade brand kept from the original page: pixel type, sharp corners, cabinet bulbs, CRT lines.
   Shape lock: every corner is square (radius 0). Accent lock: coin yellow is the only accent.
   Gold, silver, bronze and win/loss colors are used only where they carry meaning.
   Dark-only on purpose: the page is an arcade cabinet. */

@font-face {
  font-family: "Press Start 2P";
  src: url("/fonts/press-start-2p-latin.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "VT323";
  src: url("/fonts/vt323-latin.woff2") format("woff2");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #110a20;
  --bg-deep: #0c0618;
  --surface: #1a1130;
  --surface-2: #22173f;
  --edge: #35275f;
  --text: #eee8fb;
  --dim: #a99bd0;
  --accent: #ffcc33;
  --accent-ink: #1a1130;
  --brand: #ff3d7f;
  --silver: #c9d3e6;
  --bronze: #e39a64;
  --win: #5fe08a;
  --loss: #ff6b78;
  --px: 4px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --pixel: "Press Start 2P", ui-monospace, monospace;
  --mono: "VT323", ui-monospace, monospace;
  /* z-index scale */
  --z-overlay: 10;
  --z-crt: 50;
  --z-skip: 60;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 80% 50% at 70% -10%, #2a1858 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 22px;
  line-height: 1.3;
  -webkit-font-smoothing: none;
  font-variant-numeric: tabular-nums;
}
img { max-width: 100%; }
a { color: var(--accent); }
:focus-visible { outline: 3px dashed var(--accent); outline-offset: 4px; }
h1, h2, h3 { font-family: var(--pixel); font-weight: 400; text-wrap: balance; }

/* CRT scanlines: fixed, non-interactive layer so it never repaints with scroll */
.crt {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: var(--z-crt);
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px);
}

.skip {
  position: absolute; left: 16px; top: -100px;
  z-index: var(--z-skip);
  padding: 10px 14px;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--pixel); font-size: 11px; text-decoration: none;
}
.skip:focus { top: 16px; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ---------------------------------------------------------- buttons & links */

.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border: 0;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--pixel); font-size: 13px; line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 var(--px) 0 #b38a12, 0 0 0 var(--px) var(--bg-deep);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), background-color 0.2s;
}
.btn .ph { font-size: 20px; }
.btn:hover { background: #ffd95c; transform: translateY(-2px); box-shadow: 0 6px 0 #b38a12, 0 0 0 var(--px) var(--bg-deep); }
.btn:active { transform: translateY(var(--px)); box-shadow: 0 0 0 #b38a12, 0 0 0 var(--px) var(--bg-deep); }
.btn-sm { padding: 12px 14px; font-size: 11px; }
.btn-ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 var(--px) var(--accent); }
.btn-ghost:hover { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 0 0 var(--px) var(--accent); }
.btn-ghost:active { box-shadow: inset 0 0 0 var(--px) var(--accent); }

.text-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text);
  font-size: 24px;
  text-decoration: none;
  border-bottom: 2px solid var(--edge);
  transition: border-color 0.2s, color 0.2s;
}
.text-link .ph { font-size: 18px; transition: transform 0.2s var(--ease); }
.text-link:hover { color: var(--accent); border-color: var(--accent); }
.text-link:hover .ph { transform: translate(2px, -2px); }

/* ---------------------------------------------------------- hero */

.hero {
  display: grid;
  gap: 32px;
  padding-top: 40px;
  padding-bottom: 56px;
  align-items: center;
}
@media (min-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 56px;
    min-height: min(100dvh, 860px);
    padding-top: 48px;
  }
}

.hero-copy { container-type: inline-size; min-width: 0; }
.status { margin: 0 0 18px; font-size: 24px; color: var(--dim); min-height: 1.3em; }
.status .dot { display: inline-block; width: 12px; height: 12px; margin-right: 10px; background: var(--dim); vertical-align: 1px; }
.status.online .dot { background: var(--win); }
.status.playing { color: var(--text); }
.status.playing .dot { background: var(--win); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.logo {
  margin: 0 0 22px;
  font-size: min(84px, 12.6cqi);
  line-height: 1.05;
  color: var(--accent);
  text-shadow: 4px 4px 0 var(--brand), 8px 8px 0 #4a1660;
  letter-spacing: -0.02em;
}
.lede { margin: 0 0 32px; max-width: 30ch; font-size: 28px; line-height: 1.25; color: var(--text); }
.ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px; }

/* the cabinet frame around the game */
.cabinet {
  position: relative;
  padding: 22px;
  background: linear-gradient(180deg, #2a0f3f, #1a0a30);
  border: var(--px) solid var(--brand);
  box-shadow:
    0 0 0 var(--px) var(--bg),
    0 0 0 calc(var(--px) * 2) var(--edge),
    0 30px 80px -30px rgba(255, 61, 127, 0.45);
}
.bulbs {
  position: absolute; left: 12px; right: 12px; top: 7px; height: 8px;
  background-image: radial-gradient(circle, var(--accent) 0 3px, transparent 3.5px);
  background-size: 22px 8px;
  background-repeat: repeat-x;
  animation: chase 0.6s steps(2) infinite;
}
.bulbs-bottom { top: auto; bottom: 7px; animation-direction: reverse; }
@keyframes chase { to { background-position: 22px 0; } }
.cabinet:has(.is-playing) .bulbs { animation-duration: 0.25s; }

.screen {
  position: relative;
  aspect-ratio: 4 / 3;
  min-height: 300px;
  background: var(--bg-deep);
  box-shadow: inset 0 0 0 2px var(--edge), inset 0 0 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.screen canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  touch-action: manipulation;
  cursor: pointer;
}
/* inside the game the drawn crosshair is the aiming reticle, so hide the system pointer only there */
.screen.is-playing canvas { cursor: none; }
.screen canvas:focus-visible { outline-offset: -6px; }

/* small buttons in the bottom-right corner of the screen */
.corner {
  position: absolute; right: 10px; bottom: 10px;
  z-index: var(--z-overlay);
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border: 2px solid var(--edge);
  background: rgba(12, 6, 24, 0.85);
  color: var(--dim);
  font-size: 20px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, transform 0.15s var(--ease);
}
.corner:hover, .corner[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }
.corner:active { transform: scale(0.94); }
.sens-btn { right: 58px; width: auto; padding: 0 10px; display: flex; align-items: center; gap: 8px; font-family: var(--pixel); font-size: 10px; white-space: nowrap; }
.screen.is-playing .sens-btn { display: none; }

.sens-panel {
  position: absolute; left: 50%; top: 50%;
  z-index: var(--z-overlay);
  transform: translate(-50%, -50%);
  width: min(92%, 460px);
  max-height: calc(100% - 20px);
  overflow-y: auto;
  padding: 16px 18px;
  background: var(--surface);
  border: var(--px) solid var(--accent);
  display: grid; gap: 10px;
}
.sens-panel[hidden] { display: none; }
.sens-panel .panel-title { margin: 0; font-family: var(--pixel); font-size: 11px; line-height: 1.5; color: var(--accent); }
.sens-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.sens-grid .wide { grid-column: 1 / -1; }
.sens-grid label { display: block; color: var(--dim); font-size: 18px; }
.sens-grid input, .sens-grid select {
  width: 100%;
  padding: 4px 8px;
  border: 2px solid var(--edge); border-radius: 0;
  background: var(--bg-deep); color: var(--accent);
  font: inherit; font-size: 22px;
}
.sens-grid select { color: var(--text); }
.sens-grid input:focus, .sens-grid select:focus { outline: 0; border-color: var(--accent); }
.sens-grid input:disabled { opacity: 0.4; }
.sens-out { margin: 0; font-size: 20px; color: var(--text); }
.sens-out b { font-weight: 400; color: var(--accent); }
.sens-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.sens-actions .text-link { font-size: 20px; }

/* mode picker along the top of the cabinet */
.modes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.modes button {
  flex: 1 1 auto;
  padding: 10px 12px;
  border: 2px solid var(--edge);
  background: var(--bg-deep); color: var(--dim);
  font-family: var(--pixel); font-size: 10px; line-height: 1.2;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.modes button:hover { color: var(--text); border-color: var(--dim); }
.modes button[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.modes button:disabled { cursor: not-allowed; opacity: 0.5; }
.cabinet:has(.is-playing) .modes button:not([aria-pressed="true"]) { opacity: 0.35; }

.initials {
  position: absolute; left: 50%; bottom: 8%;
  z-index: var(--z-overlay);
  transform: translateX(-50%);
  width: min(88%, 380px);
  padding: 18px;
  background: var(--surface);
  border: var(--px) solid var(--accent);
  display: grid; gap: 8px;
}
.initials[hidden] { display: none; }
.initials label { font-family: var(--pixel); font-size: 11px; line-height: 1.5; color: var(--accent); }
.initials-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.initials input {
  min-width: 0;
  padding: 8px 12px;
  border: 2px solid var(--edge);
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--pixel); font-size: 20px; letter-spacing: 0.3em; text-transform: uppercase;
}
.initials input:focus { outline: 0; border-color: var(--accent); }
.help { margin: 0; font-size: 18px; color: var(--dim); }

/* ---------------------------------------------------------- sections */

.block { padding: 56px 0 24px; }
.block-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 24px;
  margin-bottom: 28px;
}
.block-head h2 { margin: 0; font-size: clamp(22px, 3.4vw, 34px); color: var(--text); text-shadow: 3px 3px 0 var(--brand); }
h3 { margin: 0 0 16px; font-size: 12px; line-height: 1.6; color: var(--dim); }

.notice {
  margin: 0 0 24px; padding: 10px 14px;
  border: 2px dashed var(--accent); color: var(--accent);
  font-size: 20px; max-width: 75ch;
}
.notice[hidden] { display: none; }

.empty { color: var(--dim); margin: 0; }

/* spotlight that follows the cursor across tiles */
.cell, .player, .hiscore, .card { position: relative; isolation: isolate; }
.cell::before, .player::before, .hiscore::before, .card::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 204, 51, 0.09), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.cell:hover::before, .player:hover::before, .hiscore:hover::before, .card:hover::before { opacity: 1; }

/* ---------------------------------------------------------- valorant bento */

.bento { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) {
  .bento { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .bento .rank { grid-row: span var(--rows, 2); }
  .bento .matches { grid-column: 1 / -1; }
}
.cell {
  background: var(--surface);
  border: var(--px) solid var(--edge);
  padding: 24px;
  overflow: hidden;
}
.cell[hidden] { display: none; }

.rank { display: grid; align-content: end; min-height: 380px; background: var(--surface-2); }
.card-art {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.35;
  image-rendering: auto;
}
.rank::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(34, 23, 63, 0.2) 0%, rgba(34, 23, 63, 0.94) 70%);
}
.rank-body { display: grid; justify-items: start; gap: 4px; }
.rank-icon { width: 128px; height: 128px; object-fit: contain; margin-bottom: 8px; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.5)); }
.rank-name { margin: 0; font-family: var(--pixel); font-size: clamp(18px, 2.4vw, 26px); line-height: 1.4; color: var(--accent); }
.rank-rr { margin: 0; font-size: 30px; }
.rank-rr small { color: var(--dim); font-size: 22px; }
.rank-peak { margin: 10px 0 0; display: flex; align-items: center; gap: 8px; color: var(--dim); }
.rank-peak img { width: 28px; height: 28px; }
.rank-id { margin: 2px 0 0; color: var(--dim); }

.bignums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 20px; margin: 0; }
@media (min-width: 560px) { .bignums { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.bignums dt { color: var(--dim); font-size: 20px; }
.bignums dd { margin: 4px 0 0; font-family: var(--pixel); font-size: clamp(20px, 2.6vw, 28px); line-height: 1.2; color: var(--text); }
.caption { margin: 18px 0 0; color: var(--dim); font-size: 19px; }

.agents-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.agent { display: grid; gap: 6px; }
.agent img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--bg-deep); border: 2px solid var(--edge); transition: transform 0.3s var(--ease), border-color 0.2s; }
.agent:hover img { transform: translateY(-4px); border-color: var(--accent); }
.agent .agent-name { font-family: var(--pixel); font-size: 11px; line-height: 1.5; }
.agent .agent-meta { color: var(--dim); font-size: 19px; }

.match-strip {
  list-style: none; margin: 0 -24px; padding: 4px 24px 12px;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 1fr);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--edge) transparent;
}
.match {
  scroll-snap-align: start;
  display: grid; grid-template-columns: 44px 1fr; gap: 4px 12px; align-items: center;
  padding: 12px;
  background: var(--bg-deep);
  border-left: var(--px) solid var(--loss);
}
.match.won { border-left-color: var(--win); }
.match.draw { border-left-color: var(--dim); }
.match img { width: 44px; height: 44px; grid-row: span 2; background: var(--surface); }
.match .m-top { display: flex; justify-content: space-between; gap: 8px; }
.match .m-result { font-family: var(--pixel); font-size: 11px; color: var(--loss); }
.match.won .m-result { color: var(--win); }
.match.draw .m-result { color: var(--dim); }
.match .m-kda { color: var(--dim); font-size: 19px; }

/* ---------------------------------------------------------- steam */

.steam-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .steam-grid { grid-template-columns: 300px minmax(0, 1fr); } }

.player {
  align-self: start;
  padding: 24px;
  background: var(--surface);
  border: var(--px) solid var(--edge);
  text-align: center;
}
@media (min-width: 860px) { .player { position: sticky; top: 24px; } }
.avatar { width: 152px; height: 152px; display: block; margin: 0 auto 16px; border: var(--px) solid var(--accent); background: var(--bg-deep); image-rendering: pixelated; }
.player-name { margin: 0 0 20px; font-family: var(--pixel); font-size: 15px; line-height: 1.5; word-break: break-word; }
.readout { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.readout div { background: var(--bg-deep); padding: 10px 6px; }
.readout dt { color: var(--dim); font-size: 18px; }
.readout dd { margin: 2px 0 0; font-size: 30px; color: var(--accent); }

.hiscore { padding: 28px 24px; background: var(--surface); border: var(--px) solid var(--edge); }
.hiscore-title { font-size: 20px; text-align: center; color: var(--accent); text-shadow: 3px 3px 0 var(--brand); margin-bottom: 24px; }
.scores { list-style: none; margin: 0; padding: 0; }
.scores li {
  display: grid;
  grid-template-columns: 64px 32px minmax(0, 1fr) auto;
  align-items: center; gap: 14px;
  padding: 7px 8px;
  font-size: 26px;
  transition: background-color 0.2s, transform 0.25s var(--ease);
}
.scores li:hover { background: var(--surface-2); transform: translateX(4px); }
.scores li:nth-child(1) { color: var(--accent); }
.scores li:nth-child(2) { color: var(--silver); }
.scores li:nth-child(3) { color: var(--bronze); }
.scores .rank-no { font-family: var(--pixel); font-size: 12px; }
.scores img, .noicon { width: 32px; height: 32px; display: block; background: var(--bg-deep); }
.scores .game { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scores .score { font-family: var(--pixel); font-size: 13px; text-align: right; }
.scores .score small { font-family: var(--mono); font-size: 18px; color: var(--dim); margin-left: 6px; }
@media (max-width: 560px) {
  .scores li { grid-template-columns: 44px 28px minmax(0, 1fr); }
  .scores .score { grid-column: 3; text-align: left; }
  .scores .game { white-space: normal; }
  .scores img, .noicon { width: 28px; height: 28px; }
}

.recent, .featured { margin-top: 40px; }
.capsules {
  list-style: none; margin: 0; padding: 0 0 12px;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 260px);
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--edge) transparent;
}
.capsule { scroll-snap-align: start; background: var(--surface); border: 2px solid var(--edge); transition: border-color 0.2s, transform 0.25s var(--ease); }
.capsule:hover { border-color: var(--accent); transform: translateY(-3px); }
.capsule img { display: block; width: 100%; aspect-ratio: 460 / 215; object-fit: cover; background: var(--bg-deep); }
.capsule .c-body { padding: 10px 12px; display: flex; justify-content: space-between; gap: 10px; }
.capsule .c-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.capsule .c-hours { color: var(--accent); white-space: nowrap; }

.cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.card { background: var(--surface); border: var(--px) solid var(--edge); }
.card .banner { display: block; width: 100%; aspect-ratio: 460 / 215; object-fit: cover; border-bottom: var(--px) solid var(--edge); }
.card .body { padding: 18px; }
.card h4 { font-family: var(--pixel); font-weight: 400; font-size: 12px; line-height: 1.6; margin: 0 0 8px; }
.card h4 a { color: var(--text); }
.card .meta { color: var(--dim); margin: 0 0 14px; }
.card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 0 0 14px; }
.card dt { color: var(--dim); font-size: 18px; }
.card dd { margin: 0; font-size: 28px; color: var(--text); }
/* achievements: blocks for unlocked only, no background track */
.ach { font-size: 19px; color: var(--dim); }
.ach .blocks { display: block; height: 12px; margin-top: 6px; background: repeating-linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 11px); }

/* ---------------------------------------------------------- footer */

.footer { padding-top: 48px; padding-bottom: 56px; color: var(--dim); font-size: 19px; }
.footer p { margin: 0 0 4px; }
.footer .fine { margin-top: 16px; font-size: 17px; max-width: 70ch; }

/* ---------------------------------------------------------- loading skeletons */

.sk { display: none; }
.is-loading .sk {
  display: block;
  background: linear-gradient(90deg, var(--surface-2) 0 40%, var(--edge) 50%, var(--surface-2) 60% 100%);
  background-size: 300% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.sk-icon { width: 128px; height: 128px; margin-bottom: 8px; }
.sk-line { width: 180px; height: 22px; }
.sk-num { width: 72px; height: 26px; }
.sk-agent { width: 100%; aspect-ratio: 1; }
.sk-avatar { width: 152px; height: 152px; margin: 0 auto 16px; }
.player .sk-line { margin: 0 auto; }
.sk-row { width: 100%; height: 30px; }

/* ---------------------------------------------------------- scroll reveal (only when JS + motion allowed) */

.motion .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
.motion .reveal.in { opacity: 1; transform: none; }
.motion .hero-copy > * { animation: rise 0.8s var(--ease) both; }
.motion .hero-copy > :nth-child(2) { animation-delay: 0.08s; }
.motion .hero-copy > :nth-child(3) { animation-delay: 0.16s; }
.motion .hero-copy > :nth-child(4) { animation-delay: 0.24s; }
.motion .cabinet { animation: rise 0.9s 0.12s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bulbs, .status.playing .dot, .is-loading .sk { animation: none; }
  .btn, .text-link .ph, .scores li, .capsule, .agent img, .corner { transition: none; }
  .btn:hover, .scores li:hover, .capsule:hover, .agent:hover img { transform: none; }
}
.rank::before { z-index: 0; }
.screen:has(.initials:not([hidden])) .corner, .screen:has(.sens-panel:not([hidden])) .corner { display: none; }

/* ---------------------------------------------------------- sens lab */

.sens .sub { margin: 0; color: var(--dim); font-size: 24px; }
.sl-panel { background: var(--surface); border: var(--px) solid var(--edge); padding: 24px; margin-bottom: 24px; }
.sl-panel h3 { color: var(--accent); margin-bottom: 8px; }
.sl-lede { margin: 0 0 20px; color: var(--dim); max-width: 75ch; }
.sens .note { color: var(--dim); font-size: 19px; margin: 12px 0 0; }
.sens .warn { color: var(--accent); font-size: 20px; }
.sens .warn.big { font-size: 40px; }

.sens label { display: block; color: var(--dim); font-size: 20px; margin-bottom: 4px; }
.sens input, .sens select {
  width: 100%;
  padding: 6px 10px;
  border: 2px solid var(--edge); border-radius: 0;
  background: var(--bg-deep); color: var(--accent);
  font: inherit; font-size: 26px;
}
.sens select { color: var(--text); }
.sens input:hover, .sens select:hover { border-color: var(--dim); }
.sens input:focus, .sens select:focus { outline: 0; border-color: var(--accent); }

.fields { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 20px; }
.fields [hidden] { display: none; }

.sl-readout { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 18px; }
.sl-readout div { background: var(--bg-deep); padding: 10px 12px; }
.sl-readout dt { color: var(--dim); font-size: 18px; }
.sl-readout dd { margin: 2px 0 0; font-size: 32px; color: var(--accent); }
.sl-readout .band { color: var(--text); }

.sl-table-wrap { overflow-x: auto; }
.sl-table { width: 100%; border-collapse: collapse; }
.sl-table th { text-align: left; font-weight: 400; color: var(--dim); font-size: 18px; padding: 4px 8px; border-bottom: 2px solid var(--edge); }
.sl-table th.r { text-align: right; }
.sl-table td { padding: 6px 8px; border-bottom: 1px dashed var(--edge); }
.sl-table td.val { color: var(--accent); font-size: 26px; text-align: right; white-space: nowrap; }
.sl-table tr.src td:first-child::before { content: "▶ "; color: var(--brand); }
.sl-table .yaw { color: var(--dim); font-size: 18px; }
.sl-table button.copy { font: inherit; font-size: 18px; color: var(--dim); background: none; border: 0; cursor: pointer; padding: 0 0 0 10px; }
.sl-table button.copy:hover { color: var(--accent); }
@media (max-width: 520px) { .sl-table .yaw { display: none; } }

.finder-setup { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; margin-bottom: 16px; }
.finder-setup > div { flex: 1 1 160px; }
.finder-setup > .fit { flex: 0 0 auto; }

.sl-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-deep);
  border: var(--px) solid var(--edge);
  overflow: hidden;
}
.sl-stage canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }
.sl-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 16px;
  text-align: center;
  background: rgba(12, 6, 24, 0.88);
}
.sl-overlay[hidden] { display: none; }
.sl-overlay h3 { margin: 0; font-size: clamp(12px, 2.4vw, 18px); color: var(--accent); }
.sl-overlay p { margin: 0; max-width: 560px; }
.choice { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.statbox { background: var(--surface); border: 2px solid var(--edge); padding: 10px 16px; min-width: 170px; }
.statbox b { display: block; font-family: var(--pixel); font-weight: 400; font-size: 12px; color: var(--accent); margin-bottom: 6px; }
.progress { display: flex; gap: 6px; justify-content: center; }
.progress i { width: 18px; height: 10px; background: var(--edge); }
.progress i.on { background: var(--accent); }

.sl-toast {
  position: fixed; left: 50%; bottom: 24px;
  z-index: var(--z-skip);
  transform: translateX(-50%);
  padding: 8px 14px;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--pixel); font-size: 11px;
}

.sl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 16px; }
.sl-actions .note { margin: 0; flex: 1 1 280px; }

.finder-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin: -4px 0 16px; }
.finder-meta .note { margin: 0; flex: 1 1 320px; }
.finder-meta b { font-weight: 400; color: var(--accent); }
.sl-overlay kbd { font-family: var(--mono); font-size: 16px; opacity: 0.7; margin-left: 4px; }

.fr { margin-top: 20px; padding: 20px; background: var(--bg-deep); border: var(--px) solid var(--accent); display: grid; gap: 18px; }
.fr[hidden] { display: none; }
.fr p { margin: 0; }
.fr-label { color: var(--dim); }
.fr-value { font-family: var(--pixel); font-size: clamp(28px, 5vw, 44px); line-height: 1.2; color: var(--accent); margin: 6px 0 !important; }
.fr-value .copy { font: inherit; font-family: var(--mono); font-size: 24px; color: var(--dim); background: none; border: 0; cursor: pointer; padding: 0 0 0 12px; vertical-align: middle; }
.fr-value .copy:hover { color: var(--accent); }
.fr-sub { color: var(--dim); }
.fr-others { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0; }
.fr-others div { background: var(--surface); padding: 8px 12px; }
.fr-others dt { color: var(--dim); font-size: 18px; }
.fr-others dd { margin: 2px 0 0; font-size: 28px; color: var(--text); }
.fr-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.fr-history summary { cursor: pointer; color: var(--dim); }
.fr-history ol { margin: 8px 0 0; padding-left: 28px; color: var(--dim); font-size: 19px; }
