:root {
  --bg: #f3f0e8;
  --paper: #fffdf7;
  --ink: #121212;
  --ink-2: #2b2b2b;
  --muted: #6f6a5f;
  --line: #d8d0c1;
  --line-strong: #121212;
  --navy: #06184a;
  --blue: #102ec8;
  --yellow: #f2c94c;
  --green: #1e7a54;
  --red: #b42318;
  --soft: #ebe4d6;
  --shadow: 6px 6px 0 rgba(18, 18, 18, 0.12);
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Arial Narrow", "Helvetica Neue", Arial, var(--font-body);
  font-family: var(--font-body);
}

* { box-sizing: border-box; }
* { min-width: 0; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(18, 18, 18, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 18, 18, .035) 1px, transparent 1px),
    var(--bg);
  background-size: 38px 38px;
  color: var(--ink);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--line-strong);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 900;
  letter-spacing: -.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  place-items: center;
  font-weight: 950;
  border: 1px solid var(--ink);
}

.nav-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--paper);
  font-weight: 760;
  letter-spacing: 0;
  box-shadow: none;
  text-align: center;
  overflow-wrap: anywhere;
}

.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--yellow); color: var(--ink); border-color: var(--ink); font-weight: 900; }
.btn.primary:hover { background: var(--ink); color: var(--paper); }
.btn.ghost { background: transparent; }
.btn.full { width: 100%; }
.btn.small { padding: 7px 10px; font-size: 13px; }
.btn.danger { background: #f8d6d2; color: var(--red); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(320px, .97fr);
  gap: 24px;
  align-items: stretch;
  min-height: 72vh;
  padding-top: 24px;
}

.hero-card,
.mock-phone,
.form-card,
.panel,
.support-card,
.score-card,
.moment-card,
.match-card,
.player-row,
.stat {
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  box-shadow: var(--shadow);
}

.hero-card {
  padding: clamp(26px, 4vw, 54px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.eyebrow {
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 11px;
  font-weight: 950;
  margin-bottom: 14px;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 960px;
  font-family: var(--font-display);
  font-size: clamp(44px, 7.4vw, 96px);
  line-height: .9;
  letter-spacing: -.035em;
  margin-bottom: 20px;
  text-transform: uppercase;
  font-weight: 900;
  text-wrap: balance;
  overflow-wrap: normal;
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 52px);
  line-height: .96;
  letter-spacing: -.025em;
  margin-bottom: 12px;
  text-transform: uppercase;
  font-weight: 900;
  text-wrap: balance;
  overflow-wrap: normal;
}
h3 { letter-spacing: -.01em; margin-bottom: 8px; font-size: 20px; }
p { color: var(--muted); line-height: 1.45; }

.hero-card p { max-width: 580px; font-size: 18px; color: var(--ink-2); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }

.mock-phone {
  padding: 14px;
  align-self: stretch;
  display: flex;
}

.phone-screen {
  width: 100%;
  background: var(--soft);
  border: 1px solid var(--ink);
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.live-pill,
.badge,
.reaction,
.tab {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border-radius: 0;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 6px 8px;
}

.live-pill { margin-bottom: 0; width: fit-content; background: var(--yellow); }

.score-card, .moment-card, .match-card, .support-card, .panel, .form-card { padding: 18px; }

.support-card h2 {
  font-size: clamp(30px, 4.2vw, 44px);
  overflow-wrap: normal;
}

.score-line {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  font-weight: 900;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: -.01em;
}
.score-line span { overflow-wrap: anywhere; }
.score-line span:last-child { text-align: right; }

.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.main { grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); align-items: start; }

.form-card { max-width: 760px; margin: 34px auto; }
.form-row { display: grid; gap: 8px; margin-bottom: 16px; }
label { color: var(--muted); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  padding: 13px 12px;
  outline: none;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(16, 46, 200, .16); }
.helper { color: var(--muted); font-size: 13px; margin-top: -8px; }

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 8px;
}
.tab { background: transparent; color: var(--muted); }
.tab:hover,
.tab.active { background: var(--ink); color: var(--paper); }

