:root {
  color-scheme: dark;
  --bg: #080a0d;
  --surface: #10141a;
  --surface-2: #151a22;
  --surface-3: #1b222c;
  --line: #28313c;
  --line-strong: #3a4654;
  --text: #f5f2e8;
  --muted: #9aa5b3;
  --muted-2: #707a86;
  --gold: #d9b35b;
  --gold-2: #f0d17a;
  --green: #67d8a0;
  --red: #f17e7e;
  --blue: #88b9ff;
  --purple: #6f38b9;
  --radius: 14px;
  --shadow: 0 18px 55px rgba(0, 0, 0, .32);
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-shell {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(217, 179, 91, .08), transparent 34%),
    radial-gradient(circle at 50% 8%, rgba(111, 56, 185, .16), transparent 34%),
    var(--bg);
}

.login-card {
  width: min(520px, calc(100vw - 36px));
  max-width: 100%;
  min-width: 0;
  display: grid;
  gap: 18px;
  text-align: center;
}

.brand-lockup {
  font-weight: 950;
  letter-spacing: -.04em;
  font-size: clamp(28px, 8vw, 54px);
  line-height: .95;
}

.brand-lockup span { color: var(--text); }
.brand-lockup strong { color: var(--gold); }
.brand-lockup.compact {
  font-size: 25px;
  text-align: left;
}

.hero-field {
  position: relative;
  height: 270px;
  border: 1px solid #292417;
  border-radius: 28px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(217, 179, 91, .14) 1px, transparent 1px),
    linear-gradient(180deg, rgba(217, 179, 91, .12) 1px, transparent 1px),
    linear-gradient(135deg, #111820, #080b0f 54%, #1e1710);
  background-size: 42px 42px, 42px 42px, auto;
  box-shadow: var(--shadow);
}

.field-grid {
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(217, 179, 91, .35);
  border-radius: 18px;
}

.field-grid::before,
.field-grid::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 86px;
  height: 86px;
  border: 1px solid rgba(217, 179, 91, .38);
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.field-grid::after {
  width: 1px;
  height: 100%;
  border: 0;
  border-left: 1px solid rgba(217, 179, 91, .3);
}

.match-ticket {
  position: absolute;
  width: 214px;
  padding: 14px;
  border: 1px solid rgba(245, 242, 232, .12);
  border-radius: 14px;
  background: rgba(12, 15, 20, .86);
  backdrop-filter: blur(12px);
  text-align: left;
  box-shadow: 0 18px 30px rgba(0, 0, 0, .25);
}

.match-ticket small,
.eyebrow {
  display: block;
  color: var(--gold);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 900;
  margin: 0 0 7px;
}

.match-ticket strong {
  display: block;
  font-size: 18px;
}

.match-ticket span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.ticket-a { left: 22px; top: 32px; }
.ticket-b { right: 22px; bottom: 32px; }

.login-card h1 {
  margin: 0;
  font-size: clamp(38px, 8vw, 70px);
  line-height: .9;
  letter-spacing: -.06em;
  text-wrap: balance;
}

.login-card p {
  margin: 0 auto;
  max-width: 470px;
  color: #c9c2aa;
  line-height: 1.55;
}

.yahoo-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 12px;
  padding: 14px 18px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #15110a;
  font-weight: 950;
  box-shadow: 0 12px 26px rgba(217, 179, 91, .2);
}

.yahoo-button {
  width: min(340px, 100%);
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  background: linear-gradient(180deg, #6d35b5, #461180);
  color: #fff;
  box-shadow: 0 12px 26px rgba(70, 17, 128, .28);
  text-align: center;
  white-space: normal;
}

.yahoo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #fff;
  color: var(--purple);
  display: grid;
  place-items: center;
  font-weight: 950;
}

.security-copy {
  color: var(--muted-2) !important;
  font-size: 12px;
}

.app-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(217, 179, 91, .05), transparent 240px),
    var(--bg);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100svh;
  border-right: 1px solid var(--line);
  background: rgba(12, 15, 20, .94);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.league-card,
