/* admin.playchiral.com: the control panel's look, after the game's: Dosis, dot-matrix Doto for figures, a dark chalkboard, glass
   panels edged in current, the wordmark's orange cursor. Served at /admin.css (no login); the panel (panel.html), its login page and the
   share page (server.js) all use it. */
:root {
  --bg: #0c1311; --bg2: #13201c;
  --glass: rgba(255, 255, 255, .035); --glass2: rgba(255, 255, 255, .06);
  --edge: rgba(150, 205, 255, .16); --edge2: rgba(150, 205, 255, .3);
  --chalk: #ecebe4; --dim: #8f9b97; --faint: #5b6864;
  --current: #73c7ff; --orange: #f7923a; --green: #6fe08a; --red: #ff6b5e; --purple: #c79bff; --gold: #ffd25a;
  --accent: var(--current);
  --r: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; color: var(--chalk);
  font: 400 16px/1.5 Dosis, system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: .01em;
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(115, 199, 255, .08), transparent 60%),
    radial-gradient(900px 600px at 110% 20%, rgba(199, 155, 255, .06), transparent 60%),
    linear-gradient(180deg, var(--bg2), var(--bg) 480px);
  background-attachment: fixed;
}
/* the faint electric grid the game's glass carries */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(rgba(150, 205, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(150, 205, 255, .05) 1px, transparent 1px);
  background-size: 40px 40px; mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 75%);
}
a { color: var(--current); }
button, .btn { cursor: pointer; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; position: relative; }

/* the wordmark */
.mark { font-weight: 300; font-size: 34px; line-height: 1; letter-spacing: .02em; color: var(--chalk); text-decoration: none; white-space: nowrap; }
.mark i { font-style: normal; color: var(--orange); animation: blink 1.1s steps(1) infinite; }
.mark small { font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--dim); margin-left: 10px; vertical-align: middle; }
@keyframes blink { 50% { opacity: 0; } }

/* the bar along the top: wordmark, the sections, log out */
.top { position: sticky; top: 0; z-index: 5; backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  background: rgba(12, 19, 17, .72); border-bottom: 1px solid var(--edge); }
.top .wrap { display: flex; align-items: center; gap: 24px; height: 68px; }
nav { display: flex; gap: 4px; flex: 1; align-self: stretch; overflow-x: auto; scrollbar-width: none; }
nav a { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 14px; color: var(--dim);
  text-decoration: none; font-weight: 500; font-size: 15px; white-space: nowrap; transition: color .15s, background .15s; }
nav a:hover { color: var(--chalk); }
nav a.on { color: var(--chalk); }
nav a.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; border-radius: 2px;
  background: var(--tab, var(--current)); box-shadow: 0 0 10px var(--tab, var(--current)), 0 0 2px var(--tab, var(--current)); }
nav a .n { font-family: Doto, monospace; font-weight: 800; font-size: 13px; color: var(--tab, var(--current)); opacity: .9; }
.out button { background: none; border: 1px solid var(--edge); color: var(--dim); border-radius: 10px; padding: 7px 14px; font: inherit; font-size: 14px; }
.out button:hover { color: var(--chalk); border-color: var(--edge2); }

/* a section's head */
main.wrap { padding-top: 34px; padding-bottom: 80px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; flex-wrap: wrap; }
.head h1 { margin: 0; font-weight: 300; font-size: 30px; line-height: 1.1; }
.head h1 b { font-weight: 300; color: var(--accent); }
.head p { margin: 6px 0 0; color: var(--dim); font-size: 15px; max-width: 640px; }
[hidden] { display: none !important; }
#announcements { --accent: var(--purple); }
#codes { --accent: var(--green); }
#version { --accent: var(--current); }
#downloads { --accent: var(--orange); }
#analytics { --accent: var(--gold); --mark: #b8892a; }
#crashes { --accent: var(--red); --mark: #b8473e; }   /* (the crashes section: the red a step down) */   /* (the charts' marks: the gold a step down, inside the dark lightness band) */

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 600; font-size: 15px; border-radius: 10px; padding: 9px 18px;
  border: 1px solid var(--edge2); background: var(--glass2); color: var(--chalk); text-decoration: none; transition: border-color .15s, box-shadow .15s, background .15s; }