.league-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 26px 0 20px;
}
.league-header h1 { font-size: clamp(40px, 5.8vw, 78px); margin: 0; }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.stat {
  padding: 12px;
  box-shadow: none;
}
.stat b { display: block; font-size: clamp(24px, 3.1vw, 30px); line-height: 1; letter-spacing: -.015em; overflow-wrap: anywhere; }
.stat span { color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }

.progress {
  width: 100%;
  height: 16px;
  border-radius: 0;
  background: var(--soft);
  border: 1px solid var(--ink);
  overflow: hidden;
}
.progress > div {
  height: 100%;
  width: var(--w, 0%);
  background: repeating-linear-gradient(45deg, var(--yellow) 0 8px, #ffe08a 8px 16px);
  border-right: 1px solid var(--ink);
}

.levels { display: grid; gap: 8px; margin-top: 14px; }
.level {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #faf6ed;
}
.level.unlocked { border-color: var(--green); background: #eef6ef; }
.level small { color: var(--muted); }

.player-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  box-shadow: none;
}
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 0;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  font-weight: 950;
}
.badge { white-space: normal; text-align: center; }
.badge.good { background: #e8f6d8; color: var(--green); border-color: var(--green); }
.badge.locked { background: var(--soft); color: var(--muted); border-color: var(--line); }

.match-card { display: grid; gap: 12px; box-shadow: none; }
.match-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .07em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
.teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: -.01em;
}
.teams span { overflow-wrap: anywhere; }
.teams span:nth-child(2) { color: var(--muted); font-size: 13px; letter-spacing: .06em; white-space: nowrap; }
.teams span:last-child { text-align: right; }
.pick-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pick-buttons .btn { padding: 11px 8px; }
.pick-buttons .btn.selected { background: var(--ink); color: var(--paper); font-weight: 950; }

.moment-feed { display: grid; gap: 14px; }
.moment-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: -.01em;
  line-height: 1.12;
}
.locked-box {
  border: 1px dashed var(--ink);
  padding: 14px;
  background: #f7f0e2;
}
.comment {
  padding: 12px;
  background: var(--soft);
  border: 1px solid var(--ink);
  margin-top: 10px;
}
.reactions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.reaction { padding: 7px 9px; }

.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 11px 14px;
  border: 1px solid var(--paper);
  font-weight: 900;
  z-index: 10;
}

.kicker { color: var(--muted); font-size: 13px; font-weight: 650; }
.empty { color: var(--muted); padding: 24px; text-align: center; }
.copy-code {
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 12px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--blue); font-weight: 950; overflow-wrap: anywhere; }

.support-card input[type="radio"] { width: auto; margin-right: 8px; }