.sidebar-note,
.panel,
.metric-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(21, 26, 34, .94), rgba(13, 17, 23, .94));
  border-radius: var(--radius);
}

.league-card,
.sidebar-note {
  padding: 14px;
}

.league-card small,
.sidebar-note small,
.metric-card small,
.balance-grid small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.league-card strong,
.sidebar-note strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.league-card span,
.sidebar-note span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.4;
}

.nav-list {
  display: grid;
  gap: 7px;
}

.nav-button,
.mobile-nav button {
  border: 1px solid transparent;
  border-radius: 10px;
  color: #cfd6df;
  background: transparent;
  padding: 12px 13px;
  text-align: left;
  font-weight: 900;
}

.nav-button.active,
.mobile-nav button.active {
  border-color: rgba(217, 179, 91, .38);
  background: #1b1a13;
  color: var(--gold-2);
}

.workspace {
  min-width: 0;
  padding: 28px;
  padding-bottom: 110px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
  margin-bottom: 22px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 58px);
  line-height: .95;
  letter-spacing: -.055em;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

select {
  min-width: 118px;
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 34px 10px 12px;
}

.user-chip {
  border: 1px solid rgba(217, 179, 91, .45);
  color: var(--gold-2);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 900;
}

.page { display: none; }
.page.active { display: block; }

.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 16px;
  margin-bottom: 24px;
}

.panel {
  padding: 18px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .18);
}

.panel h2,
.section-heading h2,
.metric-card strong {
  margin: 0;
  font-size: 24px;
  letter-spacing: -.025em;
}

.panel p {
  color: var(--muted);
  line-height: 1.55;
  margin: 10px 0 0;
}

.wallet-panel {
  display: grid;
  gap: 18px;
}

.meter {
  height: 9px;
  background: #2a281f;
  overflow: hidden;
  border-radius: 999px;
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--green));
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.stat-row strong { color: var(--text); }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 26px 0 14px;
}

.section-heading.inline { margin-top: 0; }

.ghost-button,
.icon-button {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface);
  padding: 10px 12px;
  font-weight: 900;
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 24px;
}

.market-list,
.pool-grid,
.ops-grid {
  display: grid;
  gap: 12px;
}

.market-card {
  display: grid;
  grid-template-columns: minmax(220px, .78fr) minmax(360px, 1.22fr);
  gap: 14px;
  align-items: stretch;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #141922, #0e1218);
  border-radius: 16px;
  padding: 14px;
}

.matchup-meta {
  display: flex;
  gap: 12px;
  align-items: center;
}

.team-badge {
  width: 54px;
  height: 54px;
  border: 1px solid rgba(217, 179, 91, .5);
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #1d232d;
  font-size: 24px;
}

.matchup-meta h3 {
  margin: 0;
  font-size: 19px;
}

.matchup-meta p,
.market-copy {
  color: var(--muted);
  margin: 5px 0 0;
  line-height: 1.4;
  font-size: 13px;
}

.market-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.market-option {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #202731;
  padding: 13px 10px;
  color: var(--text);
  text-align: center;
  min-height: 112px;
}

.market-option[aria-pressed="true"] {
  color: #18130a;
  border-color: var(--gold);
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
}

.market-option small,
.market-option span {
  display: block;
}

.market-option small {
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.market-option strong {
  display: block;
  margin: 12px 0 8px;
  font-size: 26px;
  line-height: 1;
}

.market-option span {
  font-size: 11px;
  color: currentColor;
  opacity: .72;
}

.challenge-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.stake-input {
  max-width: 150px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #11161d;
  color: var(--gold-2);
  padding: 10px;
  font-weight: 950;
}

.pool-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pool-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #141922, #0d1117);
  padding: 16px;
}

.pool-card h3 {
  margin: 0;
}

.pool-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.pool-options button {
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: 10px;
  background: #1b222c;
  padding: 10px;
  font-weight: 850;
}

