/* Player Performance Tracker: dark, blue and green, minimal, mobile first. */
:root {
  --bg: #0a1020;
  --surface: #0f1a30;
  --surface-2: #14233f;
  --line: #1e3050;
  --text: #e8eef9;
  --muted: #93a7c6;
  --blue: #4f8df7;
  --blue-soft: rgba(79, 141, 247, 0.14);
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.14);
  --amber: #f5b14a;
  --amber-soft: rgba(245, 177, 74, 0.14);
  --red: #f87171;
  --radius: 14px;
  --max: 1080px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-image: radial-gradient(900px 400px at 85% -10%, rgba(79, 141, 247, 0.12), transparent 70%), radial-gradient(700px 360px at -10% 0%, rgba(52, 211, 153, 0.08), transparent 70%);
  background-repeat: no-repeat;
}
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 5vw, 2.3rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
h4 { font-size: .95rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-top: 1.2rem; }
p { margin: 0 0 .75rem; }
a { color: var(--blue); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.wrap { width: min(100% - 2rem, var(--max)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--blue); color: #04101f; padding: .5rem .75rem; z-index: 20; }
.skip:focus { left: .5rem; top: .5rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 6px; }

/* header and nav */
.top { position: sticky; top: 0; z-index: 10; background: rgba(10, 16, 32, 0.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.navbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1rem; padding: .65rem 0; }
.brand { color: var(--text); text-decoration: none; font-weight: 700; display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--green)); }
.nav { display: flex; gap: .25rem; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--muted); text-decoration: none; padding: .45rem .8rem; border-radius: 999px; font-size: .92rem; white-space: nowrap; min-height: 40px; display: inline-flex; align-items: center; }
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--text); background: var(--blue-soft); box-shadow: inset 0 0 0 1px rgba(79, 141, 247, 0.5); }

main { padding: 1.4rem 0 2.5rem; }
.pagehead { margin-bottom: 1.1rem; }
.pagehead p { color: var(--muted); max-width: 62ch; margin-bottom: 0; }

