:root {
  --ink: #17243c;
  --gold: #b57913;
  --gold-ink: #fff;
  --bg: #fffaf2;
  --surface: #fff;
  --soft: #f7f4ec;
  --line: #dfe4ec;
  --muted: #68758a;
  --danger: #c43d3d;
  --win: #1f8a4c;
  --shadow: 0 18px 60px rgba(27, 43, 69, .12);
  --ldm-bar-bg: var(--surface);
  --ldm-bar-ink: var(--ink);
  --ldm-strip-bg: var(--soft);
  --ldm-strip-ink: var(--ink);
  --ldm-strip-muted: var(--muted);
  --ldm-line: var(--line);
  --ldm-accent: var(--gold);
  color-scheme: light;
}
html[data-theme="dark"] {
  --ink: #f5f7fb;
  --gold: #d6a246;
  --gold-ink: #141414;
  --bg: #0b1220;
  --surface: #131d2e;
  --soft: #101a2a;
  --line: #2b384d;
  --muted: #a9b5c8;
  --danger: #e05b5b;
  --win: #5dce8a;
  --shadow: 0 18px 60px rgba(0, 0, 0, .35);
  --ldm-bar-bg: var(--surface);
  --ldm-bar-ink: var(--ink);
  --ldm-strip-bg: var(--soft);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 Arial, Helvetica, sans-serif;
  overflow-x: clip;
}
button, input, textarea { font: inherit; color: inherit; }
a, button { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; height: auto; }
code {
  font-size: .92em;
  padding: .1em .35em;
  border-radius: 6px;
  background: var(--soft);
}
.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
}
.hero, .content, .seo-content, .card, .board {
  width: min(1180px, calc(100% - 28px));
  margin-left: auto;
  margin-right: auto;
}
.hero {
  padding: 48px 0 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
  align-items: end;
}
.hero > div { min-width: 0; }
.ad {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-align: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
.ad-live .adsbygoogle {
  display: block;
  min-height: 250px;
  width: 100%;
  flex: 1;
}
.ad small {
  letter-spacing: 1.5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.hero h1 {
  margin: 16px 0 14px;
  font-size: clamp(40px, 8vw, 76px);
  line-height: 1.08;
  letter-spacing: 0;
  word-spacing: 0.12em;
}
.hero em { color: var(--gold); font-style: normal; }
.hero p {
  margin: 0;
  max-width: 58ch;
  color: var(--muted);
  font-size: 18px;
}
.board, .card {
  margin-bottom: 28px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.board-head, .card-head, .panel-title, .controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.board-head h2, .card-head h2, .panel-title h3 {
  margin: 6px 0 0;
  word-spacing: 0.08em;
}
.chips, .pills, .history { list-style: none; margin: 0; padding: 0; }
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chips li, .pills li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  font-size: 13px;
  font-weight: 700;
}
.chips b { color: var(--gold); }
.layout {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr) minmax(220px, .8fr);
  gap: 18px;
  margin-top: 22px;
}
.layout:not(:has(#setupPanel:not([hidden]))) {
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, .85fr);
}
.panel, .arena {
  padding: 18px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.field { display: grid; gap: 8px; margin-bottom: 14px; font-weight: 700; }
.field span { font-size: 13px; }
.field input, .field textarea, .score-pad input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px 14px;
}
.field textarea { resize: vertical; min-height: 160px; font-weight: 500; }
.hint { margin: 0; color: var(--muted); font-size: 13px; }
.row, .arena-actions, .controls { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--line));
  margin-left: auto;
}
.arena { text-align: center; }
.arena-kicker {
  margin: 0 0 18px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.match {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: stretch;
}
.player-card {
  padding: 18px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.player-card.lead { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.player-card small { color: var(--muted); font-weight: 800; letter-spacing: .08em; }
.player-card strong {
  display: block;
  margin: 8px 0 16px;
  font-size: clamp(20px, 3vw, 32px);
  line-height: 1.2;
  letter-spacing: 0.01em;
  word-spacing: 0.1em;
  word-break: break-word;
}
.vs {
  display: grid;
  place-items: center;
  font-weight: 900;
  color: var(--gold);
}
.score-pad {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.score-pad input {
  width: 72px;
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  padding: 8px;
  appearance: textfield;
  -moz-appearance: textfield;
}
.score-pad input::-webkit-outer-spin-button,
.score-pad input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.step {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}
.champion {
  padding: 28px 12px;
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: 18px;
}
.champion small, .champ-kicker { color: var(--gold); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.champion strong {
  display: block;
  margin: 8px 0;
  font-size: clamp(32px, 6vw, 52px);
  letter-spacing: 0.01em;
  word-spacing: 0.1em;
}
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.standing .btn { width: 100%; margin-top: 14px; }
.pills li.out { opacity: .45; text-decoration: line-through; }
.panel-title > b {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px;
}
.empty { color: var(--muted); text-align: center; padding: 18px 8px; }
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  font-weight: 800;
  cursor: pointer;
}
.toggle input { width: 20px; height: 20px; accent-color: var(--gold); }
.token-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 6px 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  font-size: 13px;
  font-weight: 800;
}
.token-box span { color: var(--muted); }
.token-box b {
  font-family: Consolas, "Courier New", monospace;
  letter-spacing: 0.14em;
  color: var(--gold);
}
.token-box .btn { min-height: 36px; padding: 0 12px; }
.overlay-help { margin-top: 8px; }
.table-wrap { overflow-x: auto; margin-top: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); }
th { font-size: 12px; letter-spacing: .06em; color: var(--muted); }
td:first-child { font-weight: 800; word-spacing: 0.06em; }
td.status-in { color: var(--win); font-weight: 800; }
td.status-out { color: var(--muted); }
td.status-champ { color: var(--gold); font-weight: 800; }
.history { display: grid; gap: 8px; }
.history li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--soft);
  border-radius: 12px;
}
.history b { color: var(--gold); }
.content { padding: 20px 0 50px; }
.content h2, .seo-intro h2 { font-size: clamp(28px, 5vw, 36px); margin: 10px 0 20px; letter-spacing: 0; word-spacing: 0.08em; }
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.steps article, .seo-content details {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.steps b {
  display: block;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.08em;
}
.steps strong {
  display: block;
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
  word-spacing: 0.06em;
}
.steps span {
  display: block;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.55;
  word-spacing: 0.04em;
}
.faq summary { cursor: pointer; font-weight: 800; line-height: 1.4; }
.faq p { margin: 0; line-height: 1.6; color: var(--muted); }
.seo-content { padding-bottom: 50px; }
.seo-intro p { color: var(--muted); }
.faq { display: grid; gap: 10px; margin-top: 28px; }
.faq h2 { margin-bottom: 8px; }
.share-strip, footer {
  padding: 18px max(14px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
}
.share-strip { background: var(--soft); color: var(--muted); font-size: 13px; }
.share-strip a, footer a {
  color: inherit;
  text-decoration: none;
  font-weight: 800;
}
.share-strip a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
}
footer {
  justify-content: space-between;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}
footer img { width: 112px; height: 34px; object-fit: contain; }
.drawing .player-card strong { opacity: .55; }
@media (max-width: 980px) {
  .hero, .layout, .steps { grid-template-columns: 1fr; }
  .layout:not(:has(#setupPanel:not([hidden]))) { grid-template-columns: 1fr; }
  .match { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .vs { padding: 4px 6px; }
  .hero h1 { letter-spacing: 0; }
  .btn.danger { margin-left: 0; }
}
@media (max-width: 720px) {
  .hero { padding: 28px 0 18px; gap: 20px; }
  .hero p { font-size: 16px; }
  .ad { min-height: 0; }
  .ad-live .adsbygoogle { min-height: 120px; }
  .arena-actions {
    position: sticky;
    bottom: 0;
    z-index: 6;
    margin: 16px -16px -16px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .controls {
    flex-direction: column;
    align-items: stretch;
  }
  .controls .toggle,
  .controls .token-box,
  .controls .btn { width: 100%; }
}
@media (max-width: 600px) {
  .hero, .content, .seo-content, .card, .board {
    width: min(1180px, calc(100% - 20px));
  }
  .board, .card { padding: 16px; border-radius: 18px; }
  .panel, .arena { padding: 14px; }
  .player-card { padding: 14px 8px; }
  .player-card strong { font-size: clamp(16px, 5vw, 22px); }
  .score-pad { gap: 6px; }
  .score-pad input { width: 56px; font-size: 22px; }
  .history li { grid-template-columns: 1fr; }
  .arena-actions .btn, .controls .btn, .row .btn { width: 100%; }
  .token-box { width: 100%; justify-content: space-between; }
  .chips li, .pills li { min-height: 44px; }
}
@media (max-width: 420px) {
  .match { grid-template-columns: 1fr; }
  .vs { padding: 0; font-size: 13px; letter-spacing: .12em; }
}
@media (display-mode: standalone) {
  body { min-height: 100dvh; }
}
.recommend-btn {
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--gold) 14%, transparent);
  color: var(--gold);
  font: 800 12px/1 Arial, Helvetica, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-height: 36px;
  padding: 0 14px;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
}
.recommend-btn:hover,
.recommend-btn:focus-visible {
  background: color-mix(in srgb, var(--gold) 24%, transparent);
  outline: none;
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(11, 18, 32, .62);
  backdrop-filter: blur(8px);
}
.lightbox.open { display: flex; }
.form-lightbox-panel {
  width: min(520px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 22px 22px 20px;
}
.form-lightbox-panel h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}
.form-lightbox-panel .form-lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  font-weight: 500;
}
.rec-form {
  display: grid;
  gap: 14px;
  position: relative;
}
.rec-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
}
.rec-form input,
.rec-form select,
.rec-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  padding: 12px 14px;
}
.rec-form textarea { min-height: 120px; resize: vertical; font-weight: 500; }
.rec-form input:focus,
.rec-form select:focus,
.rec-form textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--gold) 55%, transparent);
  outline-offset: 1px;
}
.rec-form .hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}
.rec-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.rec-status {
  min-height: 1.3em;
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}
.rec-status.ok { color: var(--win); }
.rec-status.err { color: var(--danger); }
@media (max-width: 600px) {
  .recommend-btn { width: 100%; }
  .rec-actions .btn { width: auto; flex: 1; }
}
