:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-strong: #eef4ff;
  --ink: #111827;
  --muted: #64748b;
  --line: #d9e2ee;
  --brand: #1457d9;
  --brand-dark: #0d347f;
  --green: #16803c;
  --green-bg: #e8f7ef;
  --amber: #ad6500;
  --amber-bg: #fff3d8;
  --red: #c51d2f;
  --red-bg: #ffe9ed;
  --shadow: 0 12px 30px rgba(15, 23, 42, .10);
  --nav-height: 94px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 12% -8%, rgba(20, 87, 217, .18), transparent 34%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 46%, #edf3fb 100%);
  font-size: 18px;
  line-height: 1.42;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: default;
  opacity: .72;
}

.appShell {
  width: 100%;
  max-width: 460px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 12px 14px calc(var(--nav-height) + 28px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

.topBar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 -14px 14px;
  padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
  background: rgba(244, 247, 251, .92);
  border-bottom: 1px solid rgba(217, 226, 238, .82);
  backdrop-filter: blur(16px);
}

.topBar > div:first-child {
  min-width: 0;
}

.appKicker {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 29px;
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: 28px;
  line-height: 1.06;
}

h3 {
  margin-bottom: 10px;
  font-size: 22px;
  line-height: 1.12;
}

h1,
h2,
h3,
p,
.rowTitle,
.teamName,
.screenTitle {
  overflow-wrap: anywhere;
}

.gwPill {
  display: grid;
  flex: 0 0 auto;
  min-width: 92px;
  padding: 9px 12px;
  border: 1px solid #bfd1f4;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .07);
  text-align: right;
}

.gwPill span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.gwPill b {
  color: var(--brand-dark);
  font-size: 18px;
  text-transform: capitalize;
}

.screenHost {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.connectionStatus {
  min-height: 38px;
  margin: -2px 0 14px;
  padding: 9px 12px;
  border: 1px solid #d9e4f2;
  border-radius: 16px;
  background: rgba(255, 255, 255, .72);
  color: var(--muted);
  font-size: 15px;
  font-weight: 850;
}

.connectionStatus.isConnected {
  border-color: #bce6ca;
  background: var(--green-bg);
  color: var(--green);
}

.connectionStatus.isError {
  border-color: #ffc9d2;
  background: var(--red-bg);
  color: var(--red);
}

.heroCard,
.card,
.matchCard,
.fixtureCard,
.tableCard,
.insightCard {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.heroCard {
  padding: 18px;
  background:
    linear-gradient(160deg, rgba(255,255,255,.94) 0%, rgba(237,244,255,.95) 100%),
    repeating-linear-gradient(90deg, rgba(20, 87, 217, .08) 0 8px, transparent 8px 16px);
  border-color: #c7d9f7;
}

.card,
.tableCard,
.insightCard {
  padding: 16px;
}

.sectionHeader {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.eyebrow,
.label {
  color: var(--muted);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .02em;
}

.statusLine {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 14px;
}

.segmented {
  display: flex;
  gap: 7px;
  min-width: 0;
  margin-top: 12px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid #d9e4f2;
  border-radius: 18px;
  background: #f3f7fc;
  scrollbar-width: none;
}

.segmented::-webkit-scrollbar {
  display: none;
}

.segment {
  flex: 0 0 auto;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 0 13px;
  background: transparent;
  color: #5d6c82;
  font-size: 16px;
  font-weight: 950;
}

.segment.isActive {
  border-color: #bfd1f4;
  background: #fff;
  color: var(--brand-dark);
  box-shadow: 0 7px 14px rgba(15, 23, 42, .08);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--brand-dark);
  font-size: 15px;
  font-weight: 950;
}

.pill.good {
  background: #e7f7ec;
  color: var(--green);
}

.pill.warn {
  background: #fff2d8;
  color: var(--amber);
}

.primaryButton,
.secondaryButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 18px;
  padding: 15px 18px;
  font-size: 19px;
  font-weight: 950;
}

.primaryButton {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 13px 26px rgba(20, 87, 217, .25);
}

.secondaryButton {
  border: 1px solid #c8d6eb;
  background: #fff;
  color: var(--brand-dark);
}

.metricGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.metric {
  min-width: 0;
  padding: 13px;
  border: 1px solid #dbe5f3;
  border-radius: 18px;
  background: #fbfdff;
}

.metric b {
  display: block;
  margin-top: 4px;
  font-size: 21px;
  line-height: 1.12;
}

.nextFixture {
  display: grid;
  gap: 10px;
}

.versusLine {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.teamName {
  min-width: 0;
  font-size: 21px;
  font-weight: 950;
  line-height: 1.08;
}

.clubCrest {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 64px;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 20px 20px 24px 24px;
  background:
    linear-gradient(135deg, var(--crest-primary) 0 50%, var(--crest-secondary) 50% 100%);
  color: var(--crest-text);
  font-size: 17px;
  font-weight: 950;
  letter-spacing: .02em;
  box-shadow: inset 0 -10px 0 rgba(0,0,0,.12), 0 8px 16px rgba(15, 23, 42, .16);
  flex: 0 0 auto;
}

.clubCrest::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 255, 255, .52);
  border-radius: 15px 15px 20px 20px;
}

.clubCrest::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 18px;
  height: 18px;
  border-radius: 0 0 6px 6px;
  background: inherit;
  transform: translateX(-50%) rotate(45deg);
  box-shadow: inset -5px -5px 0 rgba(0,0,0,.08);
}

