:root {
  --bg: #0b1f17;
  --bg-2: #0f2a1f;
  --card: #133426;
  --card-2: #18402f;
  --line: rgba(232, 245, 236, 0.12);
  --chalk: #e8f5ec;
  --muted: #9cb8a8;
  --lime: #c6f432;
  --lime-ink: #1a2a05;
  --red: #ff6b5e;
  --amber: #ffc24b;
  --blue: #7cc7ff;
  --radius: 14px;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --tabs-h: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--chalk); font-family: var(--body); font-size: 15px; -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); }
a { color: var(--lime); }
button { font: inherit; color: inherit; }

.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(11, 31, 23, 0.92);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { white-space: nowrap; display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: 0.02em; text-transform: uppercase; }
.mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--lime); color: var(--lime-ink); font-size: 20px; }
.gw { margin-left: auto; font-family: var(--display); font-size: 16px; color: var(--muted); text-align: right; white-space: nowrap; }
.gw b { color: var(--chalk); font-weight: 600; }
.icon-btn { background: none; border: 1px solid var(--line); border-radius: 10px; width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer; }
.icon-btn.spin svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

main { max-width: 720px; margin: 0 auto; padding: 16px; }
h1, h2, h3 { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.03em; margin: 0; }
h1 { font-size: 28px; }
h2 { font-size: 20px; margin: 22px 0 10px; color: var(--muted); font-weight: 600; }
h3 { font-size: 18px; }
p { line-height: 1.5; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.card.hero { background: linear-gradient(160deg, var(--card-2), var(--card)); border-color: rgba(198, 244, 50, 0.35); }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.stat { background: var(--bg-2); border-radius: 10px; padding: 10px 12px; }
.stat .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat .v { font-family: var(--display); font-size: 26px; font-weight: 700; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 44px; }
.btn.primary { background: var(--lime); color: var(--lime-ink); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--chalk); }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: default; }

.pill { white-space: nowrap; display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg-2); color: var(--muted); }
.pill.good { background: rgba(198, 244, 50, 0.16); color: var(--lime); }
.pill.warn { background: rgba(255, 194, 75, 0.16); color: var(--amber); }
.pill.bad { background: rgba(255, 107, 94, 0.16); color: var(--red); }
.pill.info { background: rgba(124, 199, 255, 0.14); color: var(--blue); }

