/* Buben SMP: modern app with pixel-art accents. Tokens first, dark is the default. */
:root {
  color-scheme: dark light;
  --bg: #0E1116;
  --surface: #171C24;
  --surface-2: #202733;
  --text: #E8EDF2;
  --muted: #9AA7B4;
  --line: #2B3544;
  --edge: #2B3544;
  --edge-strong: #6C7A8E;
  --primary: #5BBF3A;
  --on-primary: #0B1A05;
  --primary-edge: #2D6B1B;
  --primary-text: #5BBF3A;
  --dirt: #8B5E3C;
  --dirt-dark: #6B452A;
  --accent: #4FD8E8;
  --gold: #F2C14E;
  --silver: #C9D1D9;
  --bronze: #C9824B;
  --redstone: #E5484D;
  --amber: #F5A524;
  --danger-text: #FF7A7E;
  --on-medal: #1A1203;
  --shadow-ink: rgba(0, 0, 0, .28);
  --sky-top: #070B16;
  --sky-mid: #14213A;
  --sky-low: #1E3A2D;
  --sky-text: #E8EDF2;
  --sky-muted: #BFCAD6;
  --cloud: rgba(255, 255, 255, .10);
  --stars: 1;
  --daylight: 0;
  --off-top: #6B7686;
  --off-left: #4A5361;
  --off-right: #38404C;
  --start-top: #FFC857;
  --start-left: #D9921A;
  --start-right: #A96F0C;
  --on-top: #5BBF3A;
  --on-left: #8B5E3C;
  --on-right: #6B452A;
  --stop-top: #8A7A58;
  --stop-left: #5E5446;
  --stop-right: #463F36;
  --px: 3px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #F4F1E8;
    --surface: #FFFFFF;
    --surface-2: #ECE8DA;
    --text: #1B2330;
    --muted: #566170;
    --line: #D8D2BE;
    --edge: #CFC8B0;
    --edge-strong: #7E775F;
    --primary: #2C811D;
    --on-primary: #FFFFFF;
    --primary-edge: #1D5A13;
    --primary-text: #27761A;
    --accent: #0A7482;
    --danger-text: #B3261E;
    --shadow-ink: rgba(0, 0, 0, .18);
    --sky-top: #6DB8EE;
    --sky-mid: #A9DAF7;
    --sky-low: #D9F0FB;
    --sky-text: #0F1A2B;
    --sky-muted: #25384F;
    --cloud: rgba(255, 255, 255, .95);
    --stars: 0;
    --daylight: 1;
    --off-top: #A5AEBA;
    --off-left: #838D9B;
    --off-right: #6B7583;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; line-height: 1.2; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--primary-text); text-underline-offset: 3px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.error { color: var(--danger-text); font-weight: 600; margin-top: 12px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.ic { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter; }
.ic-lg { width: 28px; height: 28px; }

/* top strip: grass over dirt */
.strip {
  height: 8px;
  background:
    repeating-linear-gradient(90deg, var(--primary) 0 16px, transparent 16px 40px) 0 4px / 100% 4px no-repeat,
    linear-gradient(var(--primary) 0 4px, var(--dirt) 4px 8px);
}

.shell {
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right));
}
main.shell { padding-top: 8px; padding-bottom: calc(104px + env(safe-area-inset-bottom)); }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 12px; min-height: 44px; color: inherit; text-decoration: none; min-width: 0; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 800; letter-spacing: .08em; text-transform: uppercase; line-height: 1.2; }
.hi { color: var(--muted); font-size: .875rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hi strong { color: var(--text); }
.logo { width: 40px; height: 40px; image-rendering: pixelated; flex: none; box-shadow: 0 0 0 2px var(--edge-strong); }
.logo-lg { width: 96px; height: 96px; box-shadow: 0 0 0 3px var(--edge-strong); }
.top-actions { display: flex; gap: 8px; }

.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 0;
  background: var(--surface-2); color: var(--text); border: 0; border-radius: 2px; cursor: pointer;
  box-shadow: 0 -2px 0 0 var(--edge-strong), 0 2px 0 0 var(--edge-strong), -2px 0 0 0 var(--edge-strong), 2px 0 0 0 var(--edge-strong);
  transition: transform 120ms ease-out, background-color 150ms ease-out;
}
.icon-btn:active { transform: translateY(2px); }

