/* ==========================================================================
   SESSION BET — dark analytics UI
   Design tokens, layout, components.
   ========================================================================== */

:root {
  --bg: #06090d;
  --bg-soft: #090e14;
  --panel: #0d131c;
  --panel-2: #111926;
  --panel-3: #172131;
  --line: #1d2836;
  --line-soft: #151e2a;
  --text: #e8eef7;
  --text-soft: #97a6ba;
  --text-dim: #64748b;
  --green: #35e08a;
  --green-strong: #21c878;
  --green-soft: rgba(53, 224, 138, 0.12);
  --green-line: rgba(53, 224, 138, 0.34);
  --red: #ff5c72;
  --red-soft: rgba(255, 92, 114, 0.12);
  --red-line: rgba(255, 92, 114, 0.34);
  --amber: #ffc857;
  --amber-soft: rgba(255, 200, 87, 0.12);
  --blue: #4ea8ff;
  --violet: #8b7bff;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 8px 26px rgba(0, 0, 0, 0.3);
  --font: "Inter", "SF Pro Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Cascadia Mono", Consolas, monospace;
  --header-h: 66px;
  --maxw: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }

/* The hidden attribute must always win over component display rules. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1000px 560px at 10% -12%, rgba(53, 224, 138, 0.09), transparent 62%),
    radial-gradient(900px 520px at 94% 2%, rgba(78, 168, 255, 0.07), transparent 58%),
    radial-gradient(760px 460px at 50% 112%, rgba(139, 123, 255, 0.06), transparent 62%);
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.021) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.021) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(ellipse 82% 58% at 50% 0%, #000 18%, transparent 76%);
  -webkit-mask-image: radial-gradient(ellipse 82% 58% at 50% 0%, #000 18%, transparent 76%);
  pointer-events: none;
}

h1, h2, h3, h4 { margin: 0 0 8px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.16; }
h1 { font-size: clamp(27px, 3.6vw, 42px); }
h2 { font-size: clamp(20px, 2.3vw, 26px); }
h3 { font-size: 16.5px; }
h4 { font-size: 14px; }
p { margin: 0 0 12px; color: var(--text-soft); }
a { color: var(--green); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: #7bf0b6; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(53, 224, 138, 0.28); color: #fff; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 4px; }

/* ---------- utilities ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1fr) 372px; align-items: start; }
.muted { color: var(--text-soft); }
.dim { color: var(--text-dim); }
.small { font-size: 12.5px; }
.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-amber { color: var(--amber); }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 14px; }
.hidden { display: none !important; }
.center { text-align: center; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(6, 9, 13, 0.82);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner { display: flex; align-items: center; gap: 18px; width: 100%; }

.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(145deg, #1f8f5c, #35e08a);
  color: #04120b;
  font-weight: 800;
  font-size: 13.5px;
  letter-spacing: -0.03em;
  box-shadow: 0 6px 18px rgba(53, 224, 138, 0.28);
}
.brand-text {
  font-weight: 800; font-size: 15px; letter-spacing: 0.02em; color: var(--text);
  white-space: nowrap;
}
.brand-accent { color: var(--green); }

.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.main-nav a {
  padding: 8px 13px;
  border-radius: 9px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.main-nav a:hover { background: var(--panel-2); color: var(--text); }
.main-nav a.active { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.main-nav a.admin-link { color: var(--amber); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.balance-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  color: var(--green);
  font-weight: 700;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  transition: transform 0.15s ease, background 0.2s ease;
}
.balance-chip:hover { background: rgba(53, 224, 138, 0.18); color: var(--green); }
.balance-chip.bump { animation: chipBump 0.5s ease; }
@keyframes chipBump {
  0% { transform: scale(1); }
  35% { transform: scale(1.09); box-shadow: 0 0 0 5px rgba(53, 224, 138, 0.16); }
  100% { transform: scale(1); }
}
.balance-chip-label { font-weight: 500; opacity: 0.75; font-size: 12px; }

.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
}
.user-chip:hover { border-color: var(--line); color: var(--text); background: var(--panel-3); }
.user-chip-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar {
  display: inline-grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #1b2735, #253449);
  color: var(--text);
  font-weight: 700;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.avatar-sm { width: 28px; height: 28px; font-size: 12px; }
.avatar-md { width: 40px; height: 40px; font-size: 15px; }
.avatar-lg { width: 62px; height: 62px; font-size: 26px; border-radius: 18px; }

.nav-toggle {
  display: none;
  width: 38px; height: 38px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  cursor: pointer;
  padding: 0;
  place-items: center;
  gap: 4px;
}
.nav-toggle span { display: block; width: 16px; height: 2px; background: var(--text); border-radius: 2px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(160deg, #3ce894, #21c878);
  color: #04150c;
  box-shadow: 0 8px 22px rgba(53, 224, 138, 0.24);
}
.btn-primary:hover { background: linear-gradient(160deg, #55f0a4, #2ad583); color: #04150c; box-shadow: 0 10px 28px rgba(53, 224, 138, 0.34); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--text); }
.btn-outline:hover { background: var(--panel-2); border-color: #2a3a4e; color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); }
.btn-danger { background: var(--red-soft); border-color: var(--red-line); color: var(--red); }
.btn-danger:hover { background: rgba(255, 92, 114, 0.2); color: var(--red); }
.btn-amber { background: var(--amber-soft); border-color: rgba(255, 200, 87, 0.4); color: var(--amber); }
.btn-amber:hover { background: rgba(255, 200, 87, 0.2); color: var(--amber); }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 24px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; width: 34px; height: 34px; }

/* ---------- panels ---------- */
.card {
  background: linear-gradient(180deg, var(--panel) 0%, #0b1119 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { margin: 0; }
.card-head .card-sub { font-size: 12.5px; color: var(--text-dim); margin: 3px 0 0; }
.card-tight { padding: 14px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-soft);
  white-space: nowrap;
}
.pill strong { color: var(--text); font-variant-numeric: tabular-nums; }
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.tag-positive { background: var(--green-soft); color: var(--green); }
.tag-negative { background: var(--red-soft); color: var(--red); }
.tag-neutral { background: rgba(148, 163, 184, 0.12); color: var(--text-soft); }
.tag-amber { background: var(--amber-soft); color: var(--amber); }
.tag-blue { background: rgba(78, 168, 255, 0.12); color: var(--blue); }
.tag-violet { background: rgba(139, 123, 255, 0.14); color: var(--violet); }

.badge-live {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.badge-live::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  animation: pulseDot 1.6s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(53, 224, 138, 0.5); }
  50% { opacity: 0.7; box-shadow: 0 0 0 5px rgba(53, 224, 138, 0); }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  margin: 22px 0 26px;
  padding: 30px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(900px 340px at 8% -20%, rgba(53, 224, 138, 0.11), transparent 62%),
    linear-gradient(180deg, #0d141d 0%, #080d13 100%);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 70% 100% at 18% 0%, #000 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 70% 100% at 18% 0%, #000 10%, transparent 72%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 316px;
  gap: 30px;
  align-items: center;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 14px;
}
.hero h1 { margin-bottom: 12px; }
.hero h1 .accent { color: var(--green); }
.hero h1 .accent-fail { color: var(--red); }
.hero-lead { max-width: 62ch; color: var(--text-soft); font-size: 14.5px; margin-bottom: 16px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }

.progress-wrap { max-width: 460px; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 12.5px; color: var(--text-dim); }
.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--panel-3);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1f9c64, var(--green));
  box-shadow: 0 0 14px rgba(53, 224, 138, 0.45);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.week-dots { display: flex; gap: 6px; margin-top: 10px; }
