/* ═══════════════════════════════════════════════════════════
   KESSLER'S CAPITAL — PORTAL DESIGN SYSTEM v3.0
   Dark bento grid aesthetic with FLIP card animations
   ═══════════════════════════════════════════════════════════ */

/* Fonts loaded non-blocking via <link> in HTML — no @import here */

/* Native page transitions (Chrome 126+) — zero-JS smooth fades between pages */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 120ms ease-out both fade-out; }
::view-transition-new(root) { animation: 160ms ease-in  both fade-in; }
@keyframes fade-out { to   { opacity: 0; transform: translateY(-4px); } }
@keyframes fade-in  { from { opacity: 0; transform: translateY(4px);  } }

:root {
  /* Core palette — dark navy base drawn from logo cobalt */
  --bg:        #0D0F18;
  --bg-deep:   #080A11;
  --card:      #161826;
  --card-alt:  #111320;
  --elevated:  #1E2138;
  --hover:     #252845;
  --border:    #2E3255;
  --border-hi: #3E4370;

  /* Brand accents — vibrant versions of logo colors */
  --midnight:  #0A0D1E;
  --crimson:   #C42830;
  --crimson-hi:#E03540;
  --cobalt:    #1E40AF;
  --cobalt-hi: #2B5EE8;

  /* Semantic colors */
  --green:     #34D058;
  --green-dim: rgba(52,208,88,0.12);
  --green-glow:rgba(52,208,88,0.22);
  --red:       #FF4545;
  --red-dim:   rgba(255,69,69,0.12);
  --gold:      #FFD60A;
  --gold-dim:  rgba(255,214,10,0.12);
  --blue:      --cobalt-hi;
  --blue:      #3B82F6;
  --blue-dim:  rgba(59,130,246,0.14);
  --purple:    #C084FC;

  /* Text — slightly blue-tinted for crispness */
  --text:      #F0F2FF;
  --text-2:    #A8ACCC;
  --muted:     #646880;
  --faint:     #282B44;

  /* Typography */
  --font:      'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono:      'DM Mono', 'SF Mono', 'Fira Code', 'JetBrains Mono', Consolas, monospace;

  /* Legacy page aliases — keeps old inline styles working */
  --sans:      var(--font);
  --serif:     var(--font);
  --dim:       var(--muted);
  --sub:       var(--text-2);
  --elev:      var(--elevated);
  --yellow:    var(--gold);
  --kalshi:    #34D058;
  --pmus:      #FF6B35;

  /* Animation */
  --spring:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out:  cubic-bezier(0.0, 0.0, 0.2, 1);
}

/* ── RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
a { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; }

/* ── NAV ── */
.nav {
  background: rgba(13,15,24,0.88);
  border-bottom: 1px solid rgba(196,40,48,0.25);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 52px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  /* subtle crimson-to-cobalt gradient line at top */
  box-shadow: inset 0 1px 0 0 rgba(196,40,48,0.3), 0 1px 0 0 rgba(30,64,175,0.2);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}
.nav-brand img {
  height: 30px;
  width: 30px;
  border-radius: 9px;
  object-fit: contain;
  background: linear-gradient(135deg, rgba(196,40,48,0.3) 0%, rgba(30,64,175,0.35) 100%);
  padding: 3px;
  box-shadow: 0 0 12px rgba(196,40,48,0.4), 0 0 24px rgba(30,64,175,0.25), inset 0 1px 0 rgba(255,255,255,0.08);
}
.nav-brand span {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
}
.nav-tabs {
  display: flex;
  height: 100%;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 0.5rem;
}
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  position: relative;
}
.nav-tab:hover { color: var(--text-2); background: rgba(30,64,175,0.08); }
.nav-tab.active {
  color: var(--text);
  border-bottom-color: var(--crimson);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: 0.75rem;
  flex-shrink: 0;
}
.nav-user {
  font-size: 0.7rem;
  color: var(--muted);
  font-family: var(--mono);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-role {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  background: var(--midnight);
  color: var(--blue);
  border: 1px solid var(--cobalt);
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.7rem;
  transition: all 0.15s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-hi); background: var(--elevated); }
