:root {
  --bg: #0a0c10; --bg-2: #0e1116; --card: #161a22; --card-2: #1d222c; --raised: #222834;
  --line: #262c38; --text: #eef1f7; --muted: #8b93a3; --faint: #5b6373;
  --accent: #1ad6a3; --accent-deep: #10b88a; --danger: #ef5a6b; --warn: #e7a94a;
  --radius: 16px; --shadow: 0 8px 24px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(900px 380px at 50% -120px, rgba(26,214,163,.10), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}

.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; position: sticky; top: 0; z-index: 5;
  background: rgba(10,12,16,.82); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 750; font-size: 18px; letter-spacing: .2px; }
.brand .dot {
  width: 22px; height: 22px; border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  display: grid; place-items: center; font-size: 13px;
}
.env {
  font-size: 11px; color: var(--muted); border: 1px solid var(--line);
  padding: 4px 9px; border-radius: 999px; background: var(--bg-2);
}
.env.ok { color: var(--accent); border-color: rgba(26,214,163,.4); }
.env.bad { color: var(--danger); border-color: rgba(239,90,107,.4); }

.head-right { display: flex; align-items: center; gap: 8px; }
.app-header .signout {
  width: auto; margin: 0; padding: 4px 11px; font-size: 11px; font-weight: 700;
  border-radius: 999px; background: transparent; color: var(--muted);
  border: 1px solid var(--line); box-shadow: none; cursor: pointer;
}
.app-header .signout:hover { color: var(--danger); border-color: rgba(239,90,107,.4); }

.view { flex: 1; padding: 18px 16px 26px; max-width: 520px; width: 100%; margin: 0 auto; }

/* Desktop header navigation — hidden on phones (the tab bar serves there). */
.top-nav { display: none; flex: 1; margin: 0 18px; gap: 4px; }
.top-nav a {
  color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 650;
  padding: 7px 13px; border-radius: 999px;
}
.top-nav a:hover { color: var(--text); background: var(--bg-2); }
.top-nav a.active { color: var(--accent); background: rgba(26,214,163,.10); }

.tabbar {
  display: flex; background: rgba(10,12,16,.9); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); position: sticky; bottom: 0;
}

/* ---- Desktop / laptop layout (the default styles above are mobile-first) ---- */
@media (min-width: 820px) {
  .top-nav { display: flex; }
  .tabbar { display: none; }
  .view { max-width: 980px; padding: 26px 28px 40px; }
  /* Card collections flow into two columns; cards keep their own height. */
  .grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start;
  }
  .grid .card { margin-bottom: 0; }
  /* Forms shouldn't sprawl: the auth card stays a centred column. */
  .card.auth { max-width: 440px; margin: 24px auto 0; }
  h1 { font-size: 28px; }
}
.tabbar a {
  flex: 1; text-align: center; padding: 11px 0 13px; color: var(--muted);
  text-decoration: none; font-size: 11px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.tabbar a .ic { font-size: 17px; line-height: 1; }
.tabbar a.active { color: var(--accent); }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent), var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow);
}
h1 { font-size: 24px; font-weight: 760; letter-spacing: -.2px; margin: 6px 2px 16px; }
h2 { font-size: 15px; font-weight: 680; margin: 0 0 8px; }
p { line-height: 1.5; color: var(--text); margin: 0 0 4px; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; }

label { display: block; margin: 14px 0 6px; font-size: 11px; font-weight: 700;
  letter-spacing: .7px; text-transform: uppercase; color: var(--faint); }
input, select, button {
  width: 100%; padding: 13px 14px; font-size: 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--faint); }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26,214,163,.18); }
button {
  border: 0; font-weight: 700; font-size: 15px; cursor: pointer; color: #04130e;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 4px 14px rgba(26,214,163,.28); margin-top: 16px;
}
button.secondary {
  background: transparent; color: var(--text); border: 1px solid var(--line); box-shadow: none;
}
button:disabled { opacity: .55; cursor: default; box-shadow: none; }
button + button { margin-top: 10px; }

.row { display: flex; gap: 10px; align-items: stretch; }
.row > * { flex: 1; min-width: 0; }
/* A button sharing a row sizes to its label (not 100%), so the input fills. */
.row button { flex: 0 0 auto; width: auto; margin-top: 0; padding: 13px 20px; }

