/* Your stats and the game library. */
body.statspage { min-height: 100vh; }
.sbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; background: rgba(18, 13, 10, .94); border-bottom: 1px solid var(--line);
}
.sbar .brandlink { font-size: 1.4rem; color: var(--brass-2); text-decoration: none; }
.stabs { display: flex; gap: 6px; }
.stabs button { min-height: 38px; padding: 6px 14px; background: transparent; border: 1px solid var(--line); color: var(--ivory-2); }
.stabs button.on { background: var(--brass); color: var(--wood-0); border-color: var(--brass); }

.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
.swrap { max-width: 1100px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: rgba(42, 30, 23, .85); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.tile b { display: block; font-family: var(--serif); font-size: 2.4rem; line-height: 1; color: var(--brass-2); }
.tile span { display: block; margin-top: 6px; font-size: .85rem; color: var(--ivory-2); }

.achs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.ach { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(201, 162, 39, .14); opacity: .62; }
.ach.earned { opacity: 1; border-color: var(--brass); background: rgba(201, 162, 39, .1); }
.ach .medal { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 1rem;
  border: 2px solid var(--muted); color: var(--muted); }
.ach.earned .medal { border-color: var(--brass-2); color: var(--wood-0); background: var(--brass-2); }
.ach .aname { font-weight: 700; }
.ach .atext { font-size: .82rem; color: var(--ivory-2); }
.ach .bar { margin-top: 6px; height: 5px; border-radius: 3px; background: rgba(239, 230, 210, .12); overflow: hidden; }
.ach .bar i { display: block; height: 100%; background: var(--brass); }

.scrollx { overflow-x: auto; }
table.stats { width: 100%; }
table.stats td.num, table.stats th.num { text-align: right; font-variant-numeric: tabular-nums; }

#recent li { flex-direction: column; align-items: stretch; gap: 6px; }
.rhead { display: flex; gap: 10px; align-items: baseline; }
.rhead b { font-family: var(--serif); font-size: 1.2rem; color: var(--brass-2); }
.seats { display: flex; flex-wrap: wrap; gap: 6px; }
.seat { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid rgba(201, 162, 39, .18); font-size: .88rem; }
.seat.me { border-color: var(--brass-2); background: rgba(227, 194, 90, .12); }
.seat .dot { width: 10px; height: 10px; }
.seat.won::before { content: "♛"; color: var(--brass-2); }

.libgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.game { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(29, 58, 48, .35); }
.game h3 { margin: 0; }
.game .grecord { font-size: .85rem; color: var(--ivory-2); }
.game .btn { align-self: flex-start; }

/* Achievements: grouped by category, a medal coloured by tier. */
.achtiers { display: flex; flex-wrap: wrap; gap: 8px; }
.achtiers span { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--ivory-2); }
.achtiers i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.achtools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.achtools .stabs { flex-wrap: wrap; }
.achtools select { width: auto; min-height: 38px; padding: 6px 10px; }
.achgroups { display: flex; flex-direction: column; gap: 14px; }
.achgroup h3 { margin: 0 0 8px; display: flex; gap: 10px; align-items: baseline; }
.achgroup h3 small { font-family: var(--sans, inherit); font-size: .8rem; color: var(--ivory-2); font-weight: 400; }
.t-bronze { --medal: #c08a5a; } .t-silver { --medal: #c9ccd2; } .t-gold { --medal: #e3c25a; } .t-platinum { --medal: #9fd6e0; }
.achtiers i { background: var(--medal); }
.ach.earned .medal { border-color: var(--medal); background: var(--medal); color: var(--wood-0); }
.ach .medal { border-color: color-mix(in srgb, var(--medal) 55%, transparent); color: var(--medal); }
.ach .tiername { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--medal); }
.ach.secret .aname { letter-spacing: .2em; }

/* ---------- Skeeple's stats page ---------- */
.sbar { flex-direction: column; align-items: stretch; gap: 8px; }
.sbar-top { display: flex; align-items: center; gap: 10px; }
.tabsx { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; padding-bottom: 2px; }
.tabsx::-webkit-scrollbar { display: none; }
.tabsx button { flex: none; white-space: nowrap; }
.filters { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding-bottom: 0; }
.filters select { width: auto; min-height: 38px; padding: 6px 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { min-height: 34px; padding: 5px 12px; border-radius: 999px; font-size: .85rem; background: transparent; color: var(--ivory-2); }
.chips button.on { background: var(--ivory); color: var(--wood-0); border-color: var(--ivory); }
.dates { display: flex; gap: 8px; flex-wrap: wrap; font-size: .85rem; color: var(--ivory-2); }
.dates input { width: auto; min-height: 34px; padding: 4px 8px; }
#view { padding-top: 12px; }
.scard { min-width: 0; }
.chead h2 { margin: 0; }
.tile small { display: block; margin-top: 4px; font-size: .75rem; }
.tile b { overflow-wrap: anywhere; }
.backto { color: var(--ivory-2); text-decoration: none; font-weight: 600; font-size: .9rem; padding: 4px 0; }
.good { color: var(--good); } .bad { color: var(--danger); }

.kv { display: flex; flex-direction: column; }
.kvrow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(201, 162, 39, .12); color: inherit; text-decoration: none; font-size: .92rem; }
.kvrow > span { flex: 1; min-width: 0; color: var(--ivory-2); }
.kvrow > span small { display: block; font-size: .75rem; }
.kvrow > b { text-align: right; font-variant-numeric: tabular-nums; }
.kvrow > i, .lrow > i { color: var(--muted); font-style: normal; }
.kvrow.col { flex-direction: column; align-items: stretch; gap: 2px; }
.meline { color: var(--brass-2); }
.meline > span { color: var(--brass-2); }

.lrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(201, 162, 39, .12); color: inherit; text-decoration: none; }
.lrow .grow { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lrow .grow small { line-height: 1.4; }
.lrow .rate { min-width: 64px; text-align: right; display: flex; flex-direction: column; gap: 4px; font-variant-numeric: tabular-nums; }
.lrow.pick { cursor: pointer; }
.lrow.pick input { width: 20px; height: 20px; min-height: 0; flex: none; }
.meter { display: block; width: 90px; max-width: 100%; height: 6px; border-radius: 3px; background: rgba(239, 230, 210, .1); overflow: hidden; }
.rate .meter { width: 100%; }
.meter i { display: block; height: 100%; background: var(--brass); border-radius: 3px; }
.lvl { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 800; color: #fff; background: var(--lv); vertical-align: middle; }

.form { display: flex; flex-wrap: wrap; gap: 6px; }
.form a { width: 36px; height: 36px; border-radius: 9px; display: inline-grid; place-items: center; font-weight: 800; text-decoration: none;
  color: var(--ivory-2); background: rgba(239, 230, 210, .06); border: 1px solid rgba(201, 162, 39, .2); }
.form a.w { color: var(--wood-0); background: linear-gradient(180deg, var(--brass-2), var(--brass)); border-color: transparent; }

.split { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; margin-top: 4px; width: 100%; }
.split i, .legend i.above, .legend i.below { display: block; height: 100%; }
.split .above, .legend .above { background: var(--brass); }
.split .below, .legend .below { background: #9887ef; }
.split .level { background: rgba(239, 230, 210, .2); }
.bigvs { text-align: center; display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.bigvs b { font-size: 2.6rem; font-variant-numeric: tabular-nums; line-height: 1; }

.ranked { display: flex; flex-direction: column; gap: 6px; }
.rrow { display: grid; grid-template-columns: minmax(70px, 30%) 1fr auto; gap: 10px; align-items: center; color: inherit; text-decoration: none; font-size: .9rem; }
.rname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rbar { height: 12px; }
.rbar i { display: block; height: 100%; background: var(--brass); border-radius: 0 4px 4px 0; min-width: 2px; }

/* Charts: thin marks, a faint grid, a tooltip on every mark. */
.chart { position: relative; }
.plot { position: relative; }
.plot svg.viz { width: 100%; height: 100%; display: block; overflow: visible; }
.viz .grid { stroke: rgba(239, 230, 210, .09); stroke-width: 1; vector-effect: non-scaling-stroke; }
.viz .axis, svg .axis { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.viz .hit:hover path { filter: brightness(1.2); }
.dots { position: absolute; inset: 0; pointer-events: none; }
.dots i { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; box-shadow: 0 0 0 2px var(--wood-2); }
.vizscale { display: flex; justify-content: space-between; margin-top: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: .82rem; color: var(--ivory-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 12px; height: 8px; border-radius: 2px; }
.viztip { position: fixed; z-index: 60; pointer-events: none; max-width: 260px; padding: 6px 10px; border-radius: 8px; font-size: .8rem;
  background: var(--ivory); color: var(--wood-0); box-shadow: var(--shadow); }
.donut { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.donut svg { width: 140px; height: 140px; flex: none; }
.donut path { stroke: var(--wood-2); stroke-width: 1; }
.dcentre { fill: var(--ivory); font: 700 18px var(--sans); }
.dlist { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 6px; }
.dlist li { display: flex; gap: 8px; align-items: center; font-size: .9rem; }
.dlist i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.dlist b { font-variant-numeric: tabular-nums; }
svg.heat { display: block; width: 100%; height: auto; }
.heatyears { margin-bottom: 6px; }

.group { padding: 12px 0; border-bottom: 1px solid rgba(201, 162, 39, .12); display: flex; flex-direction: column; gap: 6px; }
.group h3 { margin: 0; }
.group p { margin: 0; }
.row.wrap { flex-wrap: wrap; }
button.danger { color: var(--danger); }
.linkbtn { background: none; border: none; min-height: 0; padding: 4px 0; color: var(--muted); text-decoration: underline; }
.levels summary { cursor: pointer; color: var(--ivory-2); font-size: .9rem; margin-top: 8px; }
.levels[open] { padding: 10px 12px; border-radius: 12px; background: rgba(239, 230, 210, .05); }
.seatrow { padding: 10px 0; border-bottom: 1px solid rgba(201, 162, 39, .12); display: flex; flex-direction: column; gap: 3px; }
.seatrow .rk { width: 28px; font-weight: 800; color: var(--muted); }
.seatrow .score { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.seatrow > small { margin-left: 38px; }
.seatrow .dot, .seat .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
table.sheet td.best { font-weight: 800; color: var(--brass-2); }
#recent .rhead { color: inherit; text-decoration: none; }
@media (max-width: 520px) {
  .lrow .meter { width: 50px; }
  .tile b { font-size: 1.9rem; }
}
.plays li { flex-direction: column; align-items: stretch; gap: 6px; }
.plays .rhead { color: inherit; text-decoration: none; }
.sbar { max-width: 100vw; } .sbar > * { min-width: 0; max-width: 100%; }
.xaxis { position: relative; height: 16px; font-size: 11px; color: var(--muted); }
.xaxis span { position: absolute; top: 2px; transform: translateX(-50%); white-space: nowrap; }
.dlist { max-width: 420px; }
svg.heat .axis { font-size: 8px; }
.group .row { justify-content: flex-start; }
