/* shared UI for the pixel sports dioramas */
:root { --paper: #f3efe6; --ink: #22201c; --muted: #7a7468; --line: #d7d0c2; --card: rgba(250, 247, 240, .93); --accent: #c8352a; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper); color: var(--ink); font-family: 'Inter', system-ui, sans-serif; }
canvas#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; touch-action: none; }
.ui { position: fixed; z-index: 2; }
.k { font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.k a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.title { top: 16px; left: 18px; pointer-events: none; }
.title a { pointer-events: auto; }
.title h1 { margin: 6px 0 4px; font: 400 30px/1 'Silkscreen', monospace; letter-spacing: .02em; text-shadow: 2px 2px 0 rgba(255,255,255,.6); }
.title p { margin: 0; max-width: 250px; font-size: 12px; line-height: 1.45; color: #4a463e; }
.board { top: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: stretch; background: #1b1a18; color: #f5f0e6;
  font: 400 15px 'Silkscreen', monospace; border: 2px solid #000; box-shadow: 3px 3px 0 rgba(0,0,0,.25); }
.board > div { padding: 5px 10px; display: flex; align-items: center; gap: 7px; }
.board .sc { background: #f5f0e6; color: #1b1a18; min-width: 64px; justify-content: center; }
.board .tm { padding: 5px 9px; }
.board i { width: 10px; height: 10px; display: inline-block; border: 1px solid #000; }
.board .clock { background: #2f6b3a; }
.board .clock.red { background: #a8322a; }
.sub { position: fixed; top: 48px; left: 50%; transform: translateX(-50%); z-index: 2; font: 400 10px 'Silkscreen', monospace; background: #1b1a18; color: #ffd84a; padding: 3px 8px; opacity: 0; transition: opacity .3s; }
.sub.on { opacity: 1; }
.panel { top: 12px; right: 12px; bottom: 12px; width: 268px; overflow-y: auto; background: var(--card); border: 1px solid var(--line); padding: 12px 13px 16px;
  box-shadow: 3px 3px 0 rgba(0,0,0,.08); font-size: 11.5px; scrollbar-width: thin; }
.panel h3 { margin: 14px 0 6px; font: 600 9px 'Inter'; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; }
.panel h3:first-child { margin-top: 0; }
.seg { display: grid; gap: 4px; }
.seg.c2 { grid-template-columns: 1fr 1fr; } .seg.c3 { grid-template-columns: 1fr 1fr 1fr; } .seg.c4 { grid-template-columns: repeat(4, 1fr); }
.b { appearance: none; border: 1px solid #bdb4a4; background: #fffdf8; color: var(--ink); padding: 6px 4px; font: 500 11px 'Inter'; cursor: pointer; border-radius: 0; }
.b:hover { border-color: var(--ink); }
.b.on { background: var(--ink); color: #fffdf8; border-color: var(--ink); }
.b.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.hint { font-size: 10.5px; color: var(--muted); margin-top: 5px; line-height: 1.4; }
.log { list-style: none; margin: 0; padding: 0; max-height: 128px; overflow: hidden; }
.log li { padding: 3px 0; border-bottom: 1px dotted var(--line); line-height: 1.35; }
.log li b { font: 400 9px 'Silkscreen', monospace; color: var(--muted); margin-right: 5px; }
.log li.goal { color: var(--accent); font-weight: 700; } .log li.big { font-weight: 700; } .log li.save { color: #2f6b3a; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
td, th { padding: 2px 3px; text-align: right; } td:first-child, th:first-child { text-align: left; }
th { font-weight: 500; color: var(--muted); font-size: 9.5px; }
.lineups { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 10.5px; }
.lineups div > div { padding: 1px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lineups span { display: inline-block; width: 17px; color: var(--muted); font: 400 9px 'Silkscreen', monospace; }
.statrow { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; gap: 6px; margin: 3px 0; font-size: 11px; }
.statrow .bar { height: 6px; background: #ddd5c6; position: relative; } .statrow .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); }
.statrow div:last-child { text-align: right; } .statrow .lbl { text-align: center; font-size: 9.5px; color: var(--muted); margin-bottom: 1px; }
.checks { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.checks label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--ink); }
.foot { left: 18px; bottom: 14px; font-size: 10.5px; color: #4a463e; max-width: 330px; pointer-events: none; }
.foot b { font: 400 9px 'Silkscreen', monospace; }
@media (max-width: 760px) {
  .title h1 { font-size: 20px; } .title p, .foot { display: none; }
  .board { top: auto; bottom: 46%; font-size: 12px; } .sub { display: none; }
  .panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; height: 42%; }
}