/* cards and layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; margin-bottom: 1rem; }
.card > :last-child { margin-bottom: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .75rem; }
.row h2, .row h3 { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid > .card { margin-bottom: 0; }
.span-all { grid-column: 1 / -1; }
.cols2 { display: grid; gap: .75rem; grid-template-columns: repeat(2, 1fr); }
.cols3 { display: grid; gap: .75rem; grid-template-columns: repeat(2, 1fr); }
.cols4 { display: grid; gap: .75rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .cols3 { grid-template-columns: repeat(3, 1fr); } .cols4 { grid-template-columns: repeat(4, 1fr); } }

/* buttons and forms */
.btn { font: inherit; font-weight: 600; font-size: .92rem; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .95rem; min-height: 42px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn:hover { border-color: var(--blue); }
.btn.primary { background: linear-gradient(135deg, var(--blue), #3b6fe0); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.green { background: var(--green-soft); border-color: rgba(52, 211, 153, 0.5); color: var(--green); }
.btn.danger { color: var(--red); border-color: rgba(248, 113, 113, 0.4); background: transparent; }
.btn.small { min-height: 34px; padding: .3rem .65rem; font-size: .82rem; }
.link { font: inherit; background: none; border: 0; color: var(--blue); cursor: pointer; padding: .4rem; min-height: 36px; text-decoration: underline; }
label { display: grid; gap: .3rem; font-size: .88rem; color: var(--muted); }
input, select { font: inherit; color: var(--text); background: #0b1428; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .7rem; min-height: 44px; width: 100%; color-scheme: dark; }
input:focus, select:focus { border-color: var(--blue); outline: 2px solid var(--blue-soft); }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: .9rem; margin: 0 0 1rem; min-width: 0; }
legend { padding: 0 .4rem; font-weight: 600; font-size: .9rem; }
legend.attack { color: var(--green); } legend.passing { color: var(--blue); } legend.defending { color: #7dd3fc; } legend.physical { color: var(--amber); }
.msg { min-height: 1.4em; font-size: .92rem; margin: 0 0 .6rem; }
.msg.ok { color: var(--green); } .msg.err { color: var(--red); }
.picker { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; margin-bottom: 1rem; }
.picker label { flex: 1 1 220px; max-width: 360px; }
.empty-state { text-align: center; padding: 1.6rem 1rem; }
.empty-state p { color: var(--muted); max-width: 46ch; margin-inline: auto; }
.empty-state .actions { justify-content: center; margin-top: .75rem; }

/* big numbers */
.bignum { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
.bignum .n { font-size: 2.4rem; font-weight: 800; line-height: 1; background: linear-gradient(135deg, #8fb6ff, var(--green)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bignum .l { color: var(--muted); font-size: .88rem; }

/* lists */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .75rem; padding: .6rem .75rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.list .sub { color: var(--muted); font-size: .84rem; display: block; }
.pill { font-size: .75rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.pill.strong, .pill.up { color: var(--green); background: var(--green-soft); border-color: rgba(52, 211, 153, 0.4); }
.pill.track { color: #8fb6ff; background: var(--blue-soft); border-color: rgba(79, 141, 247, 0.4); }
.pill.focus, .pill.down { color: var(--amber); background: var(--amber-soft); border-color: rgba(245, 177, 74, 0.4); }
.pill.nodata, .pill.flat { color: var(--muted); background: transparent; border-color: var(--line); }

/* bars */
.bar { height: 10px; background: #0b1428; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--blue); }
.bar.strong > span { background: var(--green); } .bar.focus > span { background: var(--amber); } .bar.track > span { background: var(--blue); }
.hbar { display: grid; grid-template-columns: minmax(80px, 1fr) 2fr auto; gap: .6rem; align-items: center; font-size: .9rem; margin-bottom: .55rem; }
.hbar .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .v { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 3.2rem; text-align: right; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: .4rem; align-items: end; height: 130px; margin-top: .6rem; }
.dcol { display: grid; grid-template-rows: 1fr auto auto; height: 100%; text-align: center; font-size: .74rem; color: var(--muted); gap: .2rem; }
.dtrack { position: relative; background: #0b1428; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; min-height: 60px; }
.dplan { position: absolute; left: 0; right: 0; bottom: 0; background: var(--blue-soft); border-top: 1px dashed rgba(79, 141, 247, 0.6); }
.ddone { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, var(--green), #1f9d73); }
.dcol.today .dl { color: var(--green); font-weight: 700; }

/* KPI visuals */
.index { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.ring { position: relative; width: 120px; height: 120px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--line); } .ring .val { stroke: url(#ringGrad); stroke-linecap: round; }
.ring .num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-size: 2rem; font-weight: 800; line-height: 1; }
.ring .num small { display: block; font-size: .65rem; font-weight: 600; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-top: .2rem; }
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .axis { stroke: var(--line); } .chart .grid { stroke: var(--line); fill: none; stroke-dasharray: 3 4; }
.chart .ref { stroke: var(--green); stroke-dasharray: 5 5; opacity: .7; }
.chart .trendline { fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-linejoin: round; }
.chart .area { fill: var(--blue-soft); stroke: none; }
.chart circle.pt { fill: var(--green); stroke: var(--bg); stroke-width: 2; }
.chart .radar-shape { fill: rgba(52, 211, 153, 0.22); stroke: var(--green); stroke-width: 2; }
.chart .radar-dot { fill: var(--green); }
.chart .radar-lbl { fill: var(--text); font-size: 12px; }
.catgrid { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 760px) { .catgrid { grid-template-columns: minmax(260px, 340px) 1fr; } }
.kpi { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: .8rem .9rem; }
.kpi header { display: flex; justify-content: space-between; align-items: start; gap: .5rem; }
.kpi h4 { margin: 0; text-transform: none; letter-spacing: 0; font-size: .92rem; color: var(--text); }
.kpi .val { font-size: 1.5rem; font-weight: 800; margin: .25rem 0 .4rem; font-variant-numeric: tabular-nums; }
.kpi .meta { display: flex; justify-content: space-between; gap: .5rem; font-size: .8rem; color: var(--muted); margin-top: .4rem; flex-wrap: wrap; }
.kpigrid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.catsec { margin-top: 1.3rem; }
.catsec .row { margin-bottom: .6rem; }
.delta.up { color: var(--green); } .delta.down { color: var(--amber); } .delta.flat { color: var(--muted); }

/* tables */
.scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.empty { color: var(--muted); text-align: center; padding: 1.2rem; }

/* program */
.goals { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin-bottom: 1rem; }
.goal { background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: 12px; padding: .8rem .9rem; }
.goal h4 { text-transform: none; letter-spacing: 0; color: var(--text); margin: 0 0 .3rem; font-size: .95rem; }
details.week { border: 1px solid var(--line); border-radius: 12px; margin-bottom: .6rem; background: var(--surface-2); }
details.week summary { cursor: pointer; padding: .8rem .9rem; font-weight: 600; min-height: 44px; }
details.week .inner { padding: 0 .9rem .8rem; }
.sess { display: grid; grid-template-columns: auto 1fr auto; gap: .6rem; align-items: start; padding: .65rem 0; border-top: 1px solid var(--line); }
.sess:first-child { border-top: 0; }
.sess .d { font-weight: 700; min-width: 3.4rem; }
.sess .d small { display: block; color: var(--muted); font-weight: 400; font-size: .75rem; }
.sess.done .t { text-decoration: line-through; opacity: .65; }
.check { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 .3rem; cursor: pointer; color: var(--text); font-size: .85rem; }
.check input { width: 22px; height: 22px; min-height: 0; accent-color: var(--green); }
.note { color: var(--muted); font-size: .84rem; border-top: 1px solid var(--line); padding-top: .8rem; margin-top: 1rem; }
ul.tight { margin: 0 0 .5rem; padding-left: 1.1rem; } ul.tight li { margin-bottom: .35rem; }
.foot { padding: 1.5rem 0 2.5rem; color: var(--muted); font-size: .84rem; border-top: 1px solid var(--line); }

@media (min-width: 700px) { .cols2 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) {
  body { font-size: 15.5px; }
  .navbar { flex-direction: column; align-items: stretch; gap: .35rem; }
  .nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: .2rem; overflow: visible; }
  .nav a { justify-content: center; text-align: center; padding: .4rem .2rem; font-size: .8rem; line-height: 1.15; min-height: 44px; border-radius: 10px; }
  .card { padding: .9rem; }
  .hbar { grid-template-columns: 1fr auto; } .hbar .bar { grid-column: 1 / -1; order: 3; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media print {
  body { background: #fff; color: #000; }
  .top, .foot, .btn, .picker, .actions, .check { display: none !important; }
  .card, .kpi, .goal, details.week { background: #fff; border-color: #bbb; color: #000; }
  .muted, th { color: #444; }
  details.week[open] .inner, details.week .inner { display: block; }
}

/* ---- cookie notice and prose pages ---- */
.consent { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--surface-2); border-top: 1px solid var(--line); padding: .85rem 1rem; display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; justify-content: space-between; box-shadow: 0 -8px 24px rgba(0, 0, 0, .35); }
.consent p { margin: 0; flex: 1 1 320px; font-size: .88rem; color: var(--text); line-height: 1.45; }
.consent a { color: var(--blue); }
.consent-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.prose h2 { font-size: 1.05rem; margin: 1.4rem 0 .4rem; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--muted); line-height: 1.6; margin: 0 0 .8rem; }
.prose a, .foot a { color: var(--blue); }
@media print { .consent { display: none !important; } }
