/* Pinny investor site — design system.
 *
 * Deep-navy fintech dashboard: layered translucent panels on a glowing
 * gradient field, Inter with tabular numerals for money, gold as the single
 * brand accent, green/red strictly for P&L semantics.
 */

/* ---------- font ---------- */
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap;
  src: url('/static/fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap;
  src: url('/static/fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap;
  src: url('/static/fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap;
  src: url('/static/fonts/inter-700.woff2') format('woff2'); }

:root {
  --bg: #0A0F1C;
  --bg-glow: radial-gradient(1200px 500px at 50% -10%, rgba(251, 191, 36, 0.07), transparent 60%),
             radial-gradient(900px 400px at 85% 0%, rgba(56, 189, 248, 0.05), transparent 55%);
  --panel: rgba(17, 24, 39, 0.72);
  --panel-solid: #111827;
  --hairline: rgba(148, 163, 184, 0.13);
  --hairline-strong: rgba(148, 163, 184, 0.25);
  --text: #E7EAF0;
  --text-strong: #FFFFFF;
  --text-dim: #8B94A7;
  --text-faint: #5B6478;
  --gold: #FBBF24;
  --gold-soft: #FDE68A;
  --gold-dim: rgba(251, 191, 36, 0.14);
  --green: #4ADE80;
  --green-soft: #86EFAC;
  --green-dim: rgba(74, 222, 128, 0.12);
  --red: #F87171;
  --red-soft: #FCA5A5;
  --red-dim: rgba(248, 113, 113, 0.12);
  --amber: #FCD34D;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 8px 28px rgba(2, 6, 17, 0.45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-glow), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.5 'Inter', -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-feature-settings: "cv11";
}

main { max-width: 1240px; margin: 0 auto; padding: 26px 20px 10px; }
/* Tour pages carry wide tables (16 bet columns, 11 leaderboard columns). At the
   1240px reading width they needed horizontal scrolling, so those pages run
   full-bleed and their tables shed the nowrap/padding that forced the overflow. */
main.wide { max-width: none; padding-left: 22px; padding-right: 22px; }
main.wide table { font-size: 13px; table-layout: auto; }
main.wide thead th { padding: 9px 8px; }
main.wide tbody td { padding: 8px 8px; }
/* Text columns may wrap; numeric ones must not (a wrapped figure is unreadable). */
main.wide tbody td:not(.num), main.wide thead th:not(.num) { white-space: normal; }
main.wide .bets-cell { white-space: normal; min-width: 210px; }
@media (max-width: 1100px) { main.wide { padding-left: 12px; padding-right: 12px; } }
footer {
  max-width: 1240px; margin: 30px auto 0; padding: 18px 20px 30px;
  font-size: 12px; color: var(--text-faint);
  border-top: 1px solid var(--hairline);
}

.dim { color: var(--text-dim); }
.gold { color: var(--gold); }
.right { margin-left: auto; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pos-val { color: var(--green); }
.neg-val { color: var(--red); }

/* ---------- nav ---------- */
.topnav {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 20px;
  background: rgba(10, 15, 28, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
  position: sticky; top: 0; z-index: 50;
  overflow-x: auto; white-space: nowrap;
  scrollbar-width: none;
}
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  color: var(--text-dim); text-decoration: none; font-weight: 500; font-size: 13.5px;
  padding: 7px 12px; border-radius: 8px;
  transition: color .15s, background .15s;
}
.topnav a:hover { color: var(--text-strong); background: rgba(148, 163, 184, 0.08); }
.topnav a.active { color: var(--gold); background: var(--gold-dim); font-weight: 600; }
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--text-strong); font-weight: 700; letter-spacing: 0.14em; font-size: 14px;
  margin-right: 14px; text-decoration: none;
}
.brand .mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, #FBBF24, #B45309);
  color: #0A0F1C; font-weight: 800; font-size: 15px; letter-spacing: 0;
  display: grid; place-items: center;
  box-shadow: 0 2px 10px rgba(251, 191, 36, 0.35);
}
.brand.big { font-size: 22px; letter-spacing: 0.2em; }
.brand.big .mark { width: 44px; height: 44px; border-radius: 12px; font-size: 26px; }

