/* DeviceCheck — a light "test bench" look: colour-bar strip, instrument consoles with dark display windows. */
:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #e9edf1;
  --ink: #16202b;
  --muted: #536170;
  --line: #d3dae1;
  --accent: #1e5bd8;
  --accent-ink: #ffffff;
  --display: #0e151c;
  --display-line: #23303b;
  --phosphor: #3be08a;
  --amber: #f0a43a;
  --red: #e5484d;
  --radius: 12px;
  --shadow: 0 1px 0 rgba(22, 32, 43, .06), 0 6px 20px -12px rgba(22, 32, 43, .25);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1418;
    --surface: #161d23;
    --surface-2: #1d262e;
    --ink: #e7ecf0;
    --muted: #9aa8b5;
    --line: #2a3640;
    --accent: #6b9bff;
    --accent-ink: #0b1220;
    --display: #080c10;
    --display-line: #1d2832;
    --shadow: 0 1px 0 rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--font); }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
img, svg, canvas, video { max-width: 100%; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- header: logo + the colour-bar strip ---------- */
.site-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.head-in { max-width: 1080px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.logo svg { width: 30px; height: 22px; border-radius: 4px; flex: none; }
.menu summary svg { width: 18px; height: 18px; flex: none; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); height: 5px; }
.bars i:nth-child(1) { background: #c0c0c0; } .bars i:nth-child(2) { background: #d6c200; }
.bars i:nth-child(3) { background: #00b8c4; } .bars i:nth-child(4) { background: #13b04a; }
.bars i:nth-child(5) { background: #c02cc0; } .bars i:nth-child(6) { background: #d42a2a; }
.bars i:nth-child(7) { background: #2140c8; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: .95rem; background: var(--surface); }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { border-color: var(--accent); }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(92vw, 640px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 18px 40px -18px rgba(0,0,0,.35); padding: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 20px; z-index: 30; }
.menu-panel h2 { font-size: .85rem; color: var(--muted); margin: 0 0 4px; font-weight: 600; }
.menu-panel ul { list-style: none; margin: 0; padding: 0; }
.menu-panel a { display: block; padding: 3px 0; text-decoration: none; color: var(--ink); }
.menu-panel a:hover { color: var(--accent); }

/* ---------- language switcher (native names, searchable, no flags) ---------- */
.head-tools { display: flex; align-items: center; gap: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.langsw { position: relative; }
.langsw summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: .95rem; background: var(--surface); white-space: nowrap; }
.langsw summary::-webkit-details-marker { display: none; }
.langsw summary svg { width: 18px; height: 18px; flex: none; }
.langsw[open] summary { border-color: var(--accent); }
.lang-short { display: none; }
.lang-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 240px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 18px 40px -18px rgba(0,0,0,.35); padding: 10px; z-index: 31; }
.lang-panel input { width: 100%; box-sizing: border-box; font: inherit; font-size: .95rem; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); margin-bottom: 6px; }
.lang-panel ul { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow: auto; }
.lang-panel a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 6px; text-decoration: none; color: var(--ink); }
.lang-panel a small { color: var(--muted); font-size: .8rem; }
.lang-panel a:hover, .lang-panel a[aria-current] { background: var(--surface-2); }
.lang-panel a[aria-current] { font-weight: 700; }
@media (max-width: 560px) {
  .lang-full { display: none; }
  .lang-short { display: inline; }
  .langsw summary, .menu summary { padding: 7px 10px; }
}
@media (max-width: 440px) {
  .menu-label { display: none; }
  .head-in { gap: 8px; }
}
/* language notice / offer bar under the header */
.langbar { background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .95rem; }
.langbar-in { max-width: 1080px; margin: 0 auto; padding: 8px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.langbar-in > span { flex: 1 1 220px; }
.langbar .linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.langbar .x { background: none; border: 0; font-size: 1.4rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.langbar .btn.sm { padding: 5px 12px; }

/* ---------- page ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 18px 16px 40px; }
.crumbs { font-size: .85rem; color: var(--muted); margin: 0 0 6px; }
.crumbs a { color: var(--muted); }
h1 { font-size: clamp(1.9rem, 5vw, 2.9rem); line-height: 1.08; letter-spacing: -.025em; margin: 4px 0 8px; font-weight: 850; }
.lead { color: var(--muted); font-size: 1.08rem; margin: 0 0 18px; max-width: 64ch; }
h2 { font-size: 1.5rem; letter-spacing: -.015em; line-height: 1.2; margin: 34px 0 10px; }
h3 { font-size: 1.1rem; margin: 22px 0 6px; }
.prose { max-width: 70ch; }
.prose p, .prose li { margin: 0 0 12px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.note { background: var(--surface-2); border-left: 4px solid var(--amber); padding: 10px 14px; border-radius: 6px; font-size: .95rem; }

/* ---------- the instrument console ---------- */
.console { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.console-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.led { width: 11px; height: 11px; border-radius: 50%; background: #8a96a3; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); flex: none; }
.led.on { background: var(--phosphor); box-shadow: 0 0 10px var(--phosphor); }
.led.warn { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.led.bad { background: var(--red); box-shadow: 0 0 10px var(--red); }
.status { font-weight: 650; flex: 1; min-width: 12em; }
.display { background: var(--display); color: #dfe8ee; border-radius: 9px; border: 1px solid var(--display-line); position: relative; overflow: hidden; }
.readouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-top: 12px; }
.readout { background: var(--surface-2); border-radius: 8px; padding: 8px 12px; }
.readout b { display: block; font-size: 1.45rem; font-variant-numeric: tabular-nums; line-height: 1.2; letter-spacing: -.01em; }
.readout span { font-size: .82rem; color: var(--muted); }
.controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 12px; }
.controls label { display: inline-flex; align-items: center; gap: 8px; font-size: .95rem; }
select, input[type=range] { font: inherit; }
select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); max-width: 100%; }

.btn { font: inherit; font-weight: 650; border-radius: 999px; padding: 10px 18px; border: 1px solid transparent; cursor: pointer; background: var(--accent); color: var(--accent-ink); line-height: 1.2; }
.btn:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.sm { padding: 6px 12px; font-size: .9rem; }
.btn[aria-pressed=true] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn:disabled { opacity: .5; cursor: default; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }

/* ---------- screens ---------- */
.swatch-row { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 34px; height: 34px; border-radius: 8px; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.swatch[aria-pressed=true] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.screen-preview { height: clamp(200px, 38vw, 340px); display: grid; place-items: center; cursor: pointer; border-radius: 9px; border: 1px solid var(--line); position: relative; }
.screen-preview .hint { background: rgba(255,255,255,.85); color: #16202b; padding: 8px 14px; border-radius: 999px; font-weight: 650; font-size: .95rem; }
.stage { position: fixed; inset: 0; z-index: 1000; display: block; }
.stage .dim { position: absolute; inset: 0; background: #000; pointer-events: none; }
.stage .tip { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); background: rgba(0,0,0,.55); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: .9rem; transition: opacity .6s; white-space: nowrap; }
.stage .tip.faint { opacity: .12; }
.stage.nocursor { cursor: none; }
.stage .tip.gone { opacity: 0; }

/* ---------- audio / video ---------- */
.scope { display: block; width: 100%; height: 180px; }
.meter { height: 16px; border-radius: 8px; background: var(--display-line); overflow: hidden; position: relative; margin: 12px; }
.meter i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--phosphor) 0 70%, var(--amber) 70% 90%, var(--red) 90%); transition: width .05s linear; }
.meter u { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; left: 0; text-decoration: none; }
video.cam { display: block; width: 100%; max-height: 62vh; background: #000; aspect-ratio: 16/9; object-fit: contain; }
video.mirror { transform: scaleX(-1); }
.empty-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; color: #9fb0bd; }
.sweep-read { font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; padding: 18px; text-align: center; }

/* ---------- keyboard ---------- */
.kb-wrap { overflow-x: auto; padding: 12px; outline: none; --u: 42px; --g: 5px; }
.kb-wrap:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.kb { display: flex; gap: calc(var(--g) * 3); width: max-content; margin: 0 auto; }
.kb-block { display: flex; flex-direction: column; gap: var(--g); }
.kb-row { display: flex; gap: var(--g); height: var(--u); }
.kb-row.gap { height: calc(var(--u) * .3); }
.key { width: calc(var(--w, 1) * var(--u) + (var(--w, 1) - 1) * var(--g)); flex: none; border-radius: 6px; background: #1b2631; color: #c9d4dc; font-size: max(9px, calc(var(--u) * .28)); display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.1; border: 1px solid #2a3846; box-shadow: inset 0 -3px 0 rgba(0,0,0,.35); user-select: none; padding: 2px; overflow: hidden; }
.key.blank { visibility: hidden; }
.key.tested { background: #12402b; border-color: #1d6b46; color: #bff5d6; }
.key.down { background: var(--phosphor); color: #072315; border-color: var(--phosphor); box-shadow: 0 0 14px rgba(59,224,138,.6); }
.kb-numpad { display: grid; grid-template-columns: repeat(4, var(--u)); grid-auto-rows: var(--u); gap: var(--g); }
@media (max-width: 900px) { .kb-block.np { display: none; } }

/* ---------- click targets / games ---------- */
.pad { min-height: 260px; display: grid; place-items: center; text-align: center; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation; padding: 20px; }
.pad big { display: block; font-size: clamp(2.4rem, 8vw, 4.2rem); font-weight: 850; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; }
.pad small { font-size: 1rem; color: #9fb0bd; }
.react { transition: background-color .08s; }
.react.wait { background: #8a1f24; }
.react.go { background: #127a43; }
.react.go small, .react.wait small { color: #e9f1f5; }
.mouse-vis { display: grid; grid-template-columns: repeat(5, minmax(56px, 1fr)); gap: 8px; padding: 14px; }
.mbtn { background: #1b2631; border: 1px solid #2a3846; border-radius: 8px; padding: 12px 6px; text-align: center; color: #c9d4dc; font-size: .85rem; }
.mbtn b { display: block; font-size: 1.2rem; color: #fff; font-variant-numeric: tabular-nums; }
.mbtn.down { background: var(--phosphor); color: #072315; }
.mbtn.down b { color: #072315; }
.log { font-size: .88rem; color: #9fb0bd; padding: 0 14px 14px; min-height: 2.6em; font-variant-numeric: tabular-nums; }
.log .bad { color: #ff9a9d; font-weight: 700; }

/* ---------- controller ---------- */
.pads { display: grid; gap: 14px; padding: 14px; }
.gp { border: 1px solid var(--display-line); border-radius: 9px; padding: 12px; }
.gp h3 { margin: 0 0 10px; font-size: .95rem; color: #dfe8ee; font-weight: 600; word-break: break-word; }
.gp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; align-items: start; }
.sticks { display: flex; gap: 16px; flex-wrap: wrap; }
.stick { width: 160px; text-align: center; font-size: .82rem; color: #9fb0bd; font-variant-numeric: tabular-nums; }
.stick-ring { width: 110px; height: 110px; border-radius: 50%; border: 2px solid #33424f; position: relative; margin: 0 auto 6px; background: radial-gradient(circle, #16212b 0 6%, transparent 7%); }
.stick-ring i { position: absolute; width: 16px; height: 16px; border-radius: 50%; background: var(--phosphor); left: calc(50% - 8px); top: calc(50% - 8px); box-shadow: 0 0 10px var(--phosphor); }
.stick-ring.pressed { border-color: var(--phosphor); }
.gbtns { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
.gbtn { background: #1b2631; border: 1px solid #2a3846; border-radius: 6px; padding: 6px 4px; font-size: .75rem; text-align: center; color: #c9d4dc; position: relative; overflow: hidden; }
.gbtn i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--phosphor); width: 0; }
.gbtn.down { background: var(--phosphor); color: #072315; }
.drift { font-size: .85rem; margin-top: 6px; }
.drift .ok { color: var(--phosphor); } .drift .meh { color: var(--amber); } .drift .bad { color: #ff9a9d; }

/* ---------- motion test ---------- */
.ufo { display: block; width: 100%; height: 150px; }

/* ---------- ad slot (below the tool, never inside it) ---------- */
.ad-slot { margin: 22px 0 6px; min-height: 100px; border: 1px dashed var(--line); border-radius: 10px; display: grid; place-items: center; color: var(--muted); font-size: .8rem; }

/* ---------- FAQ, related, home ---------- */
.faq details { border-top: 1px solid var(--line); padding: 12px 0; max-width: 70ch; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 650; }
.faq details p { margin: 8px 0 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; text-decoration: none; color: var(--ink); }
.card:hover { border-color: var(--accent); }
.card strong { display: block; }
.card span { color: var(--muted); font-size: .9rem; }
.card .chip { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; border: 1px solid var(--line); }
.hub h2 { margin-top: 28px; }
.updated { color: var(--muted); font-size: .92rem; }
.summary { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 4px 16px 4px; margin: 14px 0 8px; }
.summary h2 { font-size: 1.15rem; margin: 12px 0 8px; }
.table-wrap { overflow-x: auto; margin: 0 0 14px; }
.prose table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 650; }
.prose td code { white-space: nowrap; font-size: .88em; }
.promise { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; max-width: 70ch; }

.site-foot { border-top: 1px solid var(--line); background: var(--surface); margin-top: 30px; }
.foot-in { max-width: 1080px; margin: 0 auto; padding: 22px 16px 30px; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); font-size: .92rem; }
.foot-in h2 { font-size: .9rem; margin: 0 0 6px; color: var(--muted); font-weight: 600; }
.foot-in ul { list-style: none; padding: 0; margin: 0; }
.foot-in a { color: var(--ink); text-decoration: none; line-height: 1.9; }
.foot-in a:hover { color: var(--accent); }
.foot-legal { max-width: 1080px; margin: 0 auto; padding: 0 16px 12px; font-size: .88rem; }
.foot-legal ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 2px 0; }
.foot-legal li + li::before { content: '·'; color: var(--muted); margin: 0 .55em; }
.foot-legal a { color: var(--ink); text-decoration: none; line-height: 1.9; }
.foot-legal a:hover { color: var(--accent); text-decoration: underline; }
.foot-note { max-width: 1080px; margin: 0 auto; padding: 0 16px 26px; color: var(--muted); font-size: .82rem; }

/* modal (photosensitivity warning) */
.modal { position: fixed; inset: 0; background: rgba(5,8,12,.7); display: grid; place-items: center; z-index: 1100; padding: 16px; }
.modal-box { background: var(--surface); color: var(--ink); border-radius: var(--radius); padding: 20px; max-width: 460px; }
.modal-box h2 { margin-top: 0; }
.fixer { position: fixed; width: 120px; height: 120px; left: calc(50% - 60px); top: calc(50% - 60px); z-index: 1001; cursor: move; touch-action: none; border: 2px solid #fff; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 560px) {
  body { font-size: 16px; }
  .prose table, .prose tbody, .prose tr, .prose td { display: block; width: auto; }
  .prose thead { display: none; }
  .prose tr { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 10px; padding: 6px 10px; background: var(--surface); }
  .prose td { border: 0; padding: 3px 0; }
  .prose td[data-label]::before { content: attr(data-label); display: block; font-size: .78rem; font-weight: 650; color: var(--muted); }
  .prose td code { white-space: normal; overflow-wrap: anywhere; }
  .foot-legal ul { gap: 2px 18px; }
  .foot-legal li + li::before { content: none; }
  .console { padding: 10px; }
  .pad { min-height: 220px; }
}

/* ---------- long words (German compounds, Russian, Polish) ---------- */
h1, h2, h3, .card b, .card strong { overflow-wrap: break-word; hyphens: auto; }
.prose, .lead, .faq, .crumbs, .status, .readout span { overflow-wrap: break-word; }
a.btn { display: inline-block; text-decoration: none; }
/* Korean: break lines between words, not inside them */
:lang(ko) { word-break: keep-all; overflow-wrap: break-word; }
