:root {
  --bg: #0e1015;
  --panel: #171a22;
  --line: #262b37;
  --text: #e6e8ee;
  --muted: #8b93a7;
  --accent: #66d9ff;
  --row-hover: #1d2130;
  --fc: #66ffff;
  --exhard: #ffd91a;
  --hard: #ffffff;
  --clear: #4aa8ff;
  --easy: #66ff66;
  --failed: #e61e25;
  --pg: #a0f0ff;
  --gr: #ffd040;
  --gd: #70ff70;
  --bd: #c080ff;
  --pr: #ff4040;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 500px at 50% -200px, #1a2433 0%, transparent 70%) no-repeat, var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 28px;
  padding: 0 24px; min-height: 64px;
  background: rgba(19, 22, 30, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 20px; color: var(--text); letter-spacing: .01em; white-space: nowrap; }
.brand:hover { text-decoration: none; color: #fff; }
.brand span { color: var(--accent); font-weight: 500; font-size: 15px; margin-left: 2px; }
nav { display: flex; align-items: stretch; gap: 4px; align-self: stretch; }
nav a {
  display: flex; align-items: center; padding: 0 16px;
  color: var(--muted); font-size: 16px; font-weight: 600;
  border-top: 3px solid transparent; border-bottom: 3px solid transparent; transition: color .15s, border-color .15s, background .15s;
}
nav a:hover { color: var(--text); background: #ffffff08; text-decoration: none; }
nav a.on { color: var(--text); border-bottom-color: var(--accent); }
main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
main.wide { max-width: 1560px; }
main.wide .pl-dan { flex-wrap: nowrap; white-space: nowrap; }
footer { color: var(--muted); font-size: 12px; text-align: center; padding: 16px; }
h1 { font-size: 20px; margin: 4px 0 2px; }
h2 { font-size: 15px; margin: 22px 0 8px; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.sub { color: var(--muted); margin-bottom: 14px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
input[type=search], select {
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 7px 10px; font: inherit; min-width: 0;
}
input[type=search] { flex: 1 1 220px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 7px 10px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--row-hover); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.song { white-space: normal; min-width: 200px; }
.lv { display: inline-block; min-width: 42px; padding: 1px 6px; border-radius: 4px; background: #2a2f3d; font-weight: 600; text-align: center; }
.lamp { display: inline-block; min-width: 54px; padding: 1px 6px; border-radius: 4px; font-weight: 700; font-size: 12px; text-align: center; color: #111; }
.lamp-1 { background: var(--fc); }
.lamp-2 { background: var(--exhard); }
.lamp-3 { background: var(--hard); }
.lamp-4 { background: var(--clear); }
.lamp-5 { background: var(--easy); }
.lamp-6 { background: var(--failed); color: #fff; }
.pg { color: var(--pg); } .gr { color: var(--gr); } .gd { color: var(--gd); } .bd { color: var(--bd); } .pr { color: var(--pr); }
.rank-1 td:first-child { color: #ffd700; font-weight: 700; }
.rank-2 td:first-child { color: #c0c0c0; font-weight: 700; }
.rank-3 td:first-child { color: #cd7f32; font-weight: 700; }
.grade { font-weight: 700; }
.error { color: var(--pr); }
@media (max-width: 640px) {
  .hide-sm { display: none; }
  th, td { padding: 6px 8px; }
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th.asc::after { content: " ▲"; font-size: 10px; }
th.desc::after { content: " ▼"; font-size: 10px; }
#account { display: flex; align-items: center; gap: 16px; margin-left: auto; }
#account a { color: var(--muted); font-weight: 600; }
#account a:hover, #account a.on { color: var(--text); text-decoration: none; }
.me { display: inline-flex; align-items: center; gap: 6px; }
.av { border-radius: 50%; object-fit: cover; vertical-align: middle; flex: none; }
.av-empty { display: inline-flex; align-items: center; justify-content: center; background: #2a2f3d; color: var(--muted); font-weight: 700; }
.pl { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.head .sub { margin-bottom: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.card h2 { margin-top: 0; color: var(--text); }
.narrow { max-width: 420px; margin: 24px auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 16px; }
.grid .card { margin-bottom: 0; }
.form label { display: block; margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.form input, .row input { display: block; width: 100%; margin-top: 4px; }
input:not([type=file]):not([type=search]) {
  background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 10px; font: inherit;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button {
  background: var(--accent); color: #0b1a22; border: 0; border-radius: 6px; padding: 8px 14px;
  font: inherit; font-weight: 600; cursor: pointer;
}
button:disabled { opacity: .6; cursor: default; }
button.link { background: none; color: var(--accent); padding: 0; font-weight: 400; }
.row { display: flex; gap: 8px; margin-bottom: 12px; }
.row input { margin-top: 0; flex: 1; }
.row button { flex: none; }
details { margin: 4px 0 12px; }
summary { cursor: pointer; color: var(--accent); }
pre { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; white-space: pre-wrap; word-break: break-all; user-select: all; }
code { font-size: 12px; }
.form .error:empty { display: none; }
.error.ok { color: var(--easy); }
.tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); margin: 16px 0; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tabs #logout { margin-left: auto; }
.lampbar { display: flex; height: 14px; min-width: 120px; border-radius: 3px; overflow: hidden; background: #22263200; }
.lampbar span { display: block; }
.lampbar .lamp-1 { background: var(--fc); } .lampbar .lamp-2 { background: var(--exhard); } .lampbar .lamp-3 { background: var(--hard); }
.lampbar .lamp-4 { background: var(--clear); } .lampbar .lamp-5 { background: var(--easy); } .lampbar .lamp-6 { background: var(--failed); } .lampbar .noplay { background: #252a36; }
td.barcell, th.barcell { width: 40%; }
th .lamp { min-width: 0; font-size: 10px; }
.lampbar { cursor: help; }
.lampbar:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.lamp-none { background: #252a36; color: var(--muted); }
.tip { position: absolute; z-index: 10; background: #0b0d12; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; box-shadow: 0 6px 24px #0008; pointer-events: none; min-width: 150px; }
.tip-h { font-weight: 700; margin-bottom: 6px; }
.tip div:not(.tip-h) { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 3px 0; }
.tip b { font-variant-numeric: tabular-nums; }

/* account menu */
.menuwrap { position: relative; }
button.me { display: inline-flex; align-items: center; gap: 8px; background: none; color: var(--text); padding: 2px 4px; font-weight: 600; }
button.me:hover { color: var(--accent); }
.caret { font-size: 10px; color: var(--muted); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; min-width: 170px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 28px #0009; padding: 6px; display: flex; flex-direction: column; }
.menu[hidden] { display: none; }
.menu a, .menu button { display: block; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--text); background: none; font-weight: 400; }
.menu a:hover, .menu button:hover { background: var(--row-hover); text-decoration: none; }
.menu #logout { color: var(--pr); border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; margin-top: 4px; }

/* overview */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.stat-v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-v .muted { font-size: 14px; font-weight: 400; }
.stat-l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.card-h h2 { margin: 0; }
.bio { white-space: pre-wrap; margin: 0; }
textarea { display: block; width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 10px; font: inherit; resize: vertical; }
.row-end { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 8px; }
.row-end .error { margin: 0 auto 0 0; }
.cform { margin-bottom: 16px; }
.comment { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); color: var(--text); }
.comment-b { flex: 1; min-width: 0; }
.comment-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 2px; }
.comment-h a { font-weight: 600; }
.comment-h .muted { font-size: 12px; }
.comment-h .danger { margin-left: auto; font-size: 12px; color: var(--muted); }
.comment-h .danger:hover { color: var(--pr); }
.comment-t { white-space: pre-wrap; overflow-wrap: anywhere; }
.avrow { display: flex; gap: 14px; align-items: flex-start; }
.avrow p { margin-top: 0; }
.small { font-size: 12px; }

/* lamps */
.ltiles { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-bottom: 16px; }
.ltile { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--c, var(--accent)); border-radius: 8px; padding: 10px 12px; }
.ltile-1 { --c: var(--fc); } .ltile-2 { --c: var(--exhard); } .ltile-3 { --c: var(--hard); }
.ltile-4 { --c: var(--clear); } .ltile-5 { --c: var(--easy); } .ltile-6 { --c: var(--failed); } .ltile-c { --c: var(--accent); }
.ltile-v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ltile-v span { font-size: 13px; color: var(--muted); font-weight: 400; }
.ltile-l { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--c); }
.lcard .toggle { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.lrows { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 10px; }
.lrows.hide-empty .lrow-empty { display: none; }
.lrow { display: grid; grid-template-columns: 52px 1fr 120px; align-items: center; gap: 12px; }
.lrow-empty .lv, .lrow-empty .lnum { opacity: .5; }
.lbar { display: flex; height: 22px; border-radius: 5px; overflow: hidden; background: #1f2330; cursor: help; }
.lbar:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #111; min-width: 3px; }
.seg.lamp-6 { background: var(--failed); color: #fff; }
.seg.noplay { background: transparent; }
.lnum { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lnum b { font-size: 15px; }
.lnum .muted { display: inline-block; width: 42px; margin-left: 6px; font-size: 12px; }
@media (max-width: 640px) {
  .ltiles { grid-template-columns: repeat(4, 1fr); }
  .lrow { grid-template-columns: 46px 1fr 88px; gap: 8px; }
  .lnum .muted { display: none; }
  .seg { font-size: 0; }
  .card-h { flex-wrap: wrap; }
  button.me span:not(.caret) { display: none; }
}

/* dan courses (profile overview) */
.dan-badge { display: inline-block; vertical-align: middle; font-size: 0.45em; padding: 2px 8px; margin-left: 6px;
  border-radius: 4px; background: linear-gradient(#ffe066, #e0a800); color: #222; font-weight: 700; letter-spacing: 0.02em; }
.dan-badge-sm { font-size: 11px; padding: 1px 6px; margin-left: 4px; }
.dan-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 4px 0 12px; }
.dan-field { padding: 8px 10px; border: 1px solid rgba(127,127,127,0.25); border-radius: 8px; min-width: 0; }
.dan-set { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.dan-name { font-size: 1.5em; font-weight: 700; color: #ffd91a; overflow-wrap: anywhere; }
.dan-table .dan-group td { font-weight: 700; color: var(--muted); padding-top: 10px; }
.dan-table { width: 100%; border-collapse: collapse; }
.dan-table th, .dan-table td { text-align: left; padding: 4px 6px; border-top: 1px solid rgba(127,127,127,0.2); }
.dan-table .num { text-align: right; }
.dan-clear { color: #4caf50; font-weight: 700; }
.dan-fail { color: #e53935; font-weight: 700; }

/* multiplayer lobby page: rounds on the left, the room chat on the right */
.live { color: #4cd964; font-weight: 600; }
.lobbygrid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.lobbygrid h2:first-child { margin-top: 4px; }
.lobbychat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  max-height: 70vh; overflow-y: auto; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.lobbychat .t { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.lobbychat .note { color: var(--muted); font-style: italic; }
@media (max-width: 800px) { .lobbygrid { grid-template-columns: 1fr; } }

/* best / all plays switch */
.seg-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin: 0 0 12px; }
.seg-switch button { background: none; color: var(--muted); border-radius: 0; padding: 6px 14px; font-weight: 600; }
.seg-switch button.on { background: var(--panel); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
tr.clickable { cursor: pointer; }

/* one play */
.scoredlg { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px;
  width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
.scoredlg::backdrop { background: rgba(0, 0, 0, .6); }
.scoredlg h3 { font-size: 14px; margin: 16px 0 8px; color: var(--muted); }
.dlg-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dlg-t { font-size: 18px; font-weight: 700; }
.dlg-close { font-size: 18px; }
.dlg-sum { margin: 12px 0; font-size: 15px; }
.judges { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.judges .j { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; text-align: center; }
.judges .j b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.judges .j span { font-size: 10px; font-weight: 700; letter-spacing: .05em; color: var(--muted); }
.judges .pg b { color: var(--pg); } .judges .gr b { color: var(--gr); } .judges .gd b { color: var(--gd); }
.judges .bd b { color: var(--bd); } .judges .pr b { color: var(--pr); }
.gauge-graph { display: block; width: 100%; height: 180px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
.gg-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.gg-border { stroke: #ff4466; stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.gg-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.dlg-info { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 14px 0 0; font-size: 13px; }
.dlg-info dt { color: var(--muted); }
.dlg-info dd { margin: 0; word-break: break-word; }
@media (max-width: 600px) { .judges { grid-template-columns: repeat(3, 1fr); } }

/* satellite levels */
.lv-sl { color: #9fd0ff; }
/* stella levels */
.lv-st { color: #d0a8ff; }
/* overjoy levels */
.lv-oj { color: #ff6f9a; }
.lv-dl { color: #7ee0c3; }
.lv-dy { color: #ff0000; }
/* ウーデオシ小学校 and gachimijoy levels */
.lv-ude { color: #ffb35c; }
.lv-gj { color: #5ce1ff; }
.table-switch { margin-right: 8px; }
.lvs { white-space: nowrap; }
.lvs .lv + .lv { margin-left: 4px; }

/* skill progress graph (profile overview) */
#progress .card-h { flex-wrap: wrap; align-items: center; }
#progress .seg-switch { margin: 0; }
.prog-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.prog-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; user-select: none; color: var(--muted); }
.prog-chip input { position: absolute; opacity: 0; pointer-events: none; }
.prog-chip b { color: var(--text); }
.prog-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--c); }
.prog-chip:has(input:checked) { color: var(--text); border-color: var(--c); }
.prog-chip:has(input:checked) .prog-dot { background: var(--c); }
.prog-chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.prog-chip.prog-none { opacity: .45; cursor: default; }
.prog-plot { min-height: 60px; }
.prog-svg { display: block; max-width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
.pg-grid { stroke: var(--line); stroke-width: 1; }
.pg-t { fill: var(--muted); font-size: 11px; }
.pg-end { font-size: 12px; font-weight: 700; }
.pg-dot { stroke: var(--bg); stroke-width: 2; cursor: pointer; }
.pg-dot:hover { r: 6; }
.prog-note { margin: 6px 0 0; }
.gr-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* O2Jam charts: their own level color, a small tag, the BMS / O2Jam switch next to Best / All plays */
.lv-o2 { color: #ffb070; }
.lv-unr { color: #9a9aa8; font-size: 0.85em; letter-spacing: 0.04em; }
.mode-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; background: #3a2a18; color: #ffb070; font-size: 11px; font-weight: 600; vertical-align: middle; }
.switches { display: flex; flex-wrap: wrap; gap: 0 10px; }
.mode-switch button.on { box-shadow: inset 0 -2px 0 #ffb070; }
.o2grade { color: #ffd040; }

/* home page */
.hero { text-align: center; padding: 72px 16px 56px; }
.hero-title { font-size: clamp(36px, 7vw, 64px); font-weight: 800; letter-spacing: -.02em; margin: 0 0 12px; line-height: 1.05; }
.hero-title span { color: var(--accent); font-weight: 500; }
.hero-sub { color: var(--muted); font-size: 16px; max-width: 560px; margin: 0 auto 32px; }
.btn-download {
  display: inline-block; padding: 14px 44px; border-radius: 10px;
  background: linear-gradient(180deg, #7fe1ff, #3fb8e6); color: #06141c;
  font-size: 18px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  box-shadow: 0 8px 30px #66d9ff33, inset 0 1px 0 #ffffff66; transition: transform .15s, box-shadow .15s;
}
.btn-download:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 12px 36px #66d9ff55, inset 0 1px 0 #ffffff66; }
.home-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; max-width: 900px; margin: 0 auto; }
.home-links a { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; color: var(--text); transition: border-color .15s, transform .15s; }
.home-links a:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.home-links b { font-size: 16px; }
.home-links span { color: var(--muted); font-size: 13px; }
@media (max-width: 640px) {
  header { padding: 8px 12px 0; gap: 4px 16px; }
  nav { order: 3; width: 100%; overflow-x: auto; min-height: 44px; }
  nav a { padding: 0 12px; font-size: 15px; }
  .hero { padding: 40px 8px 32px; }
}

/* ============================================================ wariant: Mono (ciemny, bez koloru) */
:root { --bg: #0c0c0c; --panel: #0c0c0c; --line: #222; --text: #ededed; --muted: #7a7a7a; --accent: #ededed; --row-hover: #151515; }
body { font-family: "Inter", system-ui, sans-serif; background: var(--bg); }
a { color: var(--text); } a:hover { text-decoration: underline; text-underline-offset: 3px; }
.pl, td a { color: var(--text); }
header { background: var(--bg); border-bottom: 1px solid var(--line); min-height: 56px; }
.brand { font-size: 15px; font-weight: 600; letter-spacing: 0; }
.brand span { color: var(--muted); font-weight: 400; font-size: 15px; }
nav a { font-size: 15px; font-weight: 500; border-bottom-width: 1px; }
nav a:hover { background: none; }
nav a.on { border-bottom-color: var(--text); }
h1 { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.table-wrap, .card, .stat, .ltile, .lobbychat { background: transparent; border-radius: 0; border: 0; border-top: 1px solid var(--line); }
.table-wrap { border-bottom: 1px solid var(--line); }
th { font-weight: 500; letter-spacing: .02em; text-transform: none; font-size: 12px; }
.lv { background: none; border: 1px solid var(--line); }
.lamp { font-size: 11px; }
button { background: var(--text); color: var(--bg); border-radius: 4px; }
input[type=search], select { background: transparent; border-radius: 4px; }
.seg-switch { border-radius: 4px; } .seg-switch button { background: none; } .seg-switch button.on { background: #1d1d1d; box-shadow: none; }

.hero-keys { display: none; }
.hero { text-align: left; padding: 96px 0 72px; margin: 0; background: none; border: 0; box-shadow: none; }
.hero-kicker { font-size: 13px; margin: 0 0 16px; color: var(--muted); }
.hero-title { margin: 0 0 16px; line-height: 1; }
.hero-sub { margin: 0 0 36px; max-width: 520px; font-size: 17px; text-align: left; }
.home-links { max-width: none; }
.home-links a { transition: border-color .15s; }
.home-links a:hover { text-decoration: none; }

.hero-title { font-size: clamp(44px, 8vw, 84px); font-weight: 600; letter-spacing: -.045em; }
.hero-title span { color: var(--muted); font-weight: 300; }
.btn-download { background: var(--text); color: var(--bg); border-radius: 4px; padding: 14px 32px; font-size: 15px; font-weight: 600; letter-spacing: 0; text-transform: none; box-shadow: none; }
.btn-download:hover { background: #fff; transform: none; box-shadow: none; }
.pack-links { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 8px; margin-top: 16px; }
.pack-label { width: 100%; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 2px; }
.btn-pack { display: inline-flex; gap: 6px; align-items: baseline; padding: 8px 16px; border: 1px solid var(--line); border-radius: 4px;
  color: var(--text); font-size: 14px; font-weight: 600; transition: border-color .15s, background .15s; }
.btn-pack b { color: var(--muted); font-weight: 600; }
.btn-pack:hover { text-decoration: none; border-color: var(--text); background: #ffffff0d; }
.home-links { border-top: 1px solid var(--line); gap: 0; grid-template-columns: repeat(4, 1fr); }
.home-links a { background: none; border: 0; border-radius: 0; padding: 24px 24px 24px 0; }
.home-links a:hover b { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 700px) { .home-links { grid-template-columns: 1fr 1fr; } }

/* profile overview: 8 stats as a clean 4x2 grid, values never wrap */
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 24px; }
.stat { padding: 16px 0 18px; min-width: 0; }
.stat-v { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; } .stat-v { font-size: 17px; } }

/* profile overview: player-arranged sections */
.layout-bar { display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; min-height: 28px; }
.layout-bar .row-end { display: inline-flex; align-items: center; gap: 12px; margin: 0; }
.psec { margin-bottom: 16px; }
.psec > .stats, .psec > .card { margin-bottom: 0; }
.arranging .psec { border: 1px dashed var(--line); padding: 0 12px 12px; }
.psec-tools { display: flex; align-items: center; gap: 16px; padding: 10px 0; font-size: 14px; }
.psec-tools b { margin-right: auto; }
.psec-tools button[disabled] { opacity: .3; cursor: default; }

/* profile Sessions tab */
.sess-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.sess-stats > div { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; min-width: 120px; flex: 1; }
.sess-stats b { display: block; font-size: 1.25em; color: var(--text); }
.sess-stats span { color: var(--muted); font-size: 0.85em; }
details.sess { padding: 12px 16px; }
details.sess > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; color: var(--text); }
details.sess[open] > summary { margin-bottom: 10px; }
.sess-when { font-weight: 600; }
.sess-meta { color: var(--muted); }
.sess-tag { display: inline-block; font-size: 0.75em; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.sess-tag.pb { color: var(--accent); border-color: var(--accent); }
.sess-tag.up { color: #e0a030; border-color: #e0a030; }
details.sess > summary { list-style: none; }
details.sess > summary::-webkit-details-marker { display: none; }
details.sess > summary::before { content: "▸"; color: var(--muted); width: 10px; }
details.sess[open] > summary::before { content: "▾"; }

/* stats inside a card like the other profile sections: no lines between the values */
.stats-card .stats { margin-bottom: 0; gap: 4px 24px; }
.stats-card .stat { border-top: 0; padding: 8px 0 10px; }
.stats-card .stat-v { font-size: 18px; font-weight: 600; }
.stats-card p.small { margin: 8px 0 0; }
.stats-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 640px) { .stats-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rating-tables { align-items: center; }

.gr-line { margin: 2px 0 10px; font-size: 14px; }
.gr-line b { color: #ffd91a; }
/* a player name with its dan badges: one centered row, badges wrap below on narrow cells */
.pl-dan { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; vertical-align: middle; }
.pl-dan .dan-badge, .comment-h .dan-badge, .lobbychat .dan-badge { margin-left: 0; vertical-align: middle; white-space: nowrap; line-height: 1.4; }
.comment-h .dan-badge, .lobbychat .dan-badge { margin-left: 4px; }
.dan-pick { display: flex; flex-wrap: wrap; max-width: 100%; }
.dan-pick button { flex: 1 1 auto; }

/* rating history (profile overview, replaces the skill progress graph) */
.rating-stats { margin-bottom: 8px; }
.rh-line { stroke: var(--accent); stroke-width: 2; }
.rh-area { fill: var(--accent); fill-opacity: .07; stroke: none; }
.rating-svg .pg-dot { fill: var(--accent); }
.rating-svg .pg-end { fill: var(--text); }

/* next clears (profile overview) */
.targets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.targets h3 { font-size: 13px; font-weight: 600; margin: 4px 0 8px; }
.targets .song { white-space: normal; min-width: 140px; }
.up { color: var(--easy); }
.down { color: var(--pr); }
@media (max-width: 900px) { .targets { grid-template-columns: 1fr; } }

/* table grid (Lamps tab): every chart of the table in its lamp color, LR2IR style */
.tgcard .toggle { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.tg-level { display: grid; grid-template-columns: 72px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.tg-h { display: flex; flex-direction: column; gap: 2px; font-variant-numeric: tabular-nums; }
.tg-h .muted { font-size: 12px; }
.tg-cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 3px; }
.tg-cell { display: block; padding: 3px 6px; font-size: 12px; line-height: 1.35; border-radius: 3px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; color: #111 !important; }
.tg-cell:hover { text-decoration: none; outline: 1px solid var(--text); }
.tg-1 { background: var(--fc); } .tg-2 { background: var(--exhard); } .tg-3 { background: var(--hard); }
.tg-4 { background: var(--clear); } .tg-5 { background: var(--easy); }
.tg-6 { background: var(--failed); color: #fff !important; }
.tg-none { background: #1b1b1b; color: var(--muted) !important; }
.tg-open .tg-1, .tg-open .tg-2, .tg-open .tg-3, .tg-open .tg-4, .tg-open .tg-5, .tg-open .tg-done { display: none; }
@media (max-width: 640px) {
  .tg-level { grid-template-columns: 1fr; gap: 6px; }
  .tg-h { flex-direction: row; gap: 8px; align-items: baseline; }
  .tg-cells { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* rivals (profile tab) */
.rival-h { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; font-size: 15px; }
.rival-h select { min-width: 140px; }
.rival-stats { margin-bottom: 12px; }

/* activity feed (home page) */
.home-feed { margin-top: 32px; }
.home-feed .card-h { flex-wrap: wrap; align-items: center; }
.home-feed .seg-switch { margin: 0; }
.feed { list-style: none; margin: 0 0 10px; padding: 0; }
.feed li { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); align-items: baseline; }
.feed li[data-score] { cursor: pointer; }
.feed li:hover { background: var(--row-hover); }
.feed-when { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.feed-what { min-width: 0; overflow-wrap: anywhere; }
.feed-what .pl-dan, .feed-what .pl { margin-right: 2px; }
.feed .dj { color: var(--gr); }
@media (max-width: 640px) { .feed li { grid-template-columns: 1fr; gap: 2px; } }
/* the profile tabs scroll sideways on phones (five tabs with Rivals) */
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs a { white-space: nowrap; }

/* Calc page: every chart's Easy / Hard rating against its folder average */
.calc-switches { gap: 0 10px; }
.dev-up { color: #ff9a5c; }
.dev-down { color: #6cb8ff; }
td.dev { font-variant-numeric: tabular-nums; }
.dev-bar { position: relative; display: inline-block; width: 56px; height: 8px; margin-right: 8px; vertical-align: middle; background: #ffffff0d; border-radius: 2px; }
.dev-bar::before { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--line); }
.dev-bar i { position: absolute; top: 0; bottom: 0; background: currentColor; border-radius: 2px; opacity: .85; }
td.calc-key { font-weight: 700; }
.calc-sum { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0 0 12px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.calc-sum div { display: flex; flex-direction: column; }
.calc-sum b { font-size: 18px; font-variant-numeric: tabular-nums; }
.calc-sum span { font-size: 12px; }
.show-all { margin: 12px auto; display: block; }
@media (max-width: 640px) { .dev-bar { width: 32px; margin-right: 4px; } }
@media (max-width: 640px) { .calc-switches .seg-switch button { padding: 6px 9px; font-size: 13px; } }

/* lane order of a RANDOM play: dotted label, keys popup on hover */
.lane-ran { border-bottom: 1px dotted var(--muted); cursor: help; outline: none; }
.lane-ran:hover, .lane-ran:focus-visible { color: var(--accent); border-bottom-color: var(--accent); }
.lane-pop {
  position: fixed; z-index: 100; display: none; pointer-events: none;
  padding: 8px 10px 6px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .45);
}
.lane-pop-keys { display: flex; gap: 3px; align-items: flex-start; }
.lane-key {
  width: 22px; height: 30px; border-radius: 3px;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 3px;
  font: 700 13px/1 system-ui, sans-serif; font-variant-numeric: tabular-nums;
}
.lane-key.white { background: #e9ecf3; color: #12151c; }
.lane-key.blue { background: #2f6fe0; color: #fff; }
.lane-key.low { height: 24px; }
.lane-pop-label { margin-top: 5px; text-align: center; color: var(--muted); font-size: 12px; letter-spacing: .18em; }

/* Charts page: the tables compared (folders placed by median clear rating) */
#compare .card-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#compare .seg-switch { margin: 0; }
#compare .card-h h2 { margin-right: auto; }
.cmp-wrap { overflow-x: auto; margin: 6px 0 4px; }
.cmp { display: block; width: 100%; min-width: 720px; height: auto; }
.cmp-grid { stroke: var(--line); stroke-width: 1; }
.cmp-grid-5 { stroke: #3a4152; }
.cmp-tick { fill: var(--muted); font-size: 12px; text-anchor: middle; }
.cmp-guide { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.cmp-base { stroke: var(--c); stroke-opacity: .25; stroke-width: 1; }
.cmp-name { fill: var(--c); font-size: 14px; font-weight: 700; text-anchor: end; }
.cmp-dot { cursor: pointer; outline: none; }
.cmp-dot circle { fill: var(--c); stroke: var(--panel); stroke-width: 2; }
.cmp-dot text { fill: var(--text); font-size: 12px; font-weight: 600; text-anchor: middle; }
.cmp-iqr { stroke: var(--c); stroke-width: 6; stroke-opacity: 0; stroke-linecap: round; }
.cmp-dot:hover .cmp-iqr, .cmp-dot:focus .cmp-iqr { stroke-opacity: .35; }
.cmp-dot:hover circle, .cmp-dot:focus circle { r: 7.5; }
.ch-table { flex-wrap: wrap; }

/* rivals: bell in the header, + Add rival on profiles, #/rivals page */
#account a.bell { position: relative; display: inline-flex; align-items: center; color: var(--muted); padding: 4px; }
#account a.bell:hover, #account a.bell.has { color: var(--text); }
.bell-n { position: absolute; top: -4px; right: -8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--pr); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.head .rival-btn { margin-left: auto; align-self: center; white-space: nowrap; }
.rival-btn.on { background: none; color: var(--accent); border: 1px solid var(--accent); }
.rival-btn.on:hover { color: var(--pr); border-color: var(--pr); }
.rival-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 16px; }
.rival-add input { min-width: 0; flex: 0 1 240px; }
.rival-act { white-space: nowrap; }
.rival-act .link { margin-left: 10px; color: var(--pr); }
.rival-new { display: inline-block; font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 3px; background: var(--pr); color: #fff; vertical-align: middle; }
tr.rival-fresh td { background: rgba(255, 64, 64, .07); }

/* home: title on the left, the release's changelog on the right */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 48px; align-items: start; }
.hero-changelog { border-left: 1px solid var(--line); padding-left: 32px; font-size: 14px; line-height: 1.5; }
.hero-changelog h2 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.hero-changelog h2 a { color: var(--muted); }
.hero-changelog h2 a:hover { color: var(--text); text-decoration: none; }
.hero-changelog h3 { margin: 14px 0 4px; font-size: 14px; font-weight: 600; color: var(--text); }
.hero-changelog ul { margin: 0; padding-left: 18px; color: var(--muted); }
.hero-changelog li { margin: 2px 0; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 32px; }
  .hero-changelog { border-left: 0; border-top: 1px solid var(--line); padding: 24px 0 0; }
}

/* search: magnifier in the header next to the bell, a drop-down with players and charts */
#srch { position: relative; margin-left: auto; margin-right: -12px; display: flex; align-items: center; }
#srch + #account { margin-left: 0; }
.srch-btn { display: inline-flex; align-items: center; background: none; color: var(--muted); padding: 4px; border-radius: 6px; }
.srch-btn:hover, .srch-btn[aria-expanded="true"] { color: var(--text); background: none; }
.srch-panel { position: absolute; right: 0; top: calc(100% + 14px); z-index: 25; width: min(440px, calc(100vw - 32px));
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 28px #0009; padding: 8px; }
.srch-panel input { width: 100%; font-size: 15px; padding: 9px 10px; }
.srch-res { max-height: min(60vh, 520px); overflow-y: auto; margin-top: 6px; }
.srch-h { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 8px 4px; }
.srch-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; color: var(--text); min-width: 0; }
.srch-row:hover, .srch-row.sel { background: var(--row-hover); text-decoration: none; }
.srch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.srch-lv { flex: none; font-size: 12px; white-space: nowrap; }
.srch-n { margin-left: auto; flex: none; padding-left: 8px; }
.srch-hint { padding: 6px 8px; margin: 0; }
.srch-hint kbd { border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font: inherit; color: var(--text); }
@media (max-width: 640px) {
  #srch { position: static; }
  .srch-panel { position: absolute; left: 16px; right: 16px; top: calc(100% + 4px); width: auto; }
}

/* dan course rows open the course gauge graph of the best attempt */
.dan-table tr.dan-row { cursor: pointer; }
.dan-table tr.dan-row:hover td, .dan-table tr.dan-row:focus-visible td { background: rgba(127,127,127,0.08); }
.dan-table tr.dan-row:focus-visible { outline: 2px solid var(--line); outline-offset: -2px; }
.dan-table tr.dan-detail > td { padding: 8px 6px 12px; border-top: 0; }
.dan-table tr.dan-detail .gauge-graph { height: 140px; }
.gg-sep { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }

/* player flags (app.js flag()): emoji flags drawn with the bundled Twemoji Country Flags font
   (MIT / CC-BY 4.0, see TwemojiCountryFlags.LICENSE.md), the font only covers flag characters */
@font-face {
  font-family: "Twemoji Country Flags";
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E007F;
  src: url("/TwemojiCountryFlags.woff2") format("woff2");
  font-display: swap;
}
.flag { font-family: "Twemoji Country Flags", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 1.05em; line-height: 1; vertical-align: middle; cursor: default; }
h1 .flag { margin-left: 10px; }
.comment-h .flag, .lobbychat .flag { margin-left: 4px; }
.srch-row .flag { margin-left: -2px; }
.country-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.country-row .flag { font-size: 22px; }
.country-row select { flex: 1 1 180px; min-width: 0; }

/* profile card (app.js profileCardSection, src/card.js) */
.pcard-pics { display: grid; grid-template-columns: 3fr 2fr; gap: 12px; align-items: start; margin-bottom: 12px; }
.pcard-img { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); }
.pcard-rows { display: grid; gap: 6px; }
.pcard-row { display: grid; grid-template-columns: 230px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.pcard-row label { font-weight: 600; font-size: 13px; }
.pcard-row label .small { display: block; font-weight: 400; }
.pcard-row input { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.pcard-row button { padding: 6px 12px; }
@media (max-width: 720px) {
  .pcard-pics { grid-template-columns: 1fr; }
  .pcard-row { grid-template-columns: minmax(0, 1fr) auto; }
  .pcard-row label { grid-column: 1 / -1; }
}

/* Skillsets card on the profile (rating per skillset) */
.sk-rows { display: grid; gap: 6px; margin: 4px 0 10px; }
.sk-row { display: grid; grid-template-columns: 110px 1fr 72px 52px 80px; align-items: center; gap: 10px; }
.sk-all { padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.sk-name { font-weight: 600; }
.sk-bar { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.sk-bar span { display: block; height: 100%; border-radius: 5px; opacity: .8; }
.sk-v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gr); }
.sk-lin, .sk-n { text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; }
@media (max-width: 600px) { .sk-row { grid-template-columns: 90px 1fr 64px 64px; } .sk-lin { display: none; } }

/* profile overview tidy-up: table chips folded into a "Tables" button, explanations folded away */
#psecs .card-h { align-items: center; margin-bottom: 12px; }
#psecs > .psec:first-child > .card { border-top: 0; padding-top: 4px; }
.tpick { position: relative; flex: none; }
.tpick > summary { list-style: none; cursor: pointer; user-select: none; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; }
.tpick > summary::-webkit-details-marker { display: none; }
.tpick > summary::after { content: " ▾"; color: var(--muted); }
.tpick[open] > summary, .tpick > summary:hover { border-color: var(--text); }
.tpick-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: max-content; max-width: min(440px, 88vw); margin: 0; padding: 10px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.card-note { margin-top: 12px; }
.card-note > summary { cursor: pointer; color: var(--muted); font-size: 12px; width: max-content; }
.card-note > summary:hover { color: var(--text); }
.card-note p { margin: 6px 0 0; max-width: 760px; }
.rating-stats { margin: 0 0 12px; }
.rating-stats .stat { border-top: 0; padding: 4px 0 6px; }
.rating-stats .stat-v { font-size: 18px; font-weight: 600; }

/* profile overview redesign: the sections as panels on a grid. Wide sections take the whole row, the
   smaller ones pair up (grid-auto-flow dense keeps the player's own order as far as it fits) */
#psecs { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 16px; }
#psecs .psec { grid-column: span 12; margin: 0; min-width: 0; display: flex; flex-direction: column; }
#psecs .psec > .card { flex: 1; }
@media (min-width: 900px) {
  #psecs .psec[data-sec="progress"] { grid-column: span 8; }
  #psecs .psec[data-sec="skills"] { grid-column: span 4; }
  #psecs .psec[data-sec="dan"], #psecs .psec[data-sec="about"] { grid-column: span 6; }
  /* Skillsets in its narrow column: name, bar and ★ (linear value and chart count are in the hover) */
  #psecs .psec[data-sec="skills"] .sk-row { grid-template-columns: 92px 1fr 58px; gap: 8px; }
  #psecs .psec[data-sec="skills"] .sk-lin, #psecs .psec[data-sec="skills"] .sk-n { display: none; }
  #psecs .psec[data-sec="progress"] .rating-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 16px; }
}
#psecs .card, #psecs > .psec:first-child > .card { background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.01));
  border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin: 0; }
#psecs .card h2 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 14px; }
#psecs .card-h h2 { margin: 0; }
#psecs .card-h { margin-bottom: 14px; min-height: 28px; }
#psecs .sk-rows { gap: 9px; }
#psecs .sk-bar { height: 8px; }
#psecs .rating-stats .stat:first-child .stat-v { color: var(--gr); }
.stats-card .stat-v .stat-bar { display: block; height: 3px; margin-top: 8px; background: var(--line); border-radius: 2px; overflow: hidden; }
.stats-card .stat-v .stat-bar > span { display: block; height: 100%; background: var(--c); opacity: .85; }
.arranging#psecs .psec { border-radius: 12px; }
#psecs .card-h { margin: -5px 0 9px; }
#psecs .rating-stats .stat-v > .muted.small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 2px; }

/* the whole site gets the profile Overview look: sections as rounded panels, small caps headings
   (was main only; main covers every page) */
main .card, main .table-wrap, main .ltiles { background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.01));
  border: 1px solid var(--line); border-radius: 12px; }
main .card { padding: 18px 20px; margin: 0 0 16px; }
main .card h2 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 14px; }
main .card-h { align-items: center; gap: 12px; margin: -5px 0 9px; min-height: 28px; }
main .card-h h2 { margin: 0 auto 0 0; }
main .card .stat { border-top: 0; padding: 4px 0 8px; }
main .card .stats { margin-bottom: 0; }
main .table-wrap { margin-bottom: 16px; }
main .card .table-wrap { background: none; border: 0; border-radius: 0; border-top: 1px solid var(--line); margin-bottom: 0; }
main .switches { margin-bottom: 4px; }
/* Lamps: the seven counts in one panel, each with a line in its lamp colour */
main .ltiles { padding: 14px 20px; gap: 12px 20px; margin-bottom: 16px; }
main .ltile { background: none; border: 0; border-radius: 0; border-left: 3px solid var(--c, var(--accent)); padding: 2px 0 2px 12px; }
/* Sessions: one panel per session */
main details.sess { padding: 14px 20px; margin-bottom: 10px; }
main details.sess > summary { cursor: pointer; }
/* Rivals: who vs who and the four numbers in one panel */
main .rival-top .rival-h { margin-bottom: 6px; }
main .lobbychat, main .calc-sum { background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.01)); border: 1px solid var(--line); border-radius: 12px; }
main .calc-sum { padding: 14px 20px; }
/* page titles with their controls on one row (Players) */
.page-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.page-h h1 { margin: 0; }
main > .card-note { margin: -4px 0 0; }

/* Changelog page: one panel per version, newest first */
.cl-page { max-width: 820px; }
main .cl-ver h2 { font-size: 18px; letter-spacing: 0; text-transform: none; color: var(--text); font-variant-numeric: tabular-nums; }
.cl-latest { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--bg); background: var(--text);
  border-radius: 4px; padding: 2px 6px; margin-left: 8px; vertical-align: middle; }
.cl-ver .card-h a { color: var(--muted); }
.cl-body { font-size: 14px; line-height: 1.55; }
.cl-body h3 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 0 4px; }
.cl-body h3:first-child { margin-top: 0; }
.cl-body ul { margin: 0; padding-left: 18px; }
.cl-body li + li { margin-top: 3px; }
.hero-changelog-all { margin: 12px 0 0; font-size: 13px; }
.hero-changelog-all a { color: var(--muted); }
.hero-changelog-all a:hover { color: var(--text); }
