@font-face {
  font-family: "VT323";
  src: url("fonts/vt323.woff2") format("woff2");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg-top: #121b31;
  --bg: #070b14;
  --panel: rgba(9, 14, 26, 0.72);
  --line: #1e2a42;
  --line-strong: #2c3a58;
  --text: #e7edf7;
  --muted: #8193b5;
  --dim: #56627d;
  --cyan: #74d9ff;
  --pink: #ff5d8f;
  --pixel: "VT323", ui-monospace, "DejaVu Sans Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-top) 0, var(--bg) 900px) var(--bg);
  color: var(--text);
  font: 21px/1.3 var(--pixel);
  -webkit-font-smoothing: none;
}
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.board { max-width: 960px; margin: 0 auto; padding: 40px 24px 64px; }

.label {
  margin: 0;
  color: var(--muted);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.head { display: flex; align-items: center; gap: 24px; }
.rule { flex: 1; display: flex; align-items: center; gap: 20px; }
.rule::after { content: ""; flex: 1; border-top: 1px dashed var(--line-strong); }

/* Square game button: flat face, dark block underneath. */
.btn {
  display: inline-block;
  padding: 8px 22px 6px;
  border: 1px solid var(--line-strong);
  background: #111a2c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 5px 0 #03060c;
  color: var(--muted);
  font-size: 22px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { color: var(--text); border-color: #3d4f75; }
.btn:active { transform: translateY(3px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 2px 0 #03060c; }

.meta { margin: 24px 0 36px; color: var(--muted); letter-spacing: 0.04em; }

.controls { display: flex; gap: 12px; margin-bottom: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field .label { font-size: 16px; }
.field-search { flex: 1; }
input, select {
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: #060a12;
  padding: 2px 12px 0;
  font-size: 21px;
}
input::placeholder { color: var(--dim); }
input::-webkit-search-cancel-button { filter: grayscale(1) brightness(1.4); }
select {
  appearance: none;
  min-width: 140px;
  padding-right: 34px;
  background: #060a12 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' shape-rendering='crispEdges'%3E%3Cpath fill='%238193b5' d='M0 0h10v2H8v2H6v2H4V4H2V2H0z'/%3E%3C/svg%3E") no-repeat right 12px center;
  cursor: pointer;
}
select option { background: #0b1220; }

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

.cols, .row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto 92px;
  align-items: center;
  column-gap: 24px;
  padding: 0 28px;
}
.cols {
  height: 48px;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-size: 16px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.right { text-align: right; }

.rows { list-style: none; margin: 0; padding: 0; }
.row { min-height: 92px; padding-top: 14px; padding-bottom: 14px; }
.row + .row { border-top: 1px solid var(--line); }
.row.first { background: linear-gradient(90deg, rgba(116, 217, 255, 0.05), transparent 60%); }

.rank { color: var(--pink); font-size: 34px; text-shadow: 0 0 10px rgba(255, 93, 143, 0.35); }
.who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.model { font-size: 27px; overflow-wrap: anywhere; }
.round { font-size: 15px; color: var(--dim); }
.score {
  color: var(--cyan);
  font-size: 44px;
  line-height: 1;
  text-align: right;
  text-shadow: 0 0 6px rgba(116, 217, 255, 0.55), 0 0 18px rgba(116, 217, 255, 0.25);
}

.slots { display: flex; gap: 4px; }
.slot {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  background: #0c1322;
  font: 17px/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.slot.empty {
  border-style: dashed;
  border-color: var(--line);
  background: repeating-linear-gradient(45deg, transparent 0 3px, rgba(129, 147, 181, 0.08) 3px 4px), #05080f;
}

.note { margin: 0; padding: 32px 28px; color: var(--muted); }
.foot { margin: 20px 0 0; color: var(--dim); font-size: 18px; }

@media (max-width: 720px) {
  .board { padding: 28px 16px 48px; }
  .head { gap: 16px; }
  .rule::after { display: none; }
  .label { font-size: 17px; letter-spacing: 0.16em; }
  .btn { padding: 6px 14px 4px; font-size: 19px; }
  .meta { margin: 16px 0 24px; font-size: 19px; }
  .controls { flex-wrap: wrap; }
  .field-search { flex-basis: 100%; }
  .field:not(.field-search) { flex: 1; }
  select { min-width: 0; width: 100%; }
  .cols { display: none; }
  .row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    grid-template-areas: "rank who score" ". slots slots";
    row-gap: 12px;
    column-gap: 12px;
    padding: 16px;
  }
  .rank { grid-area: rank; font-size: 28px; }
  .who { grid-area: who; }
  .model { font-size: 24px; }
  .score { grid-area: score; font-size: 38px; }
  .slots { grid-area: slots; }
  .slot { width: 30px; height: 30px; font-size: 16px; }
}

@media (max-width: 360px) {
  .row { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .slots { gap: 3px; }
  .slot { width: 27px; height: 27px; font-size: 14px; }
}