/* ---------- page furniture ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; margin: 4px 0 18px; }
.page-head h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -0.01em; color: var(--text-strong); }
.page-head .sub { color: var(--text-dim); font-size: 13.5px; }

.section-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-dim); margin: 26px 0 10px;
  display: flex; align-items: baseline; gap: 10px;
}
.section-label .sub { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text-faint); }

.stamp { font-size: 12px; color: var(--text-faint); margin: 6px 0 0; }
.stamp.stale { color: var(--amber); }

.warnbox {
  background: var(--red-dim); color: var(--red-soft);
  border: 1px solid rgba(248, 113, 113, 0.25);
  padding: 10px 14px; border-radius: var(--radius-sm); margin: 10px 0; font-size: 13px;
}

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em;
  padding: 4px 11px; border-radius: 999px; vertical-align: middle;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; }
.badge.live { background: var(--green-dim); color: var(--green-soft); border: 1px solid rgba(74, 222, 128, 0.3); }
.badge.live .dot { background: var(--green); box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); animation: pulse 2s infinite; }
.badge.pre { background: var(--gold-dim); color: var(--gold-soft); border: 1px solid rgba(251, 191, 36, 0.3); }
.badge.pre .dot { background: var(--gold); }
.badge.none { background: var(--red-dim); color: var(--red-soft); border: 1px solid rgba(248, 113, 113, 0.3); }
.badge.none .dot { background: var(--red); }
.badge.off { background: rgba(139, 148, 167, 0.12); color: var(--text-dim); border: 1px solid rgba(139, 148, 167, 0.3); }
.badge.off .dot { background: var(--text-dim); }
.badge.complete { background: var(--green-dim); color: var(--green-soft); border: 1px solid rgba(74, 222, 128, 0.3); }
.badge.complete .dot { background: var(--green); }

.offweek {
  padding: 34px 24px; text-align: center; margin: 14px 0;
}
.offweek .big { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.offweek .sub { color: var(--text-dim); font-size: 13.5px; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
.badge-note { color: var(--text-faint); font-size: 12.5px; margin-left: 10px; }

/* ---------- cards / panels ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 12px 0; }
.kpi {
  background: var(--panel); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 14px 18px 13px;
  box-shadow: var(--shadow);
}
.kpi .k {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-faint); margin-bottom: 5px;
}
.kpi .v { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.kpi .v.pos-val { color: var(--green); }
.kpi .v.neg-val { color: var(--red); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--hairline); box-shadow: var(--shadow); background: var(--panel); margin: 10px 0 6px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
thead th {
  background: rgba(10, 15, 28, 0.85);
  color: var(--text-dim);
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.09em;
  text-align: left; padding: 10px 14px;
  border-bottom: 1px solid var(--hairline-strong);
  position: sticky; top: 0;
  white-space: nowrap;
}
tbody td { padding: 9px 14px; white-space: nowrap; border-bottom: 1px solid var(--hairline); color: var(--text); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: rgba(148, 163, 184, 0.05); }
tr.held td { background: linear-gradient(90deg, rgba(251, 191, 36, 0.12), rgba(251, 191, 36, 0.05)); color: var(--gold-soft); font-weight: 600; }
tr.held td:first-child { border-left: 2px solid var(--gold); }
tr.held:hover td { background: linear-gradient(90deg, rgba(251, 191, 36, 0.16), rgba(251, 191, 36, 0.08)); }
/* All-lay rows go pink (Betfair's lay colour): we want this player OUTSIDE the
   bracket. Mixed back+lay books stay gold; the side pills carry the detail.
   Declared before tr.held.cut so cut styling still wins on cut players. */
