/* WishSeller Games portal. System fonts only, no external resources. */
:root {
  color-scheme: dark;
  --bg: #111021;
  --rail: #151427;
  --panel: #1b1930;
  --panel-2: #221f3a;
  --edge: #312c48;
  --edge-2: #433961;
  --text: #f7f4ff;
  --muted: #b3aecb;
  --accent: #bdacff;
  --lilac: #bdacff;
  --amber: #ffb476;
  --action: #b7a0ff;
  --focus: #e4d6ff;
  --rail-width: 228px;
  --radius: 14px;
  --gutter: clamp(16px, 3vw, 44px);
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: border-box }
html { background: var(--bg) }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); line-height: 1.5; overflow-x: hidden }
a { color: inherit; text-decoration: none }
button, input, select { font: inherit; color: inherit }
button { cursor: pointer }
button:disabled { cursor: default; opacity: .55 }
img { display: block; max-width: 100% }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0 }
ul, ol { padding: 0 }
[hidden] { display: none !important }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .92em; background: #241f3d; padding: 1px 6px; border-radius: 5px }
.icon { width: 20px; height: 20px; display: block; flex: none }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
.skip:focus { position: fixed; top: 10px; left: 10px; z-index: 20; background: #fff; color: #151427; padding: 12px 16px; border-radius: 8px; font-weight: 700 }
.muted { color: var(--muted) }
.small { font-size: 13px }

/* ---------- Shell ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 5; width: var(--rail-width); display: flex; flex-direction: column;
  padding: 24px 16px 20px; background: var(--rail); border-right: 1px solid var(--edge); overflow-y: auto
}
.brand { display: flex; align-items: center; gap: 10px; width: max-content; padding: 3px; border-radius: 10px }
.brand img { width: 44px; height: 44px; object-fit: contain }
.wordmark { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.035em; line-height: 1 }
.wordmark small { display: block; color: var(--lilac); font-size: 10px; letter-spacing: .3em; font-weight: 700; margin-top: 5px }
.side-nav { display: grid; gap: 5px; margin-top: 26px }
.side-nav a, .side-label { min-height: 44px; display: flex; gap: 12px; align-items: center; padding: 0 12px; border: 1px solid transparent; border-radius: 10px; color: var(--muted); font-size: 14.5px; font-weight: 600 }
.side-nav a:hover, .side-nav a[aria-current] { background: #282242; color: #ece6ff }
.side-nav a[aria-current] { border-color: #4a3e74 }
.side-label { margin-top: 26px; min-height: 30px; font-size: 13px; font-weight: 600; color: #b8b0d1 }
.side-label:hover, .side-label[aria-current] { color: #fff }
.side-label + .side-nav { margin-top: 4px }
.side-end { margin-top: auto; padding-top: 24px }
.random { width: 100% }

.workspace { margin-left: var(--rail-width); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column }
.topbar {
  position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 16px; min-height: 76px; padding: 12px var(--gutter);
  border-bottom: 1px solid #312c4880; background: #111021ec; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px)
}
.search { position: relative; display: flex; align-items: center; gap: 10px; width: min(100%, 480px); height: 46px; padding: 0 12px; border: 1px solid #3b3556; border-radius: 12px; background: var(--panel); color: #c3bddc }
.search:focus-within { border-color: #a58cf5; box-shadow: 0 0 0 3px #a58cf533 }
.search { min-width: 0 }
.search input { flex: 1; min-width: 0; width: 100%; height: 100%; border: 0; background: none; outline: none; color: var(--text); font-size: 16px }
.search input::placeholder { color: #a9a3c2 }
.search input::-webkit-search-cancel-button { filter: invert(.8) }
.search kbd { min-width: 24px; text-align: center; border: 1px solid #463c5e; border-radius: 6px; color: #c4bce1; font: 13px/22px ui-monospace, monospace }
.top-actions { display: flex; gap: 8px; margin-left: auto }
.mobile-brand, .mobile-only, .mobile-nav { display: none !important }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; flex: none; padding: 0; border: 1px solid var(--edge-2); color: #e2d9fb; border-radius: 11px; background: #1d1a31 }
.icon-button:hover { background: #2d2449; color: #fff }
.icon-button[aria-pressed="true"] { background: #352757; border-color: #6f5aa5; color: #f0e8ff }
.icon-button[aria-pressed="true"] .icon[data-icon-name="heart"] { fill: #d3c2ff }
.icon-button.done { border-color: #6bd3a3; color: #b9f5d9 }

main { width: min(100%, 1560px); margin-inline: auto; padding: 26px var(--gutter) 44px; flex: 1 }
main:focus { outline: none }
.footer { padding: 14px var(--gutter) 22px; border-top: 1px solid #322b48; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 14px }
.footer-nav { display: flex; gap: 18px }

/* ---------- Buttons, chips, links ---------- */
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border: 1px solid transparent; border-radius: 11px; font-size: 14.5px; font-weight: 700; white-space: nowrap; text-align: center }
.button .icon { width: 17px; height: 17px }
.button.primary { background: var(--action); color: #1a1033 }
.button.primary:hover { background: #d4c6ff }
.button.secondary { background: #262039; border-color: #4a3f66; color: #f0ebfd }
.button.secondary:hover { background: #352a50 }
.button.big { min-height: 56px; padding-inline: 26px; font-size: 16px; border-radius: 14px; box-shadow: 0 10px 30px #0008 }
.text-link { display: inline-flex; align-items: center; gap: 4px; color: #cdb6ff; font-weight: 650; font-size: 14.5px; min-height: 32px }
.text-link:hover { color: #f1e9ff; text-decoration: underline; text-underline-offset: 3px }
.text-link .icon { width: 17px; height: 17px }
button.text-link { background: none; border: 0; padding: 0; cursor: pointer; justify-self: start; text-align: left }
.chips { display: flex; flex-wrap: wrap; gap: 8px }
.chip { min-height: 42px; display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; color: #cbc5dc; border: 1px solid #39324f; border-radius: 10px; background: #1c192e; font-size: 14px; font-weight: 620 }
.chip .icon { width: 16px; height: 16px }
.chip:hover { background: #2a2342; color: #fff }
.chip[aria-current] { background: #3a2a5c; color: #f5edff; border-color: #7a63a8 }
.genres { margin-top: 22px }

/* ---------- Hero ---------- */
.hero {
  position: relative; display: flex; align-items: center; min-height: clamp(340px, 31vw, 470px); isolation: isolate;
  overflow: hidden; background: #24183c; border-radius: 26px; border: 1px solid #4a3862
}
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #16112af5 3%, #1f1636dc 30%, #1a142966 54%, transparent 74%), linear-gradient(0deg, #130d2490, transparent 50%) }
.hero-art { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover }
.hero-content { width: min(55%, 560px); padding: 34px clamp(24px, 4vw, 58px) }
.eyebrow { display: flex; align-items: center; gap: 7px; margin-bottom: 14px; color: #e4d3ff; font-size: 13.5px; font-weight: 650 }
.eyebrow .icon { width: 17px; height: 17px; color: var(--amber) }
.hero h1 { font-size: clamp(3.2rem, 6vw, 6.4rem); line-height: .9; letter-spacing: -.065em; font-weight: 850; max-width: 7ch; outline: none }
.hero-summary { margin-top: 18px; max-width: 32ch; color: #e6ddf6; font-size: 17px }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 24px }

/* ---------- Shelves and cards ---------- */
.shelf { margin-top: 34px }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px }
.section-head h2, .section-title { font-size: clamp(24px, 3vw, 33px); line-height: 1.1; letter-spacing: -.04em; font-weight: 800 }
.section-title { margin-bottom: 14px }
.section-head .text-link { flex: none }
.game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px }
.card { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--panel), color-mix(in srgb, var(--accent) 12%, var(--panel))); border: 1px solid #35304b; border-radius: var(--radius); transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease }
.card:hover { border-color: color-mix(in srgb, var(--accent) 70%, #fff 0%); transform: translateY(-2px); box-shadow: 0 12px 30px -12px color-mix(in srgb, var(--accent) 55%, transparent) }
.card:has(.card-link:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px }
.card-link { display: block; border-radius: var(--radius) }
.card-link:focus-visible { outline: none }
.card-media { position: relative; aspect-ratio: 16 / 10; background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--accent) 55%, #000), #1d1830 70%) }
.card-art { width: 100%; height: 100%; object-fit: cover }
.card-meta { padding: 11px 13px 14px; border-top: 2px solid color-mix(in srgb, var(--accent) 60%, transparent) }
.card-meta h3 { font-size: 17.5px; letter-spacing: -.02em; font-weight: 750; line-height: 1.25 }
.card-meta p { color: var(--muted); font-size: 13.5px; margin-top: 2px }
.card-meta .card-note { color: var(--amber); font-weight: 600 }
.card-fav { position: absolute; top: 9px; right: 9px; width: 42px; height: 42px; background: #17122bd0; backdrop-filter: blur(6px) }
.badge { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 750; backdrop-filter: blur(6px) }
.badge .icon { width: 13px; height: 13px }
.badge-play { background: #120d24d9; color: #f2ecff; border: 1px solid color-mix(in srgb, var(--accent) 70%, transparent) }
.badge-status { background: #2a1a0ad9; color: var(--amber); border: 1px solid #ffb47666 }
img.img-failed { visibility: hidden }
.img-missing { background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--accent) 55%, #000), #1d1830 70%) }

/* ---------- Catalog ---------- */
.page-head { margin-bottom: 18px }
.page-title { font-size: clamp(36px, 5.5vw, 64px); letter-spacing: -.055em; line-height: 1.04; margin: 4px 0 8px; font-weight: 850; outline: none; overflow-wrap: anywhere }
.page-sub { color: var(--muted); font-size: 16px; max-width: 65ch }
.filters { display: grid; gap: 14px; padding: 16px; margin-bottom: 22px; background: #17152a; border: 1px solid var(--edge); border-radius: 16px }
.filter-group { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: center }
.filter-label { color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em }
.filter-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center }
.select { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; font-weight: 600 }
.select select { min-height: 44px; padding: 0 36px 0 12px; border: 1px solid #4a3f66; border-radius: 10px; background: #262039 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cdb6ff' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px; color: var(--text); appearance: none }
.empty { margin-top: 6px; padding: 24px; background: var(--panel); border: 1px solid var(--edge); border-radius: 16px }
.empty h2 { font-size: 22px }
.empty p { color: var(--muted); margin: 6px 0 14px }
.pagination { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px }
.notice { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 14px; padding: 12px 14px; border-radius: 12px; border: 1px solid #ffb47666; background: #2a1d14; color: #ffe1c7; font-size: 14.5px }
.notice .icon { color: var(--amber); margin-top: 2px }
.tabs { margin-bottom: 6px }
.shelf.solo { margin-top: 18px }
.library .shelf .section-title { font-size: 24px }
.table-wrap { overflow-x: auto; border: 1px solid var(--edge); border-radius: 14px }
.bests { width: 100%; border-collapse: collapse; font-size: 15px }
.bests th, .bests td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--edge); vertical-align: top }
.bests thead th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; background: #17152a }
.bests tbody tr:last-child > * { border-bottom: 0 }
.bests td:nth-child(2) { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--amber) }
.credits td:nth-child(2) { color: inherit; font-weight: 400 }

/* ---------- Game page ---------- */
.back { margin-bottom: 10px }
.game-header { display: flex; gap: 14px; align-items: flex-end; justify-content: space-between; margin-bottom: 16px }
.game-header h1 { font-size: clamp(34px, 5vw, 60px); line-height: 1; letter-spacing: -.055em; font-weight: 850; outline: none }
.game-header p { margin-top: 8px; color: var(--muted) }
.game-actions { display: flex; gap: 8px; flex: none }
.player { scroll-margin-top: 88px; position: relative; display: flex; flex-direction: column; border-radius: 20px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--accent) 45%, #403661); background: #100d20 }
.player-viewport { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 320px }
.player-cover, .studio-cover { position: relative; min-height: clamp(300px, 40vw, 520px); display: grid; place-items: center; isolation: isolate; padding: 24px; overflow: hidden }
.player-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2 }
.player-cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at center, #1a112c40, #1a112cb0); z-index: -1 }
.studio-cover { border-radius: 20px; border: 1px solid color-mix(in srgb, var(--accent) 45%, #403661); background: #1d1830; place-items: end center }
.cover-label { background: #181329e0; border: 1px solid #ffb47655; color: #ffe0c4; border-radius: 10px; padding: 8px 14px; font-size: 14px; font-weight: 600; text-align: center }
.player-toolbar { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; padding: 8px; background: #151127; border-top: 1px solid #2f2847 }
.tool { min-height: 44px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid #3b3256; border-radius: 10px; background: #1f1a33; color: #e6defc; font-size: 14px; font-weight: 650 }
.tool:hover:not(:disabled) { background: #2d2449 }
.tool .icon { width: 18px; height: 18px }
.tool[data-player-action="sound"][aria-pressed="false"] { color: var(--amber) }
.player-message { margin: auto; padding: 40px 20px; display: grid; gap: 12px; justify-items: center; text-align: center; max-width: 480px }
.player-message h2 { font-size: 22px }
.player-message p { color: var(--muted) }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid #3a3058; border-top-color: var(--accent); animation: spin .8s linear infinite }
@keyframes spin { to { transform: rotate(1turn) } }
.player:fullscreen { border-radius: 0; border: 0; width: 100vw; height: 100vh }
.player:fullscreen .player-viewport { min-height: 0 }
.player:-webkit-full-screen { width: 100vw; height: 100vh }

.game-info { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; margin-top: 20px; align-items: start }
.game-main { display: grid; gap: 16px }
.lead { font-size: 19px; color: #ece6fb; max-width: 60ch }
.panel { background: var(--panel); border: 1px solid var(--edge); border-radius: 16px; padding: 18px 20px }
.panel h2 { font-size: 20px; letter-spacing: -.02em; margin-bottom: 10px }
.panel h3 { font-size: 15px; margin: 14px 0 6px; color: #e9e2fa }
.panel p { color: #ddd6eb }
.panel p + p, .panel ul + p, .panel ol + p { margin-top: 8px }
.panel .muted.small { margin-top: 12px }
.steps { padding-left: 22px; display: grid; gap: 6px; color: #e3dcf2 }
.steps li::marker { color: var(--accent); font-weight: 800 }
.features { padding-left: 20px; display: grid; gap: 4px; color: #e3dcf2 }
.controls { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--edge) }
.controls dt { display: flex; gap: 7px; align-items: center; font-weight: 700; color: #f0eafd }
.controls dt .icon { width: 17px; height: 17px; color: var(--accent) }
.controls dd { color: #d7cfe8 }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; font-size: 14.5px }
.facts dt { color: var(--muted) }
.facts dd { overflow-wrap: anywhere }
.facts [data-best-for] { color: var(--amber); font-weight: 750 }
.platform-list { list-style: none; display: grid; gap: 10px; margin-bottom: 10px }
.platform-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--edge); border-radius: 12px; background: #17152a }
.platform-row > .icon { color: var(--accent); margin-top: 2px }
.platform-row > div { flex: 1 }
.platform-row p { font-size: 14px; color: var(--muted); margin-top: 2px }
.status { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: #2a1d14; color: var(--amber); border: 1px solid #ffb47655 }
.status-available { background: #12291f; color: #9ff0c8; border-color: #4bc89255 }
.gallery { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px }
.gallery a { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--edge); background: #1d1830 }
.gallery a:hover { border-color: var(--accent) }
.shot { width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover }

/* ---------- Prose pages ---------- */
.prose { max-width: 760px }
.prose h2 { font-size: 22px; margin: 26px 0 8px; letter-spacing: -.02em }
.prose p, .prose li { color: #ddd6eb }
.prose ul { padding-left: 22px; display: grid; gap: 4px; margin-top: 8px }
.prose p + p { margin-top: 10px }
.privacy-box { margin: 18px 0 6px }
.privacy-box h3 { margin-top: 0 }
.privacy-box .button { margin-top: 12px }

/* ---------- Games (runtime) ---------- */
.g-stage { flex: 1; display: grid; gap: 12px; justify-items: center; align-content: center; align-content: safe center; padding: 18px; min-height: 360px; background: radial-gradient(ellipse at top, color-mix(in srgb, var(--accent) 28%, #1b1235), #141024 70%) }
.g-hud { display: flex; justify-content: center; gap: 18px; font-variant-numeric: tabular-nums; font-weight: 650; color: #e7dcfa }
.g-hud b { font-size: 1.15em; color: #fff }
.g-status { min-height: 24px; color: #dccff2; text-align: center }
.g-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center }
.g-round { min-width: 150px }
.g-lane { min-width: 64px }
.orbit-wrap { width: min(100%, 760px); aspect-ratio: 16 / 9; max-height: 52vh; border-radius: 12px; overflow: hidden; background: #0e0b1c; touch-action: none }
.orbit-canvas { width: 100%; height: 100%; display: block; cursor: pointer; touch-action: none }
.rune-grid { width: min(100%, 360px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px }
.rune-pad { position: relative; min-height: 96px; border-radius: 16px; border: 2px solid; font-size: 36px; color: #e8fff5; transition: background-color .12s, transform .12s; touch-action: manipulation }
.rune-pad:disabled { opacity: 1; cursor: default }
.rune-key { position: absolute; top: 6px; left: 10px; font-size: 13px; font-weight: 700; opacity: .7 }
.rune-jade { background: #1f4038; border-color: #43776a }
.rune-amber { background: #45311c; border-color: #8a6234; color: #ffe7cf }
.rune-violet { background: #31264f; border-color: #6a55a3; color: #efe6ff }
.rune-sky { background: #1d3550; border-color: #44709e; color: #e3f1ff }
.rune-jade.flash { background: #a1f2cd; color: #0f2a20; border-color: #d4ffe9 }
.rune-amber.flash { background: #ffcf8f; color: #3a2208; border-color: #fff0d8 }
.rune-violet.flash { background: #cdb8ff; color: #241446; border-color: #f1e9ff }
.rune-sky.flash { background: #9fd3ff; color: #0c2236; border-color: #e3f3ff }
.rune-pad.flash { transform: scale(1.03) }
.nova-target { display: grid; place-items: center; width: min(100%, 280px); min-height: 120px; font-size: 54px; border-radius: 18px; border: 2px solid #645085; background: #2b1d43; color: #bca7dc }
.nova-target[data-type="sun"] { border-color: #dd945b; background: var(--amber); color: #3a1a06 }
.nova-target[data-type="moon"] { border-color: #b19afc; background: var(--lilac); color: #20113d }
.nova-target.good { animation: pulse-good .3s ease }
.nova-target.bad { animation: pulse-bad .3s ease }
@keyframes pulse-good { 50% { box-shadow: 0 0 0 10px #6bd3a355 } }
@keyframes pulse-bad { 50% { box-shadow: 0 0 0 10px #ff6b6b66 } }
.nova-clock { font-variant-numeric: tabular-nums; font-weight: 700; color: #f2e9ff }
.nova-pick { min-width: 132px; min-height: 56px; font-size: 16px; touch-action: manipulation }
.nova-pick kbd { font: 12px/18px ui-monospace, monospace; border: 1px solid #5a4c7c; border-radius: 5px; padding: 0 5px; opacity: .8 }
.nova-sun:not(:disabled) { border-color: #dd945b }
.nova-moon:not(:disabled) { border-color: #9d86f0 }
/* Fullscreen has a fixed height: a game taller than the screen (big levels, phones in landscape)
   scrolls inside the stage instead of being cut off. */
.player:fullscreen .g-stage { padding: 24px; overflow-y: auto }
.player:-webkit-full-screen .g-stage { overflow-y: auto }

/* Top players */
.top-panel h2 { display: flex; align-items: center; gap: 8px }
.top-panel h2 .icon, .top-board h2 .icon { color: var(--amber) }
.top-list { list-style: none; display: grid; gap: 4px; margin: 4px 0 10px }
.top-list li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 38px; padding: 4px 10px; border-radius: 10px; background: #17152a; font-size: 14.5px }
.top-list li:nth-child(1) .top-rank { background: #ffcf5c; color: #2a1a00 }
.top-list li:nth-child(2) .top-rank { background: #d9d4ea; color: #1d1830 }
.top-list li:nth-child(3) .top-rank { background: #e0a272; color: #2a1406 }
.top-list li.me { outline: 2px solid var(--accent); background: #251d3d }
.top-rank { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #2c2547; font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums }
.top-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650 }
.top-name small { color: var(--amber); font-weight: 600 }
.top-value { color: var(--amber); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13.5px }
.player-box { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--edge); display: grid; gap: 6px }
.top-join .player-box { margin-top: 0; padding-top: 0; border-top: 0 }
.player-box p { margin: 0 }
.player-box .icon { width: 17px; height: 17px; vertical-align: -3px; margin-right: 6px; color: var(--amber) }
.player-row { display: flex; flex-wrap: wrap; gap: 8px }
.form-msg { color: var(--amber) }
.form-msg:empty { display: none }
.form-msg.good { color: #8fe3b0 }

/* Account page */
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; max-width: 860px }
.account-form { display: grid; gap: 6px; align-content: start; scroll-margin-top: 90px }
.account-form h2 { margin: 0 0 6px; font-size: 20px }
.account-form label { font-weight: 700; margin-top: 6px }
.account-form input { width: 100%; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid #4a3f66; border-radius: 10px; background: #17152a; color: var(--text); font-size: 16px }
.account-form input:focus { outline: 3px solid var(--focus); outline-offset: 1px }
.account-form .button { margin-top: 10px; justify-self: start }
.field-help { margin: 0 }
.field-help.good { color: #8fe3b0 }
.field-help.bad { color: var(--amber) }
.account-card { max-width: 860px }
.account-card h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 21px }
.account-card h2 .icon { color: var(--amber) }
.account-danger { max-width: 860px; margin-top: 14px }
.account-danger summary { cursor: pointer; font-weight: 700; min-height: 32px; display: flex; align-items: center }
.account-danger .account-form { margin-top: 8px; max-width: 420px }
.button.danger { background: #5a1f2e; border-color: #a2405a; color: #ffe4ea }
.button.danger:hover { background: #73283a }
.account-note { max-width: 860px; margin-top: 14px }
.top-page .top-join { margin-bottom: 18px; max-width: 640px }
.top-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px }
.top-board { border-top: 3px solid var(--accent); scroll-margin-top: 90px }
.top-board-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px }
.top-board-head h2 { margin: 0; font-size: 19px }
.small-button { min-height: 40px; padding: 0 12px; font-size: 13.5px }

/* Level-based games (runtime/levels.js) */
.g-stage.lv-stage { justify-items: stretch; align-content: start; gap: 10px }
.lv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-variant-numeric: tabular-nums; font-weight: 650; color: #e7dcfa }
.lv-bar b { color: #fff; font-size: 1.1em }
.lv-bar .tool { min-height: 40px }
.lv-info { flex: 1; min-width: 0; text-align: right; color: var(--amber); font-size: 14px }
/* No min-height on .lv-wrap: an explicit one lets a fixed-height stage (fullscreen) squeeze the wrap
   below the board's content, and the centred board then spills up over the level bar. The board's
   own min-height still keeps the 360px (320px on phones) floor. "safe center" starts an overflowing
   board at the top instead of centring it; browsers without "safe" keep plain "center". */
.lv-wrap { position: relative; display: grid }
.lv-board { display: grid; place-items: center; align-content: center; align-content: safe center; gap: 10px; min-height: 360px }
.lv-overlay { position: absolute; inset: 0; z-index: 2; display: grid; align-content: center; justify-items: center; gap: 12px; padding: 20px; text-align: center; background: #120d24eb; border: 1px solid #3b3256; border-radius: 14px; overflow-y: auto }
.lv-overlay.lv-overlay-menu { align-content: start }
.lv-overlay h3 { font-size: clamp(22px, 3vw, 30px); letter-spacing: -.03em }
.lv-goal { max-width: 46ch; color: #e6ddf6 }
.lv-hint, .lv-progress { color: var(--muted); font-size: 14px }
.lv-record { color: var(--amber); font-weight: 700 }
.lv-score-line { font-size: 20px; font-weight: 750 }
.lv-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center }
.lv-menu-head { display: grid; gap: 4px }
.lv-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; width: min(100%, 600px) }
.lv-cell { min-height: 44px; border-radius: 9px; border: 1px solid #4a3f66; background: #262039; color: #f0ebfd; font-weight: 750; font-variant-numeric: tabular-nums }
.lv-cell:hover:not(:disabled) { background: #372b52 }
.lv-cell.done { background: color-mix(in srgb, var(--accent) 35%, #241d3a); border-color: color-mix(in srgb, var(--accent) 70%, transparent) }
.lv-cell.next { box-shadow: 0 0 0 2px var(--amber) inset }
.lv-cell:disabled { opacity: .4; font-size: 13px }
.cv-wrap { justify-self: center; width: min(100%, 780px); aspect-ratio: 16 / 9; max-height: 56vh; border-radius: 12px; overflow: hidden; background: #0e0b1c; touch-action: none }
.cv { width: 100%; height: 100%; display: block; touch-action: none; cursor: pointer }
.player:fullscreen .cv-wrap { max-height: 78vh }
.lv-btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center }
.lv-btn-row .button { min-width: 72px; min-height: 52px; font-size: 20px }
.player:fullscreen .orbit-wrap { max-height: 72vh }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  :root { --rail-width: 196px }
  .sidebar { padding-inline: 12px }
  .hero-content { width: 60% }
  .game-info { grid-template-columns: 1fr }
}
@media (max-width: 760px) {
  .sidebar, .desktop-only, .search kbd { display: none !important }
  .mobile-brand { display: flex !important }
  .mobile-only { display: grid !important }
  .mobile-brand { gap: 6px; flex: none }
  .mobile-brand img { width: 34px; height: 34px }
  .mobile-brand .wordmark { font-size: 16px }
  .mobile-brand .wordmark small { font-size: 8px; letter-spacing: .22em; margin-top: 4px }
  .workspace { margin-left: 0; padding-bottom: calc(64px + env(safe-area-inset-bottom)) }
  .topbar { gap: 8px; min-height: 64px; padding: 10px 12px }
  .search { width: auto; flex: 1; height: 44px; padding: 0 9px; gap: 7px }
  .search .icon { width: 17px; height: 17px }
  .top-actions { margin-left: 0 }
  .mobile-nav {
    position: fixed; inset: auto 0 0; z-index: 6; display: grid !important; grid-template-columns: repeat(5, 1fr); gap: 2px;
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom)); background: #17152af2; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid #433756
  }
  .mobile-nav a { display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 52px; color: var(--muted); font-size: 11.5px; font-weight: 600; border-radius: 10px }
  .mobile-nav a[aria-current] { color: #ecdcff; background: #302342 }
  .mobile-nav .icon { width: 20px; height: 20px }
  main { padding: 14px 12px 28px }
  .hero { min-height: 360px; align-items: flex-end; border-radius: 18px }
  .hero::after { background: linear-gradient(0deg, #120c26fc 0%, #21163ceb 30%, #1b102440 66%, transparent 100%) }
  .hero-content { width: 100%; padding: 18px }
  .hero h1 { max-width: none; font-size: clamp(2.5rem, 11vw, 4rem); letter-spacing: -.055em }
  .eyebrow { margin-bottom: 8px }
  .hero-summary { margin-top: 8px; font-size: 16px }
  .hero-actions { margin-top: 14px }
  .hero-actions .button { flex: 1 1 140px }
  .genres { margin-top: 14px }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -12px; padding: 2px 12px 4px }
  .chips::-webkit-scrollbar { display: none }
  .chip { flex: none }
  .shelf { margin-top: 26px }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px }
  .card-fav { width: 40px; height: 40px; top: 6px; right: 6px }
  .card-meta { padding: 8px 10px 11px }
  .card-meta h3 { font-size: 15.5px }
  .card-meta p { font-size: 12.5px }
  .badge { left: 6px; bottom: 6px; font-size: 11.5px; padding: 3px 8px 3px 6px }
  .card { border-radius: 12px }
  .filters { padding: 12px; gap: 12px }
  .filter-group { grid-template-columns: 1fr; gap: 6px }
  .filters .chips { margin-inline: -12px }
  .game-header { flex-wrap: wrap; align-items: flex-start }
  .game-header h1 { font-size: 38px }
  .player { border-radius: 16px; scroll-margin-top: 72px }
  .player-cover, .studio-cover { min-height: 260px }
  .g-stage { padding: 12px; min-height: 0 }
  .orbit-wrap { aspect-ratio: 4 / 5; max-height: 56vh; max-height: 56dvh }
  .g-lane-text { display: none }
  .g-lane { min-width: 72px; min-height: 52px; font-size: 22px }
  .rune-pad { min-height: 88px }
  .lv-grid { grid-template-columns: repeat(5, minmax(0, 1fr)) }
  .top-grid { grid-template-columns: 1fr }
  .lv-board { min-height: 320px }
  .cv-wrap { aspect-ratio: 4 / 5; max-height: 56vh; max-height: 56dvh }
  .lv-info { order: 10; flex-basis: 100%; text-align: left }
  .lv-pause { margin-left: auto }
  .lv-bar { gap: 6px 10px }
  .panel { padding: 16px }
  .tool .label { font-size: 13px }
  .footer { padding-bottom: 18px }
}
@media (max-width: 359px) {
  .mobile-brand .wordmark { display: none }
  .game-grid { gap: 8px }
  .tool { padding: 0 10px }
  .tool .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
  .nova-pick { min-width: 0; flex: 1 }
}
@media (min-width: 1500px) { .game-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important }
  .card:hover { transform: none }
  .rune-pad.flash { transform: none }
}
@media (forced-colors: active) {
  .card, .panel, .chip, .button { border: 1px solid CanvasText }
}