.move { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 10px; background: var(--bg-2); border-radius: 10px; }
.move + .move { margin-top: 8px; }
.move .out { color: var(--red); }
.move .in { color: var(--lime); text-align: right; }
.move .arrow { color: var(--muted); }
.pname { font-weight: 600; }
.psub { font-size: 12px; color: var(--muted); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.xp { font-family: var(--display); font-size: 20px; font-weight: 700; min-width: 44px; text-align: right; }

/* Pitch */
.pitch {
  position: relative; border-radius: var(--radius); padding: 14px 6px 10px; overflow: hidden;
  background:
    repeating-linear-gradient(180deg, rgba(255,255,255,0.025) 0 44px, transparent 44px 88px),
    linear-gradient(180deg, #17553a, #11402c);
  border: 1px solid var(--line);
}
.pitch::before { content: ''; position: absolute; inset: 8px; border: 1.5px solid rgba(232,245,236,0.25); border-radius: 6px; pointer-events: none; }
.pitch::after { content: ''; position: absolute; left: 50%; top: 8px; width: 120px; height: 46px; transform: translateX(-50%); border: 1.5px solid rgba(232,245,236,0.25); border-top: 0; pointer-events: none; }
.line-up { position: relative; display: flex; justify-content: space-evenly; margin: 10px 0 14px; }
.shirt { width: 68px; text-align: center; position: relative; }
.shirt.sub { opacity: 0.85; }
.shirt .tee { width: 38px; height: 34px; margin: 0 auto 4px; background: var(--chalk); clip-path: polygon(25% 0, 38% 8%, 62% 8%, 75% 0, 100% 18%, 88% 38%, 80% 34%, 80% 100%, 20% 100%, 20% 34%, 12% 38%, 0 18%); position: relative; }
.shirt.gk .tee { background: var(--amber); }
.shirt .nm { font-size: 12px; font-weight: 600; background: rgba(11,31,23,0.85); border-radius: 6px 6px 0 0; padding: 2px 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shirt .sc { font-family: var(--display); font-size: 14px; background: var(--lime); color: var(--lime-ink); border-radius: 0 0 6px 6px; font-weight: 700; }
.shirt .badge { position: absolute; z-index: 1; top: -6px; right: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); color: var(--lime); font: 700 11px/18px var(--display); border: 1px solid var(--lime); }
.shirt .flag { position: absolute; z-index: 1; top: -6px; left: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--amber); color: #2a1d00; font: 700 12px/18px var(--display); }
.bench { display: flex; justify-content: space-evenly; padding: 10px 0 2px; margin-top: 4px; background: rgba(0,0,0,0.18); border-radius: 10px; }

.fx { display: inline-block; min-width: 46px; text-align: center; padding: 3px 4px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.fdr1, .fdr2 { background: #2e7d4f; color: #eafff1; }
.fdr3 { background: #4b5b54; color: #e8f5ec; }
.fdr4 { background: #b4492f; color: #fff1ec; }
.fdr5 { background: #7e1f2b; color: #ffe9ec; }
.fx.blank { background: transparent; border: 1px dashed var(--line); color: var(--muted); }

.seg { display: inline-flex; background: var(--bg-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; }
.seg button.on { background: var(--card-2); color: var(--chalk); }

label.field { display: block; margin-bottom: 12px; }
label.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input, select { width: 100%; background: var(--bg-2); color: var(--chalk); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: inherit; min-height: 44px; }
input:focus, select:focus { outline: 2px solid var(--lime); outline-offset: 1px; }

.ai { line-height: 1.55; }
.ai h4 { font-family: var(--display); text-transform: uppercase; font-size: 16px; color: var(--lime); margin: 14px 0 4px; letter-spacing: 0.04em; }
.ai ul { margin: 4px 0; padding-left: 18px; }
.ai p { margin: 6px 0; }

.skeleton { height: 90px; border-radius: var(--radius); background: linear-gradient(90deg, var(--card), var(--card-2), var(--card)); background-size: 200% 100%; animation: shimmer 1.2s infinite; margin-bottom: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.tabs {
  position: fixed; inset: auto 0 0 0; z-index: 5; display: grid; grid-template-columns: repeat(6, 1fr);
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(11, 31, 23, 0.96); border-top: 1px solid var(--line); backdrop-filter: blur(10px);
}
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; }
.tabs svg { width: 22px; height: 22px; fill: currentColor; }
.tabs a.on { color: var(--lime); }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 16px); transform: translate(-50%, 20px); opacity: 0; transition: 0.25s; background: var(--chalk); color: var(--bg); padding: 10px 14px; border-radius: 10px; font-weight: 600; z-index: 9; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.err { border-color: rgba(255,107,94,0.5); }
.center { text-align: center; }
details summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 4px 0; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* v2 additions */
.seg.wide { display: flex; width: 100%; }
.seg.wide button { flex: 1; padding: 9px 6px; }
.rating-row { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.dial { flex: none; color: var(--chalk); }
.dial-num { font: 700 34px var(--display); }
.dial-sub { font: 500 11px var(--body); fill: var(--muted); }
.bar { height: 6px; background: rgba(232,245,236,0.1); border-radius: 4px; overflow: hidden; margin-top: 3px; }
.bar span { display: block; height: 100%; border-radius: 4px; }
.grow { flex: 1; min-width: 0; }
.insights { list-style: none; margin: 8px 0 0; padding: 0; }
.insights li { position: relative; padding: 6px 0 6px 18px; line-height: 1.4; }
.insights li::before { content: ''; position: absolute; left: 2px; top: 13px; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.insights li.good::before { background: var(--lime); }
.insights li.warn::before { background: var(--amber); }
.insights li.bad::before { background: var(--red); }
.shirt.new .nm { color: var(--lime); }
.ask { border-color: rgba(124,199,255,0.35); }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.chip-x { border: 0; cursor: pointer; }
.steps { padding-left: 18px; line-height: 1.6; }
.list li.me .pname { color: var(--lime); }
.skeleton.tall { height: 220px; }
details.card summary { list-style: none; }
details.card summary::before { content: '▸ '; }
details.card[open] summary::before { content: '▾ '; }
.pred { padding: 6px 8px; }
.pred-row { display: grid; grid-template-columns: minmax(0, 1fr) repeat(5, 34px) 40px; gap: 3px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.pred-row:last-child { border-bottom: 0; }
.pred-row.head { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; text-align: center; }
.pred-row.head span:first-child { text-align: left; }
.pred-row.mine { background: rgba(124,199,255,0.08); border-radius: 8px; }
.pn { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.pn small { display: block; color: var(--muted); font-size: 11px; }
.pc { font: 600 13px var(--display); text-align: center; border-radius: 5px; padding: 3px 0; }
.tot { font: 700 16px var(--display); text-align: right; }
.fx small { font-size: 9px; opacity: 0.8; }

details.opt summary { list-style: none; cursor: pointer; padding: 0; color: var(--chalk); font-weight: 600; }
details.opt summary::-webkit-details-marker { display: none; }