.btn-ghost svg { width: 12px; height: 12px; }

/* ── PAGE WRAPPER ── */
.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 68px 1.5rem 2.5rem;
}
.page-sm { max-width: 1200px; }

/* ── PAGE HEADER ── */
.page-hdr {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.page-hdr h1 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.page-hdr .sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.2rem;
  font-family: var(--mono);
}

/* ── BENTO GRID ── */
.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0.65rem;
  align-items: start;
}
.col-1  { grid-column: span 1; }
.col-2  { grid-column: span 2; }
.col-3  { grid-column: span 3; }
.col-4  { grid-column: span 4; }
.col-5  { grid-column: span 5; }
.col-6  { grid-column: span 6; }
.col-7  { grid-column: span 7; }
.col-8  { grid-column: span 8; }
.col-9  { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-12 { grid-column: span 12; }
.row-2  { grid-row: span 2; }
.row-3  { grid-row: span 3; }

/* ── BENTO CARD ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 17px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(196,40,48,0.6) 0%, transparent 50%, rgba(30,64,175,0.6) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 0;
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card:hover {
  border-color: transparent;
  box-shadow: 0 0 0 1px var(--border-hi), 0 8px 32px rgba(0,0,0,0.5);
  transform: translateY(-1px);
}
.card.clickable { cursor: pointer; }
.card.clickable:hover { transform: translateY(-2px); }
.card.clickable:active { transform: translateY(0); }

/* Card inner regions */
.card-hdr {
  padding: 0.85rem 1rem 0.65rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.card-hdr h3 {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
}
.card-hdr .tag {
  font-size: 0.6rem;
  color: var(--muted);
  font-family: var(--mono);
}
.card-body { padding: 1rem; }
.card-body-sm { padding: 0.75rem; }

/* ── HERO CARD ── */
.card-hero {
  padding: 1.5rem 1.5rem 1.25rem;
  position: relative;
  overflow: hidden;
}
.card-hero::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  opacity: 0.03;
  pointer-events: none;
}
.card-hero.pos::after { background: var(--green); }
.card-hero.neg::after { background: var(--red); }

.hero-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.hero-val {
  font-family: var(--mono);
  font-size: 2.4rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}
.hero-val.pos { color: var(--green); }
.hero-val.neg { color: var(--red); }
.hero-sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.5rem;
  font-family: var(--mono);
}

/* ── STAT CHIP ── */
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  transition: border-color 0.15s;
}
.stat:hover { border-color: var(--border-hi); }
.stat-label {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.stat-val {
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.stat-sub {
  font-size: 0.6rem;
  color: var(--muted);
  margin-top: 0.15rem;
  font-family: var(--mono);
}

/* ── STATS ROW ── */
.stats-row {
  display: grid;
  gap: 0.65rem;
}
.stats-row-2 { grid-template-columns: repeat(2, 1fr); }
.stats-row-4 { grid-template-columns: repeat(4, 1fr); }
.stats-row-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1100px) {
  .portfolio-split { grid-template-columns: 1fr !important; }
}
@media (max-width: 900px) {
  .stats-row-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .stats-row-4, .stats-row-6 { grid-template-columns: repeat(2, 1fr); }
}

/* ── TABLE ── */
.tbl-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}
thead th {
  text-align: left;
  padding: 0.45rem 0.75rem;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  background: var(--card-alt);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}
tbody td {
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.025);
  white-space: nowrap;
}
tbody tr { transition: background 0.08s; }
tbody tr:hover td { background: var(--hover); }
th.r, td.r { text-align: right; }
th.c, td.c { text-align: center; }

