:root { color-scheme: dark; --bg:#0e0f12; --card:#16171b; --red:#ff4d57; --ink:#ececf1; --mute:#9a9aa6; --line:#2a2b33; --zebra:#1c1d23; --onink:#0e0f12; --max: 980px; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
a { color: var(--red); }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--card); padding: 6px 10px; z-index: 9; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
main { max-width: var(--max); margin: 0 auto; padding: 16px clamp(12px, 3vw, 24px) 32px; display: flex; flex-direction: column; gap: 14px; }

.topbar { position: sticky; top: 0; z-index: 5; background: rgba(14,15,18,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); padding: 10px clamp(12px, 3vw, 24px); padding-top: max(10px, env(safe-area-inset-top)); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; font-size: 13px; color: var(--ink); text-decoration: none; }
.brand-bar { width: 5px; height: 18px; background: var(--red); border-radius: 2px; }

/* Header: white, outlined, thin red bar (matches the low-toner print sheet) */
.hero { background: var(--card); border: 1.5px solid var(--ink); border-left: 8px solid var(--red); border-radius: 12px; padding: 16px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.hero-main { flex: 1 1 260px; }
.eyebrow { font-size: 11px; letter-spacing: 2.2px; text-transform: uppercase; color: var(--red); font-weight: 700; }
.hero h1 { font-weight: 900; font-size: clamp(34px, 9vw, 52px); letter-spacing: clamp(2px, 1vw, 6px); line-height: 1.05; margin: 4px 0; word-break: break-word; }
.hero-note { color: var(--mute); font-size: 14px; max-width: 60ch; }

.mode-switch { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 999px; padding: 3px; gap: 3px; }
.mode-switch button { font: inherit; font-weight: 700; font-size: 14px; border: 0; background: transparent; color: var(--ink); padding: 9px 18px; border-radius: 999px; cursor: pointer; min-height: 40px; }
.mode-switch button small { font-weight: 600; font-size: 10px; color: var(--mute); text-transform: uppercase; letter-spacing: .5px; margin-left: 4px; }
.mode-switch button[aria-selected="true"] { background: var(--ink); color: var(--onink); }
.mode-switch button[aria-selected="true"] small { color: #55555c; }
.mode-switch button:focus-visible, .pill:focus-visible, .char:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

.toolbar { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pill { font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; min-height: 38px; display: inline-flex; align-items: center; cursor: pointer; }
.pill:hover { border-color: var(--ink); }

.panel { display: flex; flex-direction: column; gap: 14px; }
.panel[hidden] { display: none; }
.mode-note { background: var(--card); border: 1px dashed var(--mute); border-radius: 10px; padding: 10px 14px; font-size: 14px; color: var(--mute); }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.card.accent { border-left: 5px solid var(--red); }
h2 { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.6px; margin-bottom: 8px; }
h2 em { font-style: normal; font-weight: 600; color: var(--red); letter-spacing: .3px; text-transform: none; margin-left: 6px; font-size: 12px; }
.empty { color: var(--mute); font-size: 14px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--mute); font-weight: 700; padding: 4px 8px 6px; border-bottom: 1.5px solid var(--ink); }
td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; line-height: 1.6; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) td { background: var(--zebra); }
td.combo { font-weight: 600; }
.t-bnb td.combo, .t-pc td.combo, .t-dr td.combo { width: 46%; } .t-corner td.combo { width: 52%; } .t-moves td:first-child { width: 24%; }

/* Notation chips (greyscale-safe) */
.ar { font-family: "DejaVu Sans", "Segoe UI Symbol", system-ui, sans-serif; font-weight: 700; letter-spacing: -.5px; font-size: 1.1em; }
.b { display: inline-block; min-width: 24px; text-align: center; font-size: 11px; font-weight: 800; padding: 1px 5px; border-radius: 4px; color: #fff; line-height: 1.45; vertical-align: 1px; margin: 0 1px; }
.b.shape-punch { border-radius: 12px; } .b.shape-kick { border-radius: 2px; } .b.shape-mod { border-radius: 4px; }
.b.btn-l { background: #d6e8fb; color: #0b3566; border: 1.2px solid #0b3566; }
.b.btn-m { color: #3a2800; border: 1.2px solid #3a2800; background: repeating-linear-gradient(135deg, #e9a92a 0 2.5px, #fff3d0 2.5px 5px); }
.b.btn-h { background: #c81d27; color: #fff; border: 1.2px solid #ff8a90; }
.b.btn-any { background: transparent; color: var(--ink); border: 1.2px solid var(--ink); }
.b.btn-od { background: #3b1670; color: #fff; border: 1.2px solid #a77bf0; box-shadow: 0 0 0 1.2px var(--card), 0 0 0 2.4px #a77bf0; margin: 0 3px; }
.b.btn-sp { background: transparent; color: #5fd3c6; border: 1.5px dashed #5fd3c6; }
.b.btn-auto { background: #4a4a52; color: #fff; border: 1.2px solid #8a8a94; font-style: italic; font-size: 10px; }
.sep { color: var(--red); font-weight: 800; padding: 0 2px; white-space: nowrap; }
.tag { font-size: 10px; font-weight: 800; letter-spacing: .6px; color: var(--red); border: 1px solid var(--red); border-radius: 3px; padding: 0 3px; vertical-align: 1px; }

.keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 14px; font-size: 13px; }
.kv-row { display: flex; align-items: center; gap: 10px; }
.kv { min-width: 92px; font-weight: 600; }
.tip { margin-top: 8px; font-size: 13px; color: var(--mute); }
.practice { padding-left: 20px; display: grid; gap: 4px; } .practice li::marker { color: var(--red); font-weight: 800; }
.sources ul { list-style: none; display: grid; gap: 4px; font-size: 13px; word-break: break-all; }

/* Home */
.search input { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
.search input:focus { outline: none; border-color: var(--red); }
.roster { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.roster li[hidden] { display: none; }
.char { background: var(--card); display: flex; flex-direction: column; gap: 6px; min-height: 76px; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 10px; text-decoration: none; color: var(--ink); }
.char:hover { border-color: var(--ink); border-left-color: var(--red); }
.char-name { font-weight: 800; font-size: 16px; letter-spacing: .5px; }
.char-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 11px; font-weight: 700; color: var(--mute); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.badge.alt { color: #5fd3c6; border-color: #5fd3c6; border-style: dashed; }

.site-foot { max-width: var(--max); margin: 0 auto; padding: 18px clamp(12px, 3vw, 24px) max(28px, env(safe-area-inset-bottom)); color: var(--mute); font-size: 12px; border-top: 1px solid var(--line); display: grid; gap: 6px; }

/* Phones: tables become stacked cards */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .hero { padding: 14px 16px; }
  .mode-switch { width: 100%; } .mode-switch button { flex: 1; }
  .toolbar .pill { flex: 1; justify-content: center; }
  .toolbar .pill[rel] { font-size: 12px; }
  table, thead, tbody, tr, td { display: block; width: 100% !important; }
  thead { display: none; }
  tbody tr { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; background: var(--card); }
  tbody tr:nth-child(even) td { background: transparent; }
  tbody tr:nth-child(even) { background: var(--zebra); }
  td { border: 0; padding: 2px 0; display: flex; gap: 10px; }
  td::before { content: attr(data-label); flex: 0 0 72px; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--mute); font-weight: 700; padding-top: 3px; }
  td.combo { display: block; font-size: 16px; padding-bottom: 6px; }
  td.combo::before { display: block; margin-bottom: 2px; }
  .t-moves td:first-child { font-weight: 800; }
}

/* Print: only the active control type, low toner */
@media print {
  :root { color-scheme: light; --bg:#fff; --card:#fff; --red:#b3121b; --ink:#16161a; --mute:#6b6b73; --line:#e4e1dc; --zebra:#f7f5f1; --onink:#fff; }
  .b.btn-od { background: #2a0f4d; border-color: #000; box-shadow: 0 0 0 1.2px #fff, 0 0 0 2.4px #2a0f4d; }
  .b.btn-h { background: #9e1219; border-color: #4a0508; }
  .b.btn-sp { color: #0b5f57; border-color: #0b5f57; }
  .b.btn-auto { background: #6d6d73; border-color: #333; }
  @page { size: Letter; margin: 0.45in; }
  .topbar, .toolbar, .mode-switch, .site-foot, .search, .skip { display: none !important; }
  main { max-width: none; padding: 0; gap: 10px; }
  .card, .hero { break-inside: avoid; }
  table { font-size: 10.5px; } .b { font-size: 9px; }
  .sources { display: none; }
}
