/* Dolphin Super 6 Predictor: floodlit-night navy. One bold element: the colour-coded scores.
   Score colour = how likely the picked result is (traffic light, always with a text label). */
:root {
  --bg: #0d1220;
  --surface: #131a2b;
  --surface-2: #1b2337;
  --line: #263049;
  --text: #eceff6;
  --dim: #97a1b7;
  --strong: #34d399;
  --fair: #fbbf24;
  --toss: #f87171;
  --home: #e6eaf2;
  --draw: #4b5672;
  --away: #8d9ab8;
  --focus: #fbbf24;
  --radius: 14px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.55 var(--font);
  font-variation-settings: "wdth" 100;
}
a { color: inherit; text-decoration-color: var(--dim); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
.dim { color: var(--dim); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.wrap { max-width: 50rem; margin: 0 auto; padding: 0 16px; }

/* masthead */
.masthead { border-bottom: 1px solid var(--line); margin-bottom: 2rem; }
.masthead-inner {
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  padding-top: 2rem; padding-bottom: 1.4rem; text-align: center;
}
h1 {
  font-size: 2rem; line-height: 1.05; font-weight: 800;
  font-variation-settings: "wdth" 118; letter-spacing: -0.01em;
}
.tagline { color: var(--dim); margin-top: 0.3rem; }
.brand { display: flex; align-items: center; justify-content: center; gap: 0.9rem; }
.logo { width: 76px; height: 76px; flex: none; object-fit: contain; }
.round { text-align: center; }
.round-name { font-weight: 700; font-size: 1.05rem; }
.round-closes { color: var(--dim); font-size: 0.9rem; }

/* list header + legend */
.list-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem 1.5rem;
  flex-wrap: wrap; margin-bottom: 0.9rem;
}
h2 { font-size: 1.15rem; font-weight: 700; }
.legend { list-style: none; display: flex; gap: 1rem; margin: 0; padding: 0; font-size: 0.85rem; flex-wrap: wrap; }
.legend li { display: flex; align-items: center; gap: 0.4rem; }
.dot { width: 0.65rem; height: 0.65rem; border-radius: 50%; display: inline-block; }
.dot.strong { background: var(--strong); }
.dot.fair { background: var(--fair); }
.dot.toss-up { background: var(--toss); }

/* fixture list: one panel, rows divided by lines */
.fixtures {
  list-style: none; margin: 0; padding: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.fixture + .fixture { border-top: 1px solid var(--line); }
summary {
  list-style: none; cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas:
    "meta meta meta"
    "home result away"
    "why why why"
    "toggle toggle toggle";
  align-items: center; column-gap: 1rem;
  padding: 1rem 1.25rem 0.85rem;
}
summary::-webkit-details-marker { display: none; }
summary:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
details[open] summary { background: var(--surface-2); }

.meta { grid-area: meta; text-align: center; font-size: 0.8rem; color: var(--dim); margin-bottom: 0.6rem; }
.team { display: flex; align-items: center; gap: 0.85rem; min-width: 0; font-weight: 650; font-size: 1.05rem; }
.team.home { grid-area: home; justify-content: flex-end; text-align: right; }
.team.away { grid-area: away; }
.tname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crest {
  width: 56px; height: 56px; flex: none; object-fit: contain;
  /* faint light edge so navy/black crests (e.g. Spurs) don't vanish on the dark background */
  filter: drop-shadow(0 0 0.6px rgba(236, 239, 246, 0.7)) drop-shadow(0 0 5px rgba(236, 239, 246, 0.12));
}

.result { grid-area: result; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.score {
  display: flex; align-items: baseline; gap: 0.35rem;
  font-size: 3.4rem; line-height: 0.95; font-weight: 800;
  font-variation-settings: "wdth" 112; font-variant-numeric: tabular-nums;
  color: var(--c, var(--text));
}
.score .sep { color: var(--dim); font-weight: 500; font-size: 0.7em; transform: translateY(-0.12em); }
.conf {
  font-size: 0.75rem; font-weight: 700; padding: 0.12rem 0.55rem; border-radius: 999px;
  color: var(--c, var(--dim)); background: color-mix(in srgb, var(--c, var(--dim)) 14%, transparent);
  white-space: nowrap;
}
.fixture[data-conf="strong"] { --c: var(--strong); }
.fixture[data-conf="fair"] { --c: var(--fair); }
.fixture[data-conf="toss-up"] { --c: var(--toss); }

.why { grid-area: why; text-align: center; margin-top: 0.75rem; color: var(--text); font-size: 0.95rem; }
.toggle {
  grid-area: toggle; justify-self: center; margin-top: 0.4rem; font-size: 0.8rem; color: var(--dim);
  display: inline-flex; align-items: center; gap: 0.3rem;
}
.toggle::after {
  content: ""; width: 0.45rem; height: 0.45rem; border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px);
}
details[open] .toggle::after { transform: rotate(-135deg) translateX(-2px); }

/* detail panel */
.detail {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem 2rem;
  padding: 1.1rem 1.25rem 1.4rem; background: var(--surface-2);
  border-top: 1px solid var(--line);
}
.col.wide { grid-column: 1 / -1; }
h3 { font-size: 0.8rem; font-weight: 600; color: var(--dim); margin-bottom: 0.55rem; }
.col h3 + * + h3 { margin-top: 1rem; }

.bars { display: grid; gap: 0.5rem; }
.bar { display: grid; grid-template-columns: 7.2rem 1fr; align-items: center; gap: 0.6rem; font-size: 0.85rem; }
.track { display: flex; height: 1.4rem; border-radius: 6px; overflow: hidden; background: var(--bg); }
.seg {
  display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden;
  font-size: 0.72rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.seg.h { background: var(--home); color: var(--bg); }
.seg.d { background: var(--draw); color: var(--text); }
.seg.a { background: var(--away); color: var(--bg); }
.bar.missing .track { align-items: center; justify-content: center; color: var(--dim); font-size: 0.75rem; }
.bar-key { margin-top: 0.55rem; font-size: 0.75rem; color: var(--dim); display: flex; align-items: center; gap: 0.35rem; }
.k { width: 0.7rem; height: 0.7rem; border-radius: 3px; display: inline-block; }
.k.h { background: var(--home); } .k.d { background: var(--draw); margin-left: 0.5rem; } .k.a { background: var(--away); margin-left: 0.5rem; }

.others { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1rem; margin: 0; font-size: 0.9rem; }
.others dt { color: var(--dim); }
.others dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

.form { display: grid; gap: 0.4rem; font-size: 0.85rem; }
.form-row { display: flex; align-items: center; gap: 0.6rem; }
.form-row .fname { width: 7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); }
.pips { display: flex; gap: 3px; }
.pip {
  width: 1.3rem; height: 1.3rem; border-radius: 4px; display: grid; place-items: center;
  font-size: 0.68rem; font-weight: 800;
}
.pip.W { background: color-mix(in srgb, var(--strong) 22%, transparent); color: var(--strong); }
.pip.D { background: var(--line); color: var(--dim); }
.pip.L { background: color-mix(in srgb, var(--toss) 20%, transparent); color: var(--toss); }

.reasons, .warnings { margin: 0; padding-left: 1.1rem; }
.reasons li { margin-bottom: 0.35rem; max-width: 72ch; }
.reasons li::marker { color: var(--dim); }
.warnings { margin-top: 0.6rem; font-size: 0.85rem; color: var(--fair); padding-left: 0; list-style: none; }

.notice { margin-top: 1rem; color: var(--dim); }

/* sections below the list */
.block { margin-top: 3rem; }
.block > h2 { margin-bottom: 0.3rem; }
.block > .dim { font-size: 0.9rem; margin-bottom: 0.9rem; }
.about { padding-bottom: 4rem; }
.about p { max-width: 70ch; margin-bottom: 0.8rem; color: var(--dim); }
.about p:first-of-type { color: var(--text); }

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.92rem; }
th, td { text-align: right; padding: 0.65rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { font-weight: 600; color: var(--dim); font-size: 0.8rem; }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 800; border-top: 1px solid var(--line); border-bottom: 0; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; color: var(--dim); }

@media (max-width: 640px) {
  h1 { font-size: 1.45rem; }
  .logo { width: 64px; height: 64px; }
  .brand { flex-direction: column; gap: 0.5rem; }  /* phones: dolphin above the title */
  summary {
    column-gap: 0.5rem; padding: 0.9rem 0.9rem 0.75rem;
  }
  .team { flex-direction: column; gap: 0.4rem; font-size: 0.9rem; text-align: center; }
  .team.home { flex-direction: column; text-align: center; justify-content: flex-start; }
  .team.home .crest { order: -1; }
  .tname { max-width: 100%; white-space: normal; line-height: 1.2; }
  .crest { width: 44px; height: 44px; }
  .score { font-size: 2.8rem; }
  .why { font-size: 0.9rem; }
  .detail { grid-template-columns: 1fr; padding: 1rem 0.9rem 1.2rem; }
  .bar { grid-template-columns: 6rem 1fr; }
  th, td { padding: 0.6rem 0.7rem; }
}
@media (prefers-reduced-motion: no-preference) {
  details[open] .detail { animation: open 180ms ease-out; }
  @keyframes open { from { opacity: 0; transform: translateY(-4px); } }
}
