:root {
  --green: #0a7f58;
  --green-2: #064d41;
  --grass: #00ff87;
  --cream: #f5f7fb;
  --white: #fff;
  --purple: #38003c;
  --purple-soft: #f0e8f4;
  --ink: #17202a;
  --muted: #64748b;
  --line: #d7dee8;
  --danger: #a93636;
  --shadow: 0 16px 42px rgba(19, 55, 39, .13);
  --nav-height: 78px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-total-height: calc(var(--nav-height) + var(--safe-bottom));
}

* { box-sizing: border-box; }
html {
  height: 100%;
  background: var(--cream);
  overflow: hidden;
}
body {
  display: flex;
  flex-direction: column;
  margin: 0;
  height: 100vh;
  min-height: 100vh;
  max-height: 100vh;
  color: var(--ink);
  background: var(--cream);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
}
@supports (height: 100dvh) {
  body {
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
  }
}
button, input { font: inherit; }
button { cursor: pointer; }
input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--white);
  outline: none;
}
input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft); }

.app-header {
  flex: none;
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: calc(10px + env(safe-area-inset-top)) 18px 10px;
  color: var(--white);
  background: rgba(56, 0, 60, .97);
  border-bottom: 3px solid var(--grass);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand div { min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid var(--white);
  border-radius: 50%;
  color: var(--green);
  background: var(--grass);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
}
.brand strong { display: block; overflow: hidden; font-size: 1.08rem; text-overflow: ellipsis; white-space: nowrap; }
.brand div span { display: block; margin-top: 2px; color: #e7d8ee; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.profile-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
  color: var(--green);
  background: var(--white);
  font-weight: 900;
}

main {
  flex: 1 1 auto;
  width: calc(100% - 32px);
  max-width: 760px;
  min-height: 0;
  margin: 0 auto;
  padding: 18px 0 28px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-padding-bottom: calc(var(--nav-total-height) + 24px);
}
.hero {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: 22px;
  color: var(--white);
  background: linear-gradient(145deg, var(--purple), #111827);
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  right: -45px;
  bottom: -75px;
  width: 190px;
  height: 190px;
  border: 2px solid rgba(255,255,255,.17);
  border-radius: 50%;
  box-shadow: inset 0 0 0 24px rgba(255,255,255,.035);
}
.eyebrow {
  display: block;
  color: #718073;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.hero .eyebrow { color: var(--grass); }
.hero h1 { max-width: 530px; margin: 7px 0 8px; font-size: clamp(1.8rem, 7vw, 2.65rem); line-height: 1.02; overflow-wrap: anywhere; }
.hero p { max-width: 520px; margin: 0; color: #dce7d9; line-height: 1.48; }
.countdown {
  display: inline-flex;
  gap: 8px;
  margin-top: 18px;
  padding: 8px 11px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  font-size: .78rem;
  font-weight: 800;
}

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 24px 2px 10px; min-width: 0; }
.section-head > div { min-width: 0; }
.section-head h2 { margin: 3px 0 0; font-size: 1.35rem; }
.section-head p { margin: 0; color: var(--muted); font-size: .78rem; }
.section-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.live-update-status {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  white-space: nowrap;
}
.live-update-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 86px;
  min-height: 34px;
  padding: 8px 11px;
  border: 1px solid #b9cda1;
  border-radius: 999px;
  color: var(--green);
  background: #f1f7e8;
  font-size: .72rem;
  font-weight: 900;
}
.live-update-button span {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 999px;
  color: var(--white);
  background: var(--green);
  font-size: .78rem;
  line-height: 1;
}
.live-update-button:disabled { cursor: wait; opacity: .78; }
.pill {
  flex: none;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--purple);
  background: var(--purple-soft);
  font-size: .68rem;
  font-weight: 900;
}

.notice, .empty, .rules-card, .league-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.78);
}
.notice { display: flex; gap: 11px; margin-top: 14px; }
.install-notice { border-color: #b9cda1; background: #f1f7e8; }
.invite-notice { border-color: #cdb7df; background: var(--purple-soft); }
.notice-icon { font-size: 1.35rem; }
.notice strong { display: block; margin-bottom: 3px; }
.notice p, .empty p { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.45; }

.day-card {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 6px 20px rgba(20,61,43,.06);
}
.day-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  list-style: none;
  cursor: pointer;
}
.day-card summary::-webkit-details-marker { display: none; }
.day-card summary strong { display: block; font-family: Georgia, serif; }
.day-card summary span { color: var(--muted); font-size: .75rem; }
.day-card summary::after { content: "⌄"; color: var(--purple); font-size: 1.1rem; }
.day-card[open] summary::after { transform: rotate(180deg); }
.day-body { padding: 0 12px 12px; }

.match-card {
  position: relative;
  overflow: hidden;
  margin: 9px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}
.fixture-calendar {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(56, 0, 60, .14);
  border-radius: 9px;
  color: var(--purple);
  background: rgba(255,255,255,.9);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
}
.fixture-calendar:hover { background: var(--purple-soft); border-color: rgba(56, 0, 60, .35); }
.match-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 46px 9px 12px;
  color: var(--muted);
  background: #f7f9fc;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.tour-badge { color: var(--purple); }
.match-intel-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 12px 0;
}
.intel-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-height: 27px;
  padding: 6px 9px;
  border: 1px solid #e1e8ef;
  border-radius: 999px;
  color: var(--ink);
  background: #f8fbff;
  font-size: .7rem;
  font-weight: 900;
  line-height: 1;
}
.intel-pill em {
  color: var(--muted);
  font-size: .6rem;
  font-style: normal;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.weather-pill { border-color: #cde7d6; background: #f0faf1; }
.venue-pill {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.players { padding: 12px; }
.player-row { display: flex; align-items: center; gap: 9px; min-height: 34px; font-weight: 800; }
.football-teams .player-row em {
  margin-left: auto;
  color: var(--muted);
  font-size: .62rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.team-crest {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--team-fg, var(--purple));
  background: var(--team-bg, #ecfff5);
  border: 2px solid var(--team-border, #b9f8d8);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.28), 0 1px 2px rgba(15,23,42,.08);
  font-size: .66rem;
  font-weight: 1000;
}
.seed { width: 27px; color: var(--muted); font-size: .72rem; text-align: right; }
.player-flag { flex: none; width: 1.35em; font-size: 1rem; line-height: 1; text-align: center; }
.player-name { min-width: 0; overflow-wrap: anywhere; }
.player-name.pending { color: #9aa39b; font-weight: 700; }
.versus { margin: -2px 0 -2px 45px; color: #94a3b8; font-size: .64rem; font-weight: 900; }
.h2h-line {
  margin: 7px 0 0 36px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  line-height: 1.35;
}
.oracle-prob {
  margin: 0 12px 11px;
  padding: 10px;
  border: 1px solid #edf1f5;
  border-radius: 12px;
  background: #fbfcfe;
}
.prob-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.prob-unavailable {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  padding: 2px 0 1px;
}
.form-dot-empty {
  color: var(--muted);
  background: #f1f3f7;
}
.prob-values {
  display: grid;
  align-items: center;
  min-width: 0;
  margin: -1px 0 3px;
  color: var(--purple);
  font-size: .64rem;
  font-weight: 1000;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.prob-values span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
/* Labels are decoupled from the fr-based segment widths so the 3-letter codes
   always render in full, even on lopsided splits (e.g. 71/7 -> COV, never
   "C…"). The rail and percent rows above keep their segment geometry. */
.prob-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}
.prob-labels span { white-space: nowrap; }
.prob-labels span:first-child { text-align: left; }
.prob-labels span:last-child { text-align: right; }
.prob-values .draw { color: #4b5563; }
.prob-values .away { color: var(--purple); }
.prob-values .home { color: var(--green); }
.prob-values .draw,
.prob-labels span:nth-child(2) { padding: 0 3px; }
.prob-values .away,
.prob-labels span:last-child { padding-left: 4px; }
.prob-values .home,
.prob-labels span:first-child { padding-right: 4px; }
.prob-rail {
  display: grid;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6edf4;
}
.prob-rail i { display: block; height: 100%; }
.prob-rail .home { background: var(--green); }
.prob-rail .draw { background: #a3aab8; }
.prob-rail .away { background: var(--purple); }
.prob-labels {
  margin-top: 5px;
  color: var(--muted);
  font-size: .64rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.prob-labels span:nth-child(2) { flex: none; text-align: center; }
.prob-labels span:last-child { text-align: right; }
.form-guide {
  display: grid;
  gap: 7px;
  margin: -1px 12px 13px;
  padding: 10px;
  border: 1px solid #edf1f5;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}
.form-note {
  margin-bottom: 2px;
  color: var(--muted);
}
.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}
.form-team {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.form-team strong {
  min-width: 0;
  overflow: hidden;
  font-size: .76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.form-team span {
  flex: none;
  color: var(--muted);
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.form-dots { display: flex; gap: 4px; }
.form-dot {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  color: var(--white);
  font-size: .58rem;
  font-weight: 1000;
  line-height: 1;
}
.form-dot.win { background: var(--green); }
.form-dot.draw { color: #243041; background: #d7dee8; }
.form-dot.loss { background: #a93636; }
.form-dot.unknown { color: var(--muted); background: #eef2f6; }
.pick-zone { padding: 0 12px 13px; }
.pick-label { margin-bottom: 7px; color: var(--muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.score-window { margin-top: 11px; border-top: 1px dashed var(--line); padding-top: 11px; }
.score-picker { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 2px 0 10px; }
.score-step { display: flex; align-items: center; gap: 8px; }
.score-step button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--white);
  font-size: 1.12rem;
  font-weight: 900;
}
.score-step button:hover { border-color: var(--purple); background: var(--purple-soft); }
.score-step button:disabled { cursor: not-allowed; opacity: .5; }
.score-value {
  width: 30px;
  text-align: center;
  color: var(--ink);
  font-size: 1.7rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.score-dash { color: var(--muted); font-size: 1.1rem; font-weight: 900; }
.lock-pick-button {
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  color: var(--white);
  background: var(--green);
  font-size: .8rem;
  font-weight: 900;
}
.lock-pick-button:hover { filter: brightness(.97); }
.lock-pick-button:disabled { cursor: not-allowed; opacity: .65; }
.pick-lock-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--green);
  border-radius: 12px;
  background: linear-gradient(145deg, #ecf8df, #fff);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.75);
}
.pick-lock-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--white);
  background: var(--green);
  font-size: .9rem;
}
.pick-lock-main { min-width: 0; }
.pick-lock-label {
  display: block;
  color: var(--green);
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.pick-lock-main strong {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
  font-size: .84rem;
  line-height: 1.25;
}
.pick-lock-main strong b {
  color: var(--purple);
  font-variant-numeric: tabular-nums;
}
.pick-lock-main p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.35;
}
.pick-edit-hint { margin-top: 7px; color: var(--muted); font-size: .7rem; font-weight: 800; }
.app-update-prompt {
  position: fixed;
  right: 14px;
  bottom: calc(var(--nav-total-height) + 12px);
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100vw - 28px);
  padding: 10px 13px;
  border: 0;
  border-radius: 999px;
  color: var(--white);
  background: var(--green);
  box-shadow: 0 10px 24px rgba(13, 62, 43, .26);
  font-size: .78rem;
  font-weight: 900;
}
.app-update-prompt span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  color: var(--green);
  background: var(--white);
  font-size: .92rem;
  line-height: 1;
}
.app-update-prompt.updating { opacity: .82; pointer-events: none; }
.flash {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid #b9cda1;
  border-radius: 10px;
  color: var(--green);
  background: #ecfff5;
  font-size: .8rem;
  font-weight: 800;
}
.flash-error {
  border-color: #fecaca;
  color: #991b1b;
  background: #fef2f2;
}

.filters { display: flex; gap: 8px; margin: 12px 0 15px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter {
  flex: none;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--white);
  font-size: .76rem;
  font-weight: 800;
}
.filter.active { border-color: var(--green); color: var(--white); background: var(--green); }
.league-switcher { align-items: stretch; }
.league-filter {
  display: inline-flex;
  align-items: center;
  max-width: min(82vw, 310px);
}
.league-filter-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 14px 0; }
.stat { padding: 14px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); text-align: center; }
.stat b { display: block; font-size: 1.5rem; color: var(--green); }
.stat span { color: var(--muted); font-size: .67rem; font-weight: 800; text-transform: uppercase; }

.league-card h2, .rules-card h2 { margin: 4px 0 8px; font-family: Georgia, serif; }
.league-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin: 13px 0; }
.action-card, .restore-card, .reveal-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.9);
}
.action-card h3 { margin: 4px 0 12px; font-family: Georgia, serif; }
.restore-card { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.restore-card > div { flex: 1; min-width: 0; }
.restore-card p { margin: 3px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.4; }
.restore-card code { color: var(--purple); font-weight: 900; overflow-wrap: anywhere; }
.restore-card input { max-width: 180px; }
.league-code { display: flex; align-items: center; justify-content: space-between; margin: 14px 0; padding: 12px; border-radius: 12px; color: var(--white); background: var(--green); }
.league-code strong { letter-spacing: .14em; }
.table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.table th, .table td { padding: 10px 5px; border-bottom: 1px solid var(--line); text-align: right; }
.table th:first-child, .table td:first-child { text-align: left; }
.league-table th:nth-child(2), .league-table td:nth-child(2) { width: 46px; text-align: center; }
.wins-col { width: 42px; text-align: center; }
th.wins-col { font-size: .92rem; }
.crown { font-size: .82rem; }
.round-toggle {
  display: flex;
  gap: 6px;
  margin: 14px 0 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}
.round-seg {
  flex: 1;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
}
.round-seg.active { color: var(--white); background: var(--purple); }
.md-picker {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin: 8px 0 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}
.md-cell {
  padding: 8px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
}
.md-cell.active { color: var(--white); border-color: var(--green); background: var(--green); }
.round-banner {
  margin: 12px 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--cream);
}
.round-banner strong { display: block; color: var(--ink); font-size: .85rem; }
.round-banner span { display: block; margin-top: 3px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.round-banner.is-success { border-color: #b9cda1; background: #ecfff5; }
.round-banner.is-success strong { color: var(--green); }
.round-banner.is-pending { border-color: #f3d9a4; background: #fff7e8; }
.round-banner.is-pending strong { color: #92600a; }
.section-head .pick-progress { margin-top: 5px; color: var(--green); font-weight: 800; }
.movement {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: .78rem;
  font-weight: 900;
}
.movement-up { color: #087f5b; background: rgba(8, 127, 91, .1); }
.movement-down { color: #d6336c; background: rgba(214, 51, 108, .1); }
.movement-flat { color: var(--muted); background: #eef1ec; }
.you { color: var(--purple); font-weight: 900; }
.secondary {
  padding: 10px 14px;
  border: 1px solid var(--purple);
  border-radius: 10px;
  color: var(--purple);
  background: var(--white);
  font-weight: 900;
}
.whatsapp-share {
  padding: 13px 14px;
  border: 0;
  border-radius: 12px;
  color: #08251a;
  background: #28d7c8;
  font-weight: 900;
}
.link-danger {
  display: block;
  margin: 8px auto 0;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: #c4122e;
  font-size: .72rem;
  font-weight: 800;
  cursor: pointer;
}
.link-danger:hover { text-decoration: underline; }
.kick-cell { width: 1%; text-align: right; padding-left: 4px; }
.kick-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #c4122e;
  background: transparent;
  font-size: 1rem;
  line-height: 1;
  opacity: .55;
  cursor: pointer;
}
.kick-btn:hover { opacity: 1; background: rgba(196, 18, 46, .1); }
.reveal-card { margin-bottom: 10px; }
.reveal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.reveal-head span { color: var(--purple); font-size: .75rem; font-weight: 900; }
.reveal-picks > div {
  display: grid;
  grid-template-columns: 1fr auto 34px;
  gap: 9px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: .8rem;
}
.reveal-picks em { color: var(--green); font-style: normal; font-weight: 900; text-align: right; }
.rules-list { padding-left: 20px; color: var(--muted); line-height: 1.6; }
.rules-list strong { color: var(--ink); }
.rules-attribution { margin: 18px 0 0; color: var(--muted); font-size: .78rem; }
.rules-attribution a { color: var(--ink); font-weight: 800; }
.round-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 14px; }
.round-rule { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.round-rule b { display: block; color: var(--green); }
.round-rule span { color: var(--muted); font-size: .75rem; }
.primary {
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  color: var(--white);
  background: var(--purple);
  font-weight: 900;
}
.wide { width: 100%; margin-top: 16px; }

.app-footer {
  flex: none;
  padding: 6px 12px;
  text-align: center;
  border-top: 1px solid var(--line);
  background: var(--white);
}
.app-footer a {
  color: var(--muted);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
}
.app-footer a:hover { color: var(--purple); }
.bottom-nav {
  flex: none;
  position: relative;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  height: var(--nav-total-height);
  min-height: var(--nav-total-height);
  padding: 7px 5px max(var(--safe-bottom), 6px);
  border-top: 1px solid var(--line);
  background: var(--white);
  backdrop-filter: blur(16px);
  transform: translateZ(0);
}
.bottom-nav button { height: 52px; min-height: 52px; padding: 3px 0 5px; border: 0; color: #839087; background: transparent; font-size: .62rem; font-weight: 800; }
.bottom-nav button span { display: block; margin-bottom: 2px; font-size: 1.15rem; filter: grayscale(1); }
.bottom-nav button.active { color: var(--purple); }
.bottom-nav button.active span { filter: none; }

/* Native shell only: tighten the bottom-nav's home-indicator padding so the
   icons sit lower while the bar still clears the indicator and its background
   still reaches the very bottom. Web build keeps the full safe-area inset. */
.is-native {
  --safe-bottom-nav: max(8px, calc(var(--safe-bottom) - 14px));
  --nav-total-height: calc(var(--nav-height) + var(--safe-bottom-nav));
}
.is-native .bottom-nav { padding-bottom: var(--safe-bottom-nav); }
.is-native .app-footer { display: none; }

dialog { width: min(430px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 24px 80px rgba(0,0,0,.28); }
dialog::backdrop { background: rgba(13, 46, 32, .58); backdrop-filter: blur(3px); }
dialog form { padding: 20px; }
.dialog-head { display: flex; justify-content: space-between; gap: 10px; }
.dialog-head h2 { margin: 4px 0 16px; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 50%; color: var(--muted); background: #eef1ec; font-size: 1.35rem; }
dialog label { display: block; margin-bottom: 6px; color: var(--muted); font-size: .75rem; font-weight: 800; }
@media (min-width: 700px) {
  main { padding-top: 26px; }
  .hero { padding: 30px; }
  .day-body { padding: 0 18px 16px; }
  .round-grid { grid-template-columns: repeat(4, 1fr); }
}

/* iPad portrait's WKWebView viewport is ~663 CSS px (device-width is scaled),
   so a 760px breakpoint never fires there — the crowded case Apple flagged.
   600px covers iPad portrait/landscape while leaving iPhone unchanged:
   iPhone portrait (402) stays single-column, iPhone landscape (874) was
   already two-column above 760. */
@media (min-width: 600px) {
  .match-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, .88fr);
    column-gap: 4px;
  }
  .match-meta,
  .match-intel-strip {
    grid-column: 1 / -1;
  }
  .players {
    grid-column: 1;
    grid-row: 3 / span 3;
    align-self: start;
    padding: 28px 12px 14px 14px;
  }
  .oracle-prob {
    grid-column: 2;
    grid-row: 3;
    margin: 11px 12px 7px 4px;
  }
  .form-guide {
    grid-column: 2;
    grid-row: 4;
    margin: 0 12px 9px 4px;
  }
  .pick-zone {
    grid-column: 2;
    grid-row: 5;
    padding: 0 12px 13px 4px;
  }
}

@media (min-width: 900px) and (max-height: 860px) {
  main {
    max-width: 960px;
    padding-top: 14px;
  }
  .app-header {
    min-height: 62px;
    padding-top: calc(7px + env(safe-area-inset-top));
    padding-bottom: 7px;
  }
  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
  .hero {
    padding: 22px 30px;
    border-radius: 18px;
  }
  .hero h1 {
    margin: 5px 0 6px;
    font-size: 2.35rem;
  }
  .countdown {
    margin-top: 14px;
  }
  .notice {
    margin-top: 10px;
    padding: 13px 16px;
  }
  .section-head {
    margin-top: 18px;
  }
  .bottom-nav {
    --nav-height: 68px;
  }
  .bottom-nav button {
    height: 46px;
    min-height: 46px;
  }
}

@media (max-width: 430px) {
  .app-header { padding-right: 13px; padding-left: 13px; }
  main > .hero,
  main > .notice,
  main > .day-card,
  main > .match-card,
  main > .rules-card,
  main > .league-card,
  main > .stats-grid,
  main > .filters {
    margin-right: 16px;
  }
  .brand div span { font-size: .62rem; }
  .profile-button { width: 34px; height: 34px; }
  .section-head .pill { display: none; }
  .section-head { align-items: flex-start; }
  .section-actions { align-items: flex-end; flex-direction: column; gap: 5px; }
  .live-update-status { max-width: 112px; overflow: hidden; text-overflow: ellipsis; }
  .score-picker { gap: 7px; }
  .score-step { gap: 6px; }
  .score-step button { width: 32px; height: 32px; }
  .league-actions { grid-template-columns: 1fr; }
  .restore-card { align-items: stretch; flex-direction: column; }
  .restore-card input { max-width: none; }
}