tr.held.lay-only td { background: linear-gradient(90deg, rgba(244, 114, 182, 0.13), rgba(244, 114, 182, 0.05)); color: #F9A8D4; }
tr.held.lay-only td:first-child { border-left: 2px solid #F472B6; }
tr.held.lay-only:hover td { background: linear-gradient(90deg, rgba(244, 114, 182, 0.18), rgba(244, 114, 182, 0.08)); }
tr.held.lay-only .bl-side, tr.held.lay-only .bl-stake { color: #F9A8D4; opacity: 0.8; }
tr.held.lay-only .bl-max { color: #F9A8D4; opacity: 0.6; }
tr.held.lay-only .bet-line + .bet-line { border-top-color: rgba(244, 114, 182, 0.25); }

/* Cut player (missed the 36-hole cut): muted + struck through. */
tr.cut td { color: var(--text-faint); }
tr.cut td:nth-child(1), tr.cut td:nth-child(2) { text-decoration: line-through; text-decoration-color: var(--text-faint); }
/* A CUT player we LAYED is a WIN - they can't reach the bracket, we collect.
   Green highlight instead of the losing red; the strike-through stays (they
   are out of the tournament). Declared after the red cut rules so it wins. */
tr.cut.cut-lay td { color: var(--green-soft); }
/* A bet we hold on a cut player: slate-red band instead of gold — the bet is likely dead. */
tr.held.cut td { background: linear-gradient(90deg, rgba(248, 113, 113, 0.14), rgba(248, 113, 113, 0.05)); color: var(--red-soft); font-weight: 600; }
tr.held.cut td:first-child { border-left: 2px solid var(--red); }
tr.held.cut.cut-lay td { background: linear-gradient(90deg, rgba(74, 222, 128, 0.14), rgba(74, 222, 128, 0.05)); color: var(--green-soft); font-weight: 600; }
tr.held.cut.cut-lay td:first-child { border-left: 2px solid var(--green); }
tr.held.cut.cut-lay:hover td { background: linear-gradient(90deg, rgba(74, 222, 128, 0.18), rgba(74, 222, 128, 0.08)); }
tr.held.cut:hover td { background: linear-gradient(90deg, rgba(248, 113, 113, 0.18), rgba(248, 113, 113, 0.09)); }

/* P&L colours must win even on highlighted (held/cut) rows — otherwise the row's
   own text colour swallows the green/red on exactly the rows that matter most. */
tr.held td.pos-val, tr.held.cut td.pos-val, tr.cut td.pos-val { color: var(--green); }
tr.held td.neg-val, tr.held.cut td.neg-val, tr.cut td.neg-val { color: var(--red); }
tr.total-row td { border-top: 1px solid var(--hairline-strong); font-weight: 700; color: var(--text-strong); }
.detail { font-size: 12px; color: var(--text-dim); white-space: pre-line; line-height: 1.6; }
tr.held .detail { color: var(--gold-soft); font-weight: 500; }

/* "Our bets" cell: one mini-row per bet, columns aligned across rows so a
   multi-bet player reads like a tiny nested table instead of a wall of text. */
.bets-cell { padding-top: 5px; padding-bottom: 5px; }
.bet-line {
  display: grid;
  grid-template-columns: 34px 44px 110px 90px 1fr;
  gap: 8px; align-items: baseline;
  font-size: 11.5px; line-height: 1.75;
  font-variant-numeric: tabular-nums;
}
.bet-line + .bet-line { border-top: 1px dashed var(--hairline); }
.bl-market { font-weight: 700; }
.bl-side { color: var(--text-dim); font-size: 10.5px; letter-spacing: 0.05em; }
.bl-stake { color: var(--text-dim); }
.bl-ev { font-weight: 600; }
.bl-max { color: var(--text-faint); }
tr.held .bl-side, tr.held .bl-stake { color: var(--gold-soft); opacity: 0.75; }
tr.held .bl-max { color: var(--gold-soft); opacity: 0.6; }
tr.held .bet-line + .bet-line { border-top-color: rgba(251, 191, 36, 0.22); }
/* Side pills use Betfair's colour language: blue = back, pink = lay. Two-class
   selectors outrank the tr.held tints above, so pills read the same on any row. */
.bl-side.side-back, .bl-side.side-lay {
  padding: 1px 6px; border-radius: 3px; font-weight: 700; opacity: 1;
}
.bl-side.side-back { background: rgba(96, 165, 250, 0.16); color: #93C5FD; border: 1px solid rgba(96, 165, 250, 0.35); }
.bl-side.side-lay { background: rgba(244, 114, 182, 0.16); color: #F9A8D4; border: 1px solid rgba(244, 114, 182, 0.35); }

/* ---------- sortable tables ---------- */
table.sortable thead th { cursor: pointer; user-select: none; }
table.sortable thead th:hover { color: var(--text-strong); }
table.sortable thead th.sort-asc::after { content: " \25B4"; color: var(--gold); }
table.sortable thead th.sort-desc::after { content: " \25BE"; color: var(--gold); }
td.empty-cell { color: var(--text-faint); text-align: center; padding: 26px; }

/* ---------- charts ---------- */
.chart-box { padding: 18px 18px 12px; }
.chart-box .chart-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.chart-box .chart-sub { font-size: 11.5px; color: var(--text-faint); margin-bottom: 12px; }
.chart-box canvas { max-height: 300px; width: 100% !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 10px 0; }
@media (max-width: 920px) { .grid-2 { grid-template-columns: 1fr; } }

/* tour cards on summary */
.tour-card { padding: 18px 20px 16px; margin: 14px 0; }
.tour-card .tour-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 4px; }
.tour-card .tour-head h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--text-strong); }
.tour-card .tour-head .event { color: var(--text-dim); font-size: 13.5px; }
.tour-card .tour-head a.goto { margin-left: auto; color: var(--gold); text-decoration: none; font-size: 12.5px; font-weight: 600; }
.tour-card .tour-head a.goto:hover { text-decoration: underline; }
.mc-grid { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; margin-top: 8px; }
@media (max-width: 920px) { .mc-grid { grid-template-columns: 1fr; } }
.mc-stats { font-size: 13px; }
.mc-stats table { font-size: 13px; }
.mc-stats td { padding: 5.5px 10px 5.5px 0; border-bottom: 1px solid var(--hairline); }
.mc-stats tr:last-child td { border-bottom: 0; }
.mc-stats td:first-child { color: var(--text-dim); }

/* ---------- rules ---------- */
.rules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; margin-top: 12px; }
.rule-card { padding: 15px 18px; }
.rule-card .r-label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); }
.rule-card .r-value { font-size: 16px; font-weight: 700; color: var(--gold); margin: 4px 0 6px; }
.rule-card .r-detail { font-size: 12.5px; color: var(--text-dim); line-height: 1.55; }

