:root {
  color-scheme: light;
  --bg: #f5f8f5;
  --panel: #ffffff;
  --raised: #eef5eb;
  --line: #dce5dc;
  --text: #203126;
  --muted: #5e6d60;
  --accent: #32651e;
  --gold: #806300;
  --red: #a43e34;
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a, input, select, summary { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { opacity: .6; cursor: default; }
button, input, select { min-height: 42px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--text); }
input::placeholder { color: var(--muted); }
:where(input, select, button, a, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
label { display: grid; gap: 6px; font-size: .875rem; color: var(--muted); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.65rem; line-height: 1.2; font-weight: 650; letter-spacing: -.04em; }
h2 { font-size: 1rem; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 1rem; margin: 24px 0 16px; }
.fine, .updated { font-size: .8125rem; color: var(--muted); }
.app-shell { max-width: 1240px; margin: 0 auto; padding: 0 36px 40px; }
.site-header { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 1.55rem; font-weight: 750; letter-spacing: -.065em; white-space: nowrap; }
.brand img { border-radius: 50%; display: block; flex-shrink: 0; image-rendering: pixelated; }
.header-meta { display: flex; align-items: center; gap: 18px; }
.demo-badge { padding: 4px 9px; border-radius: 5px; color: var(--gold); background: #fff3b3; font-size: .75rem; white-space: nowrap; }
.navigation { display: flex; gap: 26px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.navigation a { display: flex; align-items: center; min-height: 49px; padding: 0 2px; color: var(--muted); font-size: .875rem; white-space: nowrap; border-bottom: 2px solid transparent; }
.navigation a:hover { color: var(--text); }
.navigation a[aria-current] { color: var(--accent); border-bottom-color: var(--accent); }
main { min-width: 0; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 88px; padding: 20px 0; }
.badge { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 5px; color: var(--muted); background: var(--raised); font-size: .8125rem; white-space: nowrap; }
.badge.online { color: var(--accent); }
.badge.online::before { content: ''; width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: 9px; margin-bottom: 18px; overflow: hidden; }
.status-card { padding: 18px 22px; min-width: 0; border-right: 1px solid var(--line); }
.status-card:last-child { border-right: 0; }
.card-label { color: var(--muted); font-size: .8125rem; }
.status-card .value { color: var(--accent); margin-top: 7px; font-size: 1.9rem; font-weight: 600; line-height: 1.25; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.status-card .fine { margin-top: 7px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 22px; min-width: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 19px; }
.panel-heading h2 { display: flex; align-items: center; gap: 10px; }
.count { font-size: .75rem; color: var(--accent); font-weight: 500; background: #eaf4d4; border-radius: 4px; padding: 1px 7px; }
.online-panel { grid-column: 1 / -1; }
.online-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.player-mini { display: flex; align-items: center; gap: 12px; min-width: 0; }
.player-mini > div { min-width: 0; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; flex-shrink: 0; border-radius: 5px; background: #eaf2e1; color: #426331; font: 600 .875rem/1 ui-monospace, monospace; }
img.avatar { display: block; image-rendering: pixelated; object-fit: contain; border-radius: 3px; box-shadow: 0 3px 0 #20312616; }
.status-checked { margin-top: 20px; }
.season-label { color: var(--accent); background: #eaf4d4; padding: 5px 12px; border-radius: 6px; font-size: .875rem; }
.score-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; }
.score-tabs button { flex-shrink: 0; font-size: .875rem; display: flex; align-items: center; gap: 8px; border-radius: 24px; padding: 10px 16px; }
.score-tabs button[aria-pressed="true"] { background: #32651e; border-color: #32651e; color: white; }
.score-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 20px 0; }
.score-heading h2 { font-size: 1.125rem; }
.podium { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; align-items: end; max-width: 850px; margin: 30px auto; }
.podium[data-count="1"] { grid-template-columns: minmax(0,280px); justify-content: center; }
.podium[data-count="2"] { grid-template-columns: repeat(2,minmax(0,1fr)); max-width: 600px; }
.podium-card { min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 22px 14px; border-radius: 12px; gap: 12px; box-shadow: 0 5px 0 #dce5dc; }
.podium-card:hover { border-color: #90ac7c; }
.podium-card.place-1 { order: 2; background: #fff7d5; border-color: #e6c955; padding-top: 30px; padding-bottom: 30px; box-shadow: 0 5px 0 #e6c955; }
.podium-card.place-2 { order: 1; }
.podium-card.place-3 { order: 3; }
.podium-rank { color: var(--muted); font: 700 .875rem/1.4 ui-monospace,monospace; }
.place-1 .podium-rank { color: #806300; }
.podium-card .avatar { width: 64px; height: 64px; }
.podium-name { font-size: 1rem; font-weight: 650; overflow-wrap: anywhere; max-width: 100%; }
.podium-value { font-size: 1.45rem; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--accent); overflow-wrap: anywhere; max-width: 100%; }
.podium-unit { font-size: .8125rem; color: var(--muted); }
.rank-player { border: 0; background: transparent; padding: 3px 0; text-align: left; }
.rank-player:hover { color: var(--accent); }
.rank-number { color: var(--muted); font: 650 1rem ui-monospace,monospace; }
.score-cell { min-width: 140px; width: 32%; font-variant-numeric: tabular-nums; }
.score-cell strong { font-size: .875rem; font-weight: 600; }
.score-progress { display: block; width: 100%; height: 6px; margin-top: 8px; border: 0; border-radius: 4px; overflow: hidden; appearance: none; background: #edf3e8; }
.score-progress::-webkit-progress-bar { background: #edf3e8; border-radius: 4px; }
.score-progress::-webkit-progress-value { background: #8cad42; border-radius: 4px; }
.score-progress::-moz-progress-bar { background: #8cad42; border-radius: 4px; }
.score-date { color: var(--muted); white-space: nowrap; font-size: .8125rem; }
.player-name { font-size: .9375rem; font-weight: 550; overflow-wrap: anywhere; }
.player-meta { font-size: .75rem; color: var(--muted); margin-top: 2px; }
.player-meta:empty { display: none; }
.text-link { color: var(--muted); font-size: .8125rem; white-space: nowrap; }
.text-link:hover { color: var(--accent); }
.event { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.event:first-child { padding-top: 0; }
.event:last-child { padding-bottom: 0; border-bottom: 0; }
.event-icon { display: grid; place-items: center; width: 26px; height: 26px; flex-shrink: 0; border-radius: 5px; color: #476c36; background: #edf4e7; font-size: 1rem; }
.event-icon.death { color: var(--red); background: #fcece9; }
.event-icon.advancement { color: var(--gold); background: #fff4cb; }
.event-body { min-width: 0; flex: 1; }
.event-text { font-size: .875rem; overflow-wrap: anywhere; }
.event-time { color: var(--muted); font-size: .75rem; }
.event-when { color: var(--muted); font-size: .75rem; white-space: nowrap; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.empty { padding: 14px 0; color: var(--muted); font-size: .875rem; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar input { min-width: 230px; }
.section-title { margin: 28px 0 16px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; }
th { color: var(--muted); font-weight: 500; font-size: .8125rem; white-space: nowrap; }
td, th { padding: 13px 12px; border-bottom: 1px solid var(--line); }
td:first-child, th:first-child { padding-left: 0; }
tr:last-child td { border-bottom: 0; }
.player-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.player-card { padding: 20px; text-align: left; display: flex; align-items: center; gap: 12px; }
.player-card { box-shadow: 0 3px 12px #20312604; }
.player-card:hover { background: var(--raised); border-color: #90ac7c; }
#player-detail { scroll-margin-top: 16px; }
#player-summary { background: transparent; }
#player-summary .value { font-size: 1.6rem; }
.quiet { min-height: 34px; padding: 5px 0; background: transparent; border: 0; color: var(--muted); font-size: .875rem; }
details { margin-top: 24px; }
summary { color: var(--muted); cursor: pointer; font-size: .875rem; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; }
.map-surface { height: 500px; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #eef4ec; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.map-controls { position: absolute; left: 16px; bottom: 16px; display: flex; gap: 6px; }
.map-controls button { background: var(--panel); }
.map-caption { margin-top: 12px; }
.notice { padding: 12px 16px; margin-top: 18px; background: #fff0ed; border: 1px solid #eec6bf; border-radius: 7px; font-size: .875rem; }
.error { color: var(--red); }
.skip { position: absolute; top: -100px; left: 20px; padding: 12px; background: var(--accent); color: var(--bg); z-index: 10; }
.skip:focus { top: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
@media (max-width: 900px) {
  .app-shell { padding: 0 24px 28px; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .online-grid { grid-template-columns: 1fr; gap: 14px; }
  .map-layout { grid-template-columns: 1fr; }
  .map-layout .panel { min-height: 120px; }
  .player-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .podium { gap: 8px; margin: 20px auto 26px; }
  .podium-card { padding: 18px 8px; gap: 10px; }
  .podium-card.place-1 { padding: 24px 8px; }
  .podium-card .avatar { width: 44px; height: 44px; }
  .podium-name { font-size: .875rem; }
  .podium-value { font-size: 1rem; }
  .podium-unit { font-size: .75rem; }
  .score-heading h2 { font-size: 1rem; }
  .score-cell { min-width: 110px; }
  .app-shell { padding: 0 16px 24px; }
  .site-header { min-height: 72px; }
  .brand { font-size: 1.4rem; }
  .brand { gap: 8px; }
  .brand img { width: 48px; height: 48px; }
  .header-meta { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
  .updated { font-size: .75rem; }
  .demo-badge { font-size: .6875rem; }
  .navigation { gap: 23px; }
  .navigation a { min-height: 47px; }
  .page-heading { min-height: 78px; flex-wrap: wrap; padding: 18px 0; gap: 12px; }
  h1 { font-size: 1.5rem; }
  .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-card { padding: 14px 16px; }
  .status-card:nth-child(2) { border-right: 0; }
  .status-card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .status-card .value { font-size: 1.6rem; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 14px; }
  .panel { padding: 18px; }
  .online-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 10px; }
  .online-grid .player-mini { gap: 8px; }
  .online-grid .avatar { width: 32px; height: 32px; }
  .online-grid .player-name { font-size: .8125rem; }
  .toolbar input { min-width: 0; width: 100%; }
  .toolbar label:last-child { flex: 1; min-width: 150px; }
  .player-cards { grid-template-columns: 1fr; }
  .map-surface { height: 400px; }
  .event { gap: 9px; }
  .event-text { font-size: .8125rem; }
  .event-when { font-size: .6875rem; }
}
@media (prefers-reduced-motion: no-preference) {
  button, a { transition: background .15s, border-color .15s, color .15s; }
}
