/* JDNext community website (public pages; the panel keeps site.css + game.css).
   Built from the game's own menus and textures (img/game: title screen, global background, season art, logo,
   illustrations, star): translucent indigo panels, coral actions, the yellow selection with indigo text, condensed
   heavy type. The Dancer Card is the one loud element of every page. Pictures an admin uploads (panel → Website art)
   replace the defaults: /theme/fonts.css sets them on :root, which beats the html defaults below.
   CSP: no inline style, so per-item colours and bars are classes (.h0–.h11, .pct-0–.pct-100). */
html {
  --art-logo: url("/static/img/game/logo.png");
  --art-title-bg: url("/static/img/game/title-bg.jpg");
  --art-title-fx: none;
  --art-title-items: none;
  --art-page-bg: url("/static/img/game/page-bg.jpg");
}
:root {
  --field: #1400c8;
  --field-deep: #0b0078;
  --panel: rgba(37, 18, 186, .74);
  --panel-solid: #2512ba;
  --panel-hi: #3520ca;
  --line: rgba(175, 157, 255, .26);
  --ink: #fff;
  --soft: #cdc6ff;
  --dim: #a99ef0;
  --coral: #ff435c;
  --coral-hi: #ff6479;
  --yellow: #fff34b;
  --sel-ink: #26137b;
  --cyan: #00dcfa;
  --magenta: #fa45bc;
  --gold: #ffc93c;
  --green: #b5f052;
  --red: #ff435c;
  --font: GameUI, Bahnschrift, "Roboto Condensed", "Arial Narrow", "Segoe UI", system-ui, sans-serif;
  --cut: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--field-deep); scroll-padding-top: 96px; }