/* ── BAR ROW ── */
.bar-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.bar-row:last-child { border-bottom: none; }
.bar-name {
  width: 110px;
  font-size: 0.72rem;
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-track {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.7s var(--spring);
}
.bar-val {
  width: 90px;
  text-align: right;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  flex-shrink: 0;
}
.bar-extra {
  width: 65px;
  text-align: right;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  flex-shrink: 0;
}

/* ── BADGE / TAG ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-green  { background: var(--green-dim);  color: var(--green); }
.badge-red    { background: var(--red-dim);    color: var(--red); }
.badge-blue   { background: var(--blue-dim);   color: var(--blue); }
.badge-gold   { background: var(--gold-dim);   color: var(--gold); }
.badge-ghost  { background: rgba(255,255,255,0.04); color: var(--text-2); }

/* Platform tags */
.ptag {
  display: inline-block;
  padding: 0.08rem 0.3rem;
  border-radius: 3px;
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-right: 2px;
}
.ptag-k  { background: rgba(48,209,88,0.12);   color: var(--green); }
.ptag-pm { background: rgba(10,132,255,0.12);  color: var(--blue); }
.ptag-us { background: rgba(255,69,58,0.12);   color: var(--red); }

/* Status dots */
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-green { background: var(--green); box-shadow: 0 0 6px var(--green); animation: glow 2s ease-in-out infinite; }
.dot-red   { background: var(--red); }
.dot-gold  { background: var(--gold); }
.dot-muted { background: var(--muted); }
@keyframes glow { 0%,100%{opacity:1}50%{opacity:.4} }

/* ── DIVIDER ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.75rem 0;
}

/* ── LIVE INDICATOR ── */
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  border-radius: 100px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(0,230,118,0.15);
}

/* ── HOURLY CHART BARS ── */
.hour-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 80px;
}
.hour-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  min-height: 3px;
  transition: height 0.4s var(--spring);
  position: relative;
}
.hour-bar:hover { opacity: 0.75; }
.hour-label {
  font-size: 0.45rem;
  font-family: var(--mono);
  color: var(--muted);
  text-align: center;
  margin-top: 3px;
}

/* ── DONUT CHART ── */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.donut-c {
  position: relative;
  flex-shrink: 0;
}
.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.donut-center .v { font-family: var(--mono); font-size: 0.8rem; font-weight: 600; }
.donut-center .l { font-size: 0.52rem; color: var(--muted); }
.legend { display: flex; flex-direction: column; gap: 0.5rem; }
.leg-item { display: flex; align-items: center; gap: 0.4rem; }
.leg-dot { width: 8px; height: 8px; border-radius: 3px; flex-shrink: 0; }
.leg-name { font-size: 0.68rem; font-weight: 500; }
.leg-val  { font-family: var(--mono); font-size: 0.62rem; color: var(--muted); }

/* ── EXCHANGE BARS ── */
.ex-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.ex-row:last-child { border-bottom: none; }
.ex-name { width: 110px; font-size: 0.7rem; font-weight: 500; flex-shrink: 0; }
.ex-track { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.ex-fill { height: 100%; border-radius: 2px; transition: width 0.7s var(--spring); }
.ex-val { width: 90px; text-align: right; font-family: var(--mono); font-size: 0.72rem; font-weight: 600; flex-shrink: 0; }

/* ── MODAL / CARD EXPAND ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 400;
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-backdrop.visible { opacity: 1; }

.modal-card {
  position: fixed;
  z-index: 500;
  background: var(--card);
  border: 1px solid var(--border-hi);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal-card.animating {
  transition:
    left   0.45s var(--spring),
    top    0.45s var(--spring),
    width  0.45s var(--spring),
    height 0.45s var(--spring),
    border-radius 0.45s var(--spring);
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  background: var(--elevated);
  border: 1px solid var(--border-hi);
  color: var(--text-2);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: all 0.15s;
}
.modal-close:hover { color: var(--text); background: var(--hover); }

/* ── LOGIN SCREEN ── */
/* ── LOGIN PAGE ── */
#loginScreen {
  min-height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  background: #f0f2f5;
}
#loginScreen.visible { display: flex; }

.login-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  padding: 2rem;
  width: 100%;
  max-width: 420px;
}
.login-main-logo {
  width: min(340px, 90%);
  object-fit: contain;
  display: block;
}
.login-card {
  width: 100%;
  background: #ffffff;
  border: 1px solid #e2e5ea;
  border-radius: 16px;
  padding: 2rem 1.75rem;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
}
.login-notice { display: none; }
.login-footer { display: none; }

