:root { --bg:#f6f7f9; --fg:#1b1f24; --dim:#6a737d; --line:#e1e4e8; --acc:#1f6feb; --card:#fff; }
@media (prefers-color-scheme: dark) { :root { --bg:#0f1115; --fg:#e6e8eb; --dim:#8b949e; --line:#2a2f36; --acc:#58a6ff; --card:#171a20; } }
* { box-sizing: border-box; }
body { margin:0; font: 14px/1.45 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; background:var(--bg); color:var(--fg); }
header.top { display:flex; align-items:center; gap:24px; padding:10px 20px; border-bottom:1px solid var(--line); background:var(--card); }
header .brand { font-weight:700; font-size:18px; color:var(--fg); text-decoration:none; }
header nav a { margin-right:16px; color:var(--dim); text-decoration:none; }
header nav a:hover { color:var(--acc); }
main { padding:16px 20px 40px; max-width:1400px; margin:0 auto; }
footer { color:var(--dim); font-size:12px; padding:12px 20px; border-top:1px solid var(--line); }
h1 { font-size:22px; margin:8px 0 12px; display:flex; align-items:center; gap:10px; }
h2 { font-size:17px; margin:24px 0 8px; }
a { color:var(--acc); text-decoration:none; } a:hover { text-decoration:underline; }
.meta, .dim { color:var(--dim); }
.filters { display:flex; flex-wrap:wrap; gap:10px 14px; align-items:end; padding:12px; background:var(--card); border:1px solid var(--line); border-radius:8px; margin-bottom:12px; }
.filters label { display:flex; flex-direction:column; font-size:12px; color:var(--dim); gap:3px; }
.filters select, .filters input { font:inherit; padding:4px 6px; border:1px solid var(--line); border-radius:4px; background:var(--bg); color:var(--fg); }
.filters button { font:inherit; padding:6px 14px; border:0; border-radius:4px; background:var(--acc); color:#fff; cursor:pointer; }
table.rank { width:100%; border-collapse:collapse; background:var(--card); border:1px solid var(--line); border-radius:8px; }
table.rank th, table.rank td { padding:6px 8px; border-bottom:1px solid var(--line); text-align:left; white-space:nowrap; }
table.rank th { font-size:12px; color:var(--dim); text-transform:uppercase; letter-spacing:.03em; position:sticky; top:0; background:var(--card); }
table.rank td.num, table.rank th.num { text-align:right; font-variant-numeric: tabular-nums; }
table.rank tr.w td:nth-child(6) { color:#1a7f37; } table.rank tr.l td:nth-child(6) { color:#cf222e; } table.rank tr.d td:nth-child(6) { color:#9a6700; }
.cards { display:flex; flex-wrap:wrap; gap:12px; margin:12px 0; }
.card { background:var(--card); border:1px solid var(--line); border-radius:8px; padding:10px 14px; min-width:150px; }
.card .k { font-size:11px; color:var(--dim); text-transform:uppercase; }
.card .v { font-size:24px; font-weight:700; }
img.logo { height:36px; width:36px; object-fit:contain; }
.pager { display:flex; gap:12px; margin-top:10px; }
code { background:var(--line); padding:1px 5px; border-radius:3px; }

.cols { display:grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap:16px; align-items:start; }
@media (max-width: 800px) { .cols { grid-template-columns: 1fr; } }
.note { color:var(--dim); font-size:13px; background:var(--card); border:1px solid var(--line); border-radius:8px; padding:8px 12px; }

form.inline { display:inline; }
form.inline input, form.inline button, input.stat { font:inherit; font-size:13px; padding:2px 6px; border:1px solid var(--line); border-radius:6px; background:var(--card); color:var(--fg); }
input.stat { width:3.2em; text-align:right; }
form.inline button { cursor:pointer; }
form.inline button:hover { border-color:var(--acc); color:var(--acc); }

form.poschips { display:flex; flex-wrap:wrap; gap:6px 18px; align-items:center; margin:4px 0 14px; font-size:13px; }
.posgroup { display:inline-flex; flex-wrap:wrap; gap:4px 6px; align-items:center; }
.posgroup label { display:inline-flex; align-items:center; gap:3px; padding:2px 8px; border:1px solid var(--line); border-radius:999px; background:var(--card); cursor:pointer; white-space:nowrap; }
.posgroup label:has(input:checked) { border-color:var(--acc); color:var(--acc); }
.posgroup input { margin:0; }
.posgroup button { font:inherit; font-size:13px; padding:2px 8px; border:1px solid var(--line); border-radius:6px; background:var(--card); color:var(--fg); cursor:pointer; }
.posgroup button:hover { border-color:var(--acc); color:var(--acc); }

.dev { margin: 8px 0 22px; }
.dev h3 { margin: 10px 0 4px; font-size: 15px; }
.devchart { width: 100%; max-width: 760px; height: auto; display: block; background: var(--card); border: 1px solid var(--line); border-radius: 8px; margin: 6px 0; }
.devchart .grid { stroke: var(--line); stroke-width: 1; }
.devchart .grid.zero { stroke: var(--dim); }
.devchart .ref { stroke: var(--dim); stroke-width: 1; stroke-dasharray: 4 4; }
.devchart .reflab { fill: var(--dim); font-size: 10px; text-anchor: end; }
.devchart .ylab { fill: var(--dim); font-size: 10px; text-anchor: end; }
.devchart .xlab { fill: var(--fg); font-size: 10px; text-anchor: middle; }
.devchart .xlab.dim { fill: var(--dim); }
.devchart .legend { fill: var(--dim); font-size: 10px; }
.devchart .bar.pos { fill: #3c9a5f; opacity: .45; }
.devchart .bar.neg { fill: #c9553d; opacity: .45; }
.devchart .line { fill: none; stroke: var(--acc); stroke-width: 2.2; }
.devchart .dot { fill: var(--acc); stroke: var(--card); stroke-width: 1.5; }
table.rank.compact { width: auto; min-width: 360px; font-size: 13px; }
ul.notes { margin: 8px 0 0; padding-left: 0; list-style: none; display: grid; gap: 6px; max-width: 760px; }
ul.notes li { padding: 6px 10px; border-left: 3px solid var(--line); background: var(--card); border-radius: 0 6px 6px 0; font-size: 13px; }
ul.notes li.strength { border-left-color: #3c9a5f; }
ul.notes li.focus { border-left-color: #c9553d; }

/* ---------- phones and narrow screens ---------- */
.tbl { overflow-x:auto; -webkit-overflow-scrolling:touch; border-radius:8px; max-width:100%; }
main { min-width:0; }
.tbl > table.rank { min-width:100%; }
header.top { flex-wrap:wrap; gap:8px 24px; position:sticky; top:0; z-index:5; }
header nav { display:flex; flex-wrap:wrap; gap:4px 16px; }
header nav a { margin:0; padding:4px 0; }
@media (max-width: 800px) {
  main { padding:10px 10px 32px; }
  header.top { padding:8px 12px; gap:6px 12px; }
  header .brand { font-size:16px; }
  header nav { width:100%; flex-wrap:nowrap; overflow-x:auto; gap:0 14px; scrollbar-width:none; -ms-overflow-style:none; }
  header nav::-webkit-scrollbar { display:none; }
  header nav a { white-space:nowrap; padding:6px 0; font-size:13px; }
  h1 { font-size:19px; flex-wrap:wrap; }
  h2 { font-size:16px; margin-top:18px; }
  table.rank th, table.rank td { padding:6px 6px; }
  table.rank th { position:static; }
  table.rank.compact { min-width:0; width:100%; }
  .filters { display:grid; grid-template-columns:1fr 1fr; gap:8px; padding:10px; }
  .filters label { font-size:12px; }
  .filters label { min-width:0; }                                                     /* grid items must be allowed to shrink below a long <option> */
  .filters select, .filters input { width:100%; max-width:100%; min-width:0; min-height:38px; font-size:16px; }   /* 16px stops iOS zooming into fields */
  .hide-sm { display:none !important; }
  code, .meta { overflow-wrap:anywhere; }
  .filters button { grid-column:1 / -1; min-height:40px; font-size:15px; }
  .filters label:has(input[type=text]) { grid-column:1 / -1; }
  .cards { gap:8px; } .card { flex:1 1 40%; min-width:0; padding:8px 10px; } .card .v { font-size:20px; }
  .posgroup label, .posgroup button { padding:6px 10px; font-size:14px; }
  .posgroup input { width:16px; height:16px; }
  form.poschips { gap:8px 14px; }
  form.inline input, form.inline button, input.stat { min-height:34px; font-size:16px; padding:2px 8px; }
  input.stat { width:3.6em; }
  .pager { justify-content:space-between; font-size:15px; } .pager a { padding:8px 12px; border:1px solid var(--line); border-radius:6px; background:var(--card); }
  .devchart { max-width:none; }
  .devchart .legend { display:none; }
  .devchart .ylab, .devchart .xlab, .devchart .reflab { font-size:15px; }   /* the SVG is scaled down ~0.55x on a phone */
  ul.notes li { font-size:14px; }
  footer { font-size:11px; padding:10px 12px; }
}
@media (max-width: 420px) {
  .filters { grid-template-columns:1fr 1fr; }
  body { font-size:13.5px; }
}

h1 form.savebtn { margin-left:auto; }
h1 form.savebtn button { font:inherit; font-size:13px; padding:4px 10px; border:1px solid var(--line); border-radius:999px; background:var(--card); color:var(--fg); cursor:pointer; }
h1 form.savebtn button:hover { border-color:var(--acc); color:var(--acc); }
header nav a.who { color:var(--acc); margin-left:8px; }

/* ---------- player profile page ---------- */
.profile { max-width:1180px; margin:0 auto; }
.profile .hero { background:var(--card); border:1px solid var(--line); border-radius:10px; overflow:hidden; margin:4px 0 14px; }
.profile .cover { height:190px; background:#1e3a5f center/cover no-repeat; position:relative; }
.profile .cover.empty { background: linear-gradient(135deg, #0b3d2e 0%, #1f6feb 55%, #7cc4ff 100%); }
.profile .cover.empty::after { content:""; position:absolute; inset:0; background: radial-gradient(circle at 20% 70%, rgba(255,255,255,.18) 0 14px, transparent 15px), radial-gradient(circle at 78% 30%, rgba(255,255,255,.12) 0 34px, transparent 35px); }
.profile .cover .slot { position:absolute; right:12px; bottom:10px; font-size:12px; color:rgba(255,255,255,.85); background:rgba(0,0,0,.25); padding:3px 9px; border-radius:999px; z-index:1; }
.profile .avatar { width:96px; height:96px; border-radius:50%; margin:-48px 0 0 20px; border:4px solid var(--card); background:var(--bg); overflow:hidden; display:flex; align-items:center; justify-content:center; position:relative; z-index:1; }
.profile .avatar img { width:100%; height:100%; object-fit:cover; }
.profile .avatar .initials { font-size:32px; font-weight:700; color:var(--dim); }
.profile .who { padding:6px 20px 0; }
.profile .who h1 { margin:4px 0 2px; font-size:24px; }
.profile .badge { display:inline-flex; width:18px; height:18px; border-radius:50%; background:var(--acc); color:#fff; font-size:11px; align-items:center; justify-content:center; }
.profile .sub { margin:0 0 8px; color:var(--dim); font-size:13px; }
.profile .tabs { display:flex; gap:22px; border-top:1px solid transparent; }
.profile .tabs a { padding:8px 2px 10px; color:var(--dim); border-bottom:2px solid transparent; text-decoration:none; font-size:14px; }
.profile .tabs a.on { color:var(--acc); border-bottom-color:var(--acc); }
.profile .tabs a:hover { color:var(--acc); }

.pcols { display:grid; grid-template-columns: 300px minmax(0,1fr); gap:14px; align-items:start; }
.pcols > * { min-width:0; }
.pcard { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:0 0 10px; margin-bottom:14px; overflow:hidden; }
.pcard > h2 { font-size:15px; margin:0 0 10px; padding:12px 14px; border-bottom:1px solid var(--line); display:flex; align-items:baseline; gap:8px; }
.pcard > h2 .dim { font-weight:400; font-size:13px; }
.pcard > h2 .see { margin-left:auto; font-size:12px; font-weight:400; }
.pcard > p, .pcard > ul, .pcard > ol, .pcard > details, .pcard > div, .pcard > form, .pcard > svg { margin-left:14px; margin-right:14px; }
.pcard > .tbl { margin:0; border-radius:0; }
.pcard .tbl table.rank { border:0; border-radius:0; }
.pcard .tbl table.rank th { position:static; }
.pcard p.meta { margin-top:8px; }
.small { font-size:12px; }
.pcard .dev { margin:0 14px 18px; }
.pcard .devchart { max-width:none; }

.stats3 { display:grid; grid-template-columns: repeat(3, 1fr); gap:0; }
.stats3 > div { display:flex; flex-direction:column; gap:2px; padding:2px 10px 4px 0; border-right:1px solid var(--line); margin-right:10px; min-width:0; }
.stats3 > div:last-child { border-right:0; margin-right:0; }
.stats3 .k { font-size:10.5px; color:var(--dim); text-transform:uppercase; letter-spacing:.02em; line-height:1.2; min-height:2.4em; }
.stats3 .v { font-size:18px; font-weight:600; color:var(--acc); }

.season { font-size:11px; color:var(--dim); text-transform:uppercase; letter-spacing:.05em; margin:0 0 6px; }
ul.ranklist { list-style:none; padding:0; margin:0 14px 4px; }
ul.ranklist li { display:flex; align-items:baseline; gap:6px; padding:7px 0; border-bottom:1px solid var(--line); }
ul.ranklist li:last-child { border-bottom:0; }
ul.ranklist li.subrow { padding:2px 0 8px 14px; font-size:12px; border-bottom:1px solid var(--line); }
ul.ranklist .rk { margin-left:auto; color:var(--acc); font-weight:600; white-space:nowrap; }
ul.ranklist .rk .dim { font-weight:400; }

.poslist { margin:0 14px 6px; }
details.posedit summary, details.addlink summary { cursor:pointer; color:var(--acc); font-size:13px; margin:2px 0 8px; }
.pcard form.poschips { margin:0; gap:8px 10px; }
.pcard .posgroup { display:flex; flex-wrap:wrap; }

svg.radar { width:100%; max-width:300px; height:auto; display:block; margin:0 auto; }
svg.radar .grid { fill:none; stroke:var(--line); stroke-width:1; }
svg.radar .grid.outer { stroke:var(--dim); }
svg.radar .grid.median { stroke:var(--dim); stroke-dasharray:4 3; }
svg.radar .axis { stroke:var(--line); stroke-width:1; }
svg.radar .lab { fill:var(--fg); font-size:12px; }
svg.radar .val { fill:var(--acc); fill-opacity:.55; stroke:var(--acc); stroke-width:1.5; }
svg.radar .dot { fill:var(--acc); stroke:var(--card); stroke-width:1.5; }
svg.spark { width:100%; height:auto; display:block; }
svg.spark .grid { stroke:var(--line); stroke-width:1; } svg.spark .grid.zero { stroke:var(--dim); }
svg.spark .ref { stroke:var(--dim); stroke-width:1; stroke-dasharray:4 3; }
svg.spark .reflab, svg.spark .ylab { fill:var(--dim); font-size:9px; text-anchor:end; }
svg.spark .xlab { fill:var(--dim); font-size:9px; }
svg.spark .line { fill:none; stroke:var(--acc); stroke-width:2; }
svg.spark .dot { fill:var(--acc); stroke:var(--card); stroke-width:1.5; }

.media { display:grid; grid-template-columns: 84px 1fr; gap:8px; margin-bottom:8px; }
.media .shot { aspect-ratio:1; border-radius:8px; border:1px dashed var(--line); background:var(--bg); display:flex; align-items:center; justify-content:center; overflow:hidden; color:var(--dim); font-size:12px; }
.media .shot.wide { aspect-ratio:auto; }
.media .shot img { width:100%; height:100%; object-fit:cover; }
.media .shot:not(.empty) { border-style:solid; }
ul.links { list-style:none; padding:0; margin:0 14px 6px; }
ul.links li { display:flex; align-items:center; gap:8px; padding:6px 0; border-bottom:1px solid var(--line); }
ul.links li:last-child { border-bottom:0; }
ul.links .ico { display:inline-flex; width:22px; height:22px; border-radius:6px; background:var(--bg); border:1px solid var(--line); align-items:center; justify-content:center; font-size:10px; color:var(--acc); flex:none; }
ul.links.empty .ico { color:var(--dim); }
ul.links form.inline { margin-left:auto; }
ul.links button.x { border:0; background:none; }
form.linkform { display:grid; grid-template-columns: 1fr 1fr; gap:6px; }
form.linkform input[type=url] { grid-column:1 / -1; }
form.linkform select, form.linkform input, form.linkform button { font:inherit; font-size:13px; padding:5px 7px; border:1px solid var(--line); border-radius:6px; background:var(--bg); color:var(--fg); min-width:0; }
form.linkform button { background:var(--acc); color:#fff; border-color:var(--acc); cursor:pointer; }

.analysis { margin:0 14px 10px; }
.analysis .text { white-space:pre-wrap; line-height:1.5; margin-top:4px; }
.analysis .meta form.inline { margin-left:6px; } .analysis button.x { border:0; background:none; }
details.earlier { margin:0 14px 8px; } details.earlier summary { cursor:pointer; color:var(--acc); font-size:13px; }
.aiph { display:flex; gap:12px; align-items:flex-start; margin:0 14px 10px; padding:12px; border:1px dashed var(--line); border-radius:8px; background:var(--bg); font-size:13px; }
.aiph .ico { flex:none; width:34px; height:34px; border-radius:50%; background:var(--card); border:1px solid var(--line); display:flex; align-items:center; justify-content:center; color:var(--acc); font-size:16px; }
.aitools { margin:0 14px; display:flex; flex-wrap:wrap; gap:8px 16px; align-items:flex-start; }
.aitools details.addlink { flex:1 1 260px; } .aitools details.addlink summary { margin:6px 0 8px; }
.btn { font:inherit; font-size:13px; padding:5px 12px; border:1px solid var(--line); border-radius:999px; background:var(--card); color:var(--fg); cursor:pointer; }
.btn:hover { border-color:var(--acc); color:var(--acc); }
form.aiform textarea { grid-column:1 / -1; font:inherit; font-size:13px; padding:6px 8px; border:1px solid var(--line); border-radius:6px; background:var(--bg); color:var(--fg); resize:vertical; }
.devgrid { display:grid; grid-template-columns: minmax(0,1fr); }
.devgrid.with-coach { grid-template-columns: minmax(0,1fr) 300px; gap:18px; margin-right:14px; }
.devmain { min-width:0; }
.coachcol { border-left:1px solid var(--line); padding-left:16px; min-width:0; }
.coachcol h3 { margin:6px 0 10px; font-size:15px; }
form.notef { display:grid; gap:6px; margin-bottom:12px; }
form.notef .row { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
form.notef input, form.notef select, form.notef textarea, form.notef button { font:inherit; font-size:13px; padding:5px 7px; border:1px solid var(--line); border-radius:6px; background:var(--bg); color:var(--fg); min-width:0; }
form.notef textarea { resize:vertical; }
form.notef button { background:var(--acc); color:#fff; border-color:var(--acc); cursor:pointer; justify-self:start; padding:5px 14px; }
ul.cnotes { list-style:none; padding:0; margin:0; }
ul.cnotes li { padding:8px 10px; margin-bottom:8px; border-left:3px solid var(--line); background:var(--bg); border-radius:0 6px 6px 0; font-size:13px; }
ul.cnotes li .text { white-space:pre-wrap; margin-top:3px; }
ul.cnotes li.empty { border-left-color:transparent; background:none; padding-left:0; }
ul.cnotes .chip { text-transform:capitalize; }
ul.cnotes li.f-technical { border-left-color:#1f6feb; } ul.cnotes li.f-tactical { border-left-color:#8250df; }
ul.cnotes li.f-physical { border-left-color:#3c9a5f; } ul.cnotes li.f-mental { border-left-color:#bf8700; }
ul.cnotes button.x { border:0; background:none; }
details.reqaccess { margin:6px 14px 4px; } .reqstate { margin:6px 14px 4px; }
@media (max-width: 900px) {
  .devgrid.with-coach { grid-template-columns: 1fr; margin-right:0; }
  .coachcol { border-left:0; border-top:1px solid var(--line); padding:10px 14px 0; }
}
/* coach's area on the team page */
.coacharea { border:1px solid var(--line); border-left:4px solid var(--acc); border-radius:10px; background:var(--card); padding:4px 16px 14px; margin:16px 0; }
.coacharea > h2 { margin:10px 0 8px; }
.coacharea h3 { font-size:14px; margin:14px 0 6px; }
.coacharea .cards.tight { margin:8px 0; } .coacharea .card { background:var(--bg); }
.coacharea .v.form span { display:inline-block; width:22px; height:22px; line-height:22px; text-align:center; border-radius:4px; font-size:13px; margin-right:3px; color:#fff; }
.coacharea .v.form .w { background:#1a7f37; } .coacharea .v.form .l { background:#cf222e; } .coacharea .v.form .d { background:#9a6700; }
.coacharea ul.notes.flags { max-width:none; margin-bottom:4px; }
.coacharea table.rank.compact.wide { width:100%; }
.coacharea td.pos { color:#1a7f37; font-weight:600; } .coacharea td.neg { color:#cf222e; font-weight:600; }
ul.nextup { list-style:none; padding:0; margin:0; } ul.nextup li { padding:5px 0; border-bottom:1px solid var(--line); font-size:13px; } ul.nextup li:last-child { border-bottom:0; }
.chip { display:inline-block; padding:0 7px; border-radius:999px; border:1px solid var(--line); font-size:11px; text-transform:capitalize; background:var(--bg); }
.chip.clear-favourite, .chip.favourite { border-color:#1a7f37; color:#1a7f37; } .chip.underdog, .chip.clear-underdog { border-color:#cf222e; color:#cf222e; }
.chip.staff { border-color:#9a6700; color:#9a6700; }
.tnotes { margin-top:10px; } .tnotes form.teamnote { max-width:760px; }
.tvideos { margin-top:10px; } .tvideos form.teamvid { max-width:760px; margin-bottom:8px; }
.tvideos form.teamvid .row3 button { justify-self:stretch; }
ul.vlinks { list-style:none; padding:0; margin:0; max-width:760px; }
ul.vlinks li { display:flex; flex-wrap:wrap; align-items:center; gap:6px 8px; padding:6px 0; border-bottom:1px solid var(--line); font-size:13px; }
ul.vlinks li:last-child { border-bottom:0; } ul.vlinks li.empty { color:var(--dim); }
ul.vlinks .ico { display:inline-flex; width:22px; height:22px; border-radius:6px; background:var(--bg); border:1px solid var(--line); align-items:center; justify-content:center; font-size:10px; color:var(--acc); flex:none; }
ul.vlinks form.inline { margin-left:auto; } ul.vlinks button.x { border:0; background:none; }
form.notef .row3 { display:grid; grid-template-columns:1fr 1fr 1.4fr; gap:6px; }
ul.cnotes li.k-suggestion { border-left-color:#1f6feb; } ul.cnotes li.k-announcement { border-left-color:#bf8700; } ul.cnotes li.k-training { border-left-color:#3c9a5f; }
ul.cnotes li.k-lineup { border-left-color:#8250df; } ul.cnotes li.k-schedule { border-left-color:#6a737d; }
.tnotes ul.cnotes li { max-width:760px; }
@media (max-width: 800px) { form.notef .row3 { grid-template-columns:1fr; } .coacharea { padding:4px 10px 12px; } }
.ownerbar { margin:-4px 0 8px; font-size:13px; color:var(--acc); }
.ownerbar .welcome { background:var(--acc); color:#fff; border-radius:999px; padding:1px 9px; margin-left:6px; font-size:12px; }
.filters.login label:has(input[name=player]), .filters.login label:has(input[name=team]) { min-width:220px; }
.filters.addp .poschips.wide { flex-basis:100%; display:flex; flex-wrap:wrap; gap:6px 18px; align-items:center; font-size:13px; }
ul.teamlist.plain { margin:0; }
ul.teamlist { list-style:none; padding:0; margin:0 14px 4px; }
ul.teamlist li { display:flex; gap:10px; align-items:center; padding:8px 0; border-bottom:1px solid var(--line); }
ul.teamlist li:last-child { border-bottom:0; }
ul.teamlist .logo { width:36px; height:36px; flex:none; object-fit:contain; border-radius:6px; }
ul.teamlist .logo.ph { display:inline-flex; align-items:center; justify-content:center; background:var(--bg); border:1px solid var(--line); color:var(--dim); font-weight:700; }

ol.timeline { list-style:none; padding:0; margin:4px 14px 4px; position:relative; }
ol.timeline::before { content:""; position:absolute; left:70px; top:6px; bottom:6px; border-left:1px solid var(--line); }
ol.timeline li { display:flex; gap:16px; align-items:flex-start; margin:0 0 10px; position:relative; }
ol.timeline li.year { color:var(--dim); font-size:12px; margin:4px 0 8px; padding-left:0; }
ol.timeline li.year::after { content:""; position:absolute; left:65px; top:4px; width:9px; height:9px; border-radius:50%; background:var(--card); border:1px solid var(--dim); }
ol.timeline .when { flex:none; width:54px; text-align:right; font-size:12px; color:var(--dim); padding-top:9px; white-space:nowrap; }
ol.timeline .box { flex:1; min-width:0; border:1px solid var(--line); border-radius:8px; padding:8px 12px; position:relative; }
ol.timeline .box::before { content:""; position:absolute; left:-5px; top:12px; width:9px; height:9px; border-radius:50%; background:var(--acc); border:1px solid var(--card); }
ol.timeline .box ul { margin:4px 0 0; padding-left:0; list-style:none; font-size:13px; }
ol.timeline .box ul li { margin:0; display:block; }

@media (max-width: 900px) {
  .pcols { grid-template-columns: 1fr; }
  .profile .cover { height:120px; }
  .profile .avatar { width:76px; height:76px; margin:-38px 0 0 14px; } .profile .avatar .initials { font-size:26px; }
  .profile .who { padding:4px 14px 0; } .profile .who h1 { font-size:20px; }
  .profile .tabs { gap:16px; overflow-x:auto; }
  .stats3 .v { font-size:16px; }
  ol.timeline::before { left:58px; } ol.timeline .when { width:42px; } ol.timeline li.year::after { left:53px; }
  /* one column on a phone: profile + rankings first, then games and highlights, then the rest */
  .pcols { display:flex; flex-direction:column; gap:0; align-items:stretch; }
  .side, .mainc { display:contents; }
  .mainc .pcard:nth-child(-n+2) { order:1; }
  .side .pcard:nth-child(n+3) { order:2; }
  .mainc .pcard:nth-child(n+3) { order:3; }
}


/* ---- player card (own view): sticker-card layout, trading-card moves, foil for the power tier ---- */
.cardbox .fcard { margin: 4px auto 8px; }
.fcard { --s:1; --rx:0deg; --ry:0deg; --gx:50%; --gy:50%; position:relative; width:calc(300px * var(--s)); font-size:calc(14px * var(--s)); aspect-ratio: 300 / 470;
  border-radius:1.2em; padding:.85em .9em .7em; overflow:hidden; color:#2a2008; isolation:isolate;
  background: linear-gradient(160deg, #e9ebee 0%, #c9ced6 45%, #9aa3ae 100%); border:2px solid rgba(255,255,255,.65);
  box-shadow: 0 10px 30px rgba(0,0,0,.25), inset 0 0 0 1px rgba(0,0,0,.08);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .15s ease, box-shadow .3s ease;
  font-family: "Segoe UI", system-ui, sans-serif; display:flex; flex-direction:column; user-select:none; }
.fcard.big { --s:1.45; }
.fcard.tilting { transition:none; }
.fcard .foil, .fcard .glare { position:absolute; inset:0; pointer-events:none; z-index:0; }
.fcard .glare { background: radial-gradient(circle at var(--gx) var(--gy), rgba(255,255,255,.45), rgba(255,255,255,0) 55%); opacity:0; transition:opacity .2s; }
.fcard.tilting .glare { opacity:1; }
.fcard > *:not(.foil):not(.glare) { position:relative; z-index:1; }
.fcard .ftop { display:grid; grid-template-columns:auto 1fr auto; align-items:start; gap:.4em; }
.fcard .ovr { display:flex; flex-direction:column; align-items:center; line-height:1; }
.fcard .ovr b { font-size:2.6em; font-weight:800; letter-spacing:-.03em; }
.fcard .ovr span { font-size:.95em; font-weight:700; letter-spacing:.08em; margin-top:.15em; }
.fcard .stage { justify-self:center; margin-top:.35em; font-size:.68em; font-weight:700; letter-spacing:.06em; text-transform:uppercase; padding:.25em .7em; border-radius:999px;
  background:rgba(255,255,255,.55); border:1px solid rgba(0,0,0,.12); white-space:nowrap; }
.fcard .hp { display:flex; align-items:baseline; gap:.2em; font-weight:800; line-height:1; margin-top:.2em; }
.fcard .hp .ico { font-size:1.1em; align-self:center; }
.fcard .hp b { font-size:1.35em; } .fcard .hp small { font-size:.7em; opacity:.75; }
.fcard .portrait { position:relative; margin:.4em -.3em 0; height:9.6em; border-radius:.9em; overflow:hidden;
  background: radial-gradient(ellipse at 50% 30%, rgba(255,255,255,.7), rgba(255,255,255,.15) 70%), repeating-linear-gradient(135deg, rgba(0,0,0,.05) 0 2px, transparent 2px 9px);
  display:flex; align-items:center; justify-content:center; border:1px solid rgba(0,0,0,.12); }
.fcard .portrait img:not(.crest) { width:100%; height:100%; object-fit:cover; object-position:top; }
.fcard .portrait .initials { font-size:4.2em; font-weight:800; opacity:.55; letter-spacing:-.04em; }
.fcard .portrait .crest { position:absolute; left:.5em; bottom:.4em; width:2.6em; height:2.6em; object-fit:contain; filter:drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.fcard .portrait .num { position:absolute; right:.5em; bottom:.3em; font-size:1.6em; font-weight:800; opacity:.8; text-shadow:0 1px 0 rgba(255,255,255,.6); }
.fcard .fname { text-align:center; font-size:1.45em; font-weight:800; letter-spacing:-.02em; margin:.35em 0 .2em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; border-bottom:2px solid rgba(0,0,0,.18); padding-bottom:.15em; }
.fcard .fname .fn { font-weight:500; font-size:.75em; }
.fcard .abil { display:grid; grid-template-columns:repeat(6, 1fr); gap:.2em; text-align:center; margin-top:.15em; }
.fcard .abil .k { display:block; font-size:.68em; font-weight:700; letter-spacing:.05em; opacity:.8; }
.fcard .abil .v { display:block; font-size:1.3em; font-weight:800; line-height:1.05; }
.fcard .moves { margin-top:.45em; display:flex; flex-direction:column; gap:.3em; flex:1; }
.fcard .move { display:grid; grid-template-columns:auto 1fr auto; align-items:center; column-gap:.4em; padding:.3em .5em; border-radius:.5em; background:rgba(255,255,255,.5); border:1px solid rgba(0,0,0,.1); }
.fcard .move .mico { font-size:.95em; }
.fcard .move b { font-size:.9em; }
.fcard .move .pw { font-weight:800; font-size:1.05em; }
.fcard .move p { grid-column:1 / -1; margin:.1em 0 0; font-size:.66em; line-height:1.3; opacity:.85; }
.fcard .ffoot { display:flex; justify-content:space-between; gap:.5em; margin-top:.45em; font-size:.62em; text-transform:lowercase; letter-spacing:.03em; opacity:.85; border-top:1px solid rgba(0,0,0,.18); padding-top:.3em; }
.fcard .ffoot b { text-transform:none; letter-spacing:0; }
.fcard .fset { display:flex; justify-content:space-between; align-items:center; gap:.4em; margin-top:.3em; font-size:.6em; opacity:.8; }
.fcard .fset .stars { font-size:1.2em; letter-spacing:.1em; }
.fcard .fset span:first-child { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* tiers */
.fcard.tier-bronze { color:#fff4e6; background: linear-gradient(160deg, #d79a66 0%, #a66a38 45%, #6f4420 100%); }
.fcard.tier-bronze .stage, .fcard.tier-bronze .move, .fcard.tier-bronze .portrait { background-color:rgba(255,255,255,.14); border-color:rgba(255,255,255,.25); }
.fcard.tier-bronze .move { background:rgba(255,255,255,.14); }
.fcard.tier-bronze .fname, .fcard.tier-bronze .ffoot { border-color:rgba(255,255,255,.3); }
.fcard.tier-rookie { color:#30343a; background: linear-gradient(160deg, #f1f3f5 0%, #d3d7dc 50%, #b5bbc3 100%); border:2px dashed rgba(0,0,0,.25); }
.fcard.tier-rookie .abil .v, .fcard.tier-rookie .ovr b { opacity:.55; }
.fcard.tier-power { color:#3a2a00; border-color:rgba(255,248,210,.9);
  background: linear-gradient(160deg, #fff6c2 0%, #f7d35a 22%, #e2ab1c 48%, #fbe68f 70%, #d99a0f 100%);
  box-shadow: 0 12px 34px rgba(120,80,0,.35), 0 0 0 1px rgba(255,230,140,.8), 0 0 26px rgba(255,200,60,.55); animation: fcard-float 6s ease-in-out infinite; }
.fcard.tier-power .foil { opacity:.9; mix-blend-mode:overlay;
  background: linear-gradient(115deg, transparent 25%, rgba(255,255,255,.75) 42%, rgba(255,120,220,.35) 48%, rgba(120,255,255,.35) 54%, rgba(255,255,255,.7) 60%, transparent 76%);
  background-size:260% 260%; animation: fcard-foil 4.5s linear infinite; }
.fcard.tier-power .glare { background: radial-gradient(circle at var(--gx) var(--gy), rgba(255,255,255,.7), rgba(255,255,255,0) 50%), conic-gradient(from 0deg at var(--gx) var(--gy), rgba(255,0,170,.18), rgba(0,255,220,.18), rgba(255,230,0,.18), rgba(255,0,170,.18)); mix-blend-mode:screen; }
.fcard.tier-power .stage, .fcard.tier-power .move { background:rgba(255,252,230,.6); border-color:rgba(160,110,0,.25); }
.fcard.tier-power .portrait { background: radial-gradient(ellipse at 50% 30%, rgba(255,255,255,.85), rgba(255,240,170,.25) 70%), repeating-linear-gradient(135deg, rgba(160,110,0,.12) 0 2px, transparent 2px 9px); border-color:rgba(160,110,0,.3); }
.fcard.tier-power .ovr b, .fcard.tier-power .fname, .fcard.tier-power .hp b { text-shadow: 0 1px 0 rgba(255,255,255,.6), 0 0 12px rgba(255,220,120,.6); }
.fcard.tier-power .fset .stars { color:#8a5a00; text-shadow:0 0 8px rgba(255,255,255,.9); animation: fcard-twinkle 2.2s ease-in-out infinite; }
@keyframes fcard-foil { 0% { background-position: 120% 120%; } 100% { background-position: -40% -40%; } }
@keyframes fcard-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
@keyframes fcard-twinkle { 0%, 100% { opacity:.75; } 50% { opacity:1; letter-spacing:.16em; } }
@media (prefers-reduced-motion: reduce) { .fcard, .fcard .foil, .fcard .fset .stars { animation:none !important; } .fcard { transform:none !important; } }
/* the full-size page */
.cardpage { max-width:900px; margin:0 auto; }
.cardstage { display:flex; justify-content:center; padding:34px 16px 38px; border-radius:18px; background: radial-gradient(ellipse at 50% 0%, #2a3140, #0f1115 70%); margin:8px 0 18px; }
.cardstage.power { background: radial-gradient(ellipse at 50% 0%, #4a3a10, #14110a 70%); }
.cardpage .powertag { display:inline-block; font-size:11px; font-weight:800; letter-spacing:.12em; padding:1px 7px; border-radius:999px; color:#3a2a00; background:linear-gradient(90deg,#fff2b0,#e9b528); }
.cardhow ul { padding-left:18px; } .cardhow li { margin:6px 0; }
@media (max-width: 560px) { .fcard.big { --s:1.05; } .cardstage { padding:20px 8px; } }

/* picture upload + card image */
.photof { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; margin:8px 0; }
.photof.compact { justify-content:center; }
.filebtn { display:inline-block; padding:5px 12px; border:1px solid var(--acc); color:var(--acc); border-radius:8px; cursor:pointer; font-size:13px; background:var(--card); }
.filebtn:hover { background:var(--acc); color:#fff; }
.filebtn input { display:none; }
a.btn { display:inline-block; padding:5px 12px; border:1px solid var(--line); border-radius:8px; font-size:13px; background:var(--card); }
a.btn:hover { text-decoration:none; border-color:var(--acc); }
.cardtools { margin:-6px 0 16px; }
.pngprev img { display:block; max-width:360px; width:100%; margin-top:8px; border-radius:16px; box-shadow:0 8px 24px rgba(0,0,0,.25); }
p.err { color:#cf222e; font-weight:600; }