body.play {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font: 17px/1.5 var(--font);
  background: var(--field-deep) var(--art-page-bg) center / cover no-repeat fixed;
}
/* The game's logo as a picture (an uploaded one replaces it). */
.logo { display: block; background: var(--art-logo) center / contain no-repeat; }
.play a { color: var(--ink); }
.play a:hover { color: var(--yellow); }
.play h1, .play h2, .play h3 { font-stretch: condensed; font-weight: 800; line-height: 1.08; margin: 0 0 .5em; letter-spacing: .005em; }
.play h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); }
.play h2 { font-size: 1.45rem; }
.play h3 { font-size: 1.12rem; }
.play p { margin: 0 0 .9em; }
.play code { font-family: inherit; font-weight: 700; letter-spacing: .08em; background: rgba(11, 0, 120, .55); border-radius: 4px; padding: .1em .45em; }
.play :focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
/* On the yellow selection the focus ring turns white so it stays visible. */
.play .tab.on:focus-visible, .play .btn.select:focus-visible, .play .dl-os.on:focus-visible, .play .skip:focus-visible { outline-color: #fff; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted, .help, .hint { color: var(--soft); }
.help { max-width: 68ch; }
.hint { font-size: .92rem; margin: .2em 0 .6em; }
.small { font-size: .88rem; }
.hidden { display: none !important; }

/* ------------------------------------------------------------------ top bar (the game's menu header) */
.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 18px;
  padding: 10px clamp(16px, 3vw, 36px);
  background: linear-gradient(180deg, rgba(11, 0, 120, .92), rgba(20, 0, 200, .78));
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-stretch: condensed; font-size: 1.25rem; white-space: nowrap; }
.brand .logo { width: 48px; height: 48px; }
.tabs { display: flex; align-items: center; gap: 4px; margin: 0 auto; min-width: 0; }
.tabs a.tab {
  position: relative; padding: 9px 16px; border-radius: 4px; text-decoration: none; white-space: nowrap;
  font-weight: 700; font-stretch: condensed; font-size: 1.08rem; color: var(--soft);
}
.tabs a.tab:hover { color: var(--ink); background: rgba(255, 255, 255, .08); }
.tabs a.tab.on { color: var(--sel-ink); background: linear-gradient(100deg, var(--yellow), #fffbd0); box-shadow: 0 0 22px rgba(255, 243, 75, .25); }
.shoulder {
  display: inline-grid; place-items: center; min-width: 34px; height: 24px; padding: 0 7px; border-radius: 7px 7px 4px 4px;
  border: 1.5px solid rgba(255, 255, 255, .55); color: var(--ink); text-decoration: none; font-weight: 800; font-size: .78rem;
}
.shoulder:hover { background: var(--ink); color: var(--sel-ink); }
.me-chip { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.me-chip b { display: block; font-stretch: condensed; font-size: 1.02rem; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-chip small { display: flex; gap: 8px; color: var(--soft); font-size: .82rem; }
.coins::before { content: ""; display: inline-block; width: .8em; height: .8em; margin-right: .3em; border-radius: 50%; vertical-align: -.05em;
  background: radial-gradient(circle at 35% 30%, #fff6c8, var(--gold) 45%, #c98a00); box-shadow: 0 0 0 1.5px #8a5a00 inset; }
.lang { margin: 0; }
.bar .btn.ghost { padding: 6px 10px; }

/* ------------------------------------------------------------------ page frame */
.screen { width: 100%; max-width: 1280px; margin: 0 auto; padding: clamp(20px, 3vw, 40px) clamp(16px, 3vw, 40px) 64px; flex: 1; }
.screen.narrow { max-width: 560px; }
.foot { color: var(--dim); font-size: .88rem; padding: 26px clamp(16px, 3vw, 40px) 34px; border-top: 1px solid rgba(255, 255, 255, .1);
  background: linear-gradient(rgba(11, 0, 120, .55), rgba(11, 0, 120, .85)); }
.foot-in { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px 32px; }
.play .foot-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-stretch: condensed; font-size: 1.1rem; color: var(--ink); }
.foot-brand .logo { width: 40px; height: 40px; }
.foot-nav { justify-self: end; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.play .foot-nav a { color: var(--soft); font-weight: 700; text-decoration: none; }
.play .foot-nav a:hover { color: var(--yellow); }
.foot p { grid-column: 1 / -1; margin: 0; max-width: 90ch; }
/* Skip link: off screen until focused. */
.skip { position: absolute; z-index: 50; left: 12px; top: -80px; padding: 10px 16px; border-radius: 5px; background: var(--yellow);
  font-weight: 800; text-decoration: none; }
.play a.skip, .play a.skip:hover { color: var(--sel-ink); }
.skip:focus { top: 12px; }
#main:focus { outline: none; }
.banner.warn { background: var(--yellow); color: var(--sel-ink); padding: 10px 18px; text-align: center; font-weight: 700; }
.page-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 18px; margin-bottom: 22px; }
.page-title h1 { margin: 0; }
.page-title p { margin: 0; color: var(--soft); }

/* Panels: translucent indigo with one cut corner (the game's panels are rectangles with a clipped edge). */
.panel {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 22px;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
}
.play .card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 22px; margin-bottom: 20px;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%); }
.play .card.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.play .card > h2:first-child { margin-top: 0; }
.play .danger-zone { border-color: rgba(255, 67, 92, .7); }
.panel + .panel, .panel + section, section + .panel { margin-top: 20px; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel.danger { border-color: rgba(255, 67, 92, .7); }
.head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 30px 0 12px; }
.head-row h2 { margin: 0; }
.head-row a { color: var(--soft); font-weight: 700; text-decoration: none; }
.head-row a:hover { color: var(--yellow); }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 800; font-stretch: condensed; font-size: 1rem; letter-spacing: .03em; text-transform: uppercase; line-height: 1.15;
  color: var(--ink); background: rgba(255, 255, 255, .08); border: 1.5px solid rgba(255, 255, 255, .5); border-radius: 5px;
  padding: 11px 22px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: rgba(255, 255, 255, .18); color: var(--ink); }
.btn.primary { background: linear-gradient(180deg, #ff5368, #ff3556); border-color: #ff9baa; box-shadow: 0 6px 18px rgba(73, 0, 53, .3); }
.btn.primary:hover { background: var(--coral-hi); }
.btn.select { background: var(--yellow); color: var(--sel-ink); border-color: #fffbd0; }
.btn.select:hover { background: #fff98a; color: var(--sel-ink); }
.btn.ghost { background: transparent; border-color: rgba(255, 255, 255, .3); }
.btn.danger { background: rgba(255, 67, 92, .16); border-color: var(--red); color: #ffd3d9; }
.btn.danger:hover { background: var(--red); color: #fff; }
.btn.discord { background: #5865f2; border-color: #8c96ff; }
.btn.discord:hover { background: #6d78ff; }
.btn.small { padding: 6px 12px; font-size: .82rem; }
.btn.big { padding: 15px 30px; font-size: 1.15rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.inline { display: inline; margin: 0; }

/* ------------------------------------------------------------------ forms */
.form { display: flex; flex-direction: column; gap: 6px; }
.form label { font-weight: 700; margin-top: 10px; }
.form .btn { margin-top: 14px; align-self: flex-start; }
.form.row { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
.form.row label { margin: 0; }
.form.row .btn { margin: 0; }
.form.row input { flex: 1 1 220px; width: auto; }
.form + p, .form + .or, .form + form { margin-top: 18px; }
.play input, .play select, .play textarea {
  font: inherit; color: var(--ink); width: 100%; max-width: 100%;
  background: rgba(11, 0, 120, .55); border: 1.5px solid rgba(199, 187, 255, .4); border-radius: 5px; padding: 11px 13px;
}
.play input:focus, .play select:focus { border-color: var(--yellow); outline: none; }
.play input::placeholder { color: var(--dim); }
.play input[type=checkbox], .play input[type=radio] { width: 20px; height: 20px; accent-color: var(--yellow); }
.play input.code { font-size: 2rem; font-weight: 800; letter-spacing: .25em; text-align: center; text-transform: uppercase; }
.pw { display: flex; gap: 8px; align-items: center; }
.pw input { flex: 1; }
.or { text-align: center; color: var(--soft); margin: 1em 0; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 700; }

/* ------------------------------------------------------------------ messages, small facts */
.alert { border-radius: 5px; padding: 12px 16px; margin: 0 0 16px; font-weight: 700; border-left: 5px solid; }
.alert.ok { background: rgba(181, 240, 82, .15); border-color: var(--green); color: #e4ffc0; }
.alert.err { background: rgba(255, 67, 92, .18); border-color: var(--red); color: #ffd3d9; }
.alert.warn { background: rgba(255, 243, 75, .14); border-color: var(--yellow); color: #fffbd0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0 0 14px; }
.facts dt { color: var(--soft); font-weight: 700; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.links { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.status { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; }
.status .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--dim); }
.status.ok .dot { background: var(--green); box-shadow: 0 0 10px var(--green); }
.status.warn .dot { background: var(--yellow); box-shadow: 0 0 10px var(--yellow); }
.list { width: 100%; border-collapse: separate; border-spacing: 0 5px; }
.list th { text-align: left; color: var(--soft); font-size: .86rem; padding: 4px 12px; font-weight: 700; }
.list td { background: rgba(11, 0, 120, .4); padding: 12px; vertical-align: middle; }
.list td:first-child { border-radius: 5px 0 0 5px; }
.list td:last-child { border-radius: 0 5px 5px 0; }
.qr { background: #fff; border-radius: 8px; padding: 10px; width: 220px; height: 220px; margin: 8px 0 12px; }
.qr svg { width: 100%; height: 100%; display: block; }
.secret { font-size: 1.1rem; letter-spacing: .08em; }
ul.codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0 0 12px; }
ul.codes code { display: block; text-align: center; padding: 8px; font-size: 1.1rem; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 4px; font-weight: 800; font-size: .86rem;
  background: rgba(11, 0, 120, .6); border: 1px solid var(--line); white-space: nowrap; }
.chip.rank { background: var(--yellow); color: var(--sel-ink); border-color: transparent; }
.chip.gold { background: rgba(255, 201, 60, .2); border-color: var(--gold); color: #ffe7a6; }

/* ------------------------------------------------------------------ the title screen */
body.title { overflow: hidden; }
.title-screen {
  position: relative; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; text-align: center;
  padding: 40px 16px 120px; overflow: hidden; isolation: isolate;
  background: var(--field-deep) var(--art-title-bg) center / cover no-repeat;
}
/* The title's own layers (splashes, objects), when an admin uploads them. */
.title-screen::before, .title-screen::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--art-title-fx) center / cover no-repeat; }
.title-screen::after { background-image: var(--art-title-items); animation: drift 9s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translateY(-1.5%) scale(1.02); } }
.title-logo { width: clamp(220px, 40vmin, 440px); aspect-ratio: 1; margin: 0 auto; filter: drop-shadow(0 12px 40px rgba(20, 0, 120, .55)); }
.title-sub { display: table; margin: 10px auto 26px; padding: 4px 16px; border-radius: 4px; background: rgba(11, 0, 120, .5); font-size: clamp(1.05rem, 2.2vw, 1.4rem); color: var(--ink); font-weight: 600; }
.press { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; font-weight: 800; font-stretch: condensed;
  font-size: clamp(1.2rem, 2.8vw, 1.8rem); text-transform: uppercase; letter-spacing: .06em; padding: 12px 22px; border-radius: 6px;
  background: rgba(11, 0, 120, .55); text-shadow: 0 2px 10px rgba(11, 0, 120, .6); }
.press .glyph { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--ink); color: var(--sel-ink); font-size: .8em; }
.press .label { animation: blink 1.6s ease-in-out infinite; }
.press:hover, .press:focus-visible { color: var(--yellow); }
@keyframes blink { 50% { opacity: .35; } }
.title-foot { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 18px clamp(16px, 3vw, 36px); color: var(--ink); font-size: .92rem; background: linear-gradient(transparent, rgba(11, 0, 120, .7)); }
.title-foot .status { color: var(--ink); }
.title-screen.leaving { animation: leave .38s ease-in forwards; }
@keyframes leave { to { opacity: 0; transform: scale(1.06); } }

/* ------------------------------------------------------------------ hue classes (stable colour per player / song) */
.h0 { --a: #ff435c; --b: #fa45bc; } .h1 { --a: #ff7a2f; --b: #ff435c; } .h2 { --a: #ffc93c; --b: #ff7a2f; }
.h3 { --a: #b5f052; --b: #29c46a; } .h4 { --a: #29d6a0; --b: #00a7e1; } .h5 { --a: #00dcfa; --b: #2f6bff; }
.h6 { --a: #4f7bff; --b: #7a3cff; } .h7 { --a: #9b5cff; --b: #fa45bc; } .h8 { --a: #fa45bc; --b: #9b2cff; }
.h9 { --a: #ff5fa2; --b: #ffc93c; } .h10 { --a: #00dcfa; --b: #fa45bc; } .h11 { --a: #fff34b; --b: #29d6a0; }

/* ------------------------------------------------------------------ Dancer Card */
.dcard-wrap { perspective: 900px; }
.dcard {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 30%;
  position: relative; margin: 0; width: 100%; aspect-ratio: 2254 / 4008; border-radius: 14px; overflow: hidden; isolation: isolate;
  background: linear-gradient(165deg, var(--a, #4f7bff), var(--b, #9b5cff));
  box-shadow: 0 26px 60px rgba(5, 0, 70, .55), 0 0 0 2px rgba(255, 255, 255, .22) inset;
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .25s ease-out;
}
.dcard > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.dcard .dc-avatar { object-fit: contain; object-position: 50% 100%; z-index: 1; }
.dcard .dc-border { z-index: 3; object-fit: fill; }
/* Until the game sends its art the card is the player's colour with the name's first letter. */
.dcard .dc-initial { position: absolute; inset: 8% 0 26%; z-index: 1; display: grid; place-items: center; font-weight: 900; font-stretch: condensed;
  font-size: clamp(6rem, 18vw, 11rem); color: rgba(255, 255, 255, .9); text-shadow: 0 10px 40px rgba(0, 0, 0, .25); transform: skewX(-8deg); }
.dcard .dc-plate { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; padding: 46px 16px 16px;
  background: linear-gradient(transparent, rgba(11, 0, 120, .85) 55%); display: grid; gap: 2px; }
.dcard .dc-name { font-size: 1.5rem; font-weight: 900; font-stretch: condensed; line-height: 1.05; overflow-wrap: anywhere; }
.dcard .dc-alias { color: var(--yellow); font-weight: 700; font-size: .98rem; }
.dcard .dc-level { position: absolute; z-index: 4; top: 12px; left: 12px; display: grid; place-items: center; min-width: 52px; height: 52px; padding: 0 6px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: var(--ink); color: var(--sel-ink); font-weight: 900; font-size: 1.25rem; line-height: 1; }
.dcard .dc-level small { display: block; font-size: .55rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.dcard .dc-prestige { position: absolute; z-index: 4; top: 18px; right: 14px; }
.dcard .dc-sheen { position: absolute; inset: 0; z-index: 5; pointer-events: none; mix-blend-mode: soft-light; opacity: 0; transition: opacity .25s;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .7), transparent 45%); }
.dcard:hover .dc-sheen, .dcard.tilting .dc-sheen { opacity: 1; }
.dcard.small { border-radius: 10px; }
.dcard.small .dc-name { font-size: 1.05rem; }
.dcard.small .dc-plate { padding: 30px 10px 10px; }
.dcard.small .dc-level { min-width: 36px; height: 36px; font-size: .95rem; top: 8px; left: 8px; }
.dcard.small .dc-level small { display: none; }
.dcard.small .dc-initial { font-size: 4.2rem; }

/* Portrait: round avatar picture with a status ring. */
.portrait { position: relative; display: inline-grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%; overflow: hidden;
  background: linear-gradient(150deg, var(--a, #4f7bff), var(--b, #9b5cff)); font-weight: 900; font-stretch: condensed; font-size: 1.25rem;
  box-shadow: 0 0 0 3px var(--ring, rgba(255, 255, 255, .35)); }
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portrait.big { width: 72px; height: 72px; font-size: 2rem; }
.portrait.st-online { --ring: var(--green); }
.portrait.st-away { --ring: var(--gold); }
.portrait.st-dnd { --ring: var(--red); }
.portrait.st-offline { --ring: rgba(255, 255, 255, .22); filter: saturate(.55); }

/* ------------------------------------------------------------------ the profile (signed-in home)
   A stage lit in the player's own colours (the .hN hue of their card): the Dancer Card stands on a lit dance floor,
   the name is set huge and slanted like the game's song titles with an outlined echo in the card's colour. Under it
   the scoreboard (one strip, like the results screen), then highlights, places, songs and friends. */
.stage {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: minmax(190px, 290px) minmax(0, 1fr); gap: clamp(20px, 4vw, 60px); align-items: center;
  padding: clamp(20px, 3.4vw, 44px) clamp(20px, 3.4vw, 48px);
  border: 1px solid var(--line); border-radius: 8px 8px 0 0;
  background: linear-gradient(160deg, rgba(37, 18, 186, .88), rgba(11, 0, 120, .94));
  background:
    radial-gradient(55% 85% at 14% 20%, color-mix(in srgb, var(--a) 62%, transparent), transparent 72%),
    radial-gradient(45% 70% at 98% 105%, color-mix(in srgb, var(--b) 50%, transparent), transparent 70%),
    linear-gradient(160deg, rgba(37, 18, 186, .88), rgba(11, 0, 120, .94));
  clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 30px, 100% 100%, 0 100%);
}
/* The dance floor: light lines in perspective under the card. */
.stage::before {
  content: ""; position: absolute; z-index: -1; left: -20%; right: -20%; bottom: -2px; height: 46%; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .13) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .13) 0 1px, transparent 1px 48px);
  transform: perspective(380px) rotateX(58deg); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(transparent, #000 70%); mask-image: linear-gradient(transparent, #000 70%);
}
.stage-card { width: 100%; max-width: 260px; justify-self: center; }
.stage-info { min-width: 0; }
.stage-info .alert { margin-bottom: 18px; }
.play .stage-name {
  position: relative; z-index: 0; margin: 0 0 .18em; padding-right: .12em;
  font-size: clamp(2.8rem, 7.2vw, 6.4rem); font-weight: 900; font-stretch: condensed; line-height: .92; letter-spacing: -.01em;
  overflow-wrap: anywhere; transform: skewX(-8deg); transform-origin: 0 100%; text-shadow: 0 8px 34px rgba(5, 0, 70, .5);
}
.play .stage-name.long { font-size: clamp(2.2rem, 5vw, 4.4rem); }
.stage-name::before {
  content: attr(data-echo); position: absolute; z-index: -1; left: .055em; top: .055em; right: 0;
  color: transparent; -webkit-text-stroke: 2px var(--a, var(--magenta)); text-shadow: none; pointer-events: none;
}
.stage-sub { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--soft); font-size: 1.08rem; font-weight: 600; }
.stage-alias { color: var(--yellow); font-weight: 800; }
.stage-season { display: flex; align-items: center; gap: 18px; max-width: 560px; margin: 22px 0 24px; }
.hex { flex: none; display: grid; place-items: center; width: 78px; height: 78px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: linear-gradient(160deg, var(--yellow), var(--gold)); color: var(--sel-ink); font-weight: 900; font-size: 2rem; line-height: 1; text-align: center; }
.hex small { display: block; font-size: .6rem; text-transform: uppercase; letter-spacing: .08em; }
.stage-season .xp { flex: 1; min-width: 0; }
.xp { display: grid; gap: 7px; }
.xp b { display: flex; align-items: center; gap: 8px; font-stretch: condensed; font-size: 1.15rem; }
.xp b img { width: 22px; height: 22px; }
.xp-bar { height: 12px; border-radius: 6px; background: rgba(11, 0, 120, .7); overflow: hidden; box-shadow: 0 0 0 1px var(--line) inset; }
.xp-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--cyan), var(--magenta)); }
.xp small { color: var(--soft); }
.stage-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.code-chip { display: inline-flex; align-items: center; gap: 12px; padding: 6px 6px 6px 14px; border-radius: 6px;
  background: rgba(11, 0, 120, .6); border: 1px solid var(--line); }
.code-chip span { color: var(--soft); font-size: .86rem; font-weight: 700; }
.code-chip b { font-size: 1.25rem; letter-spacing: .12em; white-space: nowrap; }
.stage-hint { margin: 12px 0 0; color: var(--soft); font-size: .9rem; max-width: 52ch; }

/* One entrance, on page load: the card rises onto the floor and the name slides in. */
@media (prefers-reduced-motion: no-preference) {
  .stage-card { animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
  .stage-name { animation: slide-in .6s .12s cubic-bezier(.2, .8, .2, 1) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(28px) scale(.96); } }
  @keyframes slide-in { from { opacity: 0; transform: skewX(-8deg) translateX(-28px); } }
}

/* The scoreboard: one strip of results under the stage. Cells share 1px lines (the grid gap shows the strip's colour). */
.board { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; overflow: hidden; }
.score { padding: 14px 16px 13px; background: rgba(14, 3, 128, .94); min-width: 0; }
.score b { display: flex; align-items: center; gap: 6px; font-size: clamp(1.6rem, 2.4vw, 2.2rem); font-weight: 900; font-stretch: condensed; line-height: 1;
  font-variant-numeric: tabular-nums; }
.score b .coins::before { width: .62em; height: .62em; margin: 0; vertical-align: 0; }
.score > span { display: block; margin-top: 6px; color: var(--soft); font-weight: 700; font-size: .86rem; line-height: 1.25; }
.score.c-cyan b { color: var(--cyan); } .score.c-gold b { color: var(--gold); } .score.c-pink b { color: var(--magenta); }
.score.c-green b { color: var(--green); } .score.c-yellow b { color: var(--yellow); }
.score b.nil, .hl-value.nil { color: var(--dim); font-weight: 700; }
.stat-note { color: var(--dim); font-size: .86rem; margin: 10px 0 0; }

.profile { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 0 clamp(22px, 3vw, 44px); align-items: start; }
.profile-main, .profile-side { min-width: 0; }

/* Highlights: the best place is "selected" (the game's yellow with indigo ink); the other two sit on indigo. */
.highlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hl { display: grid; align-content: start; gap: 4px; padding: 16px 18px; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.hl-label { color: var(--soft); font-weight: 700; font-size: .9rem; }
.hl-value { font-size: clamp(2.2rem, 3.4vw, 2.9rem); font-weight: 900; font-stretch: condensed; line-height: 1; font-variant-numeric: tabular-nums; }
.hl-sub { display: block; color: var(--soft); font-size: .88rem; overflow-wrap: anywhere; }
.hl-place { background: linear-gradient(120deg, var(--yellow), #fffbd0); color: var(--sel-ink); border-color: transparent; }
.hl-place .hl-label, .hl-place .hl-sub { color: var(--sel-ink); opacity: .82; }
.hl-place .hl-value { transform: skewX(-8deg); }
.hl-place .hl-value.nil { color: var(--sel-ink); opacity: .5; }
.hl-song { display: flex; align-items: center; gap: 12px; margin-top: 4px; min-width: 0; }
.hl-song > span:last-child { min-width: 0; }
.hl-song b { display: block; font-stretch: condensed; font-size: 1.15rem; line-height: 1.15; overflow-wrap: anywhere; }

/* A small song cover (friend rows, places, recent songs). */
.mini-cover { position: relative; flex: none; display: block; width: 46px; height: 46px; border-radius: 5px; overflow: hidden;
  background: linear-gradient(150deg, var(--a, #4f7bff), var(--b, #9b5cff)); }
.mini-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Places on the leaderboards and recent songs: rows like the game's ranking list. */
.ranks, .recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rank-row { display: grid; grid-template-columns: 62px 46px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 8px 16px 8px 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.recent .rank-row { grid-template-columns: 46px minmax(0, 1fr) auto auto; padding-left: 8px; }
.rank-place { text-align: center; font-size: 1.7rem; font-weight: 900; font-stretch: condensed; line-height: 1; transform: skewX(-8deg); font-variant-numeric: tabular-nums; }
.rank-row.p1 { border-color: rgba(255, 201, 60, .75); background: linear-gradient(90deg, rgba(255, 201, 60, .24), var(--panel) 60%); }
.rank-row.p1 .rank-place { color: var(--gold); }
.rank-row.p2 .rank-place { color: #e3e6ff; }
.rank-row.p3 .rank-place { color: #ffae7a; }
.row-song { min-width: 0; }
.row-song b { display: block; font-stretch: condensed; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-song span { display: block; color: var(--soft); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-score { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }

.first-dance { margin-top: 30px; padding: clamp(22px, 3vw, 34px); border-radius: 6px; border: 2px dashed rgba(255, 243, 75, .55);
  background: rgba(11, 0, 120, .45); }
.first-dance h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.first-dance p { color: var(--soft); max-width: 60ch; }
.first-dance .actions { margin: 18px 0 0; }

.online-now { display: flex; align-items: center; gap: 8px; margin: -4px 0 12px; color: var(--soft); font-weight: 700; font-size: .92rem; }
.online-now .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.friends-list { display: grid; gap: 8px; }
.side-invite { justify-items: center; text-align: center; border-style: solid; background: var(--panel); }
.side-invite img { width: 100%; max-width: 220px; height: auto; }

/* Songs: cover tiles in a scrolling row (the game's song rows) or a grid. */
.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 172px); gap: 14px; overflow-x: auto; padding: 4px 2px 14px;
  scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .4) transparent; }
.shelf.grid { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); overflow: visible; }
.song { scroll-snap-align: start; min-width: 0; text-decoration: none; display: grid; gap: 7px; }
.cover { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: linear-gradient(150deg, var(--a, #4f7bff), var(--b, #9b5cff));
  box-shadow: 0 10px 26px rgba(5, 0, 70, .4); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover .drawn { position: absolute; inset: 0; padding: 12px; display: flex; align-items: flex-end; font-weight: 900; font-stretch: condensed; font-size: 1.35rem;
  line-height: 1; text-transform: uppercase; overflow: hidden; overflow-wrap: anywhere; }
.cover .chip { position: absolute; top: 8px; left: 8px; }
.song-meta b { display: block; font-stretch: condensed; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-meta span { display: block; color: var(--soft); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-score { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-weight: 800; }
.stars { display: inline-flex; gap: 1px; white-space: nowrap; }
.stars img { width: 15px; height: 15px; display: block; }
.stars img.off { opacity: .22; filter: grayscale(1); }
.stars.super img { filter: hue-rotate(130deg) saturate(1.4); } .stars.mega img { filter: hue-rotate(250deg) saturate(1.6); }

/* Friends: the rail on the hub and the full list. */
.friends-rail { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.friend { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; min-width: 0; }
.friend .who { min-width: 0; flex: 1; }
.friend .who b { display: block; font-stretch: condensed; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend .who span { display: block; font-size: .86rem; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend .who span.dancing { color: var(--yellow); font-weight: 700; }
.friend .mini-cover { width: 42px; height: 42px; flex: none; border-radius: 4px; overflow: hidden; position: relative; background: linear-gradient(150deg, var(--a), var(--b)); }
.friend .mini-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.friend .lvl { flex: none; font-weight: 900; font-size: .85rem; color: var(--sel-ink); background: var(--ink); border-radius: 4px; padding: 2px 6px; }
.friend form { margin: 0; }

.friend-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.friend-card { display: grid; gap: 8px; min-width: 0; }
.friend-card .state { display: flex; align-items: center; gap: 8px; color: var(--soft); font-size: .9rem; min-width: 0; }
.friend-card .state span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend-card .state .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: rgba(255, 255, 255, .3); }
.friend-card .state.st-online .dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.friend-card .state.st-away .dot { background: var(--gold); }
.friend-card .state.st-dnd .dot { background: var(--red); }
.friend-card .state.dancing { color: var(--yellow); font-weight: 700; }

.empty { display: grid; gap: 8px; justify-items: start; padding: 24px; border: 1.5px dashed rgba(255, 255, 255, .3); border-radius: 6px; color: var(--soft); }
.empty b { color: var(--ink); font-size: 1.1rem; }
.empty.with-art { grid-template-columns: minmax(0, 200px) minmax(0, 1fr); align-items: center; column-gap: 22px; border-style: solid; background: var(--panel); }
.empty.with-art > img { grid-row: span 3; width: 100%; height: auto; }
.empty.with-art > :not(img) { grid-column: 2; }
.friends-head { position: relative; overflow: hidden; border-radius: 6px; padding: 28px 24px; margin-bottom: 22px;
  background: var(--panel-solid) url("/static/img/game/friends-bg.png") center / cover no-repeat; }
.friends-head h1 { margin: 0 0 6px; }
.friends-head p { margin: 0; }

/* News tiles (the same tiles the game's home shows). */
.news { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tile { position: relative; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: linear-gradient(135deg, #4211bf, #1d0b5c); }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .tile-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px; display: grid; gap: 8px; justify-items: start;
  background: linear-gradient(transparent, rgba(11, 0, 120, .8)); }
.tile .tile-sub { font-weight: 800; font-stretch: condensed; font-size: 1.15rem; }
.tile .tile-btn { background: var(--ink); color: var(--sel-ink); font-weight: 800; border-radius: 4px; padding: 4px 12px; text-transform: uppercase; font-size: .85rem; }

/* ------------------------------------------------------------------ welcome (signed out) */
.welcome { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.welcome h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.welcome .lead { font-size: 1.15rem; color: var(--soft); max-width: 56ch; }
.welcome-art { width: 100%; height: auto; display: block; filter: drop-shadow(0 18px 40px rgba(11, 0, 120, .5)); }
.welcome-logo { width: clamp(120px, 16vw, 170px); aspect-ratio: 1; margin-bottom: 8px; }
/* Three drawn Dancer Cards fanned out (what an account gives you), the front one is "you". */
.card-fan { position: relative; width: 100%; max-width: 500px; aspect-ratio: 1 / .92; justify-self: center; }
.card-fan .dcard { position: absolute; top: 9%; left: 30%; width: 40%; transition: none; }
.card-fan .dcard .dc-initial { font-size: clamp(3.4rem, 9vw, 6.5rem); }
.card-fan .fan-l { transform: translateX(-62%) rotate(-11deg); filter: saturate(.85) brightness(.9); }
.card-fan .fan-r { transform: translateX(62%) rotate(11deg); filter: saturate(.85) brightness(.9); }
.card-fan .fan-c { z-index: 2; top: 0; left: 27%; width: 46%; }
.card-fan .fan-c .dc-name { font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
.ticks { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 30px; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: .38em; width: 16px; height: 9px; border: solid var(--yellow); border-width: 0 0 3px 3px;
  transform: rotate(-45deg); }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--yellow); color: var(--sel-ink); font-weight: 900; font-size: 1.3rem; }
.steps + .actions { margin: 20px 0 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 28px; }
.grid-2 > .panel { margin: 0; }

/* Narrow pages (log in, sign up, link a PC): the form sits on a panel next to the game logo. */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 480px); gap: clamp(20px, 5vw, 72px); align-items: center; min-height: 62vh; }
.auth-logo { width: clamp(150px, 22vw, 260px); aspect-ratio: 1; margin: 0 0 14px; }
.auth-side p { color: var(--soft); font-size: 1.1rem; max-width: 40ch; }
.play .auth-title { font-size: clamp(1.8rem, 3.4vw, 2.6rem); max-width: 16ch; transform: skewX(-8deg); transform-origin: 0 100%; }
.auth .panel h1 { font-size: 1.8rem; }

/* ------------------------------------------------------------------ my account */
.acct-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-bottom: 14px; }
.acct-who { flex: 1; min-width: 0; }
.acct-who h1 { margin: 0 0 2px; }
.acct-who p { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; font-size: 1.1rem; }
.acct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); grid-auto-flow: dense; gap: 20px; align-items: start; margin-top: 18px; }
.play .acct-grid > .card { margin: 0; }
.acct-wide { grid-column: 1 / -1; }
@media (max-width: 700px) {
  /* The PCs table becomes one block per PC, each value with its column name. */
  .list.stack, .list.stack tbody, .list.stack tr, .list.stack td { display: block; }
  .list.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .list.stack tr { margin-bottom: 8px; padding: 12px 14px; background: rgba(11, 0, 120, .4); border-radius: 5px; }
  .play .list.stack td { background: none; padding: 2px 0; border-radius: 0; }
  .list.stack td.cell-main { font-weight: 800; font-size: 1.05rem; }
  .list.stack td[data-label]::before { content: attr(data-label) ": "; color: var(--soft); font-weight: 700; }
  .list.stack td.cell-act { padding-top: 8px; }
}

/* ------------------------------------------------------------------ percent classes for bars */
.pct-0 { width: 0; } .pct-5 { width: 5%; } .pct-10 { width: 10%; } .pct-15 { width: 15%; } .pct-20 { width: 20%; } .pct-25 { width: 25%; }
.pct-30 { width: 30%; } .pct-35 { width: 35%; } .pct-40 { width: 40%; } .pct-45 { width: 45%; } .pct-50 { width: 50%; } .pct-55 { width: 55%; }
.pct-60 { width: 60%; } .pct-65 { width: 65%; } .pct-70 { width: 70%; } .pct-75 { width: 75%; } .pct-80 { width: 80%; } .pct-85 { width: 85%; }
.pct-90 { width: 90%; } .pct-95 { width: 95%; } .pct-100 { width: 100%; }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 1020px) {
  .bar { flex-wrap: wrap; gap: 10px 14px; }
  .tabs { order: 3; width: 100%; margin: 0; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .me-chip { margin-left: auto; }
  .board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .board .score:last-child { grid-column: span 2; }
  .profile { grid-template-columns: 1fr; }
  .welcome { grid-template-columns: 1fr; }
  .welcome-art { max-width: 520px; }
  .card-fan { max-width: 420px; }
  .auth { grid-template-columns: 1fr; min-height: 0; }
}
@media (max-width: 760px) {
  .stage { grid-template-columns: minmax(0, 150px) minmax(0, 1fr); gap: 18px; align-items: start; }
  .stage-actions, .stage-hint, .stage-season { grid-column: 1 / -1; }
  .stage-info { display: contents; }
  .stage-info > .alert { grid-column: 1 / -1; grid-row: 1; }
  .stage-card { grid-column: 1; }
  .stage-name, .stage-sub { grid-column: 2; }
  .play .stage-name { align-self: end; font-size: clamp(1.9rem, 8.4vw, 3.4rem); overflow-wrap: break-word; }
  .play .stage-name.long { font-size: clamp(1.5rem, 6vw, 2.4rem); }
  .stage-sub { align-self: start; margin-top: -12px; font-size: .98rem; }
  .stage-season { margin: 4px 0 2px; }
  .stage .dcard .dc-plate { padding: 26px 10px 10px; }
  .stage .dcard .dc-name { font-size: 1rem; }
  .stage .dcard .dc-alias { font-size: .8rem; }
  .stage .dcard .dc-level { min-width: 38px; height: 38px; font-size: 1rem; top: 8px; left: 8px; }
  .stage .dcard .dc-level small { display: none; }
  .stage .dcard .dc-initial { font-size: 4.6rem; }
  .highlights { grid-template-columns: 1fr 1fr; }
  .hl-place { grid-column: 1 / -1; }
  .foot-in { grid-template-columns: 1fr; }
  .foot-nav { justify-self: start; }
}
@media (max-width: 560px) {
  body.play { font-size: 16px; }
  .brand span:not(.logo) { display: none; }
  .me-chip small { display: none; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board .score:last-child { grid-column: 1 / -1; }
  .score { padding: 12px 14px; }
  .highlights { grid-template-columns: 1fr; }
  .rank-row { grid-template-columns: 44px 42px minmax(0, 1fr); gap: 10px; padding-right: 12px; }
  .rank-row .row-score { grid-column: 3; margin-top: -6px; color: var(--soft); font-size: .9rem; }
  .recent .rank-row { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .recent .rank-row .stars { grid-column: 3; grid-row: 1; }
  .recent .rank-row .row-score { grid-column: 2; grid-row: 2; }
  .rank-row .mini-cover { width: 42px; height: 42px; }
  .rank-place { font-size: 1.35rem; }
  .code-chip { width: 100%; justify-content: space-between; }
  .card-fan .fan-l { transform: translateX(-48%) rotate(-9deg); }
  .card-fan .fan-r { transform: translateX(48%) rotate(9deg); }
  .auth-logo { width: 96px; margin-bottom: 6px; }
  .play .auth-title { font-size: 1.5rem; margin-bottom: .3em; }
  .auth-side p { font-size: 1rem; }
  .shelf { grid-auto-columns: 42vw; }
  .empty.with-art { grid-template-columns: 1fr; }
  .empty.with-art > img { grid-row: auto; max-width: 220px; }
  .empty.with-art > :not(img) { grid-column: 1; }
  .facts { grid-template-columns: 1fr; gap: 2px 0; }
  .facts dd { margin-bottom: 8px; }
  .list { display: block; overflow-x: auto; }
  .title-foot { justify-content: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .title-screen::after, .press .label { animation: none; }
  .dcard { transition: none; transform: none; }
  .title-screen.leaving { animation: none; }
}

/* ------------------------------------------------------------------ downloads (/download)
   The system picker is the game's selection: tiles on indigo, the picked one yellow with indigo ink. Each step shows a
   small drawn screen of what the player will see (zip menu, the folder, the Windows warning, a terminal, the phone). */
.dl-head { max-width: 70ch; margin-bottom: 8px; }
.dl-lead { font-size: 1.12rem; color: var(--soft); }
.dl-version { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.dl-version .chip { background: var(--yellow); color: var(--sel-ink); }
.dl-notes { color: var(--soft); font-size: .95rem; border-left: 4px solid var(--coral); margin: 0 0 .9em; padding: 2px 0 2px 26px; }
.dl-notes li + li { margin-top: 2px; }
.dl-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 26px 0 22px; }
.dl-os { position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-items: center;
  padding: 18px 20px; text-decoration: none; background: var(--panel); border: 2px solid var(--line); border-radius: 6px;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%); }
.play a.dl-os:hover { border-color: var(--yellow); color: var(--ink); }
.dl-os-icon { grid-row: span 3; width: 54px; height: 54px; display: grid; place-items: center; }
.dl-os-name { font-size: 1.5rem; font-weight: 800; font-stretch: condensed; line-height: 1.1; }
.dl-os-sub { color: var(--soft); font-size: .9rem; }
.dl-os-size { font-weight: 800; color: var(--cyan); font-size: .9rem; }
.dl-yours { display: none; position: absolute; bottom: 14px; right: 16px; font-size: .78rem; font-weight: 800; padding: 1px 8px; border-radius: 3px; background: var(--coral); color: #fff; }
.dl-os.yours .dl-yours { display: block; }
.dl-os.on { background: var(--yellow); border-color: #fffbd0; color: var(--sel-ink); }
.play a.dl-os.on:hover { color: var(--sel-ink); }
.dl-os.on .dl-os-sub { color: var(--sel-ink); opacity: .8; }
.dl-os.on .dl-os-size { color: #d4152f; }
.dl-os-icon.win { grid-template-columns: 1fr 1fr; gap: 4px; padding: 6px; }
.dl-os-icon.win i { display: block; width: 100%; height: 100%; background: currentColor; border-radius: 2px; }
.dl-os-icon.tux { font-weight: 800; font-size: 1.3rem; border: 3px solid currentColor; border-radius: 8px; width: 50px; height: 44px; }
.dl-os-icon.tv i { display: block; width: 50px; height: 34px; border: 3px solid currentColor; border-radius: 4px; box-shadow: 0 7px 0 -4px currentColor; }
.shot.tv-shot { background: #232f3e; color: #fff; display: grid; place-items: center; }
.tv-shot .sh-url { padding: 6px 12px; background: #fff; color: #1b1b28; border-radius: 3px; font: 600 .78rem/1.3 Consolas, "DejaVu Sans Mono", monospace; max-width: 86%; overflow-wrap: anywhere; }
.dl-short code { font-size: 1.05rem; padding: 2px 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; overflow-wrap: anywhere; }
.dl-keys { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px 18px; }
.dl-keys kbd { display: inline-block; min-width: 2.4em; margin-right: 6px; padding: 2px 8px; text-align: center; border: 2px solid var(--line); border-radius: 6px; font: inherit; font-weight: 800; }
.dl-os-icon.phone i { display: block; width: 28px; height: 48px; border: 3px solid currentColor; border-radius: 7px; box-shadow: inset 0 -7px 0 -4px currentColor; }

.dl.js .dl-sys:not(.on) { display: none; }
.dl-sys + .dl-sys { margin-top: 20px; }
.dl-sys-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 18px; }
.dl-sys-head h2 { margin: 0; font-size: 2rem; }
.dl-steps { list-style: none; margin: 0 0 16px; padding: 0; counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px 18px; }
.dl-steps > li { counter-increment: step; display: grid; grid-template-rows: auto 1fr; gap: 12px; min-width: 0; }
.dl-steps > li > p { margin: 0; padding-left: 44px; position: relative; }
.dl-steps > li > p::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 50%; background: var(--coral); color: #fff; font-weight: 800; }
.dl-sha { margin-top: 6px; color: var(--soft); font-size: .88rem; }
.dl-sha summary { cursor: pointer; font-weight: 700; }
.dl-sha code { display: block; margin-top: 8px; overflow-wrap: anywhere; letter-spacing: .02em; }
.dl-after { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 26px; color: var(--soft); }

/* The drawn screens. */
.shot { position: relative; aspect-ratio: 16 / 10; margin: 0; border-radius: 6px; overflow: hidden; background: #f4f4f8; color: #1b1b28;
  font: 600 .82rem/1.3 "Segoe UI", system-ui, sans-serif; box-shadow: 0 0 0 1px var(--line), 0 10px 26px rgba(8, 0, 70, .35); }
.sh-file { position: absolute; left: 10%; top: 16%; padding: 6px 10px 6px 30px; background: #fff; border: 1px solid #c9c9d6; border-radius: 4px; max-width: 80%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-file.zip::before { content: ""; position: absolute; left: 8px; top: 50%; width: 14px; height: 16px; margin-top: -8px; background: #f5c542;
  border-radius: 2px; box-shadow: inset 6px 0 0 -2px #d39e17; }
.sh-menu { position: absolute; left: 34%; top: 42%; display: grid; min-width: 52%; background: #fff; border: 1px solid #c9c9d6; border-radius: 6px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18); padding: 4px; }
.sh-menu span { padding: 5px 10px; border-radius: 4px; }
.sh-menu .on, .sh-folder .on { background: #cfe3ff; outline: 2px solid #3d7cff; }
.sh-folder { list-style: none; margin: 0; padding: 8% 12%; display: grid; gap: 6px; }
.sh-folder li { padding: 3px 8px 3px 26px; position: relative; border-radius: 3px; }
.sh-folder li::before { content: ""; position: absolute; left: 6px; top: 50%; width: 13px; height: 15px; margin-top: -7.5px; background: #9aa0b8; border-radius: 2px; }
.sh-folder .dir::before { background: #f5c542; height: 11px; margin-top: -5.5px; }
.sh-folder .exe::before { background: var(--coral); border-radius: 3px; }
.shot.smart { background: #0a5cad; color: #fff; padding: 9%; display: grid; align-content: start; gap: 8px; }
.shot.smart b { font-size: 1rem; font-weight: 600; }
.sh-link { text-decoration: underline; justify-self: start; outline: 2px solid var(--yellow); outline-offset: 2px; }
.sh-run { position: absolute; right: 8%; bottom: 10%; padding: 5px 12px; border: 2px solid #fff; border-radius: 3px; outline: 2px solid var(--yellow); outline-offset: 2px; }
.shot.game { background: radial-gradient(circle at 30% 30%, #4b2bff, var(--field) 55%, var(--field-deep)); display: grid; place-items: center; }
.sh-logo { width: 46%; aspect-ratio: 1; }
.sh-toast { position: absolute; right: 7%; bottom: 9%; padding: 5px 12px; border-radius: 4px; background: var(--yellow); color: var(--sel-ink); font-weight: 800; }
.shot.term { background: #170c3a; color: #e9e4ff; padding: 7%; font: 600 .8rem/1.7 Consolas, "DejaVu Sans Mono", monospace; white-space: pre-wrap;
  overflow-wrap: anywhere; aspect-ratio: auto; min-height: 130px; }
.shot.term .p { color: var(--green); }
.shot.qr-shot { background: #fff; display: grid; place-items: center; padding: 5%; }
.shot.qr-shot svg { width: auto; height: 100%; max-width: 100%; }
.shot.phone-shot { background: var(--field-deep); display: grid; place-items: center; }
.shot.phone-shot::before { content: ""; position: absolute; inset: 6% 32%; border: 3px solid #cdc6ff; border-radius: 14px; background: #f4f4f8; }
.phone-shot .sh-row { position: absolute; z-index: 1; left: 36%; right: 36%; top: 22%; display: flex; align-items: center; justify-content: space-between; gap: 4px;
  font-size: .66rem; color: #1b1b28; }
.sh-toggle { flex: none; width: 22px; height: 12px; border-radius: 6px; background: #3d7cff; position: relative; }
.sh-toggle::after { content: ""; position: absolute; right: 2px; top: 2px; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.phone-shot .sh-run { z-index: 1; right: 36%; bottom: 16%; background: #3d7cff; color: #fff; border: 0; padding: 3px 8px; font-size: .66rem; }
.phone-shot.scan::before { background: #241656; }
.sh-frame { position: relative; z-index: 1; width: 22%; aspect-ratio: 1; border: 3px solid var(--yellow); border-radius: 6px; }
.sh-frame i { position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: var(--coral); box-shadow: 0 0 8px var(--coral); }
@media (prefers-reduced-motion: no-preference) {
  .sh-frame i { animation: dl-scan 1.8s ease-in-out infinite alternate; }
  @keyframes dl-scan { from { top: 12%; } to { top: 86%; } }
}
@media (max-width: 560px) {
  .dl-sys-head .btn { width: 100%; text-align: center; }
}

/* "New controller" banner on /download (DownloadsService.RecentControllerChange). */
.dl-new { display: flex; align-items: center; gap: 18px; margin: 0 0 22px; padding: 18px 22px;
  border: 2px solid var(--yellow); }
.dl-new .dl-os-icon { flex: none; }
.dl-new-text { flex: 1; min-width: 0; }
.dl-new h2 { margin: 0 0 4px; font-size: 1.2rem; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dl-new .chip, .dl-os-new { background: var(--yellow); color: var(--sel-ink); border-color: transparent; }
.dl-new p { margin: 0; }
.dl-os-new { position: absolute; top: 10px; right: calc(var(--cut, 14px) + 8px); }
@media (max-width: 640px) { .dl-new { flex-direction: column; align-items: stretch; text-align: left; } }

/* iPhone tile and steps (/download#ios): the web controller. */
.dl-os-icon.phone.ios i { border-radius: 9px; box-shadow: inset 0 5px 0 -3px currentColor; }
.phone-shot .sh-share { width: 14px; height: 14px; border: 2px solid currentColor; border-top: 0; position: relative; flex: none; }
.phone-shot .sh-share::before { content: ""; position: absolute; left: 50%; top: -7px; width: 2px; height: 11px; margin-left: -1px; background: currentColor; }
