:root {
  --bg: #0f1014;
  --panel: #17181e;
  --panel-2: #1f2129;
  --line: rgba(255, 255, 255, 0.1);
  --ink: #eef0f5;
  --dim: #9aa0af;
  --grad: linear-gradient(95deg, #6f5dff 0%, #27d4cd 60%, #74ff7e 100%);
  --split: #74ff7e;
  --steal: #ff7a7a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(1100px 460px at 80% -10%, #1d2340 0%, var(--bg) 62%);
  color: var(--ink);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

a { color: #27d4cd; }

.bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 24px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
  background: rgba(15, 16, 20, 0.88); backdrop-filter: blur(8px);
}

.brand { font-weight: 750; font-size: 18px; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.brand::after { content: ""; display: block; height: 2px; background: var(--grad); border-radius: 2px; }
.tag { margin: 0; color: var(--dim); font-size: 13px; }

.pill {
  margin-left: auto; border: 1px solid var(--line); background: var(--panel-2);
  color: var(--ink); padding: 7px 14px; border-radius: 999px; font: inherit; font-size: 13px; cursor: pointer;
}
.pill.on { border-color: transparent; background-image: var(--grad); color: #0b0b0d; font-weight: 650; }

main { max-width: 1020px; margin: 0 auto; padding: 22px 24px 40px; }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tab {
  border: 1px solid var(--line); background: transparent; color: var(--dim);
  padding: 8px 16px; border-radius: 9px; font: inherit; font-size: 13.5px; cursor: pointer;
}
.tab.on { color: var(--ink); background: var(--panel-2); border-color: rgba(255, 255, 255, 0.22); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.row.between { justify-content: space-between; }
.models { display: flex; gap: 8px; flex-wrap: wrap; }

.model {
  border: 1px solid var(--line); background: transparent; color: var(--dim);
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 12.5px; cursor: pointer;
}
.model.on { color: #0b0b0d; background-image: var(--grad); border-color: transparent; font-weight: 600; }

.rounds { color: var(--dim); font-size: 13px; display: flex; gap: 8px; align-items: center; }
select, input {
  background: var(--panel-2); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px; font: inherit;
}

.score {
  display: flex; align-items: center; justify-content: space-between;
  margin: 20px 0 14px; padding: 14px 18px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
}
.score-side { display: flex; flex-direction: column; gap: 2px; }
.score-side.right { align-items: flex-end; }
.score-side .who { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; }
.score-side strong { font-size: 30px; font-variant-numeric: tabular-nums; }
.round-count { color: var(--dim); font-size: 12.5px; }

.moves { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.move {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
  border-radius: 12px; padding: 16px; font: inherit; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px;
}
.move strong { font-size: 17px; }
.move span { color: var(--dim); font-size: 12.5px; }
.move.split:hover:not(:disabled) { border-color: var(--split); box-shadow: 0 0 0 1px var(--split) inset; }
.move.steal:hover:not(:disabled) { border-color: var(--steal); box-shadow: 0 0 0 1px var(--steal) inset; }
.move:disabled { opacity: 0.5; cursor: not-allowed; }

.go {
  border: 0; border-radius: 10px; padding: 10px 18px; font: inherit; font-weight: 700;
  color: #0b0b0d; background-image: var(--grad); cursor: pointer;
}
.go:disabled { opacity: 0.55; cursor: progress; }
.ghost {
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  border-radius: 9px; padding: 8px 13px; font: inherit; font-size: 13px; cursor: pointer;
  text-decoration: none; display: inline-block; text-align: center;
}
.ghost.wide { width: 100%; margin-top: 8px; }
.hint { color: var(--dim); font-size: 12.5px; margin: 12px 0 0; }

.log { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.round { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.round-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.round-n { color: var(--dim); font-size: 12px; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); }
.tag.split { color: var(--split); }
.tag.steal { color: var(--steal); }
.note { color: var(--dim); font-size: 12.5px; }
.ms { color: var(--dim); font-size: 11.5px; }
.bars { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.bar { background: linear-gradient(90deg, rgba(111,93,255,0.5) 0 var(--w), rgba(255,255,255,0.06) var(--w) 100%); border-radius: 5px; padding: 3px 8px; }
.bar-label { font-size: 11.5px; letter-spacing: 0.02em; }

.board { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13.5px; }
.board th { text-align: left; color: var(--dim); font-weight: 500; padding: 8px; border-bottom: 1px solid var(--line); }
.board td { padding: 8px; border-bottom: 1px solid rgba(255,255,255,0.05); font-variant-numeric: tabular-nums; }

.about { margin-top: 26px; color: var(--dim); font-size: 13.5px; max-width: 780px; }
.foot { max-width: 1020px; margin: 0 auto; padding: 18px 24px 32px; border-top: 1px solid var(--line); }

dialog {
  background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px; max-width: 430px; width: calc(100% - 32px);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
dialog h2 { margin: 0 0 12px; font-size: 17px; }
dialog summary { cursor: pointer; color: var(--dim); font-size: 13px; margin-top: 12px; }
dialog input { margin-top: 8px; width: 100%; }
.code { background: var(--panel-2); border: 1px dashed var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.code-label { color: var(--dim); font-size: 12px; }
.code-value { font-size: 22px; letter-spacing: 0.18em; }

@media (max-width: 620px) {
  main { padding: 16px 14px 28px; }
  .moves { grid-template-columns: 1fr; }
}