.pool-options button.selected {
  color: #16120a;
  background: var(--gold);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card {
  padding: 17px;
}

.metric-card strong {
  display: block;
  color: var(--gold-2);
  margin: 8px 0 5px;
  font-size: 32px;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
}

.data-table {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.table-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) repeat(4, minmax(72px, 100px));
  gap: 10px;
  align-items: center;
  padding: 13px 14px;
  background: rgba(255, 255, 255, .025);
}

.table-row.header {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 900;
}

.table-row.you {
  color: var(--gold-2);
  background: rgba(217, 179, 91, .09);
}

.balance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.balance-grid div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
  background: #11161d;
}

.balance-grid strong {
  display: block;
  margin-top: 7px;
  font-size: 24px;
  color: var(--gold-2);
}

.activity-list {
  display: grid;
  gap: 9px;
}

.activity-item,
.ops-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .025);
  padding: 13px;
}

.activity-item strong,
.ops-item strong {
  display: block;
}

.activity-item span,
.ops-item span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.pill {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.pill.good { color: var(--green); }
.pill.warn { color: var(--gold-2); }
.pill.bad { color: var(--red); }

.mobile-nav {
  display: none;
}

.dialog {
  width: min(520px, calc(100% - 28px));
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #10141a;
  color: var(--text);
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: rgba(0, 0, 0, .62);
}

.dialog form {
  margin: 0;
}

.dialog-head,
.dialog-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 18px;
}

.dialog-body {
  padding: 0 18px 18px;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(120%);
  border: 1px solid rgba(103, 216, 160, .45);
  border-radius: 999px;
  background: #0e1814;
  color: var(--green);
  padding: 12px 16px;
  font-weight: 900;
  transition: transform .2s ease;
  z-index: 30;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .workspace {
    padding: 18px 14px 96px;
    width: min(430px, 100%);
    margin: 0 auto;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-controls {
    justify-content: space-between;
  }

  .grid-two,
  .pool-grid,
  .metric-strip {
    grid-template-columns: 1fr;
  }

  .market-card {
    grid-template-columns: 1fr;
  }

  .mobile-nav {
    position: fixed;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(430px, 100%);
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-top: 1px solid var(--line);
    background: rgba(8, 10, 13, .94);
    backdrop-filter: blur(16px);
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    z-index: 20;
  }

  .mobile-nav button {
    text-align: center;
    padding: 11px 4px;
  }
}

@media (max-width: 620px) {
  .login-shell {
    place-items: start center;
  }

  .login-card {
    width: min(354px, calc(100vw - 36px));
  }

  .brand-lockup:not(.compact) {
    font-size: clamp(30px, 10vw, 38px);
    letter-spacing: -.07em;
  }

  .brand-lockup:not(.compact) span,
  .brand-lockup:not(.compact) strong {
    display: block;
  }

  .hero-field {
    height: 230px;
    width: 100%;
  }

  .match-ticket {
    width: min(170px, calc(50% - 12px));
    padding: 11px;
  }

  .match-ticket small,
  .eyebrow {
    font-size: 9px;
  }

  .match-ticket strong {
    font-size: 16px;
  }

  .match-ticket span {
    font-size: 11px;
  }

  .ticket-a { left: 12px; top: 26px; }
  .ticket-b { right: 12px; bottom: 24px; }

  .login-card h1 {
    font-size: clamp(32px, 9.4vw, 39px);
    letter-spacing: -.045em;
  }

  .yahoo-button {
    width: 100%;
    padding-inline: 12px;
    font-size: 14px;
    line-height: 1.2;
  }

  .market-options {
    grid-template-columns: 1fr;
  }

  .challenge-row {
    align-items: stretch;
    flex-direction: column;
  }

  .stake-input {
    max-width: none;
    width: 100%;
  }

  .table-row {
    grid-template-columns: 34px minmax(112px, 1fr) repeat(2, minmax(48px, 68px));
    font-size: 12px;
  }

  .table-row > :nth-child(5),
  .table-row > :nth-child(6) {
    display: none;
  }
}