.google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.85rem 1.25rem;
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #dadce0;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, box-shadow 0.12s, transform 0.12s;
  font-family: var(--font);
}
.google-btn:hover { background: #f8f9fa; box-shadow: 0 2px 10px rgba(0,0,0,0.1); transform: translateY(-1px); }
.google-btn:active { transform: translateY(0); box-shadow: none; }
.google-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.google-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.error-msg {
  background: #fff0f0;
  border: 1px solid #fca5a5;
  color: #dc2626;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  font-size: 0.78rem;
  margin-top: 1rem;
  display: none;
  text-align: left;
}

/* Theme toggle button */
#themeToggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-size: 0.85rem;
  line-height: 1;
}
#themeToggle:hover { color: var(--text); border-color: var(--border-hi); background: var(--elevated); }

/* ── LIGHT MODE ── */
[data-theme="light"] {
  --bg:        #F2F4F8;
  --bg-deep:   #E8EBF2;
  --card:      #FFFFFF;
  --card-alt:  #F7F8FC;
  --elevated:  #EDF0F7;
  --hover:     #E4E8F2;
  --border:    #D0D5E8;
  --border-hi: #B0B8D8;
  --midnight:  #E8EBF5;
  --crimson:   #C42830;
  --crimson-hi:#E03540;
  --cobalt:    #1E40AF;
  --cobalt-hi: #2B5EE8;
  --green:     #16A34A;
  --green-dim: rgba(22,163,74,0.1);
  --green-glow:rgba(22,163,74,0.18);
  --red:       #DC2626;
  --red-dim:   rgba(220,38,38,0.1);
  --gold:      #B45309;
  --gold-dim:  rgba(180,83,9,0.1);
  --blue:      #2563EB;
  --blue-dim:  rgba(37,99,235,0.1);
  --purple:    #7C3AED;
  --text:      #0F1220;
  --text-2:    #3D4466;
  --muted:     #6B7280;
  --faint:     #E0E4F0;
  --dim:       var(--muted);
  --sub:       var(--text-2);
  --elev:      var(--elevated);
  --yellow:    var(--gold);
}
[data-theme="light"] .nav { background: rgba(255,255,255,0.92); border-bottom-color: var(--border); }
[data-theme="light"] #loadingSplash { background: #F2F4F8; }

/* ── LOADING SPLASH ── */
#loadingSplash {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  transition: opacity 0.3s;
}
#loadingSplash img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: contain;
  animation: pulse-scale 1.4s ease-in-out infinite;
  opacity: 0.85;
}
@keyframes pulse-scale { 0%,100%{opacity:0.85;transform:scale(1)}50%{opacity:0.45;transform:scale(0.92)} }

/* ── SPINNER ── */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-ghost.spinning svg { animation: spin 0.8s linear infinite; }

/* ── SKELETON ── */
.skel {
  background: var(--elevated);
  border-radius: 6px;
  animation: skel-pulse 1.6s ease-in-out infinite;
}
@keyframes skel-pulse { 0%,100%{opacity:1}50%{opacity:0.35} }

/* ── MONO / UTIL ── */
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.green { color: var(--green); }
.red   { color: var(--red); }
.gold  { color: var(--gold); }
.blue  { color: var(--blue); }
.pos   { color: var(--green); }
.neg   { color: var(--red); }
.bold  { font-weight: 600; }
.small { font-size: 0.7rem; }
.tiny  { font-size: 0.6rem; }
.nowrap { white-space: nowrap; }

/* ── DATE NAV ── */
.date-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.date-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  font-size: 0.72rem;
  font-family: var(--mono);
  cursor: pointer;
  transition: all 0.15s;
}
.date-btn:hover { color: var(--text); border-color: var(--border-hi); }

/* ── FILTER BAR ── */
.filter-bar {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 0.75rem;
}
.filter-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}
.filter-btn:hover { color: var(--text-2); border-color: var(--border-hi); }
.filter-btn.active { background: var(--cobalt); color: var(--blue); border-color: var(--cobalt-hi); }
.filter-sep { width: 1px; height: 14px; background: var(--border); margin: 0 0.1rem; flex-shrink: 0; }