.steps { display: flex; gap: 6px; margin-bottom: 16px; }
.step { flex: 1; height: 4px; border-radius: 2px; background: #2b2e38; }
.step.done { background: var(--accent); }
.step.active { background: var(--accent-deep); }

.msg { margin-top: 12px; font-size: 14px; min-height: 18px; }
.msg.ok { color: var(--accent); }
.msg.bad { color: var(--danger); }
.msg.warn { color: var(--warn); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.active { background: rgba(26,214,163,.15); color: var(--accent); }
.pill.active::before { content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.pill.inactive { background: rgba(239,90,107,.15); color: var(--danger); }

/* Box card */
.box-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.box-head .name { font-size: 17px; font-weight: 720; }
.box-head .spacer { flex: 1; }

.keychip { display: flex; align-items: center; gap: 8px; margin-top: 10px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; }
.keychip code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px;
  color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.keychip .copy { color: var(--faint); font-size: 13px; cursor: pointer; flex: 0 0 auto; }
.keychip .copy:hover { color: var(--accent); }

/* News-ticker sport checkboxes. */
.checks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.checks .check {
  display: inline-flex; align-items: center; gap: 7px; margin: 0;
  padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-2); font-size: 13.5px; font-weight: 600; color: var(--text);
  text-transform: none; letter-spacing: 0; cursor: pointer;
}
.checks .check:has(input:checked) { border-color: var(--accent); color: var(--accent); }
.checks input { width: auto; margin: 0; padding: 0; accent-color: var(--accent); }

/* Admin stats strip. */
.stats { display: flex; gap: 10px; }
.stats .stat { flex: 1; text-align: center; padding: 8px 4px; }
.stats .n { font-size: 19px; font-weight: 800; color: var(--accent); }
.stats .l { font-size: 11px; color: var(--muted); margin-top: 2px; }
.price { font-weight: 800; color: var(--accent); font-size: 15px; white-space: nowrap; }

/* Active subscription row on the current-plan card. */
.sub-row { display: flex; align-items: center; gap: 12px; padding: 11px 0 0; }
.sub-row > div:first-child { flex: 1; min-width: 0; }
.sub-row + .sub-row { border-top: 1px solid var(--line); margin-top: 11px; }
.sub-row button { flex: 0 0 auto; width: auto; margin-top: 0; padding: 9px 14px; font-size: 13px; }
.muted.small { font-size: 12px; margin-top: 2px; }

/* Plan-card header: name + description left, price right (no box around it). */
.plan-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.plan-head .ti { flex: 1; }
.plan-head .tn { font-weight: 700; font-size: 16px; }
.plan-head .td { color: var(--muted); font-size: 13px; margin-top: 2px; }
.plan-head .price { font-weight: 800; color: var(--accent); font-size: 15px; white-space: nowrap; }

/* Launch-offer highlight on an eligible plan card. */
.card.offer { border-color: rgba(231,169,74,.55); box-shadow: 0 0 0 1px rgba(231,169,74,.35), var(--shadow); }
.pill.offer-pill { background: rgba(231,169,74,.18); color: var(--warn); font-size: 11px; }
.offer-line { color: var(--warn); font-size: 12.5px; font-weight: 700; margin: 10px 0 2px; }

.tier { display: flex; align-items: center; gap: 12px; padding: 14px;
  border: 1px solid var(--line); border-radius: 13px; margin-bottom: 10px; background: var(--bg-2); }
.tier.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.tier .name, .tier .ti { flex: 1; }
.tier .tn { font-weight: 700; font-size: 15px; }
.tier .td { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.tier .price { font-weight: 800; color: var(--accent); font-size: 15px; white-space: nowrap; }

.fixture { display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 11px;
  margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.fixture .teams { flex: 1; font-size: 14px; font-weight: 600; }
.fixture .score { font-weight: 800; }
.fixture .meta { color: var(--muted); font-size: 12px; }

.code { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--bg-2);
  padding: 2px 6px; border-radius: 6px; font-size: 13px; border: 1px solid var(--line); }
a.link { color: var(--accent); font-weight: 600; text-decoration: none; }
a.link:hover { text-decoration: underline; }
ul.tight { margin: 8px 0; padding-left: 20px; color: var(--muted); }
ul.tight li { margin: 4px 0; }
