:root {
  color-scheme: dark;
  --page: #111318;
  --surface-1: #1b1e24;
  --surface-2: #242830;
  --grid: #2e333c;
  --text-primary: #efefef;
  --text-secondary: #a9adb4;
  --series-1: #338ced;
  --series-2: #e76624;
  --series-3: #00a888;
  --series-4: #d28e05;
  --neutral: #4a505b;
  --good: #0aac23;
  font-family: system-ui, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text-primary); font-size: 14px; line-height: 1.45; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--text-secondary); }
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--grid); position: sticky; top: 0; background: var(--page); z-index: 5; }
.who { display: flex; align-items: center; gap: 12px; }
.who img { width: 40px; height: 40px; border-radius: 6px; }
.who h1 { font-size: 20px; margin: 0; }
.actions { display: flex; align-items: center; gap: 12px; }
button { background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--grid); border-radius: 6px; padding: 6px 12px; cursor: pointer; font: inherit; }
button:hover { border-color: var(--series-1); }
button:disabled { opacity: .5; cursor: wait; }
main { min-width: 0; padding: 24px 28px 48px; display: grid; gap: 24px; align-content: start; }
.loading { color: var(--text-secondary); font-size: 16px; }
.error { color: #eb6263; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kpi { background: var(--surface-1); border-radius: 10px; padding: 14px 16px; }
.kpi .label { color: var(--text-secondary); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 28px; font-weight: 650; margin: 2px 0; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--text-secondary); font-size: 12px; }

.panels { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); grid-auto-rows: 4px; column-gap: 24px; row-gap: 0; align-items: start; grid-auto-flow: row dense; }
.panel { min-width: 0; display: grid; gap: 24px; align-content: start; }
.panel.wide { grid-column: 1 / -1; }
.card { background: var(--surface-1); border-radius: 12px; padding: 20px 22px; min-width: 0; }
.card h2 { font-size: 16px; margin: 0 0 2px; }
.card .lead { color: var(--text-secondary); margin: 0 0 14px; font-size: 13px; }
.card .lead b { color: var(--text-primary); }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-secondary); margin: 12px 0 -8px; }

.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

.hbars { display: grid; grid-template-columns: minmax(120px, 34%) 1fr auto; gap: 6px 10px; align-items: center; font-size: 13px; }
.hbars .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbars .track { height: 14px; display: flex; gap: 2px; }
.hbars .seg { height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }
.hbars .seg + .seg { border-radius: 0 4px 4px 0; }
.hbars .seg:not(:last-child) { border-radius: 0; }
.hbars .val { color: var(--text-secondary); font-variant-numeric: tabular-nums; text-align: right; min-width: 56px; }
.hbars .row:hover, .hbars [data-tip]:hover { filter: brightness(1.25); }