.btn:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, 0 0 16px -4px var(--accent); }
.btn.go { background: var(--accent); border-color: var(--accent); color: #0b1310; }
.btn.go:hover { box-shadow: 0 0 22px -2px var(--accent); }
.btn.quiet { background: none; border-color: transparent; color: var(--dim); font-weight: 500; padding: 7px 10px; }
.btn.quiet:hover { color: var(--chalk); box-shadow: none; background: var(--glass); }
.btn.danger:hover { color: var(--red); border-color: var(--red); box-shadow: 0 0 14px -4px var(--red); }
.btn svg { width: 16px; height: 16px; }

/* the lists: a glass card a row */
.list { display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 18px; padding: 16px 18px;
  background: var(--glass); border: 1px solid var(--edge); border-radius: var(--r); transition: border-color .15s, background .15s; }
.item:hover { border-color: var(--edge2); background: var(--glass2); }
.item.off { opacity: .55; }
.item .what { min-width: 0; }
.item .name { font-size: 19px; font-weight: 500; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.item .name code { font: 600 17px ui-monospace, Menlo, monospace; color: var(--chalk); }
.item .sub { color: var(--dim); font-size: 14px; margin-top: 2px; display: flex; gap: 6px 14px; flex-wrap: wrap; }
.item .sub a { color: var(--dim); }
.item .sub a:hover { color: var(--accent); }
.item .said { margin-top: 8px; color: var(--chalk); opacity: .8; font-size: 15px; white-space: pre-line; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; border-left: 2px solid var(--accent); padding-left: 10px; }
.item .acts { display: flex; gap: 4px; align-items: center; }
.figure { text-align: right; min-width: 84px; }
.figure b { display: block; font: 800 24px/1 Doto, monospace; color: var(--accent); text-shadow: 0 0 12px color-mix(in srgb, var(--accent) 45%, transparent); }
.figure span { font-size: 12px; color: var(--dim); letter-spacing: .08em; text-transform: uppercase; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 2px 9px; border-radius: 99px;
  border: 1px solid currentColor; color: var(--dim); line-height: 1.5; }
.pill.live { color: var(--green); } .pill.wait { color: var(--gold); } .pill.end { color: var(--red); } .pill.kind { color: var(--accent); }
.empty { text-align: center; color: var(--dim); padding: 46px 16px; border: 1px dashed var(--edge); border-radius: var(--r); }
.empty b { display: block; font-weight: 400; font-size: 20px; color: var(--chalk); margin-bottom: 4px; }

/* the switch: a lit bar of current when on */
.switch { width: 44px; height: 24px; border-radius: 99px; background: rgba(255, 255, 255, .08); border: 1px solid var(--edge); padding: 0; position: relative;
  transition: background .2s, box-shadow .2s, border-color .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--dim); transition: left .18s, background .18s; }
.switch.on { background: color-mix(in srgb, var(--green) 30%, transparent); border-color: var(--green); box-shadow: 0 0 12px -2px var(--green); }
.switch.on::after { left: 23px; background: var(--green); box-shadow: 0 0 8px var(--green); }

/* forms */
.card { background: var(--glass); border: 1px solid var(--edge); border-radius: var(--r); padding: 22px; }
.fields { display: grid; gap: 16px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.fields > * { grid-column: span 6; }
.fields .h2 { grid-column: span 2; } .fields .h3 { grid-column: span 3; } .fields .h4 { grid-column: span 4; }
.stack { display: grid; gap: 16px; align-content: start; grid-template-columns: minmax(0, 1fr); }
.stack.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.stack .wide { grid-column: 1 / -1; }
label, .lbl { display: block; font-size: 13px; font-weight: 600; color: var(--dim); letter-spacing: .04em; }
label .hint, .lbl .hint { font-weight: 400; color: var(--faint); letter-spacing: 0; }
label > input, label > textarea, .lbl > textarea { display: block; margin-top: 6px; }
label .count, .lbl .count { float: right; font-weight: 400; font-family: Doto, monospace; letter-spacing: 0; }
input, textarea, select { font: inherit; font-size: 16px; font-weight: 400; letter-spacing: 0; color: var(--chalk); background: rgba(0, 0, 0, .28); border: 1px solid var(--edge); border-radius: 10px;
  padding: 10px 12px; width: 100%; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 92px; line-height: 1.45; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[readonly] { opacity: .6; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type="datetime-local"]::-webkit-calendar-picker-indicator, input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.8); cursor: pointer; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; color: var(--chalk); letter-spacing: 0; cursor: pointer; }
.check input { margin: 0; width: 18px; height: 18px; accent-color: var(--accent); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row .grow { flex: 1; }

/* the rich text toolbar over a message box */
.tools { display: flex; gap: 4px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.tools button { width: 30px; height: 28px; display: inline-grid; place-items: center; border-radius: 7px; border: 1px solid var(--edge); background: var(--glass); color: var(--chalk); font: 15px Dosis, sans-serif; padding: 0; }
.tools button:hover { border-color: var(--accent); }
.tools button[data-col] { width: 20px; height: 20px; border-radius: 50%; background: var(--c); border-color: transparent; box-shadow: 0 0 6px -1px var(--c); }
.tools button[data-col]:hover { transform: scale(1.15); border-color: #fff; }
.tools .sep { width: 1px; height: 20px; background: var(--edge); margin: 0 6px; }

/* the dialogs: the game's modal, a glowing glass panel in the section's colour */
dialog { border: 0; padding: 0; background: none; color: inherit; max-width: min(760px, calc(100vw - 32px)); width: 100%;
  max-height: none; overflow: visible; }   /* (the panel inside scrolls; the dialog clipping it would cut its glow square and its foot off) */
dialog::backdrop { background: rgba(4, 8, 7, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
dialog[open] { animation: pop .22s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.modal { background: linear-gradient(180deg, rgba(26, 36, 34, .96), rgba(14, 20, 19, .97)); border: 1.5px solid var(--accent); border-radius: 20px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .4), 0 0 26px -6px var(--accent), 0 30px 80px -20px #000; padding: 26px; box-sizing: border-box; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; }
.modal h2 { margin: 0 0 18px; font-weight: 300; font-size: 26px; }
.modal .foot { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 22px; flex-wrap: wrap; }
.modal .foot .left { margin-right: auto; }
.modal.small { max-width: 440px; margin: 0 auto; text-align: center; }
.modal.small p { color: var(--dim); margin: 0; }
.modal.small .foot { justify-content: center; }
dialog.small { max-width: 440px; }

/* the preview: how the game will show it */
.preview { border-radius: 16px; padding: 22px 20px; text-align: center; border: 1.5px solid var(--accent);
  background: radial-gradient(circle at 50% 0, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%), rgba(8, 12, 12, .7);
  box-shadow: 0 0 18px -6px var(--accent) inset, 0 0 18px -8px var(--accent);
  background-image: linear-gradient(color-mix(in srgb, var(--accent) 8%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--accent) 8%, transparent) 1px, transparent 1px);
  background-size: 22px 22px; }
.preview .t { font-size: 24px; font-weight: 500; margin: 6px 0 6px; text-shadow: 0 2px 6px #000; overflow-wrap: anywhere; }
.preview .b { color: rgba(236, 235, 228, .82); white-space: pre-line; font-size: 15px; overflow-wrap: anywhere; max-height: 9.5em; overflow: hidden; }
.preview .ok { display: inline-block; margin-top: 14px; padding: 1.5px; background: var(--accent); font-size: 15px;
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 12px 100%, 0 50%); }
.preview .ok span { display: block; padding: 3px 28px; color: var(--accent); background: #101716;
  clip-path: polygon(11px 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 11px 100%, 0 50%); }
.preview .ico { color: var(--accent); }
.preview .ico svg { width: 30px; height: 30px; }
/* hex mode's own unlock modal (the game's M.hexUnlockModal): a gold hexagon, "later" / "play hex" */
.preview.hexp { --accent: var(--gold); --hx: polygon(14% 0, 86% 0, 100% 50%, 86% 100%, 14% 100%, 0 50%);
  padding: 1.5px; border: 0; border-radius: 0; box-shadow: none; background: var(--accent); clip-path: var(--hx); }
.preview.hexp .in { padding: 22px 15%; clip-path: var(--hx); background-color: #0f120c;
  background-image: radial-gradient(circle at 50% 0, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%); }
.preview .ok.quiet { opacity: .7; margin-right: 6px; }
.preview .b a, .item .said a, .item .said .lk { color: var(--current); }
.item .said .lk { text-decoration: underline; cursor: default; }
.cap { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin: 0 0 8px; }

/* the version page */
.split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; align-items: start; }
.now { font-size: 15px; color: var(--dim); }
.now b { display: block; font: 800 44px/1.1 Doto, monospace; color: var(--current); text-shadow: 0 0 18px rgba(115, 199, 255, .45); margin: 6px 0; }

/* the status line */
#toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); opacity: 0; transition: .25s; z-index: 20; pointer-events: none;
  background: rgba(14, 20, 19, .95); border: 1px solid var(--green); color: var(--chalk); border-radius: 12px; padding: 10px 18px; font-weight: 500;
  box-shadow: 0 0 20px -6px var(--green); max-width: calc(100vw - 32px); }
#toast.bad { border-color: var(--red); box-shadow: 0 0 20px -6px var(--red); }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 760px) {
  .top .wrap { height: auto; flex-wrap: wrap; gap: 6px 12px; padding-top: 12px; }
  .mark { font-size: 28px; }
  nav { order: 3; flex-basis: 100%; margin: 0 -8px; height: 44px; }
  .out { margin-left: auto; }
  .item { grid-template-columns: minmax(0, 1fr) auto; }
  .item .figure { grid-column: 1; grid-row: 2; text-align: left; display: flex; align-items: baseline; gap: 8px; }
  .item .acts { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; align-items: flex-end; }
  .fields .h2, .fields .h3, .fields .h4 { grid-column: span 6; }
  .stack.two { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: 1fr; }
  .modal { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { .mark i, dialog[open] { animation: none; } }

/* analytics: stat tiles, one-series charts as small multiples, ranked bars, tables (analytics.js's report) */
:is(#analytics, #crashes, #d-level) .filters { display: flex; gap: 6px; flex-wrap: wrap; }
:is(#analytics, #crashes, #d-level) .range { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
:is(#analytics, #crashes, #d-level) .range .hint { margin: 0 0 0 4px; font-size: 13px; }
:is(#analytics, #crashes, #d-level) .custom { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: 4px; }
:is(#analytics, #crashes, #d-level) .custom[hidden] { display: none; }
#analytics #an-place { width: auto; max-width: 260px; padding: 6px 10px; font-size: 14px; }
#analytics #an-place.on { border-color: var(--orange, #f0a040); }
:is(#analytics, #crashes, #d-level) .custom label { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--dim); }
:is(#analytics, #crashes, #d-level) .custom input { width: auto; padding: 6px 10px; }
:is(#analytics, #crashes, #d-level) .filters .btn.on { border-color: var(--accent); color: var(--accent); }
:is(#analytics, #crashes, #d-level) .tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px; margin-bottom: 14px; }
:is(#analytics, #crashes, #d-level) .tile { padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--edge); background: var(--glass); }
:is(#analytics, #crashes, #d-level) .tile span { display: block; font-size: 13px; color: var(--dim); }
:is(#analytics, #crashes, #d-level) .tile b { display: block; font-size: 28px; font-weight: 600; color: var(--chalk); margin-top: 2px; }
:is(#analytics, #crashes, #d-level) .charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; margin-bottom: 14px; }
:is(#analytics, #crashes, #d-level) .card { margin-bottom: 14px; }
:is(#analytics, #crashes, #d-level) .charts .card { margin: 0; }
:is(#analytics, #crashes, #d-level) h3 { margin: 0 0 10px; font-size: 15px; font-weight: 500; color: var(--chalk); }
:is(#analytics, #crashes, #d-level) h3 .sum { color: var(--dim); font-weight: 400; margin-left: 6px; font-variant-numeric: tabular-nums; }
:is(#analytics, #crashes, #d-level) .chart svg { display: block; width: 100%; height: auto; overflow: visible; }
:is(#analytics, #crashes, #d-level) .chart .grid { stroke: rgba(255, 255, 255, .07); stroke-width: 1; }
:is(#analytics, #crashes, #d-level) .chart .axis { stroke: rgba(255, 255, 255, .2); stroke-width: 1; }
:is(#analytics, #crashes, #d-level) .chart .tick { fill: var(--dim); font-size: 13px; font-variant-numeric: tabular-nums; }
:is(#analytics, #crashes, #d-level) .chart .bar { fill: var(--mark); }
:is(#analytics, #crashes, #d-level) .chart .hit { fill: transparent; }
:is(#analytics, #crashes, #d-level) .maphead { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: 6px; }
:is(#analytics, #crashes, #d-level) .maphead h3 { margin: 0; }
:is(#analytics, #crashes, #d-level) .maps { display: grid; gap: 18px; }
:is(#analytics, #crashes, #d-level) .maps figure { margin: 0; }
:is(#analytics, #crashes, #d-level) .maps svg { width: 100%; height: auto; display: block; }
:is(#analytics, #crashes, #d-level) .maps figure + figure svg { max-width: 820px; margin: 0 auto; }   /* (the spiral: square, so narrower) */
:is(#analytics, #crashes, #d-level) .tscroll { overflow-x: auto; }
:is(#analytics, #crashes, #d-level) .tscroll td:first-child { white-space: nowrap; }
:is(#analytics, #crashes, #d-level) .tl > :first-child { stroke: rgba(0, 0, 0, .35); stroke-width: 1; }
:is(#analytics, #crashes, #d-level) .tl.none > :first-child { stroke: var(--edge); }
:is(#analytics, #crashes, #d-level) .tl.lit > :first-child { stroke: var(--chalk); stroke-width: 2; }
:is(#analytics, #crashes, #d-level) .tl text { pointer-events: none; font-family: Dosis, sans-serif; }
:is(#analytics, #crashes, #d-level) .tl .tn { font-size: 8.5px; font-weight: 500; opacity: .8; }
:is(#analytics, #crashes, #d-level) .tl .ts { font-size: 15px; font-weight: 600; }
:is(#analytics, #crashes, #d-level) .tl.none text { fill: var(--faint); }
:is(#analytics, #crashes, #d-level) .legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 12px 0 4px; font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; }
:is(#analytics, #crashes, #d-level) .legend i { display: block; width: 160px; height: 10px; border-radius: 5px; }
:is(#analytics, #crashes, #d-level) .legend .hint { flex-basis: 100%; font-size: 12px; }
#an-tip, #cr-tip, #lv-tip { white-space: pre-line; }
:is(#analytics, #crashes, #d-level) .chart .hit.lit { fill: rgba(255, 255, 255, .06); }
:is(#analytics, #crashes, #d-level) .chart .bar.lit, #analytics .brow.lit .bt i { fill: var(--accent); background: var(--accent); }
:is(#analytics, #crashes, #d-level) .chart .cap { margin: 8px 0 2px; }
:is(#analytics, #crashes, #d-level) .bars { display: grid; gap: 6px; }
:is(#analytics, #crashes, #d-level) .brow { display: grid; grid-template-columns: minmax(70px, 34%) 1fr auto; align-items: center; gap: 10px; font-size: 14px; padding: 2px 4px; border-radius: 6px; }
:is(#analytics, #crashes, #d-level) .brow.lit { background: rgba(255, 255, 255, .05); }
:is(#analytics, #crashes, #d-level) .bl { color: var(--chalk); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:is(#analytics, #crashes, #d-level) .bt { height: 10px; overflow: hidden; }
:is(#analytics, #crashes, #d-level) .bt i { display: block; height: 100%; background: var(--mark); border-radius: 0 4px 4px 0; }
:is(#analytics, #crashes, #d-level) .bv { color: var(--dim); font-variant-numeric: tabular-nums; min-width: 2.5em; text-align: right; }
:is(#analytics, #crashes, #d-level) .tablev summary { cursor: pointer; color: var(--dim); font-size: 14px; }
:is(#analytics, #crashes, #d-level) .tablev[open] summary { margin-bottom: 10px; }
:is(#analytics, #crashes, #d-level) .tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
:is(#analytics, #crashes, #d-level) .tbl th { text-align: left; font-weight: 500; color: var(--dim); font-size: 12px; letter-spacing: .04em; padding: 6px 8px; border-bottom: 1px solid var(--edge); }
:is(#analytics, #crashes, #d-level) .tbl td { padding: 6px 8px; border-bottom: 1px solid rgba(255, 255, 255, .04); font-variant-numeric: tabular-nums; }
#analytics .tbl td.tip { cursor: help; text-decoration: underline dotted rgba(255, 255, 255, .35); text-underline-offset: 3px; }   /* (a summary whose tooltip lists what it counts) */
:is(#analytics, #crashes, #d-level) .tbl code { font: 600 13px ui-monospace, Menlo, monospace; }
:is(#analytics, #crashes, #d-level) tr.dev { cursor: pointer; }
:is(#analytics, #crashes, #d-level) tr.dev:hover td { background: rgba(255, 255, 255, .03); }
:is(#analytics, #crashes, #d-level) tr.days > td { padding: 4px 8px 14px 28px; background: rgba(0, 0, 0, .18); }
:is(#analytics, #crashes, #d-level) .tbl.inner { font-size: 13px; }
:is(#analytics, #crashes, #d-level) #an-devices, #analytics #an-daytable { overflow-x: auto; }
:is(#analytics, #crashes, #d-level) .credit { color: var(--faint); font-size: 12px; }
:is(#analytics, #crashes, #d-level) .credit a { color: var(--dim); }
:is(#analytics, #crashes, #d-level) .credit.warn { color: var(--orange); font-size: 13px; }
:is(#analytics, #crashes, #d-level) .credit.warn code { color: var(--chalk); }
#an-tip, #cr-tip, #lv-tip { position: fixed; z-index: 50; pointer-events: none; padding: 6px 10px; border-radius: 8px; font-size: 13px; color: var(--chalk);
  background: rgba(10, 16, 15, .96); border: 1px solid var(--edge2); box-shadow: 0 8px 24px -8px #000; white-space: nowrap; }

/* crashes: each distinct crash a row that opens to its traceback and its reports */
#crashes .crash { border: 1px solid var(--edge); border-radius: var(--r); background: var(--glass); margin-bottom: 10px; }
#crashes .crash > summary { list-style: none; cursor: pointer; padding: 14px 16px; display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: baseline; }
#crashes .crash > summary::-webkit-details-marker { display: none; }
#crashes .crash > summary:hover { background: rgba(255, 255, 255, .03); border-radius: var(--r); }
#crashes .crash .n { font-size: 24px; font-weight: 600; color: var(--red); font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
#crashes .crash .msg { font: 500 14px/1.4 ui-monospace, Menlo, monospace; color: var(--chalk); overflow-wrap: anywhere; }
#crashes .crash .meta { grid-column: 2 / 4; font-size: 13px; color: var(--dim); }
#crashes .crash .when { font-size: 13px; color: var(--dim); white-space: nowrap; }
#crashes .crash .new { color: var(--red); font-size: 12px; border: 1px solid var(--red); border-radius: 999px; padding: 0 7px; margin-left: 6px; }
#crashes .crash .body { padding: 0 16px 16px; }
#crashes pre.trace { margin: 0 0 12px; padding: 14px 16px; max-height: 340px; overflow: auto; background: rgba(0, 0, 0, .45); border: 1px solid rgba(0, 0, 0, .5);
  border-radius: 10px; box-shadow: inset 0 2px 8px rgba(0, 0, 0, .5); font: 13px/1.5 ui-monospace, Menlo, monospace; color: #d9dcd8; white-space: pre; }
#crashes .copy { float: right; }
#crashes .tscroll { overflow-x: auto; }

/* analytics: where players are (the heat map over the land) */
#analytics .heat { position: relative; margin-top: 6px; overflow: hidden; border-radius: 10px; }
#analytics .heat svg { display: block; width: 100%; }
#analytics .heat .land { fill: rgba(255, 255, 255, .07); stroke: rgba(150, 205, 255, .22); stroke-width: .6; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
#analytics .heat canvas { position: absolute; left: 0; top: 0; mix-blend-mode: screen; touch-action: none; cursor: zoom-in; }
#analytics .heat.zoomed canvas { cursor: grab; }
#analytics .heat.dragging canvas { cursor: grabbing; }
#analytics .heat .zoom { position: absolute; right: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 2px; padding: 3px; border-radius: 10px;
  background: rgba(0, 0, 0, .45); border: 1px solid rgba(255, 255, 255, .08); }
#analytics .heat .zoom .btn { width: 30px; height: 30px; padding: 0; justify-content: center; font-size: 18px; line-height: 1; }
#analytics #an-where select { width: auto; padding: 6px 10px; }
#analytics #an-heatlegend i { width: 160px; }

/* analytics: Benfey's spiral's lines under the hex map's tiles */
#analytics .maps .sk { pointer-events: none; fill: none; }
#analytics .maps .sk .band { stroke: rgba(150, 200, 255, .05); stroke-linecap: round; }
#analytics .maps .sk .edge { stroke: rgba(210, 230, 255, .2); stroke-width: .9; }
#analytics .maps .sk .line { stroke: rgba(210, 230, 255, .4); stroke-width: 1.1; }
#analytics .maps .sk .glow { stroke: rgba(150, 200, 255, .1); stroke-width: 3.6; }
#analytics .maps .sk .base { stroke: rgba(210, 230, 255, .2); stroke-width: 1; }
#analytics .maps .sk .spoke { stroke: rgba(210, 230, 255, .13); stroke-width: 1; stroke-dasharray: 9 9; }
#analytics .maps .sk .slot { stroke: rgba(210, 230, 255, .26); stroke-width: .9; }
#analytics .maps .sk text { fill: rgba(210, 230, 255, .5); stroke: none; font: 500 11px Doto, monospace; letter-spacing: .04em; }

/* analytics: a level's own figures (a tile on the level maps clicked) */
#analytics .maps .tl:not(.none) { cursor: pointer; }
#analytics .maps .tl:focus-visible > :first-child { stroke: var(--chalk); stroke-width: 2; outline: none; }
dialog#d-level { max-width: min(940px, calc(100vw - 48px)); }   /* (a window over the page, not the whole of it: its figures scroll inside) */
dialog#d-level::backdrop { background: rgba(4, 8, 7, .45); backdrop-filter: blur(14px) saturate(.8); -webkit-backdrop-filter: blur(14px) saturate(.8); cursor: pointer; }
#d-level .modal { max-height: min(80vh, 860px); max-height: min(80dvh, 860px); position: relative; }
#d-level .x { position: sticky; top: 0; float: right; margin: -10px -10px 0 12px; width: 34px; height: 34px; padding: 0; justify-content: center; font-size: 20px; line-height: 1;
  background: rgba(14, 20, 19, .9); border-radius: 999px; z-index: 2; }
#d-level { --accent: var(--gold); --mark: #b8892a; }
#d-level h2 { margin-bottom: 4px; }
#d-level .sub { color: var(--dim); margin: 0 0 18px; font-size: 14px; }
#d-level .sub .chip { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
#d-level .charts { margin-bottom: 10px; }
#d-level .tscroll { max-height: 300px; overflow: auto; }
#d-level h3 { margin: 0 0 10px; font-weight: 500; font-size: 16px; }
#d-level .tile b small { font-size: 15px; font-weight: 500; color: var(--dim); }

/* analytics: every level as a table, filtered and sorted */
#analytics .ltf { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
#analytics .ltf input { flex: 1 1 240px; width: auto; padding: 6px 10px; font-size: 14px; }
#analytics .ltf select { width: auto; padding: 6px 10px; font-size: 14px; }
#analytics .ltf .hint { margin-left: 4px; font-size: 13px; }
#analytics .tbl.lt th { cursor: pointer; user-select: none; white-space: nowrap; }
#analytics .tbl.lt th:hover, #analytics .tbl.lt th.on { color: var(--accent); }
#analytics .tbl.lt th i { font-style: normal; font-size: 10px; }
#analytics .tbl.lt tr.lvrow { cursor: pointer; }
#analytics .tbl.lt tr.lvrow:hover td { background: rgba(255, 255, 255, .03); }

/* the donuts: a whole split into its parts, a legend beside it with every part's count and share */
:is(#analytics, #crashes, #d-level) .pie .pwrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
:is(#analytics, #crashes, #d-level) .pie svg { width: 150px; height: 150px; flex: none; overflow: visible; }
:is(#analytics, #crashes, #d-level) .pie .slice { stroke: #16201d; stroke-width: 2; stroke-linejoin: round; transition: transform .15s; transform-origin: 80px 80px; }
:is(#analytics, #crashes, #d-level) .pie .slice.lit { transform: scale(1.04); }
:is(#analytics, #crashes, #d-level) .pie .pt { fill: var(--chalk); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
:is(#analytics, #crashes, #d-level) .pie .pu { fill: var(--dim); font-size: 12px; }
:is(#analytics, #crashes, #d-level) .plegend { list-style: none; margin: 0; padding: 0; flex: 1 1 140px; min-width: 0; display: grid; gap: 4px; font-size: 14px; }
:is(#analytics, #crashes, #d-level) .plegend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 3.2em; gap: 8px; align-items: center; padding: 2px 6px; border-radius: 6px; }
:is(#analytics, #crashes, #d-level) .plegend li.lit { background: rgba(255, 255, 255, .05); }
:is(#analytics, #crashes, #d-level) .plegend i { width: 10px; height: 10px; border-radius: 3px; }
:is(#analytics, #crashes, #d-level) .plegend .pl { color: var(--chalk); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:is(#analytics, #crashes, #d-level) .plegend .pv, :is(#analytics, #crashes, #d-level) .plegend .pp { color: var(--dim); font-variant-numeric: tabular-nums; text-align: right; }

/* every table: sorted by a header clicked, filtered by its search */
.tsearch { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tsearch input { flex: 0 1 280px; width: auto; padding: 6px 10px; font-size: 14px; }
.tsearch .hint { font-size: 13px; }
table.sortable > thead th { cursor: pointer; user-select: none; white-space: nowrap; }
table.sortable > thead th:hover, table.sortable > thead th.on { color: var(--accent); }
table.sortable > thead th i.sm { font-style: normal; font-size: 10px; }
