/* "Ez a játék" tab and game detail page (views/tab-gstats.js, sheets/game-detail.js), the score
   chart (views/chart.js), the rounds table (views/rounds-table.js, .rt-*) and the round correction
   sheet (sheets/round-edit.js, .re-*). Prototype: docs/design/midnight-board.html. */

/* ---------- shared pieces (.gx-*) ---------- */
.gx-page { display: flex; flex-direction: column; }
.gx-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.gx-h1 { font: 700 26px var(--font-head); letter-spacing: -0.025em; margin: 0; }
.gx-subline { color: var(--muted); font-size: 13.5px; line-height: 1.45; margin: 0 0 10px; }
.gx-tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font: 600 11.5px var(--font-mono); background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.gx-tag.g { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.gx-tag.b { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.gx-tag.w { background: var(--warn-soft); color: var(--warn); }
.gx-sec { font: 700 11.5px var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 22px 2px 10px; }
.gx-body > .gx-sec:first-child { margin-top: 4px; }
.gx-av { width: var(--s, 36px); height: var(--s, 36px); border-radius: 50%; background: var(--c); color: var(--chip-ink); display: inline-grid; place-items: center; font: 700 calc(var(--s, 36px) * 0.42) var(--font-head); flex-shrink: 0; }

.gx-seg { display: flex; background: var(--surface-alt); border-radius: 14px; padding: 4px; gap: 4px; margin: 0 0 14px; }
.gx-seg button { flex: 1; padding: 9px 4px; border: 0; border-radius: 10px; background: none; font: 600 13px var(--font-body); color: var(--muted); cursor: pointer; }
.gx-seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px var(--shadow); }

/* ---------- score chart ---------- */
.gx-chart-card { padding: 14px 10px; }
.gx-chart-svg { display: block; width: 100%; height: auto; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.gx-chart-svg .gx-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
.gx-chart-svg .gx-grid.zero { stroke: var(--muted); stroke-width: 1.4; stroke-dasharray: none; }
.gx-chart-svg text { font-family: var(--font-mono); }
.gx-chart-svg .gx-tick { fill: var(--muted); font-size: 10px; }
.gx-chart-svg .gx-tick.zero { fill: var(--ink); }
.gx-chart-svg .gx-xl { fill: var(--muted); font-size: 9.5px; }
.gx-chart-svg .gx-xl.on { fill: var(--ink); font-weight: 700; }
.gx-chart-svg .gx-guide { stroke: var(--accent); stroke-width: 1.5; opacity: 0.6; }
.gx-chart-svg .gx-line { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.gx-chart-svg .gx-dot { stroke: var(--surface); stroke-width: 2; }
.gx-chart-svg .gx-hit { fill: transparent; cursor: pointer; }
.gx-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.gx-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.gx-tip { margin: 10px 6px 0; padding: 10px 12px; border-radius: 16px; background: var(--surface-alt); }
.gx-tip-h { font: 700 12px var(--font-body); color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.gx-tip-r { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13.5px; font-weight: 600; min-width: 0; }
.gx-tip-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.gx-tip-r .gx-tag { font-size: 11px; padding: 2px 7px; }
.gx-tip-r b { margin-left: auto; font: 700 14px var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- hit rate bars and tiles ---------- */
.gx-hb { display: grid; grid-template-columns: minmax(0, 92px) 1fr 58px; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.gx-hb-n { display: flex; gap: 6px; align-items: center; min-width: 0; }
.gx-hb-n span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-hb-tr { height: 14px; border-radius: 7px; background: var(--surface-alt); overflow: hidden; }
.gx-hb-tr i { display: block; height: 100%; border-radius: 7px; background: var(--c); }
.gx-hb-v { text-align: right; }
.gx-hb-v small { display: block; color: var(--muted); font: 500 11px var(--font-mono); }
.gx-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.gx-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 13px; box-shadow: var(--shadow-card); min-width: 0; }
.gx-tile .l { font: 600 11px var(--font-body); color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.gx-tile .v { font: 700 26px var(--font-head); letter-spacing: -0.03em; margin: 4px 0; }
.gx-tile .s { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 12.5px; color: var(--muted); }
.gx-who { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: var(--ink); font-weight: 600; min-width: 0; }
.gx-at { color: var(--muted); }
.gx-rounds-card { padding: 14px 16px; }

/* ---------- rounds table (.rt-*) ---------- */
.rt-scroll { overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
.rt-scroll::-webkit-scrollbar { display: none; }
.rt-table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.rt-table th, .rt-table td { padding: 8px 7px; text-align: center; border-bottom: 1px solid var(--border); white-space: nowrap; }
.rt-table th { color: var(--muted); font: 600 11px var(--font-body); text-transform: uppercase; letter-spacing: 0.04em; }
.rt-table th:first-child, .rt-table td:first-child { text-align: left; }
.rt-table td { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.rt-table td small { color: var(--muted); display: block; font-size: 10.5px; margin-top: 1px; }
.rt-table tfoot td { border-bottom: 0; font-weight: 700; font-size: 13.5px; }
.rt-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }
.rt-sc { font-weight: 700; }
.rt-sc.p { color: var(--good); }
.rt-sc.n { color: var(--bad); }
.rt-trump { color: var(--ink); }
.rt-trump.red { color: var(--bad); }
.rt-table .rt-time { color: var(--muted); font-size: 11.5px; }
.rt-table tr.tap { cursor: pointer; }
.rt-table tr.tap:hover td, .rt-table tr.tap:focus-visible td { background: var(--surface-alt); }
.rt-table tr.tap:active td { background: var(--accent-soft); }
.rt-hint { margin-top: 8px; }

/* ---------- game detail page (.gd-*) ---------- */
.gd-victory { text-align: center; padding: 4px 0 0; }
.gd-eyebrow { margin: 0; font: 600 11px var(--font-body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.gd-victory h3 { font: 700 26px var(--font-head); letter-spacing: -0.02em; margin: 6px 0 2px; text-wrap: balance; }
.gd-run { margin: 6px 0 0; }
.gd-rest { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.gd-row { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card); }
.gd-rk { font: 600 13px var(--font-mono); color: var(--muted); width: 18px; text-align: right; }
.gd-nm { flex: 1; min-width: 0; font-weight: 600; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gd-nm small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); }
.gd-tt { font: 700 22px var(--font-head); letter-spacing: -0.02em; }
.gd-body { margin-top: 6px; }
.gd-actions { margin-top: 0; }
.gd-actions button { flex: 1; }

/* ---------- round correction sheet (.re-*) ---------- */
.re-sub { margin: -4px 0 0; }
.re-red { color: var(--bad) !important; }
.re-rows { display: flex; flex-direction: column; }
.re-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.re-row:last-child { border-bottom: 0; }
.re-nm { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.re-nm small { display: flex; align-items: center; gap: 4px; margin-top: 2px; font-weight: 500; font-size: 11px; }
.re-role { padding: 1px 6px; border-radius: 999px; background: var(--surface-alt); color: var(--muted); }
.re-role.k { background: var(--accent-soft); color: var(--accent); }
.re-sc { font-family: var(--font-mono); font-weight: 700; }
.re-sc.p { color: var(--good); }
.re-sc.n { color: var(--bad); }
.re-col { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.re-col em { font-style: normal; font-size: 11px; color: var(--muted); }
.re-row .stepper { display: flex; align-items: center; gap: 2px; width: auto; background: var(--surface-alt); border-radius: 14px; padding: 3px; }
.re-row .stepper button { width: 32px; height: 32px; border: 0; border-radius: 10px; background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px var(--shadow); display: grid; place-items: center; padding: 0; cursor: pointer; }
.re-row .stepper button:disabled { opacity: 0.3; cursor: default; }
.re-row .stepper output { min-width: 24px; text-align: center; font: 700 16px var(--font-mono); }
.re-sum { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.re-sum b { color: var(--ink); }
.re-pill { padding: 6px 11px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.re-pill b { color: inherit; }
.re-pill.ok { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.re-pill.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
@media (max-width: 370px) {
  .re-row { gap: 6px; }
  .re-row .stepper button { width: 28px; height: 30px; }
  .re-row .stepper output { min-width: 20px; }
}