/* ---------- login ---------- */
.login-body {
  display: grid; place-items: center; min-height: 100vh;
  background: var(--bg-glow), var(--bg);
}
.login-card {
  background: var(--panel); border: 1px solid var(--hairline);
  padding: 44px 46px 38px; border-radius: 18px; text-align: center; min-width: 330px;
  box-shadow: 0 24px 70px rgba(2, 6, 17, 0.6);
  backdrop-filter: blur(10px);
}
.login-card .tagline { color: var(--text-dim); font-size: 13px; margin: 10px 0 22px; }
.login-card input {
  width: 100%; padding: 11px 14px; margin: 0 0 12px;
  background: rgba(10, 15, 28, 0.8); color: var(--text);
  border: 1px solid var(--hairline-strong); border-radius: 10px; font-size: 15px;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.login-card input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.login-card button {
  width: 100%; padding: 11px; border: 0; border-radius: 10px;
  background: linear-gradient(135deg, #FBBF24, #D97706);
  color: #14100A; font-weight: 700; font-size: 14.5px; cursor: pointer; font-family: inherit;
  letter-spacing: 0.02em;
  transition: filter .15s, transform .05s;
}
.login-card button:hover { filter: brightness(1.08); }
.login-card button:active { transform: translateY(1px); }
.error { color: var(--red-soft); font-size: 13px; }

/* ---------- how it works ---------- */
.how-lede { padding: 20px 24px; margin: 4px 0 6px; }
.how-lede p { margin: 0; font-size: 15.5px; line-height: 1.65; color: var(--text); max-width: 78ch; }
.how-steps { display: flex; flex-direction: column; gap: 14px; margin: 16px 0; }
.step { display: flex; gap: 18px; padding: 20px 24px; align-items: flex-start; }
.step-num {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--gold-dim); color: var(--gold);
  font-weight: 700; font-size: 16px; border: 1px solid rgba(251, 191, 36, 0.3);
}
.step h3 { margin: 4px 0 8px; font-size: 16px; font-weight: 700; color: var(--text-strong); }
.step p { margin: 0 0 10px; font-size: 14px; line-height: 1.65; color: var(--text-dim); max-width: 78ch; }
.step p:last-child { margin-bottom: 0; }
.how-cta a { color: var(--gold); text-decoration: none; font-weight: 600; font-size: 13px; }
.how-cta a:hover { text-decoration: underline; }

/* ---------- misc ---------- */
.footnote { font-size: 12px; color: var(--text-faint); margin: 8px 2px; }
@media (max-width: 640px) {
  main { padding: 18px 12px 6px; }
  .kpi .v { font-size: 18px; }
  .page-head h1 { font-size: 18px; }
}