/* tabs: bottom bar on phones, top on wide screens */
.tabs {
  position: fixed; inset: auto 0 0 0; z-index: 20; display: flex;
  background: var(--surface);
  box-shadow: 0 -3px 0 0 var(--edge);
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.tab {
  flex: 1; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  position: relative; color: var(--muted); text-decoration: none;
  font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  transition: color 150ms ease-out;
}
.tab[aria-current="page"] { color: var(--primary-text); }
.tab[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 18%; right: 18%; height: 4px; background: var(--primary); }
.tab:active .ic { transform: translateY(2px); }

@media (min-width: 768px) {
  .shell { padding-inline: 24px; }
  main.shell { padding-bottom: 64px; }
  .tabs {
    position: static; width: 100%; max-width: 720px; margin: 8px auto 0; padding: 0 24px; gap: 12px; background: none; box-shadow: none;
  }
  .tab {
    flex-direction: row; gap: 8px; min-height: 48px; background: var(--surface); border-radius: 2px; font-size: 13px;
    box-shadow: 0 -2px 0 0 var(--edge), 0 3px 0 0 var(--edge), -2px 0 0 0 var(--edge), 2px 0 0 0 var(--edge);
  }
  .tab[aria-current="page"]::before { left: 0; right: 0; top: auto; bottom: -3px; height: 3px; }
  .tab:hover { color: var(--text); }
  .tab[aria-current="page"]:hover { color: var(--primary-text); }
}

/* views */
.view > .card, .view > .tiles, .view > .steps, .view > .callout { margin-top: 24px; }
.view > :first-child { margin-top: 0; }
.view > .sr-only + * { margin-top: 16px; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes wipe { from { clip-path: inset(0 100% 0 0); opacity: .4; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
.stagger .reveal, .stagger .step { animation: rise 240ms cubic-bezier(.2, 0, 0, 1) both; animation-delay: calc(var(--i, 0) * 40ms); }
.stagger .reveal:nth-child(2), .stagger .step:nth-child(1) { --i: 0; }
.stagger .reveal:nth-child(3), .stagger .step:nth-child(2) { --i: 1; }
.stagger .reveal:nth-child(4), .stagger .step:nth-child(3) { --i: 2; }
.stagger .reveal:nth-child(5), .stagger .step:nth-child(4) { --i: 3; }
.stagger .reveal:nth-child(6), .stagger .step:nth-child(5) { --i: 4; }
.stagger .step:nth-child(6) { --i: 5; }
.wipe { animation: wipe 250ms steps(8, end) both; }

/* cards */
.card {
  position: relative; background: var(--surface); padding: 16px;
  box-shadow: 0 calc(-1 * var(--px)) 0 0 var(--edge), 0 5px 0 0 var(--edge), calc(-1 * var(--px)) 0 0 0 var(--edge), var(--px) 0 0 0 var(--edge);
}
@media (min-width: 768px) { .card { padding: 24px; } }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; min-height: 28px; }

/* buttons */
.btn {
  --b-bg: var(--surface-2); --b-fg: var(--text); --b-edge: var(--edge-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  background: var(--b-bg); color: var(--b-fg); border: 0; border-radius: 2px; cursor: pointer;
  font: inherit; font-size: .9375rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; text-decoration: none; text-align: center;
  box-shadow: inset 0 -4px 0 0 var(--shadow-ink), inset 0 2px 0 0 rgba(255, 255, 255, .12),
    0 -2px 0 0 var(--b-edge), 0 4px 0 0 var(--b-edge), -2px 0 0 0 var(--b-edge), 2px 0 0 0 var(--b-edge);
  transition: transform 120ms ease-out, box-shadow 120ms ease-out, filter 150ms ease-out;
  -webkit-tap-highlight-color: transparent;
}
.btn.primary { --b-bg: var(--primary); --b-fg: var(--on-primary); --b-edge: var(--primary-edge); }
.btn.big { width: 100%; min-height: 60px; font-size: 1.0625rem; }
.btn.small { min-height: 44px; padding: 0 14px; font-size: .8125rem; }
.btn:active:not(:disabled), .btn.is-pressed {
  transform: translateY(3px);
  box-shadow: inset 0 -1px 0 0 var(--shadow-ink), inset 0 2px 0 0 rgba(255, 255, 255, .12),
    0 -2px 0 0 var(--b-edge), 0 1px 0 0 var(--b-edge), -2px 0 0 0 var(--b-edge), 2px 0 0 0 var(--b-edge);
}
@media (hover: hover) { .btn:hover:not(:disabled) { filter: brightness(1.08); } }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"]::after {
  content: ""; width: 16px; height: 16px; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* hero with living sky */
.hero { overflow: visible; }
.hero-main {
  position: relative; overflow: hidden; isolation: isolate; margin: -16px -16px 0; padding: 16px; min-height: 184px;
  display: flex; align-items: center; gap: 12px;
  color: var(--sky-text);
}
@media (min-width: 768px) { .hero-main { margin: -24px -24px 0; padding: 24px; min-height: 208px; gap: 24px; } }
.sky {
  position: absolute; inset: 0; z-index: -1; overflow: hidden;
  background: linear-gradient(var(--sky-top), var(--sky-mid) 62%, var(--sky-low));
  opacity: .4; transition: opacity 1.2s ease-out; pointer-events: none;
}
[data-state="starting"] .sky { opacity: .85; transition-duration: 25s; transition-timing-function: linear; }
[data-state="online"] .sky { opacity: 1; transition-duration: 1.5s; }
[data-state="stopping"] .sky { opacity: .5; transition-duration: 2s; }
[data-state="loading"] .sky { opacity: .4; }

.sky::before, .sky::after, .sky-c {
  content: ""; position: absolute; top: 0; left: 0; background: #fff; opacity: calc(var(--stars) * .85);
  will-change: transform;
}
.sky::before { width: 1px; height: 1px; box-shadow: 136px 144px 0 0 #fff, 936px 144px 0 0 #fff, 260px 30px 0 0 #cfe4ff, 1060px 30px 0 0 #cfe4ff, 778px 114px 0 0 #cfe4ff, 1578px 114px 0 0 #cfe4ff, 666px 96px 0 0 #fff, 1466px 96px 0 0 #fff, 96px 124px 0 0 #fff, 896px 124px 0 0 #fff, 398px 110px 0 0 #fff, 1198px 110px 0 0 #fff, 712px 114px 0 0 #cfe4ff, 1512px 114px 0 0 #cfe4ff, 738px 58px 0 0 #fff, 1538px 58px 0 0 #fff, 324px 6px 0 0 #fff, 1124px 6px 0 0 #fff, 26px 166px 0 0 #fff, 826px 166px 0 0 #fff, 390px 174px 0 0 #fff, 1190px 174px 0 0 #fff, 432px 184px 0 0 #fff, 1232px 184px 0 0 #fff, 540px 56px 0 0 #cfe4ff, 1340px 56px 0 0 #cfe4ff, 506px 140px 0 0 #fff, 1306px 140px 0 0 #fff, 352px 58px 0 0 #fff, 1152px 58px 0 0 #fff, 778px 116px 0 0 #cfe4ff, 1578px 116px 0 0 #cfe4ff, 22px 106px 0 0 #fff, 822px 106px 0 0 #fff, 190px 160px 0 0 #cfe4ff, 990px 160px 0 0 #cfe4ff, 122px 190px 0 0 #cfe4ff, 922px 190px 0 0 #cfe4ff, 738px 182px 0 0 #cfe4ff, 1538px 182px 0 0 #cfe4ff, 518px 170px 0 0 #fff, 1318px 170px 0 0 #fff, 310px 72px 0 0 #cfe4ff, 1110px 72px 0 0 #cfe4ff, 516px 100px 0 0 #fff, 1316px 100px 0 0 #fff, 490px 62px 0 0 #cfe4ff, 1290px 62px 0 0 #cfe4ff, 424px 170px 0 0 #fff, 1224px 170px 0 0 #fff, 374px 140px 0 0 #cfe4ff, 1174px 140px 0 0 #cfe4ff, 88px 112px 0 0 #fff, 888px 112px 0 0 #fff, 796px 40px 0 0 #cfe4ff, 1596px 40px 0 0 #cfe4ff, 378px 124px 0 0 #fff, 1178px 124px 0 0 #fff, 480px 10px 0 0 #cfe4ff, 1280px 10px 0 0 #cfe4ff, 720px 156px 0 0 #cfe4ff, 1520px 156px 0 0 #cfe4ff, 662px 42px 0 0 #fff, 1462px 42px 0 0 #fff, 514px 58px 0 0 #fff, 1314px 58px 0 0 #fff, 788px 50px 0 0 #fff, 1588px 50px 0 0 #fff, 414px 130px 0 0 #cfe4ff, 1214px 130px 0 0 #cfe4ff, 590px 90px 0 0 #cfe4ff, 1390px 90px 0 0 #cfe4ff, 274px 168px 0 0 #fff, 1074px 168px 0 0 #fff, 392px 188px 0 0 #fff, 1192px 188px 0 0 #fff, 530px 198px 0 0 #fff, 1330px 198px 0 0 #fff, 436px 14px 0 0 #cfe4ff, 1236px 14px 0 0 #cfe4ff, 372px 144px 0 0 #fff, 1172px 144px 0 0 #fff, 516px 104px 0 0 #cfe4ff, 1316px 104px 0 0 #cfe4ff, 364px 106px 0 0 #cfe4ff, 1164px 106px 0 0 #cfe4ff, 0px 136px 0 0 #cfe4ff, 800px 136px 0 0 #cfe4ff, 468px 152px 0 0 #fff, 1268px 152px 0 0 #fff, 234px 162px 0 0 #fff, 1034px 162px 0 0 #fff, 562px 148px 0 0 #fff, 1362px 148px 0 0 #fff, 92px 140px 0 0 #cfe4ff, 892px 140px 0 0 #cfe4ff, 32px 172px 0 0 #fff, 832px 172px 0 0 #fff, 84px 4px 0 0 #cfe4ff, 884px 4px 0 0 #cfe4ff, 14px 192px 0 0 #cfe4ff, 814px 192px 0 0 #cfe4ff, 254px 68px 0 0 #fff, 1054px 68px 0 0 #fff, 638px 46px 0 0 #cfe4ff, 1438px 46px 0 0 #cfe4ff, 296px 16px 0 0 #fff, 1096px 16px 0 0 #fff, 162px 64px 0 0 #fff, 962px 64px 0 0 #fff, 672px 68px 0 0 #cfe4ff, 1472px 68px 0 0 #cfe4ff, 464px 178px 0 0 #cfe4ff, 1264px 178px 0 0 #cfe4ff, 508px 120px 0 0 #fff, 1308px 120px 0 0 #fff, 24px 78px 0 0 #cfe4ff, 824px 78px 0 0 #cfe4ff, 350px 106px 0 0 #fff, 1150px 106px 0 0 #fff, 264px 26px 0 0 #cfe4ff, 1064px 26px 0 0 #cfe4ff, 746px 130px 0 0 #fff, 1546px 130px 0 0 #fff, 620px 110px 0 0 #fff, 1420px 110px 0 0 #fff, 230px 4px 0 0 #cfe4ff, 1030px 4px 0 0 #cfe4ff, 148px 8px 0 0 #fff, 948px 8px 0 0 #fff, 456px 180px 0 0 #cfe4ff, 1256px 180px 0 0 #cfe4ff, 556px 56px 0 0 #cfe4ff, 1356px 56px 0 0 #cfe4ff, 228px 134px 0 0 #fff, 1028px 134px 0 0 #fff, 404px 172px 0 0 #cfe4ff, 1204px 172px 0 0 #cfe4ff, 674px 160px 0 0 #cfe4ff, 1474px 160px 0 0 #cfe4ff, 0 0 0 0 transparent; animation: drift-stars 120s linear infinite; }
.sky::after { width: 2px; height: 2px; box-shadow: 56px 22px 0 0 #fff, 856px 22px 0 0 #fff, 368px 42px 0 0 #ffe9b0, 1168px 42px 0 0 #ffe9b0, 684px 78px 0 0 #cfe4ff, 1484px 78px 0 0 #cfe4ff, 620px 54px 0 0 #ffe9b0, 1420px 54px 0 0 #ffe9b0, 36px 148px 0 0 #ffe9b0, 836px 148px 0 0 #ffe9b0, 162px 110px 0 0 #ffe9b0, 962px 110px 0 0 #ffe9b0, 402px 184px 0 0 #ffe9b0, 1202px 184px 0 0 #ffe9b0, 380px 138px 0 0 #cfe4ff, 1180px 138px 0 0 #cfe4ff, 514px 68px 0 0 #fff, 1314px 68px 0 0 #fff, 28px 92px 0 0 #cfe4ff, 828px 92px 0 0 #cfe4ff, 326px 96px 0 0 #cfe4ff, 1126px 96px 0 0 #cfe4ff, 538px 42px 0 0 #ffe9b0, 1338px 42px 0 0 #ffe9b0, 180px 60px 0 0 #fff, 980px 60px 0 0 #fff, 24px 44px 0 0 #cfe4ff, 824px 44px 0 0 #cfe4ff, 176px 34px 0 0 #ffe9b0, 976px 34px 0 0 #ffe9b0, 522px 92px 0 0 #ffe9b0, 1322px 92px 0 0 #ffe9b0, 690px 142px 0 0 #fff, 1490px 142px 0 0 #fff, 456px 106px 0 0 #ffe9b0, 1256px 106px 0 0 #ffe9b0, 536px 194px 0 0 #cfe4ff, 1336px 194px 0 0 #cfe4ff, 606px 90px 0 0 #cfe4ff, 1406px 90px 0 0 #cfe4ff, 456px 40px 0 0 #cfe4ff, 1256px 40px 0 0 #cfe4ff, 732px 188px 0 0 #cfe4ff, 1532px 188px 0 0 #cfe4ff, 670px 134px 0 0 #fff, 1470px 134px 0 0 #fff, 500px 70px 0 0 #cfe4ff, 1300px 70px 0 0 #cfe4ff, 512px 130px 0 0 #cfe4ff, 1312px 130px 0 0 #cfe4ff, 676px 116px 0 0 #cfe4ff, 1476px 116px 0 0 #cfe4ff, 0 0 0 0 transparent; animation: drift-stars 80s linear infinite; }
.sky-c { width: 2px; height: 2px; box-shadow: 242px 150px 0 0 #fff, 1042px 150px 0 0 #fff, 132px 94px 0 0 #fff, 932px 94px 0 0 #fff, 484px 160px 0 0 #fff, 1284px 160px 0 0 #fff, 66px 154px 0 0 #4FD8E8, 866px 154px 0 0 #4FD8E8, 480px 66px 0 0 #fff, 1280px 66px 0 0 #fff, 238px 48px 0 0 #fff, 1038px 48px 0 0 #fff, 480px 138px 0 0 #fff, 1280px 138px 0 0 #fff, 486px 100px 0 0 #fff, 1286px 100px 0 0 #fff, 154px 58px 0 0 #fff, 954px 58px 0 0 #fff, 154px 132px 0 0 #F2C14E, 954px 132px 0 0 #F2C14E, 0 0 0 0 transparent; animation: drift-stars 60s linear infinite, twinkle 4s ease-in-out infinite; }
[data-state="off"] .sky::after, [data-state="off"] .sky-c, [data-state="loading"] .sky-c { opacity: calc(var(--stars) * .35); }
@keyframes drift-stars { to { transform: translateX(-800px); } }
@keyframes twinkle { 50% { opacity: calc(var(--stars) * .4); } }

.sky-body {
  position: absolute; top: 18px; right: 22px; width: 18px; height: 18px; background: var(--silver);
  box-shadow: 6px 0 0 0 var(--silver), -6px 0 0 0 var(--silver), 0 6px 0 0 var(--silver), 0 -6px 0 0 var(--silver),
    6px 6px 0 0 var(--silver), -6px -6px 0 0 var(--silver), 6px -6px 0 0 var(--silver), -6px 6px 0 0 var(--silver);
  opacity: .9;
}
@media (prefers-color-scheme: light) {
  .sky-body {
    background: var(--gold);
    box-shadow: 6px 0 0 0 var(--gold), -6px 0 0 0 var(--gold), 0 6px 0 0 var(--gold), 0 -6px 0 0 var(--gold),
      6px 6px 0 0 var(--gold), -6px -6px 0 0 var(--gold), 6px -6px 0 0 var(--gold), -6px 6px 0 0 var(--gold),
      0 12px 0 -3px var(--gold), 0 -12px 0 -3px var(--gold), 12px 0 0 -3px var(--gold), -12px 0 0 -3px var(--gold);
    opacity: 1;
  }
}
.sky-aurora {
  position: absolute; left: -10%; right: -10%; top: 0; height: 70%; opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(91, 191, 58, .45) 25%, rgba(79, 216, 232, .35) 60%, transparent);
  -webkit-mask-image: linear-gradient(#000 20%, transparent); mask-image: linear-gradient(#000 20%, transparent);
  transition: opacity 1.5s ease-out; will-change: transform;
}
[data-state="online"] .sky-aurora { opacity: calc(1 - var(--daylight) * .85); animation: aurora 9s ease-in-out infinite alternate; }
@keyframes aurora { from { transform: translateX(-6%); } to { transform: translateX(6%); } }

.cloud {
  position: absolute; width: 12px; height: 12px; background: var(--cloud); will-change: transform; left: 0;
  box-shadow: 12px 0 0 0 var(--cloud), 24px 0 0 0 var(--cloud), 36px 0 0 0 var(--cloud), 12px -12px 0 0 var(--cloud), 24px -12px 0 0 var(--cloud), 0 0 0 0 transparent;
  animation: drift-cloud 90s linear infinite;
}
.cloud.c1 { top: 22%; }
.cloud.c2 { top: 56%; scale: .7; animation-duration: 120s; animation-delay: -50s; }
.cloud.c3 { top: 38%; scale: 1.3; animation-duration: 150s; animation-delay: -95s; }
.cloud.c1 { animation-delay: -20s; }
@keyframes drift-cloud { from { transform: translateX(-120px); } to { transform: translateX(820px); } }

.hero-text { position: relative; flex: 1; min-width: 0; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; margin-bottom: 6px;
  background: var(--primary); color: var(--on-primary); font-size: 12px; font-weight: 800; letter-spacing: .1em; line-height: 1.5;
  clip-path: polygon(0 3px, 3px 3px, 3px 0, calc(100% - 3px) 0, calc(100% - 3px) 3px, 100% 3px, 100% calc(100% - 3px), calc(100% - 3px) calc(100% - 3px), calc(100% - 3px) 100%, 3px 100%, 3px calc(100% - 3px), 0 calc(100% - 3px));
  visibility: hidden;
}
.badge.live::before { content: ""; width: 6px; height: 6px; background: currentColor; }
.badge.on { visibility: visible; }
[data-state="online"] .badge.live::before { animation: blink 1.6s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.state { font-size: 1.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; line-height: 1.15; overflow-wrap: anywhere; }
.slot { min-height: 56px; margin-top: 4px; }
.sub { color: var(--sky-muted); }
.count { display: flex; align-items: baseline; gap: 8px; }
.count #count-num { font-size: 2.25rem; font-weight: 800; letter-spacing: .02em; line-height: 1.1; }
.count-label { color: var(--sky-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .875rem; }
[data-state="loading"] .state { color: transparent; background: var(--surface-2); width: 60%; height: 32px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* isometric cube */
.cube { position: relative; flex: none; width: 104px; height: 108px; }
@media (min-width: 768px) { .cube { width: 128px; height: 133px; } }
.cube-svg { display: block; width: 100%; height: 100%; overflow: visible; shape-rendering: crispEdges; --c-top: var(--off-top); --c-left: var(--off-left); --c-right: var(--off-right); }
.cube-top { fill: var(--c-top); }
.cube-left { fill: var(--c-left); }
.cube-right { fill: var(--c-right); }
.cube-top, .cube-left, .cube-right { transition: fill 400ms ease-out, opacity 400ms ease-out; }
.tile.lt { fill: rgba(255, 255, 255, .22); }
.tile.dk { fill: rgba(0, 0, 0, .2); }
.cube-grid { fill: none; stroke: rgba(0, 0, 0, .22); stroke-width: 1; }
.cube-edge { fill: none; stroke: rgba(5, 8, 12, .85); stroke-width: 2; stroke-linejoin: miter; }
.cube::before { content: ""; position: absolute; inset: 8% -10% 0; background: radial-gradient(closest-side, rgba(91, 191, 58, .5), transparent); opacity: 0; transition: opacity 600ms ease-out; z-index: -1; }
.cube::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: -6px; height: 6px; background: rgba(0, 0, 0, .35); opacity: 0; transition: opacity 400ms ease-out; }
.cube[data-state="starting"] .cube-svg { --c-top: var(--start-top); --c-left: var(--start-left); --c-right: var(--start-right); }
.cube[data-state="online"] .cube-svg { --c-top: var(--on-top); --c-left: var(--on-left); --c-right: var(--on-right); }
.cube[data-state="stopping"] .cube-svg { --c-top: var(--stop-top); --c-left: var(--stop-left); --c-right: var(--stop-right); }
.cube[data-state="starting"] .cube-top, .cube[data-state="starting"] .cube-left, .cube[data-state="starting"] .cube-right { opacity: .6; }
.cube[data-state="stopping"] .cube-top, .cube[data-state="stopping"] .cube-left, .cube[data-state="stopping"] .cube-right { opacity: .55; }
.cube[data-state="online"]::before { opacity: calc(1 - var(--daylight) * .5); }
.cube[data-state="online"]::after { opacity: 1; animation: ground 4s ease-in-out infinite; }
.cube[data-state="online"] .cube-svg { animation: float 4s ease-in-out infinite; }
.cube-svg, .cube::after { will-change: transform; }
@keyframes float { 0%, 100% { transform: translateY(-4px); } 50% { transform: translateY(4px); } }
@keyframes ground { 0%, 100% { transform: scaleX(.85); } 50% { transform: scaleX(1.05); } }
.cube[data-state="starting"] .tile { animation: build 3s cubic-bezier(.3, 0, .2, 1) infinite both; animation-delay: calc(var(--n, 0) * 130ms); }
.cube[data-state="stopping"] .tile { animation: fall 1.8s cubic-bezier(.5, 0, 1, .6) forwards; animation-delay: calc(var(--n, 0) * 90ms); }
@keyframes build {
  0% { opacity: 0; transform: translateY(-22px); }
  9% { opacity: 1; transform: translateY(0); }
  82% { opacity: 1; transform: translateY(0); }
  94%, 100% { opacity: 0; transform: translateY(0); }
}
@keyframes fall { to { opacity: 0; transform: translateY(34px); } }
.cube .tile:nth-child(4) { --n: 0; }
.cube .tile:nth-child(5) { --n: 1; }
.cube .tile:nth-child(6) { --n: 2; }
.cube .tile:nth-child(7) { --n: 3; }
.cube .tile:nth-child(8) { --n: 4; }
.cube .tile:nth-child(9) { --n: 5; }
.cube .tile:nth-child(10) { --n: 6; }
.cube .tile:nth-child(11) { --n: 7; }
.cube .tile:nth-child(12) { --n: 8; }
.cube .tile:nth-child(13) { --n: 9; }
.cube .tile:nth-child(14) { --n: 10; }
.cube .tile:nth-child(15) { --n: 11; }
.cube .tile:nth-child(16) { --n: 12; }

/* hero lower part */
.action { min-height: 64px; margin-top: 20px; display: flex; align-items: center; }
.action .btn { margin-bottom: 4px; }
.action-hint { color: var(--muted); border-left: 4px solid var(--primary); padding: 8px 0 8px 12px; }
[data-state="stopping"] .action-hint { border-left-color: var(--amber); }
.progress { width: 100%; height: 16px; background: var(--surface-2); position: relative; overflow: hidden; box-shadow: 0 0 0 3px var(--edge); }
.progress span { position: absolute; inset: 0; width: 40%; background: repeating-linear-gradient(90deg, var(--amber) 0 10px, transparent 10px 14px); animation: indet 1.8s steps(12) infinite; will-change: transform; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

.addr-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 20px; }
.field-label { display: block; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.addr-row .field-label { flex-basis: 100%; }
.addr, .addr-inline {
  font-size: 1.0625rem; font-weight: 700; background: var(--surface-2); padding: 10px 14px; min-height: 44px; display: inline-flex; align-items: center;
  word-break: break-all; box-shadow: 0 -2px 0 0 var(--edge), 0 2px 0 0 var(--edge), -2px 0 0 0 var(--edge), 2px 0 0 0 var(--edge);
}
.addr-inline { padding: 2px 8px; min-height: 0; font-size: .95rem; display: inline; }
.autostop { margin-top: 16px; min-height: 44px; }
.note-small { font-size: .875rem; color: var(--muted); }
.segbar { display: flex; gap: 3px; margin-top: 8px; height: 8px; }
.segbar span { flex: 1; background: var(--surface-2); box-shadow: 0 0 0 1px var(--edge); }
.segbar span.on { background: var(--amber); box-shadow: none; }
.segbar.off { visibility: hidden; }

/* fx */
.fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
.px { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; animation: burst 650ms cubic-bezier(.1, .7, .3, 1) forwards; will-change: transform, opacity; }
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) scale(.3); opacity: 0; } }
.shake { animation: shake 120ms steps(4) 1; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* chips and identicons */
.pill { display: inline-block; padding: 2px 10px; background: var(--surface-2); font-weight: 800; letter-spacing: .04em; min-width: 3.5em; text-align: center; box-shadow: 0 0 0 2px var(--edge); }
.players-box { min-height: 76px; }
.chips { list-style: none; margin: 0; padding: 0 0 4px; display: flex; flex-wrap: wrap; gap: 12px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 14px 4px 4px; background: var(--surface-2); font-weight: 700; box-shadow: 0 3px 0 0 var(--edge); }
.chip.pop { animation: pop 320ms cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } to { transform: scale(1); } }
.idt { width: 32px; height: 32px; flex: none; image-rendering: pixelated; background: #202733; display: inline-block; }
.idt.s24 { width: 24px; height: 24px; }
.idt.s40 { width: 40px; height: 40px; }
#players-hidden { margin-top: 8px; }

/* stats */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tile { background: var(--surface); padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; box-shadow: 0 calc(-1 * var(--px)) 0 0 var(--edge), 0 5px 0 0 var(--edge), calc(-1 * var(--px)) 0 0 0 var(--edge), var(--px) 0 0 0 var(--edge); }
.tile-label { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tile-value { font-size: 1.5rem; font-weight: 800; line-height: 1.2; color: var(--primary-text); white-space: nowrap; min-height: 1.8rem; }
.tile:nth-child(2) .tile-value { color: var(--accent); }
.tile:nth-child(3) .tile-value { color: var(--text); }
.tile-sub { font-size: 12px; color: var(--muted); line-height: 1.3; }
@media (min-width: 768px) { .tile { padding: 16px; } .tile-value { font-size: 2rem; } }
.skeleton { background: var(--surface-2); animation: pulse 1.4s ease-in-out infinite; border-radius: 2px; }
.skeleton-text { color: transparent; background: var(--surface-2); width: 70%; animation: pulse 1.4s ease-in-out infinite; }
.chip.skeleton { width: 120px; }
.chip .skel-text { width: 56px; height: 14px; background: var(--line); }
.idt:empty { background: var(--line); }

.board, .timeline { list-style: none; margin: 0; padding: 0; }
.row.skeleton { height: 64px; margin-bottom: 8px; }
.lb { position: relative; display: grid; grid-template-columns: 32px 40px 1fr auto; gap: 6px 12px; align-items: center; padding: 12px 0; border-bottom: 2px solid var(--line); }
.lb:last-child { border-bottom: 0; }
.lb-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.lb-meta { color: var(--muted); font-size: .875rem; grid-column: 3 / 4; line-height: 1.3; }
.lb-main { min-width: 0; }
.dot-on { width: 8px; height: 8px; background: var(--primary); flex: none; }
.lvl { font-size: 12px; font-weight: 800; letter-spacing: .08em; padding: 2px 8px; background: var(--surface-2); color: var(--text); box-shadow: 0 0 0 2px var(--edge); white-space: nowrap; }
.pix { clip-path: polygon(0 3px, 3px 3px, 3px 0, calc(100% - 3px) 0, calc(100% - 3px) 3px, 100% 3px, 100% calc(100% - 3px), calc(100% - 3px) calc(100% - 3px), calc(100% - 3px) 100%, 3px 100%, 3px calc(100% - 3px), 0 calc(100% - 3px)); }
.rank { width: 32px; height: 32px; display: grid; place-items: center; font-weight: 800; background: var(--surface-2); color: var(--text); box-shadow: inset 0 -3px 0 0 var(--shadow-ink), inset 0 3px 0 0 rgba(255, 255, 255, .22); }
.rank.r1 { background: var(--gold); color: var(--on-medal); }
.rank.r2 { background: var(--silver); color: var(--on-medal); }
.rank.r3 { background: var(--bronze); color: var(--on-medal); }
.idt-wrap { position: relative; width: 40px; height: 40px; }
.crown { position: absolute; left: 50%; top: -14px; width: 24px; height: 16px; margin-left: -12px; fill: var(--gold); z-index: 1; }
.spark { position: absolute; top: -18px; right: -8px; width: 6px; height: 6px; background: #fff; opacity: 0; box-shadow: 6px 0 0 0 #fff, -6px 0 0 0 #fff, 0 6px 0 0 #fff, 0 -6px 0 0 #fff; animation: sparkle 6s steps(1, end) infinite; }
@keyframes sparkle { 0%, 82% { opacity: 0; transform: scale(.4); } 86% { opacity: 1; transform: scale(1); } 92% { opacity: 1; transform: scale(.6); } 96%, 100% { opacity: 0; transform: scale(.3); } }
.xp { grid-column: 1 / -1; position: relative; height: 10px; background: repeating-linear-gradient(90deg, var(--line) 0 calc(5% - 2px), transparent calc(5% - 2px) 5%); }
.xp-fill { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, var(--xp, var(--primary)) 0 calc(5% - 2px), transparent calc(5% - 2px) 5%); transition: clip-path 900ms steps(20, end); }
.xp-fill.no-tr { transition: none; }
.lb:first-child .xp-fill { --xp: var(--gold); }

.timeline { margin-left: 6px; border-left: 2px solid var(--line); }
.run { position: relative; padding: 0 0 20px 22px; }
.run:last-child { padding-bottom: 0; }
.run::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; background: var(--edge-strong); box-shadow: 0 0 0 3px var(--surface); }
.run.live::before { background: var(--primary); }
.run-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.run-date { font-weight: 800; }
.run-dur { font-size: 12px; font-weight: 800; letter-spacing: .06em; padding: 1px 8px; background: var(--surface-2); box-shadow: 0 0 0 2px var(--edge); }
.run-by { color: var(--muted); font-size: .875rem; margin-top: 2px; }
.run-who { display: flex; margin-top: 8px; padding-left: 4px; min-height: 24px; align-items: center; }
.run-who .idt { margin-left: -4px; box-shadow: 0 0 0 2px var(--surface); }
.run-who .none { color: var(--muted); font-size: .875rem; }

/* guide */
.steps { list-style: none; margin-bottom: 0; padding: 0; display: grid; gap: 24px; }
.step { position: relative; display: flex; gap: 16px; padding: 16px; background: var(--surface); box-shadow: 0 calc(-1 * var(--px)) 0 0 var(--edge), 0 5px 0 0 var(--edge), calc(-1 * var(--px)) 0 0 0 var(--edge), var(--px) 0 0 0 var(--edge); }
.num { flex: none; width: 40px; height: 40px; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); font-size: 1.25rem; font-weight: 800; box-shadow: inset 0 -4px 0 0 var(--shadow-ink), inset 0 3px 0 0 rgba(255, 255, 255, .25); }
.step-body { min-width: 0; flex: 1; display: grid; gap: 8px; align-content: start; }
.step-body h2 { padding-top: 10px; }
.step-body .btn { margin-top: 8px; }
.step-body .btn.big { font-size: .9375rem; letter-spacing: .03em; padding: 0 12px; }
.keys { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.keys li { display: flex; align-items: center; gap: 16px; min-height: 44px; }
.keys kbd { min-width: 4.5rem; }
kbd {
  display: inline-block; min-width: 2rem; padding: 4px 10px 6px; text-align: center; font: 800 .875rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--surface-2); color: var(--text); border-radius: 4px;
  box-shadow: inset 0 -3px 0 0 var(--shadow-ink), 0 3px 0 0 var(--edge-strong), 0 0 0 2px var(--edge-strong);
}
.acc { border-bottom: 2px solid var(--line); }
.acc:last-child { border-bottom: 0; }
.acc summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 0; cursor: pointer; font-weight: 700; list-style: none; }
.acc summary::-webkit-details-marker { display: none; }
.chev { transition: transform 150ms ease-out; }
.acc[open] .chev { transform: rotate(180deg); }
.acc-body { padding: 0 0 16px; color: var(--muted); }
.acc-body strong { color: var(--text); }
.callout { display: flex; gap: 12px; padding: 16px; background: var(--surface-2); color: var(--text); box-shadow: -4px 0 0 0 var(--accent); }
.callout .ic { color: var(--accent); }
.callout, .callout p { overflow-wrap: anywhere; }

/* bottom sheet / modal */
dialog { border: 0; padding: 0; background: transparent; color: inherit; max-width: none; max-height: none; margin: 0; position: fixed; inset: auto 0 0 0; width: 100%; overflow: visible; }
dialog::backdrop { background: rgba(4, 7, 11, .75); }
dialog[open] { animation: sheet-up 240ms cubic-bezier(.2, 0, 0, 1); }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-body {
  max-width: 560px; margin: 0 auto; background: var(--surface); padding: 12px 16px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 0 0 var(--edge-strong), -4px 0 0 0 var(--edge-strong), 4px 0 0 0 var(--edge-strong);
}
.sheet-grab { width: 48px; height: 6px; margin: 0 auto 12px; background: var(--edge-strong); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.sheet-body .field-label { margin: 16px 0 6px; }
.field { width: 100%; min-height: 48px; padding: 8px 12px; background: var(--bg); color: var(--text); border: 0; border-radius: 2px; font: .875rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; box-shadow: 0 0 0 2px var(--edge-strong); }
.sheet-body .small { margin-top: 8px; min-height: 1.4em; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; padding-bottom: 4px; }
.sheet-actions .btn { flex: 1 1 140px; }
@media (min-width: 768px) {
  dialog { inset: 0; margin: auto; width: min(480px, calc(100% - 32px)); height: fit-content; }
  .sheet-body { padding: 24px; box-shadow: 0 0 0 4px var(--edge-strong); }
  .sheet-grab { display: none; }
}

/* toasts */
.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 40; max-width: calc(100% - 32px);
  padding: 12px 18px; background: var(--text); color: var(--bg); font-weight: 700; pointer-events: none;
  opacity: 0; transform: translate(-50%, 8px); transition: opacity 200ms ease-out, transform 200ms ease-out;
  box-shadow: 0 3px 0 0 var(--edge-strong);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 768px) { .toast { bottom: 32px; } }
.join-toasts { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 0; right: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding-inline: 16px; }
.jt { display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; background: var(--surface-2); color: var(--text); font-weight: 700; box-shadow: 0 0 0 3px var(--primary), 0 6px 0 0 var(--primary-edge); animation: slide-in 260ms cubic-bezier(.2, 0, 0, 1) both; }
.jt.out { animation: slide-out 200ms ease-out forwards; }
@keyframes slide-in { from { transform: translateY(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slide-out { to { transform: translateY(-12px); opacity: 0; } }

/* guest + join */
.narrow, .guest { padding-top: 12vh; }
.guest-card, .join-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; padding-block: 32px; }
.guest-card .cube { display: none; }
.guest-card p, .join-msg { color: var(--muted); font-size: 1.0625rem; max-width: 34ch; }
.join { padding-top: 6vh; padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
.join-card .hero-main { margin: -32px -16px 0; width: calc(100% + 32px); justify-content: center; min-height: 190px; }
.join-card h1 { font-size: 1.75rem; overflow-wrap: anywhere; }
.join-card .name { text-transform: none; }
.join-card .btn.big { margin-bottom: 4px; }
.join-card .logo-lg { margin-top: 0; }
@media (min-width: 768px) { .join-card .hero-main { margin: -32px -24px 0; width: calc(100% + 48px); } }

/* reduced motion: static end states, no pulse, glow, stagger or drift */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .stagger .reveal, .stagger .step, .wipe { opacity: 1; transform: none; }
  .sky { opacity: 1 !important; }
  .sky-aurora, .cube::before { display: none; }
  .sky-c { opacity: calc(var(--stars) * .6); }
  .spark { display: none; }
  .cube[data-state="starting"] .tile { opacity: 1; }
  .cube[data-state="stopping"] .tile { opacity: .25; }
  .cube[data-state="online"]::after { transform: none; }
  .progress span { width: 100%; transform: none; opacity: .6; }
  .btn[aria-busy="true"]::after { border-right-color: currentColor; }
}
