:root {
  color-scheme: dark;
  --bg: #07100d;
  --surface: #0e1c17;
  --surface-2: #13251e;
  --line: rgba(207, 255, 229, .1);
  --text: #ecfff5;
  --muted: #8eaa9d;
  --lime: #a7ff83;
  --mint: #52e6a5;
  --red: #ff7d85;
  --amber: #ffc96b;
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 90% -10%, rgba(82, 230, 165, .18), transparent 32rem),
    radial-gradient(circle at -10% 30%, rgba(167, 255, 131, .08), transparent 24rem),
    var(--bg);
}
button, input, select { font: inherit; }
button { color: inherit; }
.shell { width: min(760px, 100%); margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 18px calc(96px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(24px, 7vw, 36px); letter-spacing: -.045em; }
h2 { font-size: 20px; letter-spacing: -.025em; }
.eyebrow { color: var(--mint); font-size: 10px; letter-spacing: .18em; font-weight: 800; margin-bottom: 5px; }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--line); background: rgba(14, 28, 23, .8); border-radius: 999px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 14px currentColor; }
.status.live { color: var(--lime); }
.status.live i { background: var(--lime); }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 5px; border: 1px solid var(--line); background: rgba(14, 28, 23, .85); border-radius: 15px; position: sticky; top: max(8px, env(safe-area-inset-top)); z-index: 5; backdrop-filter: blur(18px); }
.tab { border: 0; background: transparent; padding: 10px 8px; border-radius: 11px; color: var(--muted); cursor: pointer; }
.tab.active { color: #07100d; background: var(--lime); font-weight: 800; }
.panel { display: none; padding-top: 18px; }
.panel.active { display: block; }
.hero-card { position: relative; overflow: hidden; padding: 22px; border: 1px solid rgba(167,255,131,.2); border-radius: var(--radius); background: linear-gradient(145deg, rgba(31, 67, 51, .88), rgba(12, 28, 22, .94)); box-shadow: 0 25px 70px rgba(0,0,0,.28); }
.hero-card::after { content: ""; position: absolute; width: 190px; height: 190px; right: -90px; top: -110px; border-radius: 50%; border: 35px solid rgba(167,255,131,.05); }
.hero-head, .score-row { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.life-number { display: block; font-size: 32px; letter-spacing: -.04em; }
.market-badge, .chip { padding: 7px 10px; border-radius: 999px; background: rgba(167,255,131,.09); color: var(--lime); font-size: 11px; border: 1px solid rgba(167,255,131,.15); }
.life-time { margin: 18px 0 22px; font-variant-numeric: tabular-nums; font-size: clamp(34px, 10vw, 60px); line-height: 1; font-weight: 850; letter-spacing: -.055em; }
.score-row { font-size: 13px; color: var(--muted); }
.score-row strong { color: var(--text); font-size: 18px; }
.progress { height: 7px; border-radius: 20px; background: rgba(255,255,255,.08); margin: 10px 0 9px; overflow: hidden; }
.progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mint), var(--lime)); transition: width .5s ease; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
.metric { padding: 16px; min-height: 116px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 18px; background: rgba(14, 28, 23, .76); }
.metric span { color: var(--muted); font-size: 12px; }
.metric strong { font-size: 29px; letter-spacing: -.04em; margin: 9px 0 auto; }
.metric small { color: var(--muted); font-size: 11px; }
.section-title { display: flex; justify-content: space-between; align-items: end; gap: 15px; margin: 28px 2px 13px; }
.episode-list { display: grid; gap: 9px; }
.episode { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; padding: 15px; border: 1px solid var(--line); background: rgba(14,28,23,.7); border-radius: 17px; }
.side { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; font-size: 11px; font-weight: 900; }
.side.long { background: rgba(82,230,165,.12); color: var(--mint); }
.side.short { background: rgba(255,125,133,.12); color: var(--red); }
.episode-main strong { display: block; font-size: 14px; }
.episode-main span { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.result { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.result.win { color: var(--lime); }
.result.loss { color: var(--red); }
.result.open { color: var(--amber); }
.result small { display: block; margin-top: 4px; color: var(--muted); font-weight: 500; }
.empty { padding: 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 17px; }
.explain, .notice { color: var(--muted); font-size: 13px; line-height: 1.5; }
.notice { display: grid; gap: 4px; padding: 14px 16px; background: rgba(255,201,107,.07); border: 1px solid rgba(255,201,107,.16); border-radius: 15px; margin-bottom: 15px; }
.notice strong { color: var(--amber); }
.notice.danger { background: rgba(255,125,133,.08); border-color: rgba(255,125,133,.2); }
.notice.danger strong { color: var(--red); }
.settings-group { margin: 22px 0; }
.settings-group h3 { font-size: 12px; letter-spacing: .12em; color: var(--mint); text-transform: uppercase; margin: 0 0 9px; }
.field { display: grid; grid-template-columns: 1fr minmax(108px, 42%); align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.field label { font-size: 13px; }
.field label small { display: block; margin-top: 4px; color: var(--amber); }
.field input, .field select { width: 100%; border: 1px solid var(--line); color: var(--text); background: var(--surface-2); border-radius: 10px; padding: 10px; outline: none; }
.field input:focus, .field select:focus { border-color: var(--mint); }
.switch { justify-self: end; width: 48px; height: 27px; appearance: none; border-radius: 20px; background: #263a32; position: relative; cursor: pointer; transition: .2s; }
.switch::after { content: ""; position: absolute; width: 21px; height: 21px; left: 3px; top: 3px; border-radius: 50%; background: #81988d; transition: .2s; }
.switch:checked { background: var(--mint); }
.switch:checked::after { transform: translateX(21px); background: #07100d; }
.save-dock { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 12px 12px 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(14,28,23,.94); backdrop-filter: blur(20px); box-shadow: 0 15px 40px rgba(0,0,0,.35); }
.save-dock span { color: var(--muted); font-size: 12px; }
.save-dock button { border: 0; border-radius: 11px; padding: 11px 15px; background: var(--lime); color: #07100d; font-weight: 850; cursor: pointer; }
.save-dock button:disabled { opacity: .35; cursor: default; }
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(90%, 420px); padding: 13px 16px; border-radius: 13px; background: #defedc; color: #07100d; font-size: 13px; font-weight: 700; box-shadow: 0 20px 60px rgba(0,0,0,.45); z-index: 20; }
.hidden { display: none !important; }
@media (min-width: 660px) { .metric-grid { grid-template-columns: repeat(4, 1fr); } .metric { min-height: 130px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
