:root {
  --bg: #0e1412;
  --panel: #151d1a;
  --panel-2: #1d2723;
  --line: #27332e;
  --text: #ecf1ee;
  --muted: #8fa39a;
  --accent: #c8f04a;
  --win: #34d399;
  --loss: #f87171;
  --draw: #fbbf24;
  --radius: 14px;
  --head: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 Inter, system-ui, -apple-system, sans-serif; padding-bottom: env(safe-area-inset-bottom); }
a { color: inherit; }
button { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.wrap { max-width: 760px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

.top { position: sticky; top: 0; z-index: 5; background: rgba(14, 20, 18, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding-top: calc(10px + env(safe-area-inset-top)); }
.brand { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
h1 { font: 700 25px/1 var(--head); text-transform: uppercase; letter-spacing: .6px; margin: 0; }
h1::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 3px; box-shadow: 0 0 10px var(--accent); }
.sub { color: var(--muted); font-size: 12px; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-top: 10px; padding-bottom: 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--panel); padding: 6px 13px; border-radius: 999px; cursor: pointer; font-size: 13.5px; color: var(--muted); }
.chip.on { background: var(--accent); color: #0e1412; border-color: var(--accent); font-weight: 600; }
.chip .off { opacity: .55; }

h2 { font: 600 21px/1.1 var(--head); text-transform: uppercase; letter-spacing: .6px; margin: 22px 0 8px; }
h2 small { font: 500 12px Inter, sans-serif; color: var(--muted); text-transform: none; letter-spacing: 0; margin-left: 6px; }
.empty { color: var(--muted); padding: 18px 0; font-size: 14px; }

/* upcoming list */
.day { font: 600 13px Inter, sans-serif; color: var(--accent); text-transform: uppercase; letter-spacing: .6px; margin: 14px 0 4px; }
.fx { display: grid; grid-template-columns: 76px 1fr; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.fx .t { font: 600 17px/1 var(--head); }
.fx .t.late { color: #a5b4fc; }
.fx .who { font-weight: 600; font-size: 14.5px; }
.fx .meta { color: var(--muted); font-size: 12px; }
.live { color: var(--loss); font-weight: 700; font-size: 11px; letter-spacing: .6px; }

/* team cards */
.cards { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 620px) { .cards { grid-template-columns: 1fr 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; }
.team { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.crest { width: 34px; height: 34px; flex: none; border-radius: 50%; object-fit: contain; background: #fff1; }
.crest.txt { display: grid; place-items: center; font: 700 14px var(--head); color: var(--accent); background: var(--panel-2); }
.team b { font-size: 15.5px; display: block; line-height: 1.2; }
.team span { color: var(--muted); font-size: 12px; }
.pos { margin-left: auto; text-align: right; font: 600 22px/1 var(--head); }
.pos small { display: block; font: 500 10.5px Inter, sans-serif; color: var(--muted); }
.row2 { display: grid; grid-template-columns: 44px 1fr; gap: 8px; font-size: 13.5px; padding: 5px 0; border-top: 1px solid var(--line); }
.row2 .k { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; padding-top: 2px; }
.res { display: inline-block; min-width: 20px; text-align: center; font-weight: 700; font-size: 12px; border-radius: 4px; padding: 0 4px; margin-right: 6px; color: #0e1412; }
.res.W { background: var(--win); } .res.L { background: var(--loss); } .res.D { background: var(--draw); }
.form { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: 1px; }
.form i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.form .W { background: var(--win); } .form .L { background: var(--loss); } .form .D { background: var(--draw); }
.dim { color: var(--muted); }

/* ladders */
.ladder { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ladder th { color: var(--muted); font-weight: 500; font-size: 11.5px; text-align: right; padding: 4px; }
.ladder th:nth-child(2) { text-align: left; }
.ladder td { padding: 6px 4px; border-top: 1px solid var(--line); text-align: right; }
.ladder td:first-child { color: var(--muted); width: 26px; }
.ladder td:nth-child(2) { text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.ladder td:last-child { font-weight: 700; }
.ladder tr.mine td { background: rgba(200, 240, 74, .09); color: var(--text); }
.ladder tr.mine td:nth-child(2) { font-weight: 700; color: var(--accent); }
.ladder tr.cut td { border-top: 2px dashed var(--muted); }
.ladder img { width: 16px; height: 16px; object-fit: contain; vertical-align: -3px; margin-right: 6px; }
details.more summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 8px 0 0; }

/* news */
.story { display: block; text-decoration: none; padding: 11px 0; border-bottom: 1px solid var(--line); }
.story .src { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.story .src .tg { color: var(--accent); }
.story h3 { font-size: 15px; font-weight: 600; line-height: 1.3; margin: 3px 0 3px; }
.story p { margin: 0; color: var(--muted); font-size: 13px; }

/* f1 */
.race { display: grid; grid-template-columns: 36px 1fr auto; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; align-items: center; }
.race .r { font: 600 15px var(--head); color: var(--muted); }
.big { font: 700 34px/1 var(--head); }

.foot { color: var(--muted); font-size: 11.5px; margin-top: 28px; padding-bottom: 28px; }

/* f1 weekend */
.f1chips { padding-top: 2px; }
.f1t td:nth-child(2) { max-width: none; white-space: normal; }
.f1t td:nth-child(3) { white-space: nowrap; }
.tc { display: inline-block; width: 4px; height: 14px; border-radius: 2px; margin-right: 7px; vertical-align: -2px; }
.dnf { color: var(--loss); font-weight: 600; font-size: 12px; }