.colchart { --pl: 40px; position: relative; container-type: inline-size; font-size: 11px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.colchart svg.cols { position: absolute; left: var(--pl); top: 0; width: calc(100% - var(--pl)); display: block; overflow: visible; }
.colchart .ylab { position: absolute; left: 0; width: calc(var(--pl) - 8px); text-align: right; transform: translateY(-50%); line-height: 1; }
.colchart .xlab { position: absolute; bottom: 0; left: calc(var(--pl) + (100% - var(--pl)) * var(--x)); transform: translateX(-50%); white-space: nowrap; line-height: 16px; }
@container (max-width: 560px) { .colchart .xlab.x2 { display: none; } }
svg.cols .gridline { stroke: var(--grid); stroke-width: 1; }svg.cols rect.hit { fill: transparent; }
svg.cols g.col:hover rect.bar { filter: brightness(1.3); }

.split { display: flex; height: 22px; gap: 2px; margin: 8px 0 10px; }
.split div { border-radius: 2px; }
.split div:first-child { border-radius: 4px 2px 2px 4px; }
.split div:last-child { border-radius: 2px 4px 4px 2px; }

.list { display: grid; gap: 6px; }
.item { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: center; background: var(--surface-2); border-radius: 6px; padding: 4px; padding-right: 10px; }
.item img { width: 120px; height: 45px; object-fit: cover; border-radius: 4px; background: var(--grid); }
.item .t { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .s { color: var(--text-secondary); font-size: 12px; }
.item .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.item .r b { display: block; }
.badge { display: inline-block; background: var(--good); color: #fff; border-radius: 4px; padding: 0 6px; font-size: 12px; font-weight: 650; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.fact { background: var(--surface-2); border-radius: 8px; padding: 12px 14px; }
.fact b { font-size: 20px; display: block; }
.fact span { color: var(--text-secondary); font-size: 13px; }

.tools { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; align-items: center; }
.tools input, .tools select { background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--grid); border-radius: 6px; padding: 6px 10px; font: inherit; }
.tools > input { min-width: 260px; }
.msel-pop input[type=checkbox] { margin: 0 4px 0 0; vertical-align: -2px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--grid); text-align: left; }
th { color: var(--text-secondary); font-weight: 500; cursor: pointer; user-select: none; white-space: nowrap; position: sticky; top: 0; z-index: 1; background: var(--surface-1); }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
th.sorted::after { content: " ▾"; }
th.sorted.asc::after { content: " ▴"; }
tbody tr:hover { background: var(--surface-2); }
td img { width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; border-radius: 2px; }

.tip { position: fixed; pointer-events: none; background: #2b3039; border: 1px solid #3b414c; color: var(--text-primary); border-radius: 6px; padding: 6px 10px; font-size: 12px; max-width: 320px; z-index: 20; box-shadow: 0 4px 16px #0008; white-space: pre-line; }
.tip b { font-size: 13px; }
#table { scroll-margin-top: calc(var(--top-h, 90px) + 16px); }
html { scroll-behavior: smooth; }
.section-title { scroll-margin-top: calc(var(--top-h, 90px) + 16px); }
.nav { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; flex: 1; }
.nav a { padding: 4px 10px; border-radius: 6px; color: var(--text-secondary); font-size: 13px; white-space: nowrap; }
.nav a:hover { text-decoration: none; color: var(--text-primary); background: var(--surface-2); }
.nav a.on { color: var(--text-primary); background: var(--surface-2); }
.top { flex-wrap: wrap; row-gap: 8px; padding: 12px 24px; }
button.more { margin-top: 10px; width: 100%; }
.modal { padding: 0; border: 1px solid var(--grid); border-radius: 10px; background: var(--surface-1); color: var(--text-primary); width: min(760px, 94vw); max-height: 86vh; }
.modal[open] { display: flex; flex-direction: column; }
.modal::backdrop { background: rgb(0 0 0 / .6); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--grid); }
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-body { overflow-y: auto; padding: 14px 18px; }
.modes { display: inline-flex; gap: 2px; padding: 2px; background: var(--surface-2); border-radius: 8px; margin-bottom: 8px; }
.modes button { border: 0; background: none; padding: 4px 10px; color: var(--text-secondary); font-size: 13px; }
.modes button.on { background: var(--surface-1); color: var(--text-primary); }
.mode-note { margin: 0 0 8px; font-size: 12px; }

.t-S { --tc: #ff7f7f; } .t-A { --tc: #ffbf7f; } .t-B { --tc: #ffdf7f; } .t-C { --tc: #bfff7f; } .t-D { --tc: #7fbfff; } .t-F { --tc: #c49bff; }
.item .pic { position: relative; display: block; width: 120px; height: 45px; }
.tb { background: var(--tc); color: #111; font-weight: 800; font-size: 12px; line-height: 18px; min-width: 18px; text-align: center; border-radius: 4px; display: inline-block; }
.card .lead b.tb, .lead .tb, .muted .tb { color: #111; }
.tier-pick { display: none; gap: 1px; }
.tier-pick button { padding: 0; width: 18px; height: 18px; line-height: 16px; font-size: 11px; font-weight: 700; border-radius: 3px; border: 1px solid transparent; background: #000c; color: var(--tc, #ccc); }
.tier-pick button:hover, .tier-pick button.on { background: var(--tc, #555); color: #111; }
.pic .tier, .tile .tier { position: absolute; inset: 0; pointer-events: none; }
.pic .tier-pick, .tile .tier-pick { position: absolute; left: 1px; right: 1px; bottom: 1px; justify-content: center; pointer-events: auto; }
.item .pic:hover .tier-pick, .tile:hover .tier-pick, tr:hover .tier-pick { display: flex; }
.tier-cell .tier { display: flex; align-items: center; gap: 4px; height: 18px; width: 134px; }
tr:hover .tier-cell .tb { display: none; }
.tier-board { display: grid; gap: 4px; }
.tier-row { display: grid; grid-template-columns: 48px 1fr 64px; gap: 4px; min-height: calc(52px + var(--tier-extra, 0px)); }
.tier-label { background: var(--tc); color: #111; font-weight: 800; font-size: 22px; display: grid; place-items: center; border-radius: 6px; }
.tier-games { display: flex; flex-wrap: wrap; gap: 4px; background: var(--surface-2); border-radius: 6px; padding: 4px; align-content: flex-start; border-bottom: var(--tier-extra, 0px) solid var(--surface-2); }
.tile { position: relative; width: 120px; height: 45px; border-radius: 4px; overflow: hidden; display: block; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--grid); }
.tile .tile-name { display: none; position: absolute; inset: 0 0 auto 0; font-size: 10px; padding: 1px 3px; background: #000b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .tb { display: none; }

td.num { white-space: nowrap; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #5a1f24; border: 1px solid #a33; color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 30; box-shadow: 0 4px 16px #0008; max-width: 90vw; }
.tier-name .tb { margin-right: 6px; vertical-align: 1px; }
a.genre { display: inline-block; font-size: 11px; padding: 1px 6px; margin: 1px 2px 1px 0; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--grid); white-space: nowrap; }
a.genre:hover { text-decoration: none; border-color: var(--series-1); }
#wtable td img { width: 40px; height: 15px; object-fit: cover; }
#wtable { scroll-margin-top: calc(var(--top-h, 90px) + 16px); }
.table-scroll { max-height: 70vh; overflow: auto; border-bottom: 1px solid var(--grid); }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 10px; }
.pager button { min-width: 32px; padding: 4px 8px; }
.pager button.on { border-color: var(--series-1); background: var(--series-1); color: #fff; }
.pager button:disabled { opacity: .35; cursor: default; }
.pager .muted:last-child { margin-left: auto; }

.gchip { display: inline-block; font-size: 10px; font-weight: 700; line-height: 15px; padding: 0 5px; margin-right: 4px; border-radius: 3px; vertical-align: 1px; border: 1px solid var(--gc, #666); color: var(--gc, #aaa); white-space: nowrap; }
.gchip:hover { text-decoration: none; background: var(--gc); color: #111; }
.g-AAA { --gc: #f2c14e; } .g-AA { --gc: #6fa8ff; } .g-Indie { --gc: #5fd39b; } .g-F2P { --gc: #a0a6b0; }
.g-Klasyk { --gc: #e58bd9; } .g-Retro { --gc: #ff9f6b; } .g-Remaster { --gc: #7fd6e0; } .g-Wczesnydostęp { --gc: #c9c96b; }
.chips-cell { white-space: nowrap; }
#group { background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--grid); border-radius: 6px; padding: 6px 8px; font: inherit; }
#group.active { border-color: var(--series-2); box-shadow: 0 0 0 1px var(--series-2); }
.group-banner { background: #3a2a14; border: 1px solid var(--series-2); border-radius: 8px; padding: 10px 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.group-banner button { margin-left: auto; }
.gchip { cursor: pointer; }
.tier.quick { display: flex; align-items: center; gap: 6px; }
.tier.quick .tier-pick { display: flex; gap: 3px; }
.tier.quick .tier-pick button { width: 26px; height: 26px; font-size: 13px; line-height: 24px; background: var(--surface-1); border: 1px solid var(--grid); }
.tier.quick .tier-pick button:hover { background: var(--tc); color: #111; border-color: var(--tc); }
.tier.quick .skip { padding: 2px 8px; font-size: 12px; color: var(--text-secondary); }
.list.two-col { grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); container-type: inline-size; }
.rate-progress { height: 6px; background: var(--surface-2); border-radius: 3px; margin: 0 0 12px; overflow: hidden; }
.rate-progress div { height: 100%; background: var(--series-1); }
button.linklike { background: none; border: 0; padding: 0; color: var(--series-1); text-decoration: underline; font: inherit; cursor: pointer; }
.gsearch { position: relative; display: flex; align-items: center; gap: 6px; }
#gsearch { width: 190px; background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--grid); border-radius: 6px; padding: 6px 10px; font: inherit; }
#gsearch.active { border-color: var(--series-1); box-shadow: 0 0 0 1px var(--series-1); }
#gsearch-count { font-size: 12px; white-space: nowrap; }
.dim { opacity: .28; filter: grayscale(1); transition: opacity .15s, filter .15s; }
.dim:hover { opacity: .6; }
:root { --tier-S: #ff7f7f; --tier-A: #ffbf7f; --tier-B: #ffdf7f; --tier-C: #bfff7f; --tier-D: #7fbfff; --tier-F: #c49bff; }
.item .r .tb { margin-left: auto; }
.item .t-link:hover { color: var(--series-1); }
.kpis-3 { grid-template-columns: repeat(3, 1fr); margin-bottom: 14px; }
.taste-rows { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px 10px; align-items: center; font-size: 13px; }
.taste-rows .track { height: 12px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.taste-rows .seg { height: 100%; border-radius: 0 4px 4px 0; }
.vs { display: inline-flex; align-items: center; gap: 4px; }
.item .r .vs { display: inline-flex; justify-content: flex-end; }
.item .r .vs .tb { display: inline-block; }
.item .r .vs + .muted { display: block; font-size: 11px; margin-top: 2px; }
.tier-row:not(.open) .tier-games { max-height: calc(53px + (var(--tier-lines, 1) - 1) * 49px + var(--tier-extra, 0px)); overflow: hidden; }
.row-more { align-self: stretch; min-width: 56px; font-size: 13px; font-weight: 600; background: var(--surface-2); border-radius: 6px; }
.row-more[hidden] { display: none; }
.card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-head h2 { margin-right: auto; }
.tier-counts { font-size: 12px; color: var(--text-secondary); display: flex; gap: 8px; align-items: center; }
.tier-counts .tb { margin-right: 2px; }

/* Steam review colours */
.rv-pos { color: #66c0f4; } .rv-mix { color: #b9a074; } .rv-neg { color: #c35c2c; }
/* own categories */
.cchip { display: inline-block; font-size: 10px; line-height: 15px; padding: 0 5px; margin-right: 4px; border-radius: 3px; vertical-align: 1px; background: #2c3442; color: #b8c7dd; white-space: nowrap; cursor: pointer; }
.cchip:hover { background: var(--series-1); color: #fff; }
.cchip.manual { box-shadow: inset 0 0 0 1px #b8c7dd; }
.cedit { padding: 0 4px; font-size: 11px; line-height: 15px; border: 0; background: none; color: var(--text-secondary); opacity: 0; }
tr:hover .cedit { opacity: 1; }
.cedit:hover { color: var(--series-1); }
/* header controls */
#views, #fbtn { background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--grid); border-radius: 6px; padding: 6px 8px; font: inherit; max-width: 190px; }
#views.active, #fbtn.active { border-color: var(--series-2); box-shadow: 0 0 0 1px var(--series-2); }
.actions { flex-wrap: wrap; justify-content: flex-end; }
/* filter banner and dialog */
.fchip { display: inline-flex; align-items: center; gap: 4px; background: #24364d; border-radius: 12px; padding: 1px 4px 1px 10px; font-size: 12px; }
.fchip i { font-style: normal; color: var(--text-secondary); }
.fchip.ex { background: #4a2626; }
.fchip button { border: 0; background: none; padding: 0 4px; line-height: 1; }
.group-banner > button:first-of-type { margin-left: auto; }
.group-banner button { margin-left: 0; }
.modal.wide { width: min(1100px, 96vw); }
.modal-head .fsave { margin-left: auto; display: flex; gap: 6px; }
.modal-head input[type=text] { background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--grid); border-radius: 6px; padding: 5px 8px; font: inherit; }
.fsec { margin: 12px 0; }
.fsec h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-secondary); margin: 0 0 6px; font-weight: 500; }
.fchips { display: flex; flex-wrap: wrap; gap: 4px; }
.fopt { padding: 2px 8px; font-size: 12px; border-radius: 12px; }
.fopt span { color: var(--text-secondary); font-size: 11px; }
.fopt.fdim { opacity: .25; }
.fsec.fdim h3 { opacity: .35; }
#fdialog [data-fq] { flex: 0 1 280px; margin-left: 16px; background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--grid); border-radius: 6px; padding: 6px 10px; font: inherit; }
.fopt.inc { background: #1f4a2c; border-color: #3fae5f; }
.fopt.exc { background: #4a2626; border-color: #c35c2c; text-decoration: line-through; }
/* table tools */
.tools .push { margin-left: auto; }
details.msel { position: relative; }
details.msel summary { list-style: none; cursor: pointer; background: var(--surface-2); border: 1px solid var(--grid); border-radius: 6px; padding: 6px 10px; user-select: none; }
details.msel summary::after { content: " ▾"; color: var(--text-secondary); }
details.msel.active summary { border-color: var(--series-1); }
.msel-pop { position: absolute; z-index: 4; top: calc(100% + 4px); left: 0; background: var(--surface-1); border: 1px solid var(--grid); border-radius: 8px; padding: 8px; width: 280px; max-height: 360px; overflow: auto; box-shadow: 0 8px 24px #000a; display: grid; gap: 2px; }
.msel-pop label { display: block; padding: 2px 4px; border-radius: 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.msel-pop label:hover { background: var(--surface-2); }
.msel-pop label.ind { padding-left: 22px; font-size: 12px; }
.msel-pop label[hidden] { display: none; }
.msel-pop input[type=search] { min-width: 0; width: 100%; margin-bottom: 4px; }
.msel-pop .linklike { justify-self: end; font-size: 12px; }
/* ignore buttons */
.item { position: relative; }
.item .r { position: static; }
.ign { position: absolute; top: -8px; right: -8px; z-index: 3; width: 22px; height: 22px; padding: 0; display: grid; place-items: center; font-size: 11px; line-height: 1; border-radius: 50%; border: 1px solid var(--grid); background: var(--surface-1); color: var(--text-primary); box-shadow: 0 1px 4px #0008; opacity: 0; transition: opacity .12s; cursor: pointer; }
.item:hover .ign { opacity: 1; }
.ign:hover { background: #d9484a; border-color: #d9484a; color: #fff; }
.item.tall { align-items: start; }
.item.tall .r { padding-top: 4px; }
.ign-list { font-size: 12px; margin-left: auto; }
.card-head .ign-list + * { margin-left: 0; }
.ok { color: #5fd39b; } .wishmark { color: var(--series-2); }
.toast.ok { background: #1c4a2c; border-color: #3fae5f; }
/* tier board tools */
.tier-tools { display: flex; gap: 6px; }
.tier-tools select { background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--grid); border-radius: 6px; padding: 4px 6px; font: inherit; font-size: 12px; }
/* series */
.srow { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.shead { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.sname { font-weight: 600; }
.s-cup { display: inline-grid; color: #f5c542; margin-right: -4px; }
.s-cup .ic { width: 16px; height: 16px; opacity: 1; }
.srow.full .sbar > div { background: #f5c542; }
.sbar { flex: 1; max-width: 200px; height: 6px; background: var(--grid); border-radius: 3px; overflow: hidden; }
.sbar div { height: 100%; background: var(--series-1); }
.stiles { display: flex; flex-wrap: wrap; gap: 4px; }
.stile { position: relative; width: 92px; height: 43px; border-radius: 4px; overflow: hidden; display: block; background: var(--grid); }
.stile img { width: 100%; height: 100%; object-fit: cover; display: block; }

.stile.miss img { filter: grayscale(1) brightness(.45); }
.stile.miss:hover img { filter: grayscale(.3) brightness(.8); }
.stile .tier { position: absolute; inset: 0; pointer-events: none; }
.stile .tier > .tb { position: absolute; top: 2px; left: 2px; font-size: 10px; line-height: 14px; min-width: 14px; }
.stile .tier-pick { position: absolute; left: 1px; right: 1px; bottom: 1px; justify-content: center; pointer-events: auto; }
.stile:hover .tier-pick { display: flex; }
/* timeline */
.tl-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.tl-tools .modes { margin: 0; }
/* vertical axis: year label | line with a node | tiles */
.timeline { --tl-x: 76px; padding-top: 4px; }
.tl-year { position: relative; display: grid; grid-template-columns: var(--tl-x) 1fr; column-gap: 26px; padding-bottom: 18px; }
.tl-year::before { content: ''; position: absolute; left: calc(var(--tl-x) + 12px); top: 0; bottom: 0; width: 2px; background: linear-gradient(var(--series-1), color-mix(in srgb, var(--series-1) 45%, var(--grid))); opacity: .85; }
.tl-year:first-child::before { top: 10px; }
.tl-year:last-child::before { bottom: auto; height: 10px; }
.tl-head { position: sticky; top: calc(var(--top-h, 80px) + 10px); align-self: start; text-align: right; font-weight: 650; font-size: 17px; line-height: 20px; cursor: pointer; font-variant-numeric: tabular-nums; }
.tl-head::after { content: ''; position: absolute; right: -19px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface-1); border: 2px solid var(--series-1); box-sizing: border-box; }
.tl-head:hover::after { background: var(--series-1); }
.tl-year.decade .tl-head { font-size: 20px; color: var(--series-1); }
.tl-year.decade .tl-head::after { width: 14px; height: 14px; right: -21px; top: 3px; background: var(--series-1); }
.tl-head span { display: block; color: var(--text-secondary); font-weight: 400; font-size: 11px; line-height: 14px; }
.tl-head:hover { color: var(--series-1); }
.tl-tiles { display: grid; grid-template-columns: repeat(auto-fill, 84px); grid-auto-rows: 32px; gap: 4px; }
.tl-tile { position: relative; display: block; border-radius: 3px; overflow: hidden; background: var(--grid); }
.tl-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tl-tile.cold img { filter: brightness(.5) saturate(.5); }

.tl-tile .tb { position: absolute; top: 1px; left: 1px; font-size: 9px; line-height: 12px; min-width: 12px; }
.tl-tile:hover { outline: 2px solid var(--series-1); outline-offset: -2px; }
/* taste by category */
.taste-cats { display: grid; grid-template-columns: minmax(120px, 30%) 1fr auto; gap: 6px 10px; align-items: center; font-size: 13px; }
.tc-bar { display: flex; height: 14px; gap: 1px; border-radius: 3px; overflow: hidden; }
/* settings and classification */
.set-sec { border-top: 1px solid var(--grid); padding: 6px 0; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 3px 0 3px 22px; font-size: 13px; }
.set-row.sec { padding-left: 0; }
.set-row span { display: flex; gap: 4px; align-items: center; }
.set-row button { padding: 1px 8px; }
.set-row select, .cls-grid select { background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--grid); border-radius: 6px; padding: 3px 6px; font: inherit; font-size: 12px; }
.cls-grid { display: grid; gap: 12px; margin: 12px 0; }
.cls-grid label { display: grid; gap: 4px; }
.chk { display: inline-flex !important; gap: 4px; align-items: center; background: var(--surface-2); border-radius: 6px; padding: 3px 8px; }
.cls-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

/* API loader */
.loader { order: 4; flex-basis: 100%; display: flex; align-items: center; gap: 10px; font-size: 13px; background: #1c2a3d; border: 1px solid var(--series-1); border-radius: 8px; padding: 8px 12px; flex-wrap: wrap; }
.loader[hidden] { display: none; }
.loader-bar { flex-basis: 100%; height: 4px; background: var(--grid); border-radius: 2px; overflow: hidden; }
.loader-bar div { height: 100%; width: 3%; background: var(--series-1); transition: width .5s; }
.loader-bar.indeterminate div { width: 30%; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.spin { width: 14px; height: 14px; border: 2px solid #ffffff33; border-top-color: var(--series-1); border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 6px; }
.loader .spin { margin-right: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- layout: sidebar, tabs, KPI bar ---------- */
[hidden] { display: none !important; }
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.side { position: sticky; top: var(--top-h, 80px); align-self: start; height: calc(100vh - var(--top-h, 80px)); overflow: auto; border-right: 1px solid var(--grid);
  display: flex; flex-direction: column; gap: 14px; padding: 18px 12px 0 16px; }
.side > .nav-bottom { margin-top: auto; position: sticky; bottom: 0; background: var(--page); border-top: 1px solid var(--grid); padding: 10px 0 14px; }
.side-tools { display: grid; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--grid); }
.side-tools .gsearch { display: block; position: relative; }
.side-tools #gsearch-count { position: absolute; right: 34px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.side-tools #gsearch, .side-tools #playedSel, .side-tools #views, .side-tools #fbtn { width: 100%; max-width: none; box-sizing: border-box; height: 36px; padding: 0 10px; }
.side-tools #fbtn { text-align: left; }
.side > .nav { flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; gap: 2px; flex: none; }
.side > .nav a { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; font-size: 14px; border-radius: 8px; }
.side > .nav a.on { background: var(--surface-2); color: var(--text-primary); box-shadow: inset 3px 0 0 var(--series-1); }
.nhits { font-size: 11px; background: var(--series-1); color: #fff; border-radius: 8px; padding: 0 6px; }
.nhits:empty { display: none; }
.sec { display: grid; gap: 16px; }
body.tabs .section-title { font-size: 22px; text-transform: none; letter-spacing: 0; color: var(--text-primary); margin: 0; }
.sec { scroll-margin-top: calc(var(--top-h, 90px) + 16px); }
@media (max-width: 1100px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; overflow: visible; border-right: 0; border-bottom: 1px solid var(--grid); padding: 10px 16px; gap: 8px; }
  .side-tools { grid-template-columns: minmax(200px, 2fr) repeat(2, minmax(140px, 1fr)) auto; padding-bottom: 8px; }
  .side-tools #fbtn { width: auto; }
  .side > .nav { flex-direction: row; flex-wrap: wrap; }
  .side > .nav-bottom { position: static; margin-top: 0; border-top: 0; padding: 0; }
  .side > .nav a { padding: 4px 10px; font-size: 13px; }
}
/* header: who | KPIs | actions; KPIs drop to their own row when the window is narrow */
.top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "who kpi act" "load load load"; column-gap: 20px; row-gap: 0; padding: 10px 24px; }
.who { grid-area: who; min-width: 0; }
.who .muted { font-size: 12px; white-space: nowrap; }
.kpibar { grid-area: kpi; display: flex; gap: 6px; justify-content: center; flex-wrap: nowrap; min-width: 0; }
.actions { grid-area: act; flex-wrap: nowrap; gap: 8px; }
.loader { grid-area: load; margin-top: 10px; }
@media (max-width: 1180px) {
  .top { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who act" "kpi kpi" "load load"; row-gap: 8px; }
  .kpibar { justify-content: flex-start; flex-wrap: wrap; }
}
.kpibar a { display: flex; flex-direction: column; align-items: flex-start; padding: 4px 12px; border-radius: 8px; background: var(--surface-1); line-height: 1.2; white-space: nowrap; }
#stamp { display: none; }
.kpibar a:hover { text-decoration: none; background: var(--surface-2); }
.kpibar b { font-size: 18px; font-variant-numeric: tabular-nums; }
.kpibar span { font-size: 11px; color: var(--text-secondary); }

/* ---------- cover grid ---------- */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.cgrid.small { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.lib-grid { margin-top: 12px; }
.ctile { display: flex; flex-direction: column; gap: 2px; padding: 0 0 8px; text-align: left; background: var(--surface-2); border: 1px solid transparent; border-radius: 10px; overflow: hidden; min-width: 0; }
.ctile:hover { border-color: var(--series-1); }
.ct-img { position: relative; display: block; aspect-ratio: 460 / 215; background: var(--grid); }
.ct-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ct-img .tier-name { position: absolute; top: 6px; left: 6px; }
.ct-name { padding: 6px 10px 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-sub { padding: 0 10px; font-size: 12px; display: flex; justify-content: space-between; gap: 8px; }
tr[data-game] { cursor: pointer; }

/* ---------- game details slide-over ---------- */
dialog.slide { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(560px, 94vw); padding: 0; border: 0; border-left: 1px solid var(--grid); background: var(--surface-1); color: var(--text-primary); }
dialog.slide::backdrop { background: #0008; }
dialog.slide .modal-close { position: absolute; top: 10px; right: 10px; z-index: 1; }
.slide-body { height: 100%; overflow: auto; padding: 0 0 24px; }
.slide-body > :not(.gd-hero):not(.gd-wish) { margin-left: 22px; margin-right: 22px; }
.gd-hero { width: 100%; display: block; aspect-ratio: 460 / 215; object-fit: cover; }
.slide-body h2 { margin: 14px 22px 6px; font-size: 22px; }
.slide-body h3 { margin: 18px 22px 8px; font-size: 14px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; }
.gd-links { display: flex; gap: 14px; margin-bottom: 10px; }
.gd-links a { color: #66c0f4; }
.gd-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.gd-tier { display: flex; align-items: center; gap: 12px; margin: 8px 22px 12px; }
.gd-rows { display: grid; gap: 1px; background: var(--grid); border-radius: 8px; overflow: hidden; }
.gd-row { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 8px 12px; background: var(--surface-2); }
.gd-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--grid); font-size: 12px; margin: 0 4px 4px 0; }
.chip:hover { text-decoration: none; border-color: var(--series-1); }
.gd-note { font-size: 12px; margin-top: 16px; }
#playedSel { background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--grid); border-radius: 6px; padding: 6px 8px; font: inherit; }

/* ---------- scanability and keyboard ---------- */
/* One row of covers: as many as fit the width; the rest is cut off instead of leaving an orphan row. */
.cgrid.one-row { grid-template-rows: auto; grid-auto-rows: 0; row-gap: 0; overflow: hidden; }
:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }
input:focus-visible, select:focus-visible { outline-offset: 0; }
.ctile:focus-visible { outline-offset: -2px; }
[role=button] { cursor: pointer; }
/* settings rows of sections share the .sec class with page sections; keep them one line */
.set-row.sec { display: flex; gap: 10px; }
.card-head + .tools { margin-top: 12px; }
.kpibar.filtered a { box-shadow: inset 0 -2px 0 var(--series-2); }
/* tables: one line per row, so the eye can run down a column */
td.tags-cell { max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td.name-cell { min-width: 200px; max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the details panel is where you rate: the S–F picker is always shown there */
.gd-tier .tier { display: flex; align-items: center; gap: 8px; }
.gd-tier .tier-pick { display: flex; gap: 3px; }
.gd-tier .tier-pick button { width: 28px; height: 28px; font-size: 13px; line-height: 26px; background: var(--surface-2); border: 1px solid var(--grid); }
.gd-tier .tier-pick button:hover, .gd-tier .tier-pick button.on { background: var(--tc, #555); color: #111; border-color: var(--tc, #555); }
.gd-tier .tier:has(.tier-pick) > .tb { display: none; }
.sync { border-bottom: 1px dotted currentColor; cursor: help; }
.sync.todo { color: var(--series-4); }
.card-head .pin { order: 99; background: none; border: 0; padding: 0 2px; font-size: 18px; line-height: 1; color: var(--text-secondary); opacity: .45; }
.card-head .pin:hover, .card-head .pin.on { opacity: 1; color: var(--series-4); }
.el-off { display: none !important; }
.gd-hide { display: flex; gap: 10px; align-items: center; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--grid); font-size: 12px; }
/* settings tab */
.settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 24px; align-items: start; }
.set-card.span { grid-column: 1 / -1; }
.set-card .set-row.sec { padding-left: 0; }
.set-card .set-row button, .set-card .set-row select { margin-left: 4px; }
.set-cols { columns: 3 380px; column-gap: 40px; }
.set-cols .set-sec { break-inside: avoid; }
.set-list { margin: 8px 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.set-card .cls-actions { margin-top: 12px; flex-wrap: wrap; justify-content: flex-start; }
.set-card .cls-actions button { white-space: nowrap; }
/* line chart, heatmap, scatter, segmented bar */
svg.cols polyline.ln { fill: none; stroke-width: 2; stroke-linejoin: round; }
svg.cols polygon.area { opacity: .45; }
svg.cols .xhair { stroke: var(--text-secondary); stroke-width: 1; opacity: 0; }
svg.cols g.col:hover .xhair { opacity: .6; }
.heatmap { display: grid; grid-template-columns: 44px repeat(var(--cols), minmax(0, 1fr)); gap: 3px; font-size: 11px; color: var(--text-secondary); font-variant-numeric: tabular-nums; margin: 8px 0 6px; }
.hm-col { text-align: center; }
.hm-row { text-align: right; padding-right: 6px; line-height: 16px; }
.hm-cell { height: 16px; border-radius: 3px; background: var(--surface-2); }
.hm-cell.s1 { background: color-mix(in srgb, var(--series-1) 22%, var(--surface-2)); }
.hm-cell.s2 { background: color-mix(in srgb, var(--series-1) 40%, var(--surface-2)); }
.hm-cell.s3 { background: color-mix(in srgb, var(--series-1) 60%, var(--surface-2)); }
.hm-cell.s4 { background: color-mix(in srgb, var(--series-1) 80%, var(--surface-2)); }
.hm-cell.s5 { background: var(--series-1); }
.heatmap .hm-cell:hover { outline: 2px solid var(--text-primary); outline-offset: -1px; }
.hm-key { display: flex; gap: 3px; align-items: center; justify-content: flex-end; font-size: 11px; color: var(--text-secondary); margin-bottom: 12px; }
.hm-key .hm-cell { width: 16px; height: 10px; }
.scatter { --pl: 48px; position: relative; font-size: 11px; color: var(--text-secondary); font-variant-numeric: tabular-nums; margin-top: 8px; }
.sc-plot { position: absolute; left: var(--pl); right: 8px; top: 6px; bottom: 22px; }
.scatter .ylab { position: absolute; left: calc(-1 * var(--pl)); width: calc(var(--pl) - 8px); text-align: right; transform: translateY(-50%); line-height: 1; }
.sc-h { position: absolute; left: 0; right: 0; border-top: 1px solid var(--grid); }
.sc-v { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--grid); }
.sc-xlab { position: absolute; bottom: -20px; transform: translateX(-50%); white-space: nowrap; }
.dot { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: color-mix(in srgb, var(--series-1) 55%, transparent); box-shadow: 0 0 0 1px var(--surface-1); cursor: pointer; }
.dot.hi { background: var(--series-3); }
.dot:hover { transform: scale(1.6); background: var(--text-primary); z-index: 2; }
.segbar { display: flex; gap: 2px; height: 30px; margin: 6px 0 16px; }
.sb-part { border-radius: 4px; display: flex; align-items: center; justify-content: center; min-width: 3px; cursor: pointer; }
.sb-part span { font-size: 12px; font-weight: 650; color: #0d0f12; }
.sb-part:hover { filter: brightness(1.15); }
.rows-off { display: none !important; }
.mv { font-weight: 650; }
.mv.up { color: #3fcf5e; }
.mv.down { color: #f0645c; }
.mv.new { color: var(--series-1); }
/* game thumbnails open the details panel: show it on hover */
.item, .tile, .stile, .tl-tile, .ct-img, td img, [data-game] { cursor: pointer; }
.item .pic img, .tile img, .stile img, .tl-tile img, .ct-img img, td img { transition: filter .12s, transform .12s; }
.tile:hover img, .stile:hover img, .tl-tile:hover img, .ct-img:hover img, td img:hover { filter: brightness(1.18); }
.tile::after, .stile::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px var(--series-1); opacity: 0; transition: opacity .12s; pointer-events: none; }
.tile:hover::after, .stile:hover::after { opacity: 1; }
.item .pic { border-radius: 4px; overflow: hidden; }
.dumbbell { display: grid; grid-template-columns: max-content 1fr max-content; gap: 14px 12px; align-items: center; margin: 10px 0 4px; font-size: 13px; }
.db-name { color: var(--text-secondary); }
.db-track { position: relative; height: 16px; background: linear-gradient(var(--grid), var(--grid)) center / 100% 2px no-repeat; }
.db-line { position: absolute; top: 6px; height: 4px; border-radius: 2px; background: var(--text-secondary); opacity: .45; }
.db-dot { position: absolute; top: 2px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface-1); }
.db-dot.a { background: var(--series-1); } .db-dot.b { background: var(--series-2); }
.db-val { font-variant-numeric: tabular-nums; white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.db-val .sw { width: 8px; height: 8px; border-radius: 2px; display: inline-block; } .db-val .sw.a { background: var(--series-1); } .db-val .sw.b { background: var(--series-2); margin-left: 6px; }
.seg-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.sub-h { font-size: 13px; font-weight: 650; margin: 18px 0 8px; }
/* rating sits right of the title; hovering the row opens the whole S–F picker */
.item .t { display: flex; align-items: center; gap: 8px; overflow: visible; }
.item .tt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .t .tier { display: inline-flex; align-items: center; flex: none; font-weight: 400; }
.item .t .tier-pick { gap: 2px; }
.item .t .tier-pick button { width: 20px; height: 20px; line-height: 18px; background: var(--surface-1); border: 1px solid var(--grid); }
.item .t .tier-pick button:hover, .item .t .tier-pick button.on { background: var(--tc); border-color: var(--tc); color: #111; }
.item:hover .t .tier-pick { display: inline-flex; }
.item:hover .t .tier > .tb { display: none; }
.item { transition: background .12s, box-shadow .12s; }
.item:hover { background: color-mix(in srgb, var(--surface-2) 85%, var(--text-primary)); box-shadow: inset 0 0 0 1px var(--series-1); }
/* taste mode */
.taste-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--grid); background: var(--surface-1); color: var(--text-secondary); font-size: 20px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; align-self: center; }
.taste-btn:hover { color: #ff6b8a; border-color: #ff6b8a; }
.taste-btn.on { color: #ff4d73; border-color: #ff4d73; background: color-mix(in srgb, #ff4d73 14%, var(--surface-1)); }
.fit { flex: none; font-size: 11px; font-weight: 700; line-height: 16px; padding: 0 4px; border-radius: 4px; border: 1px dashed var(--tc); color: var(--tc); }
.taste-note { color: #ff7b96; }
.top > .taste-btn { grid-area: act; justify-self: end; }
.taste-badge { font-size: 11px; font-weight: 650; color: #ff6b8a; border: 1px solid color-mix(in srgb, #ff4d73 50%, transparent); background: color-mix(in srgb, #ff4d73 12%, transparent); border-radius: 999px; padding: 1px 8px; white-space: nowrap; margin-left: 8px; }
.cut-grid { display: grid; gap: 6px; margin: 8px 0 12px; }
.cut-row { display: grid; grid-template-columns: 26px auto 64px auto 1fr; align-items: center; gap: 8px; font-size: 13px; }
.cut-row input { width: 64px; height: 30px; padding: 0 8px; background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--grid); border-radius: 6px; font: inherit; text-align: right; }
.cut-row input:disabled { opacity: .5; }
.cut-info { font-size: 12px; }
/* wishlist games you do not own: one look everywhere */
.is-wish .pic, .tile.is-wish, .stile.is-wish, .tl-tile.is-wish, .ctile.is-wish .ct-img { outline: 2px dashed var(--series-2); outline-offset: -2px; }
.is-wish .pic img, .tile.is-wish img, .stile.is-wish img, .tl-tile.is-wish img, .ctile.is-wish .ct-img img { filter: saturate(.45) brightness(.8); }
.item.is-wish { background: color-mix(in srgb, var(--series-2) 8%, var(--surface-2)); }
.ctile.is-wish { border-color: color-mix(in srgb, var(--series-2) 45%, var(--grid)); }
.wl-flag { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; background: var(--series-2); color: #14100c; font-size: 10px; font-weight: 800; line-height: 13px; text-align: center; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; overflow: hidden; pointer-events: none; }
.ct-img .wl-flag { font-size: 11px; line-height: 18px; }
.tl-tile .wl-flag, .stile .wl-flag { font-size: 8px; line-height: 10px; letter-spacing: 0; }
.wishmark { color: var(--series-2); font-weight: 700; }
#set-hidden { scroll-margin-top: calc(var(--top-h, 80px) + 16px); }
.gd-wish { background: var(--series-2); color: #14100c; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; text-align: center; padding: 6px 12px; }
/* settings: one labelled row per group */
.settings { display: flex; flex-direction: column; align-items: stretch; gap: 28px; }
.set-group-title { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 20px; align-items: start; }
.set-grid > .set-card.span { grid-column: 1 / -1; }
/* year summary */
.yr-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; }
.yr-pick button { padding: 4px 10px; border-radius: 999px; border: 1px dashed var(--grid); background: transparent; color: var(--text-secondary); font: inherit; font-size: 13px; cursor: pointer; }
.yr-pick button.exact { border-style: solid; }
.yr-pick button:hover:not(:disabled) { color: var(--text-primary); background: var(--surface-2); }
.yr-pick button.on { background: var(--series-1); border-color: var(--series-1); color: #fff; }
.yr-pick button:disabled { opacity: .35; cursor: default; }
.yr-kpis { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); }
.yr-kpis .kpi { padding: 12px 14px; }
.yr-kpis .kpi .value { font-size: 26px; }
.yr-kpis .up { color: var(--good, #3fb950); } .yr-kpis .down { color: var(--critical, #f0605a); }
.yr-facts { margin-top: 12px; }
.col[data-year] { cursor: pointer; }
/* sidebar groups and icons */
.nav-group { margin: 14px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); opacity: .7; }
.side > .nav a, .side > .nav-bottom a { justify-content: flex-start; gap: 10px; }
.side .nav a .nlabel { flex: 1; }
.ic { width: 18px; height: 18px; flex: none; opacity: .75; }
.nav a.on .ic, .nav a:hover .ic { opacity: 1; color: var(--series-1); }
.kpibar a { flex-direction: row; align-items: center; gap: 10px; }
.kpibar a > div { display: flex; flex-direction: column; }
.kpibar .ic { width: 20px; height: 20px; color: var(--series-1); opacity: .9; }
@media (max-width: 900px) { .nav-group { display: none; } }
/* heart: no ring, bigger */
.taste-btn { width: auto; height: auto; border: 0; background: none; border-radius: 0; font-size: 30px; padding: 0 6px; }
.taste-btn:hover { background: none; color: #ff6b8a; }
.taste-btn.on { background: none; color: #ff4d73; }
/* type-to-filter selects */
.combo { position: relative; display: inline-block; min-width: 160px; vertical-align: middle; }
.combo-in { width: 100%; box-sizing: border-box; background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--grid); border-radius: 6px; padding: 5px 26px 5px 8px; font: inherit; font-size: 13px; cursor: pointer; }
.combo-in:focus { outline: none; border-color: var(--series-1); cursor: text; }
.combo-list { position: absolute; z-index: 50; left: 0; top: calc(100% + 4px); min-width: 100%; max-height: 320px; overflow: auto; background: var(--surface-1); border: 1px solid var(--grid); border-radius: 8px; box-shadow: 0 8px 24px #0008; padding: 4px; }
.combo-opt { padding: 5px 8px; border-radius: 5px; font-size: 13px; white-space: nowrap; cursor: pointer; }
.combo-opt.sel { color: var(--series-1); }
.combo-opt.act, .combo-opt:hover { background: var(--surface-2); }
.combo-none { padding: 6px 8px; color: var(--text-secondary); font-size: 13px; }
.side .combo { display: block; width: 100% !important; }
/* release calendar */
.cal-group { margin: 10px 0 4px; }
.cal-group > summary { cursor: pointer; padding: 6px 0; font-size: 14px; list-style: none; display: flex; gap: 8px; align-items: baseline; }
.cal-group > summary::-webkit-details-marker { display: none; }
.cal-group > summary::before { content: '▸'; color: var(--text-secondary); transition: transform .15s; display: inline-block; }
.cal-group[open] > summary::before { transform: rotate(90deg); }
.cal-group > summary b::first-letter { text-transform: uppercase; }
.cal-group > .cgrid { margin: 6px 0 12px; }
/* one chevron for native selects and type-to-filter boxes */
select, .combo-in { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%239aa4b2%27 stroke-width=%272.5%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27m6 9 6 6 6-6%27/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; background-position: right 9px center !important; background-size: 12px !important; padding-right: 28px !important; }
select option { background: var(--surface-1); color: var(--text-primary); }
/* Metacritic score */
.mc { display: inline-block; min-width: 26px; padding: 1px 5px; border-radius: 4px; font-weight: 700; font-size: 12px; text-align: center; color: #fff; text-decoration: none; }
.mc-good { background: #00c066; } .mc-mid { background: #fc3; color: #222; } .mc-bad { background: #f33; }
a.mc:hover { text-decoration: none; filter: brightness(1.1); }
.hl-bar { height: 6px; border-radius: 3px; background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--grid); margin: 6px 0 4px; overflow: hidden; max-width: 240px; }
.hl-bar i { display: block; height: 100%; background: var(--series-1); border-radius: 3px; }
.hl-note { font-size: 12px; }
.gd-row > span:last-child { flex: 1; min-width: 0; }
.lt-rows { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 12px; align-items: center; font-size: 13px; margin-bottom: 8px; }
.lt-rows .segbar { margin: 0; }
/* Completion flag */
.done-btn { margin-left: 4px; width: 26px; height: 26px; display: inline-grid; place-items: center; vertical-align: middle; border-radius: 6px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; line-height: 1; padding: 0; }
.done-btn:hover { background: var(--surface-1); color: var(--series-3); }
.done-btn.on { color: var(--series-3); }
.done-btn.on.manual { background: var(--series-3); color: #fff; }
.done-pick { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.done-pick button { border: 1px solid var(--grid); background: transparent; color: var(--text); border-radius: 6px; padding: 3px 9px; font-size: 12px; cursor: pointer; }
.done-pick button.on { background: var(--series-3); border-color: var(--series-3); color: #fff; }
.kpibar { overflow-x: auto; scrollbar-width: none; justify-content: safe center; }
.kpibar a { flex: none; }
.ct-sub .ct-a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ct-sub .ct-b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
/* Month calendar */
.cal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cal-nav b { font-size: 16px; min-width: 150px; text-align: center; text-transform: capitalize; }
.cal-nav button, .cal-chips button { border: 1px solid var(--grid); background: transparent; color: var(--text); border-radius: 6px; padding: 3px 10px; cursor: pointer; }
.cal-nav button:hover, .cal-chips button:hover:not(:disabled) { background: var(--surface-2); }
.cal-chips { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-chips button { font-size: 12px; padding: 2px 8px; }
.cal-chips button b { color: var(--series-1); }
.cal-chips button.on { background: var(--series-1); border-color: var(--series-1); color: #fff; }
.cal-chips button.on b { color: #fff; }
.cal-chips button:disabled { opacity: .4; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { font-size: 11px; text-transform: uppercase; color: var(--text-secondary); padding: 0 6px 2px; }
.cal-day { min-height: 96px; background: var(--surface-2); border-radius: 6px; padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.empty { background: transparent; }
.cal-day.past { opacity: .55; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--series-1); }
.cal-num { font-size: 12px; color: var(--text-secondary); padding: 0 2px; }
.cal-day.has .cal-num { color: var(--text); font-weight: 700; }
.cal-game { display: flex; align-items: center; gap: 6px; border: 0; background: var(--surface-1); border-radius: 4px; padding: 2px; color: var(--text); cursor: pointer; text-align: left; min-width: 0; font-size: 11px; }
.cal-game:hover { background: var(--grid); }
.cal-game img { width: 46px; height: 22px; object-fit: cover; border-radius: 3px; flex: none; }
.cal-game span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cal-more { font-size: 11px; padding: 0 4px; }
/* Crown: finished game */
.crown { display: inline-flex; color: #f5c518; filter: drop-shadow(0 1px 1px rgba(0,0,0,.7)); }
.crown svg { width: 16px; height: 16px; fill: currentColor; }
.ct-img .crown, .pic .crown, .tile .crown { position: absolute; top: 5px; right: 5px; padding: 3px; border-radius: 50%; background: rgba(10, 12, 16, .75); }
.ct-img .crown svg { width: 18px; height: 18px; }
.pic .crown svg, .tile .crown svg { width: 13px; height: 13px; }
.pic { position: relative; }
.name-cell .crown { margin-left: 6px; vertical-align: -2px; }
.name-cell .crown svg { width: 14px; height: 14px; }
.pic .crown, .tile .crown { top: 2px; right: 2px; padding: 2px; }
.ct-sub { flex-wrap: wrap; row-gap: 0; }
.ct-sub .ct-a { flex: none; overflow: visible; }
.ct-sub .ct-b { margin-left: auto; max-width: 100%; }
.crown { color: inherit; filter: drop-shadow(0 1px 2px rgba(0,0,0,.8)); }
.ct-img .crown, .pic .crown, .tile .crown { background: none; padding: 0; }
.ct-img .crown svg { width: 24px; height: 24px; }
.pic .crown svg, .tile .crown svg { width: 17px; height: 17px; }
.name-cell .crown svg { width: 16px; height: 16px; }
.crown { filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.95)) drop-shadow(0 0 2px rgba(0,0,0,.6)); }
/* Game history in the game panel */
.gd-hist { margin-top: 18px; padding: 14px; border-radius: 10px; background: var(--surface-2); }
.gd-hist h3 { margin-top: 0; }
.gd-hist p { margin: 4px 0 12px; }
.gh-years, .gh-months { margin-top: 10px; }
.gh-years > .muted, .gh-months > .muted { display: block; font-size: 12px; margin-bottom: 4px; }
.gh-years .col { cursor: pointer; }
.gh-kpis { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; }
.gh-k b { display: block; font-size: 22px; line-height: 1.1; }
.gh-k span { font-size: 11px; color: var(--text-secondary); }
.hl-bar { position: relative; display: flex; overflow: visible; }
.hl-bar i { border-radius: 0; }
.hl-bar i:first-child { border-radius: 3px 0 0 3px; }
.hl-bar i:last-child { border-radius: 0 3px 3px 0; }
.hl-bar i:only-child { border-radius: 3px; }
.hl-bar i.ok { background: var(--series-3); }
.hl-bar i.ex { background: #f5b82e; }
.hl-bar .tick { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text); border-radius: 1px; }
.hl-ex { color: #f5b82e; }
.gd-title .crown { margin-left: 10px; vertical-align: -3px; }
.gd-title .crown svg { width: 26px; height: 26px; }
#confirm h2 { margin: 0; padding: 16px 20px 0; }
#confirm .cls-actions { padding: 0 20px 16px; justify-content: flex-end; }
#confirm [data-confirm-yes] { background: var(--series-1); border-color: var(--series-1); color: #fff; }
.deck { display: inline-flex; align-items: center; gap: 6px; }
.deck svg { width: 18px; height: 18px; flex: none; }
.deck-ok { color: #59bf40; }
.deck-play { color: #ffc82c; }
.deck-no { color: #9aa0aa; }
.deck span { color: var(--text-primary); }
.deck-fps { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; margin-top: 6px; }
.fps-hist { flex-basis: 100%; display: flex; align-items: flex-end; gap: 2px; height: 34px; max-width: 280px; margin-top: 4px; }
.fps-hist i { flex: 1; background: var(--series-1); border-radius: 2px 2px 0 0; min-height: 2px; }
.fps-axis { flex-basis: 100%; display: flex; justify-content: space-between; max-width: 280px; font-size: 11px; }
.proton span { display: inline-block; padding: 1px 8px; border-radius: 4px; color: #14161a; font-weight: 700; font-size: 12px; }
.ds-hint { margin: 4px 0 10px; font-weight: 600; }
.ds-hint.todo { color: #ffc82c; }
.ds-list { display: grid; gap: 12px; margin-bottom: 12px; }
.ds-head, .ds-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.ds-foot { font-size: 12px; }
.ds-bar { height: 6px; border-radius: 3px; background: var(--grid); margin: 4px 0; overflow: hidden; }
.ds-bar i { display: block; height: 100%; background: var(--series-1); border-radius: 3px; }
.ds-ok { color: #59bf40; }
.ds-todo { color: #ffc82c; }
.ds-btn { margin-left: 8px; padding: 1px 8px; font-size: 12px; }
.hh-row { margin-bottom: 14px; }
.hh-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; font-size: 13px; }
.hw-cell { white-space: nowrap; }
.hw-in { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.hw-fps { color: var(--text-secondary); font-size: 12px; }

#modal [data-modal-n] { white-space: nowrap; }
.list > [hidden] { display: none !important; }
.vs-pair { display: inline-flex; align-items: center; gap: 5px; margin-left: 12px; white-space: nowrap; }
.hrs-hi { color: var(--series-1); font-weight: 700; }
.cph-good { color: #59bf40; } .cph-mid { color: #ffc82c; } .cph-bad { color: #ff7a45; }
.hl-mini { display: block; height: 3px; margin: 2px 0 0 auto; width: 44px; border-radius: 2px; background: var(--grid); overflow: hidden; }
.hl-mini i { display: block; height: 100%; background: var(--series-1); }
.hl-mini.ok i { background: #59bf40; }
/* One look for every text field (filters in windows, lists, settings). */
input[type=search], input[type=text] { background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--grid); border-radius: 6px; padding: 7px 10px; font: inherit; }
#modal [data-modal-q] { flex: 0 1 280px; margin-left: auto; }
.hid-q { width: 100%; margin-bottom: 8px; }
.hid-list { max-height: 360px; overflow-y: auto; padding-right: 4px; }
.hid-list > [hidden] { display: none; }
/* Panel controls in the lead line (sort pickers). */
.lead select { margin-left: 6px; background-color: var(--surface-2); color: var(--text-primary); border: 1px solid var(--grid); border-radius: 6px; padding: 3px 28px 3px 8px; font: inherit; font-size: 12px; }
.awards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.award { display: flex; flex-direction: column; gap: 6px; }
.award-t { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--series-4); }
.award .ctile { width: 100%; }

/* ---------- phones and small tablets ---------- */
.menu-btn, .side-backdrop { display: none; }
@media (max-width: 760px) {
  .top { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "menu who act" "kpi kpi kpi" "load load load"; padding: 8px 12px; column-gap: 10px; }
  .menu-btn { display: inline-flex; grid-area: menu; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border-radius: 8px; }
  .who img { width: 32px; height: 32px; }
  .who h1 { font-size: 17px; }
  .who .muted { white-space: normal; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  .kpibar { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; -webkit-overflow-scrolling: touch; }
  .kpibar a { padding: 4px 10px; }
  .kpibar b { font-size: 16px; }
  /* the sidebar becomes a drawer */
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 30; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); height: 100dvh; overflow-y: auto; transform: translateX(-105%); transition: transform .2s ease; background: var(--page); border-right: 1px solid var(--grid); border-bottom: 0; padding: 14px; display: flex; flex-direction: column; }
  body.nav-open .side { transform: none; }
  .side-tools { grid-template-columns: minmax(0, 1fr); }
  .side > .nav { flex-direction: column; flex-wrap: nowrap; }
  .side > .nav a { padding: 10px 12px; font-size: 15px; }
  .side > .nav-bottom { position: static; margin-top: auto; }
  .nav-group { display: block; }
  .side-backdrop { position: fixed; inset: 0; z-index: 25; background: #0009; }
  body.nav-open .side-backdrop { display: block; }
  body.nav-open { overflow: hidden; }
  main { padding: 12px 10px 40px; gap: 14px; }
  body.tabs .section-title { font-size: 18px; }
  .card { padding: 14px 12px; border-radius: 10px; }
  .cgrid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .awards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .tools { flex-wrap: wrap; }
  .tools > input { min-width: 0; flex: 1 1 100%; }
  .table-scroll { max-height: none; }
  /* windows fill the screen */
  .modal, .modal.wide { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .modal-head { flex-wrap: wrap; padding: 10px 12px; }
  .modal-head h2 { flex: 1 1 100%; order: -1; }
  #modal [data-modal-q], #fdialog [data-fq] { flex: 1 1 auto; margin-left: 0; }
  .modal-body { max-height: none; }
  dialog.slide { width: 100vw; max-width: 100vw; border-left: 0; }
  .slide-body > :not(.gd-hero):not(.gd-wish) { margin-left: 12px; margin-right: 12px; }
  .slide-body h2 { margin: 12px 12px 6px; font-size: 19px; }
  .slide-body h3 { margin: 16px 12px 8px; }
  .set-cols { columns: 1; }
}
/* touch screens have no hover: show the small per-row controls all the time */
@media (hover: none) {
  .item .ign, .cedit, .card-head .pin { opacity: .7; }
}
.awards { grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 16px; }
.aw-list { display: flex; flex-direction: column; gap: 2px; }
.aw-row { display: grid; grid-template-columns: 18px 46px minmax(0, 1fr) auto; grid-template-areas: "n img name l" "n img v v"; align-items: center; column-gap: 6px; padding: 3px 4px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.aw-row:hover { background: var(--surface-2); }
.aw-n { grid-area: n; color: var(--text-secondary); font-size: 12px; text-align: right; }
.aw-row img { grid-area: img; width: 46px; height: 22px; object-fit: cover; border-radius: 3px; }
.aw-name { grid-area: name; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aw-l { grid-area: l; font-size: 11px; font-weight: 700; }
.aw-v { grid-area: v; font-size: 11px; color: var(--text-secondary); }
.aw-l { color: var(--tc); }
.crown .rep { display: inline-flex; margin-left: 2px; }
.done-pick .rep-btn.on { background: #8a4fd6; border-color: #8a4fd6; color: #fff; }
.sync-row { align-items: center; }
.sync-row select { min-width: 160px; }
.sync-out { margin-top: 10px; }
/* loader while the page recalculates (filters, settings) */
body.busy main { opacity: .45; transition: opacity .12s; pointer-events: none; }
body.busy::after { content: ''; position: fixed; z-index: 40; top: 50%; left: calc(50% + 116px); width: 38px; height: 38px; margin: -19px; border-radius: 50%; border: 3px solid var(--grid); border-top-color: var(--series-1); animation: spin .7s linear infinite; }
@media (max-width: 760px) { body.busy::after { left: 50%; } }
body.busy { cursor: progress; }
.panel.span2 { grid-column: span 2; }
.panels[data-cols="1"] > .panel.span2 { grid-column: auto; }
/* header actions: layout mode + taste */
.top-act { grid-area: act; justify-self: end; display: flex; align-items: center; gap: 4px; }
.layout-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 0; background: none; color: var(--text-secondary); border-radius: 8px; cursor: pointer; }
.layout-btn:hover { color: var(--text-primary); background: var(--surface-1); }
.layout-btn.on { color: var(--series-1); background: color-mix(in srgb, var(--series-1) 16%, transparent); }
/* layout mode */
.lay-cols { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--text-secondary); }
.lay-cols button, .ph-w button { min-width: 30px; padding: 3px 8px; border: 1px solid var(--grid); background: transparent; color: var(--text-primary); border-radius: 6px; cursor: pointer; font: inherit; font-size: 12px; }
.lay-cols button.on, .ph-w button.on { background: var(--series-1); border-color: var(--series-1); color: #fff; }
.card.ph { position: relative; box-sizing: border-box; display: flex; align-items: flex-start; gap: 10px; min-height: 64px; padding: 12px 16px; border: 1px dashed var(--grid); background: var(--surface-1); cursor: grab; }
.card.ph .ph-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-grip { color: var(--text-secondary); font-size: 18px; }
.ph-tools { display: flex; gap: 8px; align-items: center; }
.ph-w { display: inline-flex; gap: 2px; }
.ph-tools > button { padding: 3px 9px; border: 1px solid var(--grid); background: transparent; color: var(--text-primary); border-radius: 6px; cursor: pointer; font-size: 12px; }
.panel.dragging .card.ph { opacity: .4; border-color: var(--series-1); }
.panel.ph-off .card.ph { opacity: .45; }
.panel.ph-off .ph-t { text-decoration: line-through; }
.ph-rs { position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; cursor: nwse-resize; border-right: 3px solid var(--series-1); border-bottom: 3px solid var(--series-1); border-bottom-right-radius: 10px; opacity: .6; touch-action: none; }
.ph-rs:hover { opacity: 1; }
.ph-h { position: absolute; left: 16px; bottom: 10px; font-size: 12px; }
/* a panel stretched to its row's height (layoutBox) lets its chart use the extra space */
.panel > .card { display: flex; flex-direction: column; }
.panel > .card > * { flex: none; }
.panel > .card > .colchart, .panel > .card > .hbars { flex: 1 1 auto; }
.panel > .card > .hbars { align-content: space-evenly; }
.colchart svg.cols { height: calc(100% - 22px); }
.ph-w button:disabled { opacity: .3; cursor: not-allowed; }
/* layout mode: strict order (a widened panel pushes the next one down), header line wraps instead of overlapping */
.card.ph { flex-wrap: wrap; align-content: space-between; row-gap: 8px; }
.card.ph .ph-t { flex: 1 1 120px; white-space: normal; }
.card.ph .ph-tools { flex-wrap: wrap; margin-left: auto; }
.card.ph .ph-h { position: static; flex: 1 0 100%; }
.card.ph .ph-h { order: 9; }
.card.ph .ph-t { text-align: left; }
.card.ph { flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: space-between; }
.ph-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.ph-head .ph-t { flex: 1 1 140px; }
.card.ph .ph-h { flex: none; }
/* layout mode feedback: drop slot while dragging, ghost + snapped size while resizing */
body.lay-edit .panels { position: relative; }
.panel.dragging .card.ph { opacity: 1; border: 2px dashed var(--series-1); background: color-mix(in srgb, var(--series-1) 14%, transparent); }
.panel.dragging .card.ph > * { visibility: hidden; }
.panel.dragging .card.ph::after { content: attr(data-drop); position: absolute; inset: 0; display: grid; place-items: center; color: var(--series-1); font-weight: 600; }
.rs-ghost { position: absolute; z-index: 5; pointer-events: none; border: 1px dashed var(--text-secondary); border-radius: 10px; background: color-mix(in srgb, var(--text-secondary) 8%, transparent); }
.panel.resizing .card.ph { border: 2px solid var(--series-1); background: color-mix(in srgb, var(--series-1) 12%, var(--surface-1)); transition: none; }
.rs-badge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 6px 12px; border-radius: 8px; background: var(--series-1); color: #fff; font-weight: 600; font-size: 13px; white-space: nowrap; z-index: 6; }
.rs-badge.snap { animation: rs-snap .25s ease-out; }
@keyframes rs-snap { from { transform: translate(-50%, -50%) scale(1.18); } to { transform: translate(-50%, -50%) scale(1); } }
.drag-mini { position: fixed !important; left: 0; top: 0; z-index: 1000; pointer-events: none; transform-origin: 0 0; opacity: .92; box-shadow: 0 18px 40px rgba(0,0,0,.5); border: 2px solid var(--series-1); }
body.lay-edit .card.ph { user-select: none; touch-action: none; }
.panel.landed .card.ph { animation: ph-land .45s ease-out; }
@keyframes ph-land { from { opacity: .2; transform: scale(.96); box-shadow: 0 0 0 4px var(--series-1); } to { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 transparent; } }
.drop-hole { position: absolute; z-index: 4; display: grid; place-items: start center; padding: 12px; text-align: center; border-radius: 10px; border: 2px dashed var(--series-1); background: color-mix(in srgb, var(--series-1) 12%, transparent); color: var(--series-1); font-weight: 600; pointer-events: none; }
.drop-hole.bad { border-color: #e5534b; background: color-mix(in srgb, #e5534b 14%, transparent); color: #ff7b72; }
/* narrow list (e.g. "Do oceny" in one column): the S–F buttons go under the title instead of sticking out */
@container (max-width: 519px) {
  .list.two-col .item { grid-template-columns: 120px 1fr; }
  .list.two-col .item .r { grid-column: 1 / -1; justify-self: start; text-align: left; }
}
.rs-snap { position: absolute; z-index: 5; pointer-events: none; border: 2px solid var(--series-1); border-radius: 10px; background: color-mix(in srgb, var(--series-1) 16%, transparent); box-shadow: 0 0 0 9999px rgba(0,0,0,.18); }
.panel.resizing .card.ph { border-style: dashed; background: var(--surface-1); }
/* layout mode on real panels: content is inert, an overlay carries the toolbar, the corner and the drop label */
body.lay-edit .panel { position: relative; }
body.lay-edit .panel > .card { pointer-events: none; user-select: none; }
body.lay-edit .panel > .card .pin { display: none; }
.ph-over { position: absolute; inset: 0 0 24px 0; border: 2px dashed transparent; border-radius: 12px; cursor: grab; touch-action: none; user-select: none; }
.ph-over:hover { border-color: color-mix(in srgb, var(--series-1) 60%, transparent); }
.ph-over .ph-head { position: absolute; left: 8px; right: 8px; top: 8px; padding: 6px 10px; border-radius: 8px; background: color-mix(in srgb, var(--surface-1) 92%, transparent); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.ph-over .ph-h { font-size: 12px; color: var(--text-secondary); }
.ph-over .ph-rs { width: 26px; height: 26px; opacity: .9; }
.panel.ph-off > .card { opacity: .35; filter: grayscale(1); }
.panel.ph-off .ph-t { text-decoration: line-through; }
.panel.dragging > .card { visibility: hidden; }
.panel.dragging .ph-over { border-color: var(--series-1); background: color-mix(in srgb, var(--series-1) 14%, transparent); }
.panel.dragging .ph-over > * { visibility: hidden; }
.panel.dragging .ph-over::after { content: attr(data-drop); position: absolute; inset: 0; display: grid; place-items: center; color: var(--series-1); font-weight: 600; }
.panel.resizing .ph-over { border-color: var(--text-secondary); }
.panel.landed > .card { animation: ph-land .45s ease-out; }
/* layout mode: real sizes, no data — the card keeps its exact box but its content is invisible */
body.lay-edit .panel > .card { outline: 1px dashed var(--grid); outline-offset: -1px; background: var(--surface-1); }
body.lay-edit .panel > .card > * { visibility: hidden; }
.ph-over .ph-h { position: static; flex: none; }
.ph-over .ph-head .ph-t { flex: 1 1 auto; }
/* overlay lives inside the card */
body.lay-edit .panel > .card { position: relative; }
body.lay-edit .panel > .card > .ph-over { visibility: visible; pointer-events: auto; inset: 0; }
.panel.dragging > .card > .ph-over { visibility: visible; }
.shr-off { display: none !important; }
.ph-over button.ph-h { padding: 2px 8px; border: 1px solid var(--grid); border-radius: 6px; background: transparent; color: var(--text-primary); cursor: pointer; font-size: 12px; }
.ph-over button.ph-h:hover { border-color: var(--series-1); color: var(--series-1); }
.nav-bottom-row { display: flex; align-items: center; gap: 4px; }
.nav-bottom-row > a { flex: 1; min-width: 0; }
.nav-bottom-row .layout-btn { flex: none; }
.lay-sec-preset { margin-left: 12px; }
.sec-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; }
.sec-head .yr-pick { margin: 0; }
.more + .mode-note, .list + .mode-note { margin-top: 18px; }
#modal .list.modal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.empty-ph { flex: 1; min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--text-secondary); border: 1px dashed var(--grid); border-radius: 10px; font-size: 14px; text-align: center; padding: 16px; margin-top: 8px; }
.empty-ph svg { opacity: .6; }
.card-head .all-auto { margin-left: auto; font-size: 13px; }
.card-head .all-auto + * { margin-left: 12px; }
#modal .list.modal-whole { display: block; padding: 8px 4px; }
.card-head .all-head { margin-left: auto; font-size: 13px; }
.card-head .all-head[hidden] { display: none; }
.card-head .all-head + :not(.all-head) { margin-left: 12px; }

/* Phones: nothing may widen the page (a wider page lets the browser pan the view and hide the sticky header). */
@media (max-width: 760px) {
  html, body { overflow-x: clip; }
  .item { grid-template-columns: 96px minmax(0, 1fr) auto; }
  .item > * { min-width: 0; }
  .tier-tools { flex-wrap: wrap; }
  .tier-tools .combo, .tier-tools select { min-width: 0; max-width: 100%; }
  .modes { display: flex; flex-wrap: wrap; max-width: 100%; }
}
@media (max-width: 760px) {
  dialog.slide { width: 100%; max-width: 100%; overflow-x: clip; }
  .gd-row { grid-template-columns: 104px minmax(0, 1fr); gap: 10px; }
  .done-pick { flex-wrap: wrap; }
  .msel-pop { position: fixed; left: 12px; right: 12px; width: auto; top: auto; }
}

/* Phones, from the mobile audit (v121). */
@media (max-width: 760px) {
  #layoutBtn { display: none; }
  .item .pic, .item img { width: 96px; height: 36px; }
  .item .r { max-width: 38vw; white-space: normal; }
  .cchip, .gchip, .tb, .wl-flag { font-size: 11px; }
  .item .ign { width: 32px; height: 32px; }
  .done-btn { width: 34px; height: 34px; }
  .card-head .pin { min-width: 34px; min-height: 34px; }
  .fopt { min-height: 34px; padding: 4px 10px; }
  .tier-pick button { min-width: 34px; height: 34px; }
  .msel-pop label { padding: 7px 4px; }
  .msel-pop input[type=checkbox] { width: 18px; height: 18px; }
  .card-head .all-head, .card-head .all-auto { padding: 8px 0; }
  .ct-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  dialog.slide .modal-close { background: color-mix(in srgb, var(--surface-1) 85%, transparent); position: fixed; }
  .kpibar { mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .tl-year { grid-template-columns: 1fr; row-gap: 6px; }
  .tl-year::before, .tl-head::after { display: none; }
  .tl-head { position: static; text-align: left; }
  .tl-head span { display: inline; margin-left: 8px; }
  .tl-tiles { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
  td.name-cell, .table-scroll th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface-1); }
  td.name-cell { min-width: 140px; max-width: 55vw; }
}
@media (max-width: 760px) {
  /* The right column of a list row moves under the title, so titles keep the full width. */
  .item { grid-template-columns: 96px minmax(0, 1fr); row-gap: 4px; }
  .item .r { grid-column: 2; max-width: none; text-align: left; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
  .item .r b { display: inline; }
  .item .r .tb { margin-left: 0; }
  .item .r .vs { justify-content: flex-start; }
}

.cal-list { display: none; }
@media (max-width: 760px) {
  .cal-day { min-height: 44px; }
  .cal-day.has { background: color-mix(in srgb, var(--series-1) 22%, var(--surface-2)); }
  .cal-game { display: none; }
  .cal-list { display: grid; gap: 10px; margin-top: 14px; }
  .cal-li { display: grid; gap: 4px; }
  .cal-li.today .cal-li-d { color: var(--series-1); }
  .cal-li-d { font-size: 13px; color: var(--text-secondary); }
  .cal-li-d b { font-size: 16px; color: var(--text-primary); }
  .cal-li-g { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; align-items: center; text-align: left; border: 0; background: var(--surface-2); color: var(--text); border-radius: 6px; padding: 4px; cursor: pointer; }
  .cal-li-g img { width: 96px; height: 36px; object-fit: cover; border-radius: 4px; }
  .cal-li-g span { min-width: 0; font-weight: 600; }
  .cal-li-g small { display: block; font-weight: 400; font-size: 12px; }
  /* Header: fixed, so hiding the KPI bar (scrolling down) never moves the page; it comes back on the way up. */
  .top { position: fixed; left: 0; right: 0; top: 0; }
  body { padding-top: var(--top-full, 115px); }
  .kpibar { transition: max-height .2s ease, opacity .2s ease, margin .2s ease; max-height: 80px; }
  body.top-min .kpibar { max-height: 0; opacity: 0; overflow: hidden; margin: 0; padding-top: 0; padding-bottom: 0; }
}

/* Public service: sign-in screen */
.login-box { max-width: 520px; margin: 12vh auto; padding: 28px; background: var(--surface-1); border-radius: 12px; display: grid; gap: 14px; }
.login-box h2 { margin: 0; }
.login-btn { justify-self: start; padding: 10px 18px; border-radius: 6px; background: var(--series-1); color: #fff; font-weight: 700; text-decoration: none; }
.login-btn:hover { filter: brightness(1.15); }
.legal { font-size: 12px; margin: 0; }
.legal a { color: inherit; }
.doc-page { display: block; }
.doc { max-width: 760px; margin: 0 auto; padding: 32px 20px 60px; line-height: 1.6; }
.doc h2 { margin-top: 28px; font-size: 18px; }

/* Landing page (public service, signed out): no app chrome */
body.landing { padding-top: 0 !important; }
body.landing .top, body.landing .side, body.landing .side-backdrop, body.landing #menuBtn { display: none !important; }
body.landing .shell { display: block; }
body.landing #app { padding: 0; max-width: none; }
.lp { --lp-w: 1120px; min-height: 100vh; background: radial-gradient(1200px 600px at 75% -10%, rgba(51, 140, 237, .18), transparent 60%), var(--page); }
.lp > * { max-width: var(--lp-w); margin-left: auto; margin-right: auto; padding-left: 24px; padding-right: 24px; }
.lp a { color: var(--series-1); }
.lp-top { display: flex; align-items: center; justify-content: space-between; padding-top: 20px; padding-bottom: 20px; }
.lp-logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: .2px; }
.lp-logo .ic { width: 26px; height: 26px; color: var(--series-1); opacity: 1; }
.lp-btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; border-radius: 10px; background: var(--series-1); color: #fff !important; font-weight: 700; font-size: 17px; text-decoration: none; box-shadow: 0 6px 24px rgba(51, 140, 237, .35); transition: transform .15s, filter .15s; }
.lp-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.lp-btn .ic { width: 22px; height: 22px; opacity: 1; }
.lp-btn.small { padding: 8px 14px; font-size: 14px; box-shadow: none; }
.lp-hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; padding-top: 48px; padding-bottom: 64px; }
.lp-hero h1 { font-size: clamp(32px, 4.4vw, 52px); line-height: 1.08; margin: 0 0 18px; letter-spacing: -.5px; }
.lp-lead { font-size: 19px; line-height: 1.55; color: var(--text-secondary); margin: 0 0 28px; max-width: 34em; }
.lp-small { font-size: 13px; color: var(--text-secondary); margin: 14px 0 0; }
.lp-error { color: #ff8a80; margin: 0 0 16px; }
.lp-preview { position: relative; background: var(--surface-1); border: 1px solid var(--grid); border-radius: 16px; padding: 18px; display: grid; gap: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); transform: rotate(-1deg); }
.lp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.lp-kpis div { background: var(--surface-2); border-radius: 10px; padding: 10px; display: grid; }
.lp-kpis b { font-size: 18px; }
.lp-kpis span { font-size: 11px; color: var(--text-secondary); }
.lp-card { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; }
.lp-card-t { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.lp-bars { display: flex; align-items: flex-end; gap: 6px; height: 90px; }
.lp-bars i { flex: 1; background: var(--series-1); border-radius: 4px 4px 0 0; }
.lp-tier { display: grid; grid-template-columns: 22px 1fr 28px; align-items: center; gap: 8px; margin: 4px 0; }
.lp-tier b { text-align: center; border-radius: 4px; color: #111; font-size: 12px; }
.lp-tier b.t-S { background: var(--tier-S); } .lp-tier b.t-A { background: var(--tier-A); } .lp-tier b.t-B { background: var(--tier-B); }
.lp-tier b.t-C { background: var(--tier-C); } .lp-tier b.t-D { background: var(--tier-D); } .lp-tier b.t-F { background: var(--tier-F); }
.lp-tier span { height: 8px; border-radius: 4px; background: var(--neutral); }
.lp-tier em { font-style: normal; font-size: 12px; color: var(--text-secondary); text-align: right; }
.lp-note { position: absolute; right: 16px; bottom: -26px; margin: 0; font-size: 11px; color: var(--text-secondary); }
.lp-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding-bottom: 64px; }
.lp-feature { background: var(--surface-1); border: 1px solid var(--grid); border-radius: 14px; padding: 22px; }
.lp-feature .ic { width: 28px; height: 28px; color: var(--series-1); opacity: 1; }
.lp-feature h3 { margin: 12px 0 6px; font-size: 17px; }
.lp-feature p { margin: 0; color: var(--text-secondary); line-height: 1.5; font-size: 14px; }
.lp-steps, .lp-privacy { padding-bottom: 56px; }
.lp-steps h2, .lp-privacy h2 { font-size: 24px; margin: 0 0 18px; }
.lp-steps ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: s; }
.lp-steps li { counter-increment: s; display: grid; gap: 6px; padding-left: 52px; position: relative; }
.lp-steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--series-1); color: var(--series-1); font-weight: 800; }
.lp-steps li span { color: var(--text-secondary); line-height: 1.5; font-size: 14px; }
.lp-privacy ul { margin: 0 0 12px; padding-left: 20px; line-height: 1.8; color: var(--text-secondary); }
.lp-foot { border-top: 1px solid var(--grid); padding-top: 20px; padding-bottom: 32px; font-size: 12px; color: var(--text-secondary); }
@media (max-width: 860px) {
  .lp-hero { grid-template-columns: 1fr; gap: 40px; padding-top: 16px; }
  .lp-preview { transform: none; }
  .lp-features { grid-template-columns: 1fr; }
  .lp-steps ol { grid-template-columns: 1fr; }
  .lp-kpis { grid-template-columns: repeat(2, 1fr); }
}