/* ── SECURE FOOTER ── */
.secure-footer {
  text-align: center;
  padding: 1.5rem 0 0.5rem;
  color: var(--muted);
  font-size: 0.62rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}
.secure-footer span.line {
  display: inline-block;
  width: 1.5rem;
  height: 1px;
  border-radius: 1px;
}

/* ── POSITIONS TABLE ── */
.pos-r {
  display: grid;
  grid-template-columns: 22px minmax(0,1fr) 120px 72px 170px;
  gap: 0 0.5rem;
  padding: 0.42rem 0.9rem;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.025);
  border-left: 2px solid transparent;
  transition: background 0.08s;
  font-size: 0.72rem;
  position: relative;
}
.pos-r:hover { background: var(--hover); }

/* Won positions — prominent green accent */
.pos-r.win {
  background: rgba(48,209,88,0.07);
  border-left-color: var(--green);
}
.pos-r.win:hover { background: rgba(48,209,88,0.12); }

.pos-ic {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 700;
  flex-shrink: 0;
}
.pos-ic.arb    { background: var(--green-dim);             color: var(--green); }
.pos-ic.won    { background: rgba(48,209,88,0.22);         color: var(--green); box-shadow: 0 0 6px rgba(48,209,88,0.35); }
.pos-ic.single { background: var(--gold-dim);              color: var(--gold); }
.pos-ic.loss   { background: var(--red-dim);               color: var(--red); }

.pos-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.72rem; min-width: 0; }
.pos-title.win { color: var(--green); }
.pos-cat   { font-size: 0.58rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-plats { display: flex; flex-wrap: nowrap; gap: 3px; overflow: hidden; min-width: 0; }
.pos-plats span { display: flex; align-items: center; gap: 2px; white-space: nowrap; font-family: var(--mono); font-size: 0.65rem; font-weight: 600; }
.pos-matched { text-align: right; font-family: var(--mono); font-size: 0.68rem; font-weight: 600; color: var(--blue); white-space: nowrap; }
.pos-imb { text-align: right; font-family: var(--mono); font-size: 0.66rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pos-imb.ok   { color: var(--green); }
.pos-imb.warn { color: var(--gold); }
.pos-imb.bad  { color: var(--red); }
.pos-hdr {
  display: grid;
  grid-template-columns: 22px minmax(0,1fr) 120px 72px 170px;
  gap: 0 0.5rem;
  padding: 0.3rem 0.9rem;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}

/* Won value badge */
.won-badge {
  display: inline-block;
  padding: 0.05rem 0.3rem;
  background: rgba(48,209,88,0.18);
  color: var(--green);
  border-radius: 4px;
  font-size: 0.56rem;
  font-weight: 700;
  font-family: var(--mono);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.show-more {
  width: 100%;
  padding: 0.6rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--blue);
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.show-more:hover { background: var(--elevated); }

/* ── BACKGROUND GLOW ── */
.bg-glow-green {
  background:
    radial-gradient(ellipse at 15% 50%, rgba(0,230,118,0.04) 0%, transparent 55%),
    var(--bg);
}
.bg-glow-red {
  background:
    radial-gradient(ellipse at 15% 50%, rgba(239,83,80,0.04) 0%, transparent 55%),
    var(--bg);
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .col-4  { grid-column: span 6; }
  .col-3  { grid-column: span 6; }
}
@media (max-width: 768px) {
  .bento { grid-template-columns: repeat(6, 1fr); gap: 0.5rem; }
  .col-4, .col-3, .col-6 { grid-column: span 6; }
  .col-7, .col-8, .col-9 { grid-column: span 6; }
  .col-5 { grid-column: span 6; }
  .row-2, .row-3 { grid-row: span 1; }
  .page { padding: 60px 1rem 2rem; }
  .nav { padding: 0 1rem; }
}
@media (max-width: 480px) {
  .bento { grid-template-columns: 1fr; }
  [class^="col-"] { grid-column: span 1 !important; }
}