.week-dot { flex: 1; height: 4px; border-radius: 999px; background: var(--panel-3); }
.week-dot.done { background: var(--green-line); }
.week-dot.current { background: var(--amber); box-shadow: 0 0 10px rgba(255, 200, 87, 0.5); }

/* gauge */
.gauge-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 18px;
  border-radius: var(--radius);
  background: rgba(9, 14, 20, 0.72);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.gauge { position: relative; width: 190px; height: 190px; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge-track { fill: none; stroke: #18222f; stroke-width: 13; }
.gauge-fill {
  fill: none;
  stroke: url(#gaugeGrad);
  stroke-width: 13;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  filter: drop-shadow(0 0 9px rgba(53, 224, 138, 0.5));
}
.gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.gauge-value {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.gauge-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  font-weight: 600;
  text-align: center;
  max-width: 110px;
}
.gauge-caption { font-size: 11.5px; color: var(--text-dim); text-align: center; margin: 12px 0 0; }

/* ---------- odds tiles ---------- */
.odds-tile {
  position: relative;
  padding: 18px 18px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel) 0%, #0a1017 100%);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.odds-tile::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
}
.odds-tile.pass::before { background: var(--green); box-shadow: 0 0 18px var(--green); }
.odds-tile.fail::before { background: var(--red); box-shadow: 0 0 18px var(--red); }
.odds-tile:hover { transform: translateY(-2px); }
.odds-tile.pass:hover { border-color: var(--green-line); box-shadow: 0 12px 30px rgba(53, 224, 138, 0.1); }
.odds-tile.fail:hover { border-color: var(--red-line); box-shadow: 0 12px 30px rgba(255, 92, 114, 0.1); }
.odds-tile.is-selected.pass { border-color: var(--green); box-shadow: 0 0 0 1px var(--green), 0 14px 34px rgba(53, 224, 138, 0.14); }
.odds-tile.is-selected.fail { border-color: var(--red); box-shadow: 0 0 0 1px var(--red), 0 14px 34px rgba(255, 92, 114, 0.14); }
.odds-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.odds-tile.pass .odds-label { color: rgba(53, 224, 138, 0.85); }
.odds-tile.fail .odds-label { color: rgba(255, 92, 114, 0.85); }
.odds-value {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: color 0.25s ease;
}
.odds-tile.pass .odds-value { color: var(--green); }
.odds-tile.fail .odds-value { color: var(--red); }
.odds-value.flash-up { animation: flashUp 0.7s ease; }
.odds-value.flash-down { animation: flashDown 0.7s ease; }
@keyframes flashUp { 0% { text-shadow: 0 0 22px currentColor; } 100% { text-shadow: none; } }
@keyframes flashDown { 0% { opacity: 0.4; } 100% { opacity: 1; } }
.odds-sub { display: flex; align-items: center; gap: 8px; margin-top: 9px; font-size: 12.5px; color: var(--text-dim); }
.odds-delta { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12px; }
.odds-delta.up { color: var(--green); }
.odds-delta.down { color: var(--red); }

/* sparkline */
.sparkline { width: 100%; height: 46px; display: block; }
.sparkline path.line { fill: none; stroke: var(--green); stroke-width: 1.6; stroke-linejoin: round; }
.sparkline path.area { fill: url(#sparkGrad); stroke: none; }

/* ---------- bet form ---------- */
.bet-form { display: flex; flex-direction: column; gap: 14px; }
.bet-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bet-option { position: relative; }
.bet-option input { position: absolute; opacity: 0; pointer-events: none; }
.bet-option label {
  display: flex; flex-direction: column; gap: 3px;
  padding: 13px 15px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.bet-option label strong { font-size: 14.5px; font-variant-numeric: tabular-nums; }
.bet-option label small { font-size: 11.5px; color: var(--text-dim); }
.bet-option.pass input:checked + label {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: 0 0 0 1px var(--green) inset;
}
.bet-option.pass input:checked + label strong { color: var(--green); }
.bet-option.fail input:checked + label {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: 0 0 0 1px var(--red) inset;
}
.bet-option.fail input:checked + label strong { color: var(--red); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
.field .hint { font-size: 11.5px; color: var(--text-dim); }
input[type="text"], input[type="number"], input[type="password"], input[type="search"],
select, textarea {
  width: 100%;
  padding: 10px 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #080d13;
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-variant-numeric: tabular-nums;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green-line);
  box-shadow: 0 0 0 3px rgba(53, 224, 138, 0.1);
}
textarea { resize: vertical; min-height: 74px; font-family: inherit; }
input[type="range"] { width: 100%; accent-color: var(--green); }

.stake-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.stake-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.stake-quick button {
  padding: 5px 11px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: all 0.14s ease;
}
.stake-quick button:hover { border-color: var(--green-line); color: var(--green); background: var(--green-soft); }
.stake-quick button.active { border-color: var(--green); color: var(--green); background: var(--green-soft); }

.payout-preview {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 15px;
  border-radius: 10px;
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  font-size: 13px;
  color: var(--text-soft);
}
.payout-preview strong { font-size: 20px; color: var(--green); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* ---------- feed ---------- */
.feed { display: flex; flex-direction: column; gap: 2px; }
.feed-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line-soft);
  animation: feedIn 0.35s ease;
}
.feed-item:last-child { border-bottom: none; }
@keyframes feedIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
.feed-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 15px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.feed-icon.positive { background: var(--green-soft); border-color: var(--green-line); }
.feed-icon.negative { background: var(--red-soft); border-color: var(--red-line); }
.feed-body { min-width: 0; }
.feed-title { font-weight: 600; font-size: 14px; margin: 0 0 2px; color: var(--text); }
.feed-text { font-size: 12.5px; color: var(--text-soft); margin: 0; }
.feed-meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 11.5px; color: var(--text-dim); }
.feed-impact { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 12.5px; white-space: nowrap; }
.feed-impact.positive { color: var(--green); }
.feed-impact.negative { color: var(--red); }
.feed-impact.neutral { color: var(--text-dim); }

/* ---------- leaderboard ---------- */
.leader-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 8px;
  border-radius: 9px;
  transition: background 0.15s ease;
}
.leader-row:hover { background: var(--panel-2); }
.leader-row.is-me { background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green-line); }
.rank-badge {
  width: 26px; height: 26px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 12px;
  font-weight: 800;
  background: var(--panel-3);
  color: var(--text-soft);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.rank-badge.rank-1 { background: linear-gradient(145deg, #f7d774, #d4a520); color: #2a1e00; }
.rank-badge.rank-2 { background: linear-gradient(145deg, #dfe6ee, #a7b3c1); color: #1a222c; }
.rank-badge.rank-3 { background: linear-gradient(145deg, #e8a868, #b9793c); color: #2a1600; }
.leader-name { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.leader-name strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader-name small { font-size: 11px; color: var(--text-dim); }
.leader-balance { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }
.leader-balance small { display: block; font-size: 10.5px; font-weight: 500; color: var(--text-dim); }

/* ---------- quests ---------- */
.quest {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.quest.done { border-color: var(--green-line); background: var(--green-soft); }
.quest.claimed { opacity: 0.55; }
.quest-body { flex: 1; min-width: 0; }
.quest-title { font-weight: 600; font-size: 13.5px; margin: 0; }
.quest-desc { font-size: 11.5px; color: var(--text-dim); margin: 1px 0 6px; }
.quest-bar { height: 4px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.quest-bar > span { display: block; height: 100%; background: var(--green); border-radius: 999px; transition: width 0.5s ease; }
.quest-reward {
  font-size: 12.5px; font-weight: 700; color: var(--green);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* ---------- achievements ---------- */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 10px; }
.ach {
  padding: 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  text-align: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.ach.locked { opacity: 0.42; filter: grayscale(1); }
.ach.unlocked { border-color: var(--green-line); background: var(--green-soft); }
.ach:hover { transform: translateY(-2px); }
.ach-icon { font-size: 24px; margin-bottom: 5px; }
.ach-title { font-size: 12.5px; font-weight: 700; margin: 0 0 2px; }
.ach-desc { font-size: 10.5px; color: var(--text-dim); margin: 0; line-height: 1.35; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left;
  padding: 9px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--panel-2); }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data th.num { text-align: right; }

/* ---------- modals ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 6, 9, 0.78);
  backdrop-filter: blur(7px);
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #0e151f, #0a0f16);
  box-shadow: var(--shadow);
  animation: modalIn 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal.wide { max-width: 620px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.modal-head h3 { margin: 0; font-size: 20px; }
.modal-close {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-soft);
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 17px;
  line-height: 1;
  flex-shrink: 0;
}
.modal-close:hover { background: var(--panel-3); color: var(--text); }
.modal form { display: flex; flex-direction: column; gap: 13px; }
.modal .switch-line { display: flex; justify-content: center; gap: 6px; font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.modal .switch-line button { background: none; border: none; color: var(--green); cursor: pointer; font-weight: 600; padding: 0; }

/* ---------- toasts ---------- */
.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: 360px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #0e151f;
  box-shadow: var(--shadow);
  font-size: 13.5px;
  animation: toastIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: auto;
}
.toast.success { border-color: var(--green-line); }
.toast.error { border-color: var(--red-line); }
.toast.info { border-color: rgba(78, 168, 255, 0.35); }
.toast.achievement { border-color: rgba(255, 200, 87, 0.4); background: linear-gradient(135deg, #1a1508, #0e151f); }
.toast-icon { font-size: 16px; line-height: 1.2; flex-shrink: 0; }
.toast-text { flex: 1; min-width: 0; }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.toast.out { animation: toastOut 0.25s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }

/* ---------- empty state ---------- */
.empty { padding: 30px 16px; text-align: center; color: var(--text-dim); }
.empty-icon { font-size: 30px; margin-bottom: 8px; opacity: 0.8; }
.empty p { margin: 0 0 12px; font-size: 13.5px; }

/* ---------- banner ---------- */
.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 11px;
  border: 1px solid var(--amber-soft);
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 13px;
  margin-bottom: 18px;
}
.banner strong { color: var(--amber); }

.notice-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 15px;
  border-radius: 10px;
  border: 1px solid var(--green-line);
  background: var(--green-soft);
  color: var(--green);
  font-size: 13px;
  margin-bottom: 16px;
}

/* ---------- stats strip ---------- */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
  margin-bottom: 18px;
}
.stat-cell { padding: 15px 18px; background: var(--panel); }
.stat-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); font-weight: 700; margin-bottom: 4px; }
.stat-value { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-note { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ---------- key/value rows ---------- */
.kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--line-soft);
}
.kv:last-child { border-bottom: none; }
.kv > span { color: var(--text-dim); }
.kv > strong { font-variant-numeric: tabular-nums; font-weight: 700; }

.section-head { display: flex; align-items: flex-end; gap: 14px; }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 52px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line-soft);
  color: var(--text-dim);
  font-size: 12.5px;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: center; }
.disclaimer {
  max-width: 720px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-dim);
}
.disclaimer strong { color: var(--text-soft); }

/* ---------- skeleton ---------- */
.skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, #101822 25%, #17222f 50%, #101822 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- admin layout ---------- */
.admin-shell { display: grid; grid-template-columns: 218px minmax(0, 1fr); gap: 20px; margin: 20px 0 40px; align-items: start; }
.admin-nav {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
}
.admin-nav button {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.14s ease, color 0.14s ease;
}
.admin-nav button:hover { background: var(--panel-2); color: var(--text); }
.admin-nav button.active { background: var(--green-soft); color: var(--green); font-weight: 600; }
.admin-nav .nav-icon { font-size: 15px; width: 18px; text-align: center; }
.admin-panel { min-width: 0; }
.admin-section { display: none; }
.admin-section.active { display: block; animation: fadeIn 0.2s ease; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.search-input { max-width: 260px; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { flex: 1; min-width: 120px; }

/* user row in admin */
.user-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.user-card:hover { border-color: #26364a; }
.user-card-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.user-card-info { min-width: 0; }
.user-card-info strong { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card-info small { font-size: 11px; color: var(--text-dim); }
.user-card-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.points-badge {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--green);
  font-size: 14px;
  white-space: nowrap;
}

/* ---------- responsive ---------- */
@media (max-width: 1120px) {
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .gauge-panel { flex-direction: row; gap: 22px; justify-content: center; }
  .gauge-caption { margin: 0; text-align: left; max-width: 200px; }
}
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .admin-nav { position: static; flex-direction: row; overflow-x: auto; }
  .admin-nav button { white-space: nowrap; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .container { padding: 0 15px; }
  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px;
    background: #080d13;
    border-bottom: 1px solid var(--line);
    transform: translateY(-120%);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    margin-left: 0;
    z-index: 55;
  }
  .main-nav.open { transform: none; box-shadow: var(--shadow); }
  .nav-toggle { display: grid; }
  .header-actions { gap: 6px; }
  .user-chip-name { display: none; }
  .balance-chip-label { display: none; }
  .hero { padding: 20px; }
  .hero-grid { gap: 20px; }
  .gauge-panel { flex-direction: column; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .odds-value { font-size: 34px; }
  .stake-row { grid-template-columns: minmax(0, 1fr); }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toast-stack { left: 14px; right: 14px; bottom: 14px; max-width: none; }
  .card { padding: 16px; }
  .feed-item { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 9px; }
  table.data th, table.data td { padding: 8px 9px; }
}
@media (max-width: 420px) {
  .stat-strip { grid-template-columns: minmax(0, 1fr); }
  .bet-options { grid-template-columns: minmax(0, 1fr); }
}

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