@media (max-width: 920px) {
  .hero, .grid.main, .grid.two, .grid.three { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .league-header { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
  .app-shell { width: min(100% - 18px, 1180px); padding-top: 10px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .brand span:last-child { display: inline; }
  .nav-actions { justify-content: flex-start; }
  .stat-strip { grid-template-columns: 1fr; }
  .pick-buttons { grid-template-columns: 1fr; }
  .teams { font-size: 18px; }
  h1 { font-size: clamp(42px, 14vw, 66px); letter-spacing: -.025em; line-height: .94; }
  h2 { font-size: clamp(30px, 10vw, 42px); letter-spacing: -.015em; line-height: 1; }
  .brand { white-space: normal; }
  .player-row { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .player-row > strong:last-child { grid-column: 3; }
  .player-row .badge { display: none; }
}

/* v0.4 mobile-first competition catalog pass */
.mobile-hero h1,
.catalog-head h1 {
  max-width: 980px;
}

.catalog-page {
  padding-top: 22px;
}

.catalog-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin: 0 0 18px;
}

.catalog-head h1 {
  margin-bottom: 12px;
}

.sport-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 10px;
  margin: 0 0 14px;
  border-bottom: 1px solid var(--ink);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.sport-tabs::-webkit-scrollbar { display: none; }
.sport-tabs .tab { white-space: nowrap; flex: 0 0 auto; }

.competition-list {
  display: grid;
  gap: 10px;
}

.competition-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: none;
}
.competition-card.selected {
  outline: 3px solid rgba(16, 46, 200, .22);
  background: #fff8df;
}
.competition-card.disabled {
  opacity: .62;
}
.competition-index {
  width: 34px;
  height: 34px;
  border: 1px solid var(--ink);
  display: grid;
  place-items: center;
  font-weight: 950;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
}
.competition-main h3 {
  margin: 0 0 4px;
  text-transform: uppercase;
  line-height: 1.02;
  overflow-wrap: anywhere;
}
.competition-main p {
  margin: 0 0 10px;
  color: var(--ink-2);
}
.meta-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.competition-action {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 92px;
}
.selected-competition {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--ink);
  background: var(--soft);
}
.choice-card {
  display: block;
  cursor: pointer;
}
.disabled-choice {
  opacity: .58;
  cursor: not-allowed;
}
.index-preview .phone-screen {
  gap: 8px;
}
.index-line {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--ink);
  background: var(--paper);
}
.index-line span {
  font-weight: 950;
  color: var(--blue);
}
.index-line strong {
  text-transform: uppercase;
  line-height: 1;
  overflow-wrap: anywhere;
}
.index-line small {
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 10px;
}
.locked-box.compact {
  padding: 12px;
}
.data-note p { margin-bottom: 0; }
.comment-form {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.two-picks {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 720px) {
  body {
    background-size: 28px 28px;
  }
  .app-shell {
    width: min(100% - 18px, 1180px);
    padding: 10px 0 86px;
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--bg);
    padding: 8px 0 10px;
  }
  .nav-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .nav-actions .btn {
    padding: 8px 6px;
    font-size: 12px;
  }
  .hero {
    min-height: 0;
    padding-top: 12px;
  }
  .hero-card,
  .mock-phone,
  .form-card,
  .panel,
  .support-card,
  .score-card,
  .moment-card,
  .match-card {
    box-shadow: 4px 4px 0 rgba(18, 18, 18, .1);
  }
  .hero-card,
  .score-card,
  .moment-card,
  .match-card,
  .support-card,
  .panel,
  .form-card {
    padding: 14px;
  }
  .catalog-head {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .catalog-head .btn {
    width: 100%;
  }
  .competition-card {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }
  .competition-action {
    grid-column: 1 / -1;
    justify-items: stretch;
    min-width: 0;
  }
  .competition-action .btn {
    width: 100%;
  }
  .competition-index {
    width: 30px;
    height: 30px;
  }
  .selected-competition {
    grid-template-columns: 1fr;
  }
  .selected-competition .btn {
    width: 100%;
  }
  .index-line {
    grid-template-columns: 30px minmax(0, 1fr);
  }
  .index-line small {
    grid-column: 2;
  }
  .bottom-nav {
    position: sticky;
    bottom: 0;
    z-index: 4;
    background: var(--bg);
    border-top: 1px solid var(--ink);
    border-bottom: 0;
    margin: 0 calc(-1 * ((100vw - 100%) / 2));
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }
  .bottom-nav .tab {
    justify-content: center;
    padding: 8px 3px;
    font-size: 10px;
    letter-spacing: .02em;
  }
  .stat-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat b {
    font-size: 22px;
  }
  .match-head {
    display: grid;
    gap: 4px;
  }
  .teams {
    font-size: 19px;
  }
  .pick-buttons {
    grid-template-columns: 1fr;
  }
  .pick-buttons.two-picks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .levels .level {
    grid-template-columns: 1fr;
  }
  .level .badge {
    width: fit-content;
  }
}
