:root {
  color-scheme: dark;
  --background: #14171c;
  --panel: #1c2027;
  --panel-hover: #232833;
  --sidebar: #13161b;
  --edge: #3d444f;
  --ink: #f2f2f4;
  --muted: #aeb6c3;
  --lime: #cdeb86;
  --lavender: #b9a3f8;
  --amber: #edbc74;
  --unknown: #829caf;
  font: 100%/1.45 system-ui, sans-serif;
  background: var(--background);
  color: var(--ink);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-height: 100vh; margin: 0; display: grid; grid-template-columns: 15rem minmax(0, 1fr); }
main { width: 100%; max-width: 100rem; padding: 1.65rem 2rem 2.5rem; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
button, select, .button { font: inherit; color: inherit; background: transparent; border: 1px solid var(--edge); border-radius: .45rem; }
button, .button { padding: .52rem .85rem; cursor: pointer; }
button:hover, .button:hover, select:hover { background: var(--panel-hover); }
button:disabled { opacity: .58; cursor: wait; }
button.primary { border-color: var(--lime); color: #172110; background: var(--lime); font-weight: 650; }
button.primary:hover { background: #e2f4bc; }
h1, h2, p, dl, dd { margin: 0; }
h1 { font-size: clamp(2rem, 3vw, 2.8rem); font-weight: 720; letter-spacing: -.035em; line-height: 1.15; overflow-wrap: anywhere; }
h2 { font-size: 1.32rem; font-weight: 680; letter-spacing: -.022em; }
.muted { color: var(--muted); }
.numeric, .kpis dd, .distribution dd, time { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; background: var(--sidebar); border-right: 1px solid var(--edge); }
.brand { font-size: 1.2rem; font-weight: 710; letter-spacing: -.025em; }
.sidebar .brand { padding: 1.3rem 1.3rem 1.15rem; margin-bottom: 1rem; border-bottom: 1px solid var(--edge); }
.sidebar nav { display: flex; flex-direction: column; gap: .12rem; }
.sidebar nav a, .access-link { display: flex; align-items: center; gap: .85rem; padding: .82rem 1.2rem; border-left: 3px solid transparent; white-space: nowrap; }
.sidebar a[aria-current] { border-left-color: var(--lime); background: #2d3428; }
.sidebar nav a:hover, .access-link:hover { background: var(--panel-hover); }
.access-link { margin-top: auto; border-top: 1px solid var(--edge); padding-block: 1rem; }
.nav-icon { display: inline-block; width: 1rem; height: 1rem; flex: none; color: var(--muted); }
.overview-icon { background: linear-gradient(currentColor, currentColor) 0 bottom / 3px 44% no-repeat,
    linear-gradient(currentColor, currentColor) center bottom / 3px 78% no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 3px 100% no-repeat; }
.game-icon { border: 1.5px solid currentColor; border-radius: .27rem; width: .86rem; height: .86rem; margin-inline: .07rem; }
.game-icon.purring-sun { border-radius: 50%; }
.game-icon.orbcore-386 { border-radius: .12rem; box-shadow: inset 0 0 0 2px var(--sidebar), inset 0 0 0 3px currentColor; }
.access-icon { border: 1.5px solid currentColor; border-radius: 50%; position: relative; }
.access-icon::after { content: ''; position: absolute; inset: .27rem; border: 1px solid currentColor; border-radius: 50%; }

.page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.4rem; }
.filters { display: flex; flex-wrap: wrap; gap: .65rem; }
.select-control { position: relative; display: inline-flex; min-width: 8rem; }
.select-control::after { content: ''; pointer-events: none; width: .39rem; height: .39rem; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(45deg); position: absolute; right: .9rem; top: calc(50% - .32rem); }
select { appearance: none; width: 100%; cursor: pointer; padding: .62rem 2rem .62rem .78rem; }
select option { background: var(--panel); }
.game-filters .filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 1.5rem; }
.game-filters .select-control { min-width: 0; }

.panel { background: var(--panel); border: 1px solid var(--edge); border-radius: .58rem; }
.kpis { display: grid; margin: 0 0 1.4rem; }
.kpis.grouped { grid-template-columns: repeat(3, 1fr); padding: 1rem 0; }
.kpis.grouped > div { padding: 0 1.24rem; }
.kpis.grouped > div + div { border-left: 1px solid var(--edge); }
.kpis.cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; }
.kpis.cards > div { padding: 1rem 1.2rem .85rem; }
.kpis dt { color: var(--muted); font-weight: 540; }
.kpis dd { font-size: clamp(1.6rem, 3.4vw, 2.9rem); font-weight: 700; line-height: 1.22; margin-top: .32rem; letter-spacing: -.03em; white-space: nowrap; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .6rem 1.15rem; padding: .9rem 1.15rem; }
.panel-heading + .table-wrap { border-top: 1px solid var(--edge); }
.trend { margin-bottom: 1.4rem; position: relative; }
.legend { padding: 0; margin: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .45rem 1rem; font-size: .875rem; }
.legend li { display: inline-flex; align-items: center; gap: .45rem; }
.swatch { width: .75rem; height: .75rem; flex: none; border-radius: .2rem; background: var(--unknown); }
.swatch.signarchy { background: var(--lime); }
.swatch.purring-sun, .swatch.complete { background: var(--lavender); }
.swatch.orbcore-386 { background: #85c9dd; }
.swatch.exit { background: var(--amber); }
.trend-chart { display: block; width: calc(100% - 2.3rem); height: clamp(12.5rem, 25vw, 18.5rem); margin: 0 1.15rem .9rem; }
.chart-tooltip { position: absolute; top: 3.5rem; right: 1.4rem; z-index: 1; pointer-events: none; font-size: .88rem; border: 1px solid var(--edge); padding: .4rem .6rem; border-radius: .3rem; background: var(--background); }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { padding: .62rem 1.15rem; }
thead { color: var(--muted); font-size: .875rem; }
thead tr, tbody tr:not(:last-child) { border-bottom: 1px solid var(--edge); }
th { font-weight: 550; }
tbody th { font-weight: 620; }
.linked-row { cursor: pointer; }
.linked-row:hover, .linked-row.selected { background: var(--panel-hover); }
.linked-row th a { display: inline-block; }
.row-end { position: relative; padding-right: 2.1rem; }
.row-end::after { content: ''; width: .42rem; height: .42rem; border-top: 1px solid var(--muted); border-right: 1px solid var(--muted); transform: rotate(45deg); position: absolute; right: 1.05rem; top: calc(50% - .21rem); }
.empty-state { padding: 1.55rem 1.15rem; color: var(--muted); border-top: 1px solid var(--edge); }
.tabs { display: flex; gap: 1.75rem; border-bottom: 1px solid var(--edge); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs a { white-space: nowrap; padding: .24rem .3rem .7rem; border-bottom: 2px solid transparent; color: var(--muted); }
.tabs a[aria-current] { border-bottom-color: var(--lavender); color: var(--ink); font-weight: 670; }
.levels-table th:nth-child(2) { width: 55%; }
.levels-table :is(th, td) { padding-block: .76rem; }
.level-zone { display: block; font-size: .82rem; color: var(--muted); }
.outcome-bar { display: block; height: 1.37rem; width: 100%; min-width: 5.7rem; border-radius: .29rem; }
.supporting { margin-top: 1.2rem; }
.distribution { display: flex; gap: 1.6rem; flex-wrap: wrap; padding: .8rem 1.15rem 1.2rem; border-top: 1px solid var(--edge); }
.distribution dt { color: var(--muted); }
.distribution dd { font-size: 1.4rem; font-weight: 675; }
.attempt { border-top: 1px solid var(--edge); padding: .6rem 1.15rem; }
.attempt summary { cursor: pointer; }
.attempt summary span { display: inline-block; margin-inline: .35rem .6rem; }
.attempt-outcome.complete { color: var(--lavender); }
.attempt-outcome.exit { color: var(--amber); }
.attempt-outcome.unknown { color: var(--unknown); }
.timeline { list-style: none; margin: .7rem 0 .35rem; padding-left: 1rem; }
.timeline li { display: grid; grid-template-columns: 4.2rem 1fr; gap: .55rem; padding: .18rem 0; }
.timeline time { color: var(--muted); }

.signed-out { display: grid; place-items: center; }
.signed-out main { max-width: 32rem; }
.login, .error-panel { padding: 2rem; }
.login h1 { font-size: 2rem; margin: 1.2rem 0 1.45rem; }
.login .brand { color: var(--muted); }
.status { color: var(--amber); margin-top: .9rem; }
.status.padded { padding: 0 1.15rem .8rem; }
.error-panel p, .error-panel .button { margin-top: 1rem; }
.error-panel .button { display: inline-block; }

@media (max-width: 71rem) {
  body { grid-template-columns: 12rem minmax(0, 1fr); }
  main { padding-inline: 1.35rem; }
  .kpis.cards > div { padding-inline: .85rem; }
}
@media (max-width: 52rem) {
  body { display: block; }
  .sidebar { position: static; display: grid; grid-template-columns: 1fr auto; height: auto; border-right: 0; border-bottom: 1px solid var(--edge); }
  .sidebar .brand { padding: .8rem 1rem; margin: 0; border: 0; }
  .sidebar nav { grid-column: 1 / -1; grid-row: 2; flex-direction: row; overflow: auto; }
  .sidebar nav a, .access-link { gap: .45rem; padding: .65rem .8rem; border: 0; }
  .sidebar nav a[aria-current] { box-shadow: inset 0 -2px var(--lime); }
  .sidebar .access-link { grid-column: 2; grid-row: 1; margin: 0; }
  .signed-out { display: grid; }
  .game-filters .filters { grid-template-columns: repeat(2, 1fr); }
  .kpis.cards { grid-template-columns: repeat(2, 1fr); gap: .58rem; }
}
@media (max-width: 34rem) {
  main { padding: 1rem .85rem 1.5rem; }
  .sidebar nav .nav-icon { display: none; }
  .kpis.grouped > div { padding-inline: .6rem; }
  .kpis dt { font-size: .875rem; }
  th, td, .levels-table :is(th, td) { padding-inline: .64rem; }
  .row-end { padding-right: 1.75rem !important; }
  .row-end::after { right: .65rem; }
  .login { padding: 1.4rem; }
}