.clubCrest span {
  position: relative;
  z-index: 1;
}

.clubCrest.hasImage {
  overflow: hidden;
  background: #fff;
}

.clubCrest.hasImage::before,
.clubCrest.hasImage::after {
  display: none;
}

.clubCrest img {
  width: 76%;
  height: 76%;
  object-fit: contain;
}

.leaderList,
.tableList,
.insightGrid,
.fixtureList,
.matchList {
  display: grid;
  gap: 10px;
}

.leaderRow,
.tableRow {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 12px;
  border: 1px solid #dde7f3;
  border-radius: 19px;
  background: #fbfdff;
}

.rank,
.medal {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #eaf1ff;
  color: var(--brand-dark);
  font-size: 18px;
  font-weight: 950;
}

.medal {
  border: 2px solid rgba(255,255,255,.85);
  box-shadow: inset 0 -8px 0 rgba(0,0,0,.10), 0 8px 14px rgba(15, 23, 42, .13);
}

.medal.gold {
  background: linear-gradient(145deg, #ffe28a, #c88400);
  color: #4a2b00;
}

.medal.silver {
  background: linear-gradient(145deg, #f2f5f8, #99a8b8);
  color: #263241;
}

.medal.bronze {
  background: linear-gradient(145deg, #ffc18a, #a55417);
  color: #3f1c08;
}

.leaderRow.isMe,
.tableCard .leaderRow.isMe {
  border-color: #a9c4f8;
  background: linear-gradient(180deg, #eef5ff, #ffffff);
  box-shadow: 0 10px 22px rgba(20, 87, 217, .12);
}

.meTag {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  margin-left: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  vertical-align: middle;
}

.rowTitle {
  font-size: 19px;
  font-weight: 950;
}

.rowMeta {
  color: var(--muted);
  font-size: 17px;
  font-weight: 760;
}

.points {
  text-align: right;
  font-size: 25px;
  font-weight: 950;
}

.negativeText {
  color: var(--red);
}

.positiveText {
  color: var(--green);
}

.moneyHero {
  margin-top: 8px;
  font-size: 36px;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.screenTitle {
  margin-bottom: 2px;
}

.fixtureCard {
  padding: 15px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(250,253,255,.98)),
    repeating-linear-gradient(0deg, rgba(22, 128, 60, .07) 0 12px, transparent 12px 24px);
}

.fixtureCard::before {
  content: "";
  display: block;
  height: 4px;
  margin: -15px -15px 13px;
  background: linear-gradient(90deg, #16803c, #86bf95, #16803c);
}

.fixtureTeams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
}

.fixtureKickoff {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 850;
}

.pickTeam {
  display: grid;
  justify-items: center;
  gap: 9px;
  min-width: 0;
  text-align: center;
}

.scoreBox {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 2px solid #c8d6eb;
  border-radius: 22px;
  background: #fff;
  color: var(--ink);
  font-size: 34px;
  font-weight: 950;
  box-shadow: inset 0 0 0 5px #f4f8ff;
}

.scoreInput {
  display: block;
  text-align: center;
}

.fixtureMeta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 800;
  text-align: center;
}

.pitchLine {
  width: 36px;
  height: 3px;
  border-radius: 999px;
  background: #86bf95;
}

.saveBar {
  position: sticky;
  bottom: calc(var(--nav-height) + 14px + env(safe-area-inset-bottom));
  z-index: 4;
  padding: 10px;
  border: 1px solid rgba(200, 214, 235, .92);
  border-radius: 22px;
  background: rgba(248, 251, 255, .95);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .14);
  backdrop-filter: blur(16px);
}

.matchCard {
  overflow: hidden;
  background:
    linear-gradient(180deg, #ffffff, #f8fbff),
    repeating-linear-gradient(90deg, rgba(20,87,217,.05) 0 10px, transparent 10px 20px);
}

.matchSummary {
  width: 100%;
  min-height: 82px;
  padding: 14px;
  border: 0;
  background: #fff;
  text-align: left;
}

.scoreLine {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.liveTeamBlock {
  display: grid;
  justify-items: center;
  gap: 7px;
  min-width: 0;
  text-align: center;
}

.score {
  color: var(--brand-dark);
  font-size: 34px;
  font-weight: 950;
  text-align: center;
}

.liveMeta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 850;
}

.swingCard {
  display: grid;
  gap: 3px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #c8d9f7;
  border-radius: 17px;
  background: #eef5ff;
  text-align: center;
}

.swingCard b {
  color: var(--brand-dark);
  font-size: 19px;
}

.matchDetail {
  display: none;
  padding: 0 14px 14px;
}

.matchCard.isOpen .matchDetail {
  display: grid;
  gap: 8px;
}

.detailTitle {
  margin: 4px 0 2px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 950;
}

.pickRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 16px;
  background: #f5f8fc;
  font-size: 18px;
  font-weight: 850;
}

.pickRow.isMe {
  background: linear-gradient(180deg, #eaf1ff, #f8fbff);
  color: var(--brand-dark);
  border: 1px solid #c1d5fb;
}

.tableControls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

select {
  width: 100%;
  min-height: 56px;
  border: 1px solid #c8d6eb;
  border-radius: 17px;
  padding: 0 13px;
  background: #fff;
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
}

.moneySummary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.moneyMetric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 13px;
  border: 1px solid #dbe5f3;
  border-radius: 18px;
  background: #fbfdff;
}

.moneyMetric b {
  font-size: 24px;
}

.moneyMetric.positive {
  border-color: #bce6ca;
  background: var(--green-bg);
  color: var(--green);
}

.moneyMetric.negative {
  border-color: #ffc9d2;
  background: var(--red-bg);
  color: var(--red);
}

.moneyMetric .label {
  color: inherit;
  opacity: .72;
}

.profileCard {
  padding: 19px;
  border-radius: 26px;
  background: linear-gradient(160deg, var(--brand), var(--brand-dark));
  color: #fff;
  box-shadow: 0 16px 32px rgba(20, 87, 217, .28);
}

.profileCard .label {
  color: rgba(255, 255, 255, .74);
}

.traitRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.traitRow span {
  display: inline-flex;
  align-items: center;
  min-height: 35px;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}

.profileNumber {
  margin: 9px 0 0;
  font-size: 48px;
  line-height: 1;
  font-weight: 950;
}

.insightGrid {
  grid-template-columns: 1fr 1fr;
}

.insightCard {
  min-height: 128px;
  background:
    linear-gradient(180deg, #ffffff, #fbfdff);
}

.statAction {
  padding: 0;
  overflow: hidden;
}

.statButton {
  display: block;
  width: 100%;
  min-height: 128px;
  border: 0;
  padding: 16px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.statDetail {
  display: none;
  padding: 0 16px 16px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 760;
}

.statAction.isOpen .statDetail {
  display: block;
}

.statAction.goldCard {
  border-color: #f0ca63;
  background: linear-gradient(180deg, #fff7df, #fff);
}

.statAction.greenCard {
  border-color: #bce6ca;
  background: linear-gradient(180deg, #e8f7ef, #fff);
}

.statAction.redCard {
  border-color: #ffc9d2;
  background: linear-gradient(180deg, #ffe9ed, #fff);
}

.insightCard b {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1.08;
}

.insightCard p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 760;
}

.footballNote {
  grid-column: span 2;
}

.miniTrend {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  gap: 8px;
  height: 130px;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid #dbe5f3;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(20,87,217,.05), rgba(255,255,255,.9));
}

.miniTrend span {
  display: block;
  min-height: 24px;
  border-radius: 999px 999px 8px 8px;
  background: linear-gradient(180deg, var(--brand), var(--brand-dark));
}

.statButton p,
.profileCard p {
  margin-bottom: 0;
}

.bottomNav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: flex;
  gap: 6px;
  min-height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(217, 226, 238, .92);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 -12px 28px rgba(15, 23, 42, .12);
  backdrop-filter: blur(18px);
}

.navItem {
  display: grid;
  place-items: center;
  align-content: center;
  flex: 1;
  min-width: 0;
  min-height: 64px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: transparent;
  color: #6b7a90;
  font-size: 15px;
  font-weight: 950;
}

.navIcon {
  font-size: 21px;
  line-height: 1;
}

.navItem.isActive {
  border-color: #c7d9f7;
  background: #eaf1ff;
  color: var(--brand-dark);
}

@media (min-width: 700px) {
  .appShell {
    border-right: 1px solid var(--line);
    border-left: 1px solid var(--line);
  }
}
