/* Mobilsiden. Mørk som standard, «sol-modus» er lys med høy kontrast for bruk ute på banen. */
:root {
  --bg: #0b0d12; --card: #151922; --line: #252b38; --text: #f2f4f8; --muted: #8d97ab;
  --accent: #e8102e; --gold: #ffb400; --ok: #1fb864; --me: rgba(232, 16, 46, .14);
  color-scheme: dark;
}
:root[data-theme='sun'] {
  --bg: #ffffff; --card: #f1f3f6; --line: #c9ced8; --text: #000000; --muted: #3c4352;
  --accent: #c8001e; --gold: #a86f00; --ok: #00803c; --me: rgba(200, 0, 30, .12);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.35 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
  padding-bottom: env(safe-area-inset-bottom);
}
:root[data-theme='sun'] body { font-weight: 500; }
button { font: inherit; color: inherit; }

.head { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 2px solid var(--accent); padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { font-weight: 700; font-size: 18px; }
.brand b { background: var(--accent); color: #fff; padding: 0 5px; margin-right: 2px; }
.brand span { color: var(--muted); font-weight: 500; font-size: 14px; margin-left: 6px; }
.icon { background: var(--card); border: 1px solid var(--line); border-radius: 99px; width: 40px; height: 40px; font-size: 18px; }
.heat { margin-top: 8px; align-items: flex-end; }
.heatname { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.sub { color: var(--muted); font-size: 14px; }
.right { text-align: right; }
.status { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .08em; padding: 2px 8px; border-radius: 4px; background: var(--card); border: 1px solid var(--line); }
.status.live { background: var(--accent); border-color: var(--accent); color: #fff; animation: pulse 1.6s infinite; }
.status.done { background: var(--gold); border-color: var(--gold); color: #000; }
@keyframes pulse { 50% { opacity: .65; } }
.clock { font-size: 26px; font-weight: 800; margin-top: 2px; }

.offline { background: var(--gold); color: #000; text-align: center; padding: 8px; font-weight: 700; }

main { padding: 12px 16px 32px; max-width: 640px; margin: 0 auto; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 18px 0 8px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: grid; grid-template-columns: 30px 6px 1fr auto; align-items: center; gap: 10px;
  padding: 10px 8px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 6px;
}
.list li.me { background: var(--me); }
.list li.down { opacity: .45; }
.list li.flash { animation: flash 1.2s; }
@keyframes flash { 0% { background: var(--gold); } 100% { background: transparent; } }
.list .pos { font-size: 22px; font-weight: 800; text-align: center; }
.list .bar { width: 6px; height: 34px; border-radius: 3px; background: var(--c); }
.list .nm { font-weight: 700; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .nm small { display: block; font-weight: 500; font-size: 13px; color: var(--muted); }
.list .t { text-align: right; }
.list .t b { display: block; font-size: 17px; }
.list .t small { color: var(--muted); font-size: 13px; }
.list.small li { padding: 6px 8px; }
.list.small .pos { font-size: 16px; }
.list.small .nm { font-size: 15px; }
.tag { font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 3px; margin-left: 6px; vertical-align: 2px; }
.tag.down { background: var(--accent); color: #fff; }
.tag.fin { background: var(--gold); color: #000; }
.fastest { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.fastest b { color: var(--text); }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }

.mine { margin-top: 4px; background: var(--card); border: 2px solid var(--c, var(--accent)); border-radius: 12px; padding: 14px; }
.mine .top { display: flex; justify-content: space-between; align-items: baseline; }
.mine .name { font-size: 20px; font-weight: 800; }
.mine .pos { font-size: 40px; font-weight: 900; line-height: 1; }
.mine .big { font-size: 44px; font-weight: 900; line-height: 1.1; margin: 6px 0 2px; }
.mine .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.mine .grid div { font-size: 12px; color: var(--muted); }
.mine .grid b { display: block; color: var(--text); font-size: 18px; }
.mine .stop { margin-top: 10px; background: none; border: 0; color: var(--muted); font-size: 13px; padding: 0; text-decoration: underline; }

.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translate(-50%, calc(100% + 40px));
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 99px; font-weight: 700;
  transition: transform .25s; white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis;
}
.toast.show { transform: translate(-50%, 0); }
.toast.gold { background: var(--gold); color: #000; }

.stakes { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.stakes span::before { content: '●'; margin-right: 8px; color: var(--z, var(--muted)); }
.z-advance { --z: var(--ok); } .z-final { --z: var(--gold); } .z-second { --z: #e8a000; } .z-out { --z: var(--accent); } .z-champion { --z: var(--gold); }
.tag.z-advance, .tag.z-final, .tag.z-second, .tag.z-out, .tag.z-champion { background: var(--z); color: #000; }
.tag.z-out { color: #fff; }
.stakes[hidden] { display: none; }
