/* GG Galaxy Games, "Planet Hop" look */
:root {
  --ground: #3522C9;
  --ground-deep: #2A19A8;
  --ink: #1A1240;
  --muted: #5A5480;
  --soft: #C9C2FF;
  --line: #ECEAF7;
  --yellow: #FFD84D;
  --coral: #FF7A59;
  --pink: #FF9AD5;
  --mint: #5BE3B0;
  --sky: #6EC8FF;
  --lilac: #C9C2FF;
  --orange: #FFA94D;
  --ok: #0F7A55;
  --bad: #B3261E;
  --display: "Fredoka", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--ground); color: #FFFFFF;
  font-family: var(--body); font-size: 16px; line-height: 1.4; -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.stars-bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.app { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; padding: env(safe-area-inset-top) 16px 120px; min-height: 100vh; }

/* ---------- Header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; padding: 18px 0 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.gg { width: 44px; height: 44px; border-radius: 50%; background: var(--yellow); color: var(--ink); display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 18px; box-shadow: 0 0 0 4px rgba(255, 216, 77, .25); flex: none; }
.brand-name { font-family: var(--display); font-weight: 600; font-size: 21px; }
.avatar { position: relative; width: 50px; height: 50px; border-radius: 50%; border: 3px solid #FFFFFF; background: #FFFFFF; color: var(--ink);
  font-family: var(--display); font-weight: 700; font-size: 18px; display: grid; place-items: center; padding: 0; flex: none; }
.avatar svg { display: block; width: 100%; height: 100%; border-radius: 50%; }
.avatar.big { width: 62px; height: 62px; border-color: var(--line); }
.avatar .lv { position: absolute; right: -6px; bottom: -4px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px; background: var(--yellow); color: var(--ink);
  border: 2px solid var(--ground); font-family: var(--display); font-weight: 700; font-size: 12px; display: grid; place-items: center; }
.top-right { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #FFFFFF; display: grid; place-items: center; }
.icon-btn[aria-pressed="true"] { background: var(--yellow); color: var(--ink); }
.demo-band { margin: 12px 0 0; padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, .12); font-size: 13px; font-weight: 700; color: var(--yellow); }

/* ---------- Worlds ---------- */
.hello { padding: 18px 0 0; }
.hello h1 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 31px; line-height: 1.1; }
.hello p { margin: 6px 0 0; font-size: 15px; color: var(--soft); }
.orbit { position: relative; height: 150px; margin-top: 10px; }
.orbit svg.ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.planet-btn { position: absolute; transform: translateX(-50%); width: 72px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 0; background: none; border: 0; color: var(--soft); }
.planet-btn[aria-pressed="true"] { color: #FFFFFF; }
.planet { border-radius: 50%; box-shadow: inset -8px -6px 0 rgba(26, 18, 64, .18); transition: transform .15s; }
.planet-btn[aria-pressed="true"] .planet { box-shadow: inset -8px -6px 0 rgba(26, 18, 64, .18), 0 0 0 3px var(--ground), 0 0 0 6px #FFFFFF; }
.planet-btn:active .planet { transform: scale(.94); }
.planet-label { display: flex; flex-direction: column; align-items: center; font-size: 12px; font-weight: 800; line-height: 1.2; }
.planet-label span + span { font-weight: 600; }

.world-head { display: flex; align-items: baseline; justify-content: space-between; margin: 10px 0 8px; }
.world-head h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 20px; }
.world-head span { font-size: 13px; font-weight: 700; color: var(--soft); }
.cards { display: flex; flex-direction: column; gap: 8px; }
.card { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 10px 8px 12px; border-radius: 18px; background: #FFFFFF; color: var(--ink); }
.card-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 0; background: none; border: 0; text-align: left; color: inherit; }
.dot { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--ink); }
.card-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.card-name { font-family: var(--display); font-weight: 600; font-size: 17px; }
.card-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 0;
  font-weight: 800; font-size: 14px; text-decoration: none; white-space: nowrap; }
.pill.play { background: var(--ground); color: #FFFFFF; }
.pill.done { background: #E7F7F0; color: var(--ok); }
.pill.fun { background: var(--line); color: var(--muted); }
.tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: var(--line); color: var(--muted); font-family: var(--body); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; vertical-align: 2px; }

/* ---------- Bottom bar ---------- */
.nav { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  width: min(448px, calc(100% - 32px)); height: 64px; padding: 6px; border-radius: 999px; background: #FFFFFF;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; box-shadow: 0 10px 30px rgba(10, 5, 60, .35); }
.nav button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0 2px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font-weight: 800; font-size: 12px; line-height: 1.1; }
.nav .badge { position: absolute; top: 2px; right: 10%; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #FF3D6E; color: #FFFFFF; font-size: 11px; line-height: 18px; text-align: center; }
@media (min-width: 420px) { .nav button { font-size: 13px; } }
.nav button[aria-current="page"] { background: var(--ground); color: #FFFFFF; }
.nav button.paste-btn { background: var(--yellow); color: var(--ink); }

/* ---------- Race ---------- */
.race-head { padding: 18px 0 0; }
.race-head h1 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 30px; line-height: 1.1; }
.race-head p { margin: 4px 0 0; font-size: 15px; color: var(--soft); }
.race { position: relative; height: 300px; margin-top: 14px; border-radius: 24px; background: var(--ground-deep); overflow: hidden; }
.moon { position: absolute; left: 50%; top: -540px; width: 640px; height: 590px; margin-left: -320px; border-radius: 50%; background: var(--yellow); }
.crater { position: absolute; border-radius: 50%; background: #EEC02E; }
.moon-label { position: absolute; left: 0; right: 0; top: 16px; text-align: center; font-size: 12px; font-weight: 800; letter-spacing: .1em; color: var(--ink); }
.lane { position: absolute; top: 0; bottom: 0; width: 20%; }
.lane .track { position: absolute; left: 50%; top: 66px; bottom: 44px; border-left: 2px dashed #5A4BE0; }
.lane .trail-wrap { position: absolute; left: 50%; bottom: 44px; width: 22px; transform: translateX(-50%); overflow: hidden; }
.lane .trail-wrap .trail { position: absolute; left: 50%; bottom: 0; height: 100%; }
.rocket { position: absolute; left: 50%; width: 30px; height: 40px; margin-left: -15px; transition: bottom .6s ease; }
.rocket svg { display: block; }
.lane .who { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font-size: 12px; font-weight: 800; line-height: 1.15; }
.lane .who small { display: block; font-weight: 700; color: var(--soft); font-size: 11px; }
.lane.me .who { color: var(--yellow); }
.lane.tight .who { font-size: 11px; }
.lane.tight .rocket { width: 26px; height: 35px; margin-left: -13px; }
.lane.tight .rocket svg { width: 26px; height: 35px; }
.pad { position: absolute; left: 12px; right: 12px; bottom: 43px; border-top: 2px solid #7B6CF0; }

/* Leaderboard, in the app's own blue and yellow */
.scores { margin-top: 14px; padding: 16px 14px 8px; border-radius: 24px; background: var(--ground-deep); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.scores-top h2 { margin: 0 0 12px; font-family: var(--display); font-weight: 600; font-size: 22px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .1); }
.seg button { min-height: 40px; padding: 0 8px; border: 0; border-radius: 999px; background: transparent; color: #FFFFFF; font-weight: 800; font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--yellow); color: var(--ink); }
.seg.small { margin-top: 8px; background: rgba(255, 255, 255, .06); }
.seg.small button { font-size: 13px; }
.board-note { margin: 12px 2px 0; font-size: 13px; color: var(--soft); }
.board { list-style: none; margin: 8px 0 0; padding: 0; }
.board li { display: grid; grid-template-columns: 30px 36px 1fr auto; align-items: center; gap: 10px; min-height: 56px; padding: 6px 8px; border-radius: 16px; }
.board li + li { margin-top: 2px; }
.board li.me { background: rgba(255, 216, 77, .14); box-shadow: inset 0 0 0 2px var(--yellow); }
.board .rk { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--soft); }
.board .rk.r1 { background: var(--yellow); color: var(--ink); }
.board .rk.r2 { background: #FFFFFF; color: var(--ink); }
.board .rk.r3 { background: var(--coral); color: var(--ink); }
.board .rk.trophy { background: var(--yellow); width: 30px; height: 30px; }
.board li.champ { grid-template-columns: 36px 1fr auto; }
.board .av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--ink); }
.board .nm { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.board .nm b { font-weight: 800; font-size: 16px; overflow-wrap: anywhere; }
.board .nm small { font-size: 12px; color: var(--soft); }
.board .sc { display: flex; align-items: center; gap: 5px; font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--yellow); }
.board .empty { display: block; grid-column: 1 / -1; padding: 12px 4px; font-size: 14px; color: var(--soft); }
.swatch { width: 12px; height: 12px; border-radius: 50%; flex: none; display: inline-block; }

/* Stars by game: bright tiles, one per game */
.panel { margin-top: 14px; padding: 14px 16px 8px; border-radius: 22px; background: #FFFFFF; color: var(--ink); }
.panel-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.panel h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 20px; }
.daynav { display: flex; gap: 6px; }
.x[disabled] { opacity: .35; cursor: default; }
.stars-panel { padding: 16px 14px 14px; color: #FFFFFF; background: linear-gradient(155deg, #FF3D9A 0%, #A23BFF 48%, #3D6BFF 100%); box-shadow: 0 0 0 1px rgba(255, 255, 255, .18) inset, 0 10px 30px -10px rgba(255, 61, 154, .55); }
.stars-panel h2 { font-size: 22px; text-shadow: 0 2px 0 rgba(26, 18, 64, .25); }
.panel-sub { margin: 2px 0 0; font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, .85); }
.stars-panel .x { background: rgba(255, 255, 255, .2); color: #FFFFFF; }
.panel-empty { margin: 10px 2px 4px; font-weight: 700; color: rgba(255, 255, 255, .9); }
.day-sum { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.sum-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 12px; border-radius: 999px; background: rgba(26, 18, 64, .32); font-size: 14px; font-weight: 700; }
.sum-chip b { font-weight: 800; color: var(--yellow); }
.sum-chip.mine { background: var(--yellow); color: var(--ink); }
.sum-chip.mine b { color: var(--ink); }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tile { border-radius: 18px; background: rgba(255, 255, 255, .15); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); overflow: hidden; }
.tile.won { background: rgba(255, 216, 77, .2); box-shadow: inset 0 0 0 2px var(--yellow); }
.tile-row { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; align-items: center; gap: 8px; min-height: 64px; padding: 10px 12px; border: 0; background: none; color: #FFFFFF; text-align: left; }
.tile-g { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tile-g > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.tile-g b { font-weight: 800; font-size: 16px; line-height: 1.2; }
.tile-g small { font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .85); }
.tile-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--wc, #FFD84D); box-shadow: 0 0 0 3px rgba(255, 255, 255, .25), 0 0 12px var(--wc, #FFD84D); }
.tile-w { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border-radius: 999px; background: rgba(26, 18, 64, .34); max-width: 190px; }
.tile-av { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: rgba(255, 255, 255, .15); }
.tile-av svg { display: block; }
.tile-wt { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.tile-wt b { font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-wt small { font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-st { flex: none; display: inline-flex; align-items: center; gap: 2px; padding: 3px 8px; border-radius: 999px; background: var(--yellow); color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 14px; }
.tile-st svg path { fill: var(--ink); }
.tile-row .chev { color: rgba(255, 255, 255, .85); transition: transform .15s; }
.tile-row[aria-expanded="true"] .chev { transform: rotate(180deg); }
.tile-detail { margin: 0 8px 8px; padding: 4px 12px 8px; border-radius: 14px; background: #FFFFFF; color: var(--ink); }
.tile-detail .hint { margin: 8px 0 2px; }
.tile-detail .results { margin: 0; }
.key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 0; font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .9); }
.key span { padding: 3px 9px; border-radius: 999px; background: rgba(26, 18, 64, .28); }
@media (max-width: 400px) { .tile-w { max-width: 150px; } .tile-st { padding: 3px 6px; } }
.rules { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.rules li { margin: 4px 0; }
.rules b { color: var(--ink); }

/* Asteroids in the empty space either side on tablets and computers */
.space { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.rock { position: absolute; top: 0; pointer-events: auto; cursor: pointer; will-change: transform; }
.rock.comet { pointer-events: none; }
.rock-in { display: block; width: 100%; height: 100%; transition: transform .2s; }
.rock:hover .rock-in { transform: scale(1.12); }
.rock.pop .rock-in { animation: pop .45s ease-out forwards; }
@keyframes fly { from { transform: translate(0, -20vh) rotate(0deg); } to { transform: translate(var(--drift, 0), 120vh) rotate(var(--spin, 0deg)); } }
@keyframes pop { 0% { transform: scale(1); opacity: 1; filter: brightness(1.6); } 100% { transform: scale(2.1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .space { display: none; } }

/* ---------- Sheets ---------- */
dialog.sheet { width: min(480px, 100%); max-width: 100%; max-height: 92vh; margin: auto auto 0; padding: 0; border: 0; border-radius: 24px 24px 0 0; background: #FFFFFF; color: var(--ink); overflow: auto; }
dialog.sheet::backdrop { background: rgba(10, 5, 60, .55); }
dialog.sheet[open] { animation: sheetup .28s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes sheetup { from { transform: translateY(40px); opacity: .4; } }
/* On iPads and computers the sheets become a card in the middle of the screen */
@media (min-width: 700px) and (min-height: 520px) {
  dialog.sheet { width: min(560px, calc(100% - 64px)); max-height: min(86vh, 860px); margin: auto; border-radius: 28px; box-shadow: 0 30px 80px -20px rgba(10, 5, 60, .6); }
  dialog.sheet[open] { animation: cardin .25s cubic-bezier(.2, .9, .3, 1) both; }
  .sheet-in { padding: 22px 26px 26px; }
  .av-sticky { margin: 8px -26px 0; padding: 10px 26px; }
}
@keyframes cardin { from { transform: translateY(16px) scale(.97); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { dialog.sheet[open] { animation: none; } }
.sheet-in { padding: 18px 18px calc(24px + env(safe-area-inset-bottom)); }
.sheet-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.sheet-x { float: right; margin: 0 0 8px 12px; }
.sheet-top h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 22px; }
.x { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--line); color: var(--ink); display: grid; place-items: center; flex: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 20px; border-radius: 999px; border: 0; font-weight: 800; font-size: 16px; text-decoration: none; }
.btn.primary { background: var(--ground); color: #FFFFFF; }
.btn.yellow { background: var(--yellow); color: var(--ink); }
.btn.ghost { background: var(--line); color: var(--ink); }
.btn.wide { width: 100%; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row > .btn { flex: 1 1 140px; white-space: nowrap; }
.hint { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
textarea, input[type="text"], input[type="email"], input[type="password"] {
  width: 100%; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #FAFAFF; color: var(--ink); font-size: 16px; }
textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; }
textarea:focus, input:focus { border-color: var(--ground); outline: none; }
.lbl { display: block; margin: 14px 0 6px; font-weight: 800; font-size: 14px; }
.err { margin: 10px 0 0; color: var(--bad); font-weight: 700; font-size: 14px; }
.outcomes { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.outcomes li { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; background: #F4F3FC; font-size: 15px; }
.outcomes li.good { background: #E7F7F0; }
.outcomes li.bad { background: #FDECEA; }
.outcomes b { display: block; }
.game-hero { display: flex; align-items: center; gap: 14px; margin: 4px 0 12px; }
.game-hero .dot { width: 56px; height: 56px; font-size: 24px; }
.game-hero p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.results { list-style: none; margin: 8px 0 0; padding: 0; }
.results li { border-bottom: 1px solid var(--line); }
.results li:last-child { border-bottom: 0; }
.res-row { width: 100%; display: grid; grid-template-columns: 34px 1fr auto 44px; align-items: center; gap: 8px; min-height: 48px; padding: 6px 2px; border: 0; background: none; text-align: left; color: var(--ink); }
.res-row .pl { font-family: var(--display); font-weight: 700; color: var(--muted); }
.res-row .n { min-width: 0; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.res-row .v { font-weight: 800; text-align: right; }
.res-row .got { display: flex; align-items: center; justify-content: flex-end; gap: 2px; font-weight: 800; color: #9A7300; }
.receipt { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: #F4F3FC; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
h3.small { margin: 18px 0 4px; font-family: var(--display); font-weight: 600; font-size: 17px; }
.colors { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.color-btn { height: 56px; border-radius: 16px; border: 3px solid transparent; background: #F4F3FC; display: grid; place-items: center; }
.color-btn[aria-pressed="true"] { border-color: var(--ground); }
.toggles { list-style: none; margin: 0; padding: 0; }
.toggles li { border-bottom: 1px solid var(--line); }
.toggles label { display: flex; align-items: center; gap: 12px; min-height: 48px; font-weight: 700; }
.toggles input { width: 22px; height: 22px; accent-color: var(--ground); }
.toggles .w { margin: 14px 0 2px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 0; }

/* ---------- Sign in ---------- */
.gate { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 32px 0 48px; }
.gate-logo { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.gate-logo .gg { width: 92px; height: 92px; font-size: 36px; box-shadow: 0 0 0 10px rgba(255, 216, 77, .2); }
.gate-logo h1 { margin: 10px 0 0; font-family: var(--display); font-weight: 600; font-size: 34px; }
.gate-logo p { margin: 0; color: var(--soft); }
.gate-card { margin-top: 26px; padding: 20px 18px; border-radius: 24px; background: #FFFFFF; color: var(--ink); }
.gate-card h2 { margin: 0 0 4px; font-family: var(--display); font-weight: 600; font-size: 21px; }
.google { width: 100%; background: #FFFFFF; color: var(--ink); border: 2px solid var(--line); }
.or { display: flex; align-items: center; gap: 10px; margin: 16px 0 4px; color: var(--muted); font-size: 13px; font-weight: 700; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.linkbtn { border: 0; background: none; padding: 8px 0; color: var(--ground); font-weight: 800; text-decoration: underline; min-height: 44px; }

.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; width: min(448px, calc(100% - 32px));
  padding: 12px 16px; border-radius: 16px; background: var(--ink); color: #FFFFFF; font-weight: 700; font-size: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); display: flex; align-items: center; gap: 10px; }
.toast button { margin-left: auto; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--yellow); color: var(--ink); font-weight: 800; }
.loading { padding: 40px 0; text-align: center; color: var(--soft); font-weight: 700; }

/* ---------- Avatars and levels ---------- */
.mini-av { display: inline-grid; place-items: center; flex: none; }
.mini-av svg { display: block; border-radius: 50%; }
.board .av { background: none; }
.board .av svg { display: block; border-radius: 50%; }
.lvtag { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, .14); color: var(--yellow); font-size: 11px; font-weight: 800; vertical-align: 2px; }
.level-chip { margin-top: 12px; width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px 6px 6px;
  border: 0; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #FFFFFF; text-align: left; }
.level-chip .lvl { padding: 6px 10px; border-radius: 999px; background: var(--yellow); color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 14px; }
.level-chip .xp { font-size: 12px; font-weight: 800; color: var(--soft); }
.bar { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 999px; background: var(--yellow); }

/* ---------- Profile sheet ---------- */
.seg.light { margin: 6px 0 4px; background: #F1EFFB; }
.seg.light button { color: var(--ink); }
.seg.light button[aria-pressed="true"] { background: var(--ground); color: #FFFFFF; }
.av-sticky { position: sticky; top: 0; z-index: 3; margin: 8px -18px 0; padding: 10px 18px 10px; background: #FFFFFF; box-shadow: 0 10px 12px -12px rgba(26, 18, 64, .45); }
.av-head { display: flex; align-items: center; gap: 14px; }
.av-head > svg { flex: none; border-radius: 50%; box-shadow: 0 0 0 4px var(--line); }
.av-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.av-actions .btn { min-height: 44px; padding: 0 16px; font-size: 15px; }
.av-actions .linkbtn { min-height: 36px; padding: 0; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: default; }
.av-parts { margin: 10px 0 0; }
.av-parts button { padding: 0 4px; font-size: 13px; }
.av-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px 4px; padding: 2px 0 4px; }
.av-opt { justify-self: center; width: 64px; height: 64px; padding: 1px; border-radius: 50%; border: 3px solid transparent; background: none; }
.av-opt svg { display: block; width: 100%; height: 100%; border-radius: 50%; }
.av-opt[aria-pressed="true"] { border-color: var(--ground); box-shadow: 0 0 0 2px var(--yellow); }
.lvl-card { margin-top: 14px; padding: 14px; border-radius: 18px; background: var(--ground); color: #FFFFFF; }
.lvl-card .hint { color: var(--soft); }
.lvl-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-weight: 800; }
.lvl-big { font-family: var(--display); font-weight: 700; font-size: 24px; color: var(--yellow); }
.rocket-show { margin-top: 12px; height: 200px; border-radius: 18px; background: var(--ground-deep); position: relative; overflow: hidden; }
.show-lane { position: absolute; left: 50%; top: 0; bottom: 0; width: 0; }
.show-lane .trail { position: absolute; left: 0; bottom: 0; }
.show-rocket { position: absolute; left: -24px; bottom: 96px; width: 48px; height: 64px; animation: hover 2.4s ease-in-out infinite; }
.show-rocket svg { display: block; }
@keyframes hover { 50% { transform: translateY(-8px); } }
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.skin { position: relative; min-height: 96px; padding: 10px 6px 8px; border-radius: 16px; border: 3px solid transparent; background: #F4F3FC; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 12px; font-weight: 800; line-height: 1.2; text-align: center; }
.skin[aria-pressed="true"] { border-color: var(--ground); background: #ECE9FF; }
.skin.locked > svg, .skin.locked .trail-swatch { filter: grayscale(1) brightness(.7); opacity: .55; }
.skin .lock { position: absolute; top: 6px; right: 6px; padding: 2px 6px; border-radius: 999px; background: var(--ink); color: var(--yellow); font-size: 10px; }
.trail-swatch { position: relative; width: 40px; height: 44px; border-radius: 10px; background: var(--ground-deep); overflow: hidden; }
.trail-swatch .trail { position: absolute; left: 50%; bottom: 0; height: 44px; }
.vol input { width: 140px; accent-color: var(--ground); }

/* ---------- Trails (race, profile and previews) ---------- */
.trail { display: block; width: 4px; transform: translateX(-50%); border-radius: 4px; }
.t-plain { background: var(--c, #FF7A59); opacity: .6; }
.t-stars { width: 14px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='16' viewBox='0 0 12 12'%3E%3Cpath d='M6 .5l1.6 3.4 3.7.4-2.8 2.5.8 3.7L6 8.6 2.7 10.5l.8-3.7L.7 4.3l3.7-.4z' fill='%23FFD84D'/%3E%3C/svg%3E") repeat-y 0 0 / 14px 16px; animation: tscroll 1.2s linear infinite; }
.t-bubbles { width: 14px; border-radius: 0; background: radial-gradient(circle at 50% 50%, transparent 3px, #9BE7FF 3.5px, #9BE7FF 4.6px, transparent 5px) 0 0 / 14px 14px repeat-y, linear-gradient(rgba(110, 200, 255, .1), rgba(110, 200, 255, .45)); animation: tscroll 1.6s linear infinite reverse; }
.t-jelly { width: 12px; border-radius: 999px; background: linear-gradient(#FF9AD5, #C9C2FF, #FF9AD5); animation: jelly .9s ease-in-out infinite alternate; }
.t-fire { width: 10px; border-radius: 999px 999px 4px 4px; background: linear-gradient(to top, rgba(255, 61, 0, .2), #FF3D00 25%, #FFA000 60%, #FFE680); animation: flicker .15s ease-in-out infinite alternate; }
.t-rainbow { width: 10px; background: linear-gradient(#FF4D4D, #FFA94D, #FFD84D, #5BE3B0, #6EC8FF, #C9C2FF); }
.t-lightning { width: 16px; border-radius: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='24'%3E%3Cpath d='M10 0 L4 11 L10 11 L5 24' stroke='%23BDF3FF' stroke-width='2.5' fill='none' stroke-linejoin='round'/%3E%3C/svg%3E") repeat-y 0 0 / 16px 24px; filter: drop-shadow(0 0 4px #6EC8FF); animation: tscroll .5s linear infinite; }
.t-lava { width: 10px; border-radius: 999px; background: radial-gradient(circle at 50% 30%, #FFE680 0 2px, transparent 3px) 0 0 / 10px 18px repeat-y, linear-gradient(to top, #4A0D00, #D32F00 40%, #FF7A00); animation: tscroll 2s linear infinite; }
.t-comet { width: 14px; border-radius: 0; background: radial-gradient(circle, #FFFFFF 0 1.3px, transparent 1.8px) 0 0 / 7px 9px, linear-gradient(rgba(201, 194, 255, 0), rgba(201, 194, 255, .35)); animation: tscroll 1s linear infinite; }
.t-goldtrail { width: 12px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='18'%3E%3Cpath d='M6 2 L7.2 7.8 L12 9 L7.2 10.2 L6 16 L4.8 10.2 L0 9 L4.8 7.8 Z' fill='%23FFF4B8'/%3E%3C/svg%3E") repeat-y 0 0 / 12px 18px, linear-gradient(rgba(255, 216, 77, .15), rgba(224, 168, 0, .8)); animation: tscroll 1.4s linear infinite; }
.t-smoke { width: 16px; border-radius: 0; background: radial-gradient(circle, rgba(255, 255, 255, .5) 0 3.4px, transparent 4px) 0 0 / 16px 16px repeat-y, linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, .2)); animation: tscroll 2.4s linear infinite; }
.t-hearts { width: 14px; border-radius: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='16'%3E%3Cpath d='M7 13 C1 9 1 4 4 3.5 C5.5 3.2 6.5 4 7 5 C7.5 4 8.5 3.2 10 3.5 C13 4 13 9 7 13 Z' fill='%23FF4D8D'/%3E%3C/svg%3E") repeat-y 0 0 / 14px 16px; animation: tscroll 1.4s linear infinite; }
.t-confetti { width: 16px; border-radius: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='32'%3E%3Crect x='2' y='2' width='3' height='5' fill='%23FFD84D' transform='rotate(20 3.5 4.5)'/%3E%3Crect x='10' y='8' width='3' height='5' fill='%235BE3B0' transform='rotate(-30 11.5 10.5)'/%3E%3Crect x='4' y='16' width='3' height='5' fill='%23FF4D8D' transform='rotate(45 5.5 18.5)'/%3E%3Crect x='11' y='23' width='3' height='5' fill='%236EC8FF' transform='rotate(10 12.5 25.5)'/%3E%3Ccircle cx='4' cy='28' r='1.5' fill='%23FFFFFF'/%3E%3C/svg%3E") repeat-y 0 0 / 16px 32px; animation: tscroll 1.1s linear infinite; }
.t-snow { width: 14px; border-radius: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='16'%3E%3Cpath d='M7 2v12M2 5l10 6M12 5L2 11' stroke='%23FFFFFF' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E") repeat-y 0 0 / 14px 16px, linear-gradient(rgba(191, 239, 255, 0), rgba(191, 239, 255, .3)); animation: tscroll 2.2s linear infinite; }
@keyframes tscroll { to { background-position-y: 64px, 0; } }
@keyframes jelly { from { transform: translateX(-50%) scaleX(.7); } to { transform: translateX(-50%) scaleX(1.25); } }
@keyframes flicker { from { opacity: .8; transform: translateX(-50%) scaleX(.85); } to { opacity: 1; transform: translateX(-50%) scaleX(1.1); } }

/* Rockets launch up to their places when you open the race */
.lane.launch .rocket { animation: launch 1.5s cubic-bezier(.2, .8, .25, 1) both; animation-delay: var(--d, 0s); }
.lane.launch .trail-wrap { animation: grow 1.5s cubic-bezier(.2, .8, .25, 1) both; animation-delay: var(--d, 0s); }
@keyframes launch { from { bottom: 44px; } }
@keyframes grow { from { height: 0; } }

/* ---------- Pop-ups: yesterday's winner and level up ---------- */
dialog.pop { width: min(420px, calc(100% - 32px)); max-height: 88vh; padding: 0; border: 0; border-radius: 28px; background: var(--ground); color: #FFFFFF; overflow: auto; }
dialog.pop[open] { animation: popin .55s cubic-bezier(.2, 1.4, .4, 1) both; }
dialog.pop::backdrop { background: rgba(10, 5, 60, .7); }
@keyframes popin { from { transform: scale(.6) translateY(40px); opacity: 0; } }
.pop-in { position: relative; padding: 28px 22px 22px; text-align: center; overflow: hidden; }
.pop-x { position: absolute; top: 12px; right: 12px; z-index: 2; }
.pop-kicker { position: relative; margin: 0; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 12px; color: var(--yellow); }
.pop-title { position: relative; margin: 8px 0 4px; font-family: var(--display); font-weight: 600; font-size: 28px; line-height: 1.15; }
.pop-level { position: relative; margin: 6px 0; font-family: var(--display); font-weight: 700; font-size: 84px; line-height: 1; color: var(--yellow); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.pop-sub { position: relative; margin: 16px 0 6px; font-weight: 800; color: var(--soft); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.pop-avatars { position: relative; display: flex; justify-content: center; gap: 10px; margin: 14px 0 6px; }
.pop-av { display: inline-block; border-radius: 50%; box-shadow: 0 0 0 5px var(--yellow), 0 0 40px rgba(255, 216, 77, .6); animation: bounce 1.2s cubic-bezier(.3, 1.6, .5, 1) both; }
.pop-av svg { display: block; border-radius: 50%; }
@keyframes bounce { from { transform: scale(0) rotate(-20deg); } }
.pop-list { position: relative; list-style: none; margin: 0; padding: 0; text-align: left; }
.pop-list li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; padding: 10px 12px; margin-top: 6px; border-radius: 14px; background: rgba(255, 255, 255, .1); animation: rise .5s ease both; }
.pop-list li:nth-child(2) { animation-delay: .1s; } .pop-list li:nth-child(3) { animation-delay: .2s; } .pop-list li:nth-child(4) { animation-delay: .3s; } .pop-list li:nth-child(n+5) { animation-delay: .4s; }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.pop-list li span { grid-column: 1; font-size: 13px; color: var(--soft); }
.pop-list li em { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 3px; font-style: normal; font-weight: 800; color: var(--yellow); }
.pop-list.podium li { grid-template-columns: auto 1fr auto; }
.pop-list.podium li em { grid-column: 3; grid-row: 1; }
#levelBody .pop-list li { grid-template-columns: auto 1fr; justify-content: start; gap: 10px; font-weight: 800; }
.shooting { position: absolute; inset: 0; pointer-events: none; }
.shooting span { position: absolute; left: var(--x); top: var(--y); width: 90px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, rgba(255, 255, 255, 0), #FFFFFF); transform: rotate(25deg); opacity: 0; animation: shoot 2.6s ease-in infinite; animation-delay: var(--t); }
@keyframes shoot { 0% { transform: rotate(25deg) translateX(-60px); opacity: 0; } 10% { opacity: 1; } 40% { transform: rotate(25deg) translateX(220px); opacity: 0; } 100% { opacity: 0; } }
.shooting i { position: absolute; left: var(--x); top: var(--y); width: 4px; height: 4px; border-radius: 50%; background: var(--yellow); animation: twinkle 2s ease-in-out infinite; animation-delay: var(--t); }
@keyframes twinkle { 50% { opacity: .15; transform: scale(.4); } }

/* ---------- Asteroid Run arcade ---------- */
dialog.arcade { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #1B1170; color: #FFFFFF; overflow: hidden; }
dialog.arcade::backdrop { background: #1B1170; }
dialog.arcade canvas { display: block; touch-action: none; cursor: crosshair; }
.arc-hud { position: absolute; z-index: 2; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 12px; padding: max(14px, env(safe-area-inset-top)) 16px 0; pointer-events: none; }
.arc-score { font-family: var(--display); font-weight: 700; font-size: 30px; }
.arc-best { font-weight: 800; color: var(--soft); }
.arc-close { margin-left: auto; pointer-events: auto; }
.arc-over { position: absolute; z-index: 1; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(27, 17, 112, .55); overflow: auto; }
.arc-over[hidden] { display: none; }
.arc-card { width: min(380px, 100%); padding: 22px 18px; border-radius: 26px; background: #FFFFFF; color: var(--ink); text-align: center; }
.arc-card h2 { margin: 2px 0 6px; font-family: var(--display); font-weight: 600; font-size: 30px; }
.arc-card h3 { margin: 18px 0 6px; font-family: var(--display); font-weight: 600; font-size: 18px; text-align: left; }
.arc-kicker { margin: 0; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 12px; color: var(--ground); }
.arc-big { margin: 4px 0; font-family: var(--display); font-weight: 700; font-size: 56px; line-height: 1; color: var(--ground); }
.arc-sub { margin: 6px 0 14px; color: var(--muted); font-size: 15px; }
.arc-board ol { list-style: none; margin: 0; padding: 0; text-align: left; }
.arc-board li { display: grid; grid-template-columns: 22px 30px 1fr auto; align-items: center; gap: 10px; min-height: 44px; border-bottom: 1px solid var(--line); font-size: 15px; }
.arc-board li.me { font-weight: 800; color: var(--ground); }
.arc-board li span:last-child { font-weight: 800; }
.arc-board .rk { font-family: var(--display); font-weight: 700; color: var(--muted); }

@media (max-width: 380px) { .nav button svg { display: none; } .nav button { font-size: 13px; } }

/* ---------- Leagues ---------- */
.league-bar { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.league-pill { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 14px 6px 12px; border: 0; border-radius: 18px;
  background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); color: #FFFFFF; text-align: left; }
.league-pill .lg-text { flex: 1 1 auto; min-width: 0; }
.league-pill .chev { color: var(--soft); flex: none; }
.lg-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.lg-text b { font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-text small { font-size: 12px; font-weight: 700; color: var(--soft); }
.league-invite { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 52px; padding: 0 16px; border: 0; border-radius: 18px; background: var(--yellow); color: var(--ink); font-weight: 800; font-size: 15px; }
.invite-banner { display: flex; align-items: center; gap: 10px; margin-top: 22px; padding: 12px 14px; border-radius: 18px; background: rgba(255, 216, 77, .16); box-shadow: inset 0 0 0 2px var(--yellow); font-size: 15px; }
.invite-banner svg { flex: none; }
.lg-card { margin-top: 6px; padding: 16px; border-radius: 20px; color: #FFFFFF; background: linear-gradient(155deg, #FF3D9A 0%, #A23BFF 52%, #3D6BFF 100%); }
.lg-card h3 { margin: 2px 0 2px; font-family: var(--display); font-weight: 600; font-size: 26px; }
.lg-card p { margin: 0; font-size: 14px; color: rgba(255, 255, 255, .9); }
.lg-kicker { font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 11px !important; }
.lg-code { margin-top: 10px !important; font-size: 14px; }
.lg-code b { font-family: var(--display); letter-spacing: .14em; font-size: 18px; color: var(--yellow); }
.btn.ghost.light { background: rgba(255, 255, 255, .2); color: #FFFFFF; }
.btn.tiny { min-height: 36px; padding: 0 12px; font-size: 13px; white-space: nowrap; }
.btn.danger { color: #C62848; }
.lg-list, .lg-members { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.lg-row { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 12px; border: 0; border-radius: 16px; background: #F4F3FC; color: var(--ink); text-align: left; }
.lg-row[aria-pressed="true"] { background: #ECE9FF; box-shadow: inset 0 0 0 2px var(--ground); }
.lg-row .lg-text { flex: 1 1 auto; }
.lg-row .lg-text small, .lg-members .lg-text small { color: var(--muted); }
.lg-dot { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--ground); color: var(--yellow); font-family: var(--display); font-weight: 700; font-size: 18px; }
.lg-on { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 13px; color: var(--ground); }
.lg-go { font-weight: 800; font-size: 13px; color: var(--ground); text-decoration: underline; }
.lg-members li { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 4px; border-bottom: 1px solid var(--line); }
.lg-members li:last-child { border-bottom: 0; }
.lg-members .lg-text { flex: 1 1 auto; }
.lg-members .lg-text b { font-size: 15px; }
.lg-form { margin-top: 6px; }
.pop-trophy { position: relative; width: 84px; height: 84px; margin: 14px auto 4px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 216, 77, .18); }
.pop-trophy svg { width: 46px; height: 46px; }
.pop-note { position: relative; margin: 6px 0 0; color: var(--soft); }

/* ---------- Friends ---------- */
.fr-req, .fr-add { margin-top: 14px; padding: 16px; border-radius: 22px; }
.fr-req { background: rgba(255, 216, 77, .16); box-shadow: inset 0 0 0 2px var(--yellow); }
.fr-req h2, .fr-add h2, .fr-list h2 { margin: 0 0 4px; font-family: var(--display); font-weight: 600; font-size: 20px; }
.fr-req ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.fr-req li { display: flex; align-items: center; gap: 10px; }
.fr-req li .lg-text { flex: 1 1 auto; }
.fr-add { color: #FFFFFF; background: linear-gradient(155deg, #2EC5FF 0%, #3D6BFF 45%, #A23BFF 100%); }
.fr-add > p { margin: 0; font-size: 14px; color: rgba(255, 255, 255, .92); }
.fr-add .lbl { color: #FFFFFF; }
.fr-form { margin-top: 8px; }
.fr-tip { margin-top: 10px !important; font-size: 13px !important; opacity: .9; }
.fr-list { margin-top: 14px; }
.fr-list .board li.champ { grid-template-columns: 36px 1fr auto; }
.fr-tag { display: inline-flex; align-items: center; gap: 4px; flex: none; font-weight: 800; font-size: 13px; color: #1E8E4E; }
.fr-tag.muted { color: var(--muted); }
.tile-st.crown { background: rgba(255, 216, 77, .25); padding: 3px 6px; }
.res-row .got svg { vertical-align: middle; }

.legal { margin: 18px 0 0; text-align: center; font-size: 13px; color: var(--soft); }
.legal a { color: var(--soft); font-weight: 700; }
.legal.dark, .legal.dark a { color: var(--muted); }
#mMsg { min-height: 90px; font-family: var(--body); font-size: 15px; }

/* Add to home screen tip */
.a2hs { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 8px 10px 12px; border-radius: 18px; background: rgba(255, 216, 77, .14); box-shadow: inset 0 0 0 2px rgba(255, 216, 77, .7); }
.a2hs-ico .gg { width: 40px; height: 40px; font-size: 15px; }
.a2hs-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.a2hs-text b { font-size: 15px; }
.a2hs-text small { font-size: 12px; color: var(--soft); font-weight: 700; }
.a2hs-x { width: 36px; height: 36px; background: rgba(255, 255, 255, .12); color: #FFFFFF; }
.steps { margin: 8px 0 0; padding-left: 22px; font-size: 16px; }
.steps li { margin: 8px 0; }

/* How to add your score */
.howto-card { margin-top: 14px; padding: 14px 12px 14px 14px; border-radius: 20px; background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 2px rgba(255, 216, 77, .55); }
.howto-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.howto-top h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 20px; }
.howto-top .x { width: 36px; height: 36px; background: rgba(255, 255, 255, .12); color: #FFFFFF; }
.howto { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.howto li { display: flex; align-items: flex-start; gap: 10px; }
.howto .n { flex: 0 0 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--yellow); color: var(--ink); font-weight: 800; font-size: 15px; }
.howto li > span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.howto b { font-size: 15px; }
.howto small { font-size: 14px; color: var(--soft); }
.howto.light { margin-top: 2px; }
.howto.light small { color: var(--muted); }

/* Paste: what the box would add, and skipped duplicates */
.found { margin: 8px 0 0; padding: 10px 12px; border-radius: 12px; background: #F4F3FC; color: var(--ink); font-size: 14px; line-height: 1.35; }
.found small { color: var(--muted); font-size: 12px; }
.outcomes li.quiet { background: #F4F3FC; color: var(--muted); font-size: 14px; }

/* Names that open a player card */
button.plink { margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
button.plink:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 6px; }
button.plink.inline { display: inline; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
.board button.nm b, .lg-members button.lg-text b { text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .35); text-underline-offset: 3px; }
.lg-members button.lg-text b { text-decoration-color: rgba(26, 18, 64, .3); }

/* Streak on the home screen */
.streak-chip { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 8px 12px; border-radius: 14px; background: rgba(255, 122, 89, .18); box-shadow: inset 0 0 0 2px rgba(255, 122, 89, .55); color: #FFFFFF; font-size: 15px; }
.streak-chip .flame { font-size: 18px; }

/* Player card */
.pc-name { margin: 0; font-family: var(--display); font-weight: 600; font-size: 24px; }
.pc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 4px; }
.pc-stats span { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border-radius: 14px; background: #F4F3FC; text-align: center; }
.pc-stats b { font-family: var(--display); font-weight: 600; font-size: 20px; }
.pc-stats small { font-size: 11px; font-weight: 700; color: var(--muted); }
.bests { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bests li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 14px; background: #F4F3FC; }
.b-main { display: flex; flex-direction: column; min-width: 0; }
.b-main b { font-size: 15px; }
.b-main small { font-size: 12px; color: var(--muted); }
.b-val { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-weight: 800; font-size: 15px; text-align: right; white-space: nowrap; }
.tag.rec { margin: 0; background: var(--yellow); color: var(--ink); }
.tag.ok { background: #E7F7F0; color: var(--ok); }
.board .rk.rec-ic { background: rgba(255, 216, 77, .2); }
.board .rec-sc { font-size: 14px; white-space: nowrap; }

/* Scoring notice on the League tab */
.howto-card.news { margin: 12px 0 0; }
.howto-card.news p { margin: 8px 0 0; font-size: 15px; color: var(--soft); }
.howto-card.news .rules { margin-top: 6px; color: var(--soft); }
.howto-card.news .rules b { color: #FFFFFF; }
.howto-card.news .news-foot { font-size: 13px; }

/* Suggest a game */
.suggest-card { display: flex; align-items: center; gap: 10px; margin: 18px 0 0; padding: 12px 10px 12px 12px; border-radius: 18px; background: rgba(91, 227, 176, .14); box-shadow: inset 0 0 0 2px rgba(91, 227, 176, .6); }
.sg-ic { flex: 0 0 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--mint); color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 22px; }
.sg-copy { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.sg-copy b { font-size: 15px; }
.sg-copy small { font-size: 12px; font-weight: 700; color: var(--soft); }
#sgForm input { width: 100%; }
.sg-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sg-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 14px; background: #F4F3FC; }
.sg-text { display: flex; flex-direction: column; min-width: 0; }
.sg-text b { font-size: 15px; overflow-wrap: anywhere; }
.sg-text small { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.vote, .sg-votes { flex: none; display: inline-flex; align-items: center; gap: 6px; min-width: 64px; height: 40px; justify-content: center; padding: 0 12px; border-radius: 999px; border: 2px solid var(--line); background: #FFFFFF; color: var(--ink); font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; }
.vote[aria-pressed="true"] { background: var(--yellow); border-color: var(--yellow); }
.sg-votes { cursor: default; background: #E7F7F0; border-color: #E7F7F0; }

/* Shared result shown on the Paste screen: read-only */
#pasteText[readonly] { background: #F4F3FC; color: var(--muted); cursor: default; min-height: 96px; }

/* ---------- 4 Nov 2026: game descriptions, the World league, where you compete ---------- */
.lg-card.world { background: linear-gradient(155deg, #0F9E78 0%, #2B7BD9 55%, #3522C9 100%); }
.lg-dot.world { background: #E3FAF1; }
.lg-dot.world svg { stroke: #0F7A55; }
.howto-card.nudge { box-shadow: inset 0 0 0 2px rgba(91, 227, 176, .7); }
.howto-card.nudge p { margin: 8px 0 0; font-size: 15px; color: var(--soft); }
.lg-rank { flex: none; min-width: 44px; height: 38px; padding: 0 6px; border-radius: 12px; display: grid; place-items: center; background: var(--ground); color: #FFFFFF; font-family: var(--display); font-weight: 700; font-size: 15px; }
.lg-rank.r1 { background: var(--yellow); color: var(--ink); }
.lg-rank.r2 { background: #DAD6EE; color: var(--ink); }
.lg-rank.r3 { background: var(--coral); color: var(--ink); }
.lg-row.world .lg-rank:not(.r1):not(.r2):not(.r3) { background: #0F7A55; }
.lg-row .lg-text b { display: flex; align-items: center; gap: 6px; }
.lg-row .lg-text b svg { flex: none; stroke: #0F7A55; }
.lg-stars { flex: none; display: inline-flex; align-items: center; gap: 3px; font-family: var(--display); font-weight: 700; font-size: 16px; }
.lg-row { position: relative; }
.lg-row .lg-on { position: absolute; top: -7px; right: 10px; padding: 1px 8px; border-radius: 999px; background: var(--ground); color: #FFFFFF; font-size: 11px; font-weight: 800; }

/* Trails for levels 11 to 50 and prestige (4 Nov 2026) */
.t-waves { width: 12px; border-radius: 6px; background: repeating-linear-gradient(to top, #7FE1FF 0 3px, #1E88C8 3px 7px, #0B3D6B 7px 9px) 0 0 / 12px 64px, linear-gradient(#1E88C8, #1E88C8); animation: tscroll 1.2s linear infinite; }
.t-neonline { width: 4px; background: #2EE6FF; box-shadow: 0 0 6px #2EE6FF, 0 0 12px #2EE6FF; }
.t-pixel { width: 12px; border-radius: 0; background: repeating-linear-gradient(to top, #FF4D8D 0 6px, transparent 6px 8px, #FFD84D 8px 14px, transparent 14px 16px, #5BE3B0 16px 22px, transparent 22px 24px, #6EC8FF 24px 30px, transparent 30px 32px) 0 0 / 12px 64px, linear-gradient(transparent, transparent); animation: tscroll .9s steps(8) infinite; }
.t-plasma { width: 12px; border-radius: 999px; background: linear-gradient(#FF4FD8, #7C4DFF, #2EE6FF, #FF4FD8) 0 0 / 12px 64px, linear-gradient(#7C4DFF, #7C4DFF); animation: tscroll .8s linear infinite; filter: drop-shadow(0 0 4px #B44DFF); }
.t-sparkler { width: 16px; border-radius: 0; background: radial-gradient(circle, #FFFFFF 0 1px, transparent 1.5px) 0 0 / 5px 6px, linear-gradient(rgba(255, 169, 77, 0), rgba(255, 169, 77, .55)); animation: tscroll .5s linear infinite; }
.t-swirl { width: 14px; border-radius: 999px; background: radial-gradient(circle, #FFFFFF 0 1px, transparent 1.6px) 0 0 / 7px 10px, linear-gradient(#2B0F6B, #6A1B9A 40%, #0D47A1 70%, #FF9AD5); animation: tscroll 1.6s linear infinite; }
.t-ghost { width: 16px; border-radius: 999px 999px 0 0; background: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, .55)); animation: jelly 1.4s ease-in-out infinite alternate; }
.t-dragon { width: 12px; border-radius: 999px 999px 4px 4px; background: linear-gradient(to top, rgba(0, 200, 120, .2), #00C878 25%, #2EE6FF 60%, #E8FFF6); animation: flicker .15s ease-in-out infinite alternate; }
.t-laser { width: 3px; background: #FF2E4D; box-shadow: 0 0 4px #FF2E4D, 0 0 10px #FF2E4D, 0 0 18px rgba(255, 46, 77, .6); }
.t-nova { width: 16px; border-radius: 0; background: radial-gradient(circle, #FFFFFF 0 1.4px, transparent 2px) 0 0 / 8px 9px, linear-gradient(#FF4D4D, #FFA94D, #FFD84D, #5BE3B0, #6EC8FF, #C9C2FF); animation: tscroll .8s linear infinite; }
.t-legendtrail { width: 14px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='18'%3E%3Cpath d='M7 2 L8.3 7.7 L14 9 L8.3 10.3 L7 16 L5.7 10.3 L0 9 L5.7 7.7 Z' fill='%23FFFFFF'/%3E%3C/svg%3E") repeat-y 0 0 / 14px 18px, linear-gradient(#FFD84D, #FF9AD5, #9BE7FF, #FFD84D); animation: tscroll 1s linear infinite; filter: drop-shadow(0 0 4px rgba(255, 216, 77, .8)); }
.t-prestigetrail { width: 16px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='18' viewBox='0 0 12 12'%3E%3Cpath d='M6 .5l1.6 3.4 3.7.4-2.8 2.5.8 3.7L6 8.6 2.7 10.5l.8-3.7L.7 4.3l3.7-.4z' fill='%23FFD84D'/%3E%3C/svg%3E") repeat-y 0 0 / 16px 18px, linear-gradient(rgba(61, 139, 255, .15), #3D8BFF); animation: tscroll 1s linear infinite; filter: drop-shadow(0 0 4px #3D8BFF); }

/* Level badges glow in the prestige colour (Neon style) */
.lv.p1, .lvl.p1, .lvtag.p1 { --pg: #3D8BFF; }
.lv.p2, .lvl.p2, .lvtag.p2 { --pg: #FF3B4E; }
.lv.p3, .lvl.p3, .lvtag.p3 { --pg: #A23BFF; }
.lv.p4, .lvl.p4, .lvtag.p4 { --pg: #12D18E; }
.lv.p5, .lvl.p5, .lvtag.p5 { --pg: #FFD84D; }
.lv[class*=" p"], .lvl[class*=" p"], .lvtag[class*=" p"] { background: #0A0820; color: #FFFFFF; box-shadow: 0 0 0 2px var(--pg), 0 0 10px var(--pg); text-shadow: 0 0 6px var(--pg); animation: neonpulse 2s ease-in-out infinite; }
@keyframes neonpulse { 50% { box-shadow: 0 0 0 2px var(--pg), 0 0 4px var(--pg); } }
@media (prefers-reduced-motion: reduce) { .lv[class*=" p"], .lvl[class*=" p"], .lvtag[class*=" p"] { animation: none; } }
.pbadge { display: inline-block; vertical-align: middle; }
.pop-badge { display: flex; justify-content: center; margin: 6px 0 4px; }
.prestige-card { margin-top: 12px; padding: 14px; border-radius: 18px; background: radial-gradient(circle at 50% 0, #1A4FD6, #0A0820 70%); color: #FFFFFF; box-shadow: inset 0 0 0 2px #3D8BFF, 0 0 18px rgba(61, 139, 255, .45); }
.prestige-card .pc-top { display: flex; align-items: center; gap: 12px; }
.prestige-card h3 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 20px; }
.prestige-card p { margin: 6px 0 0; font-size: 14px; color: rgba(255, 255, 255, .9); }
.pop-level.p1 { color: #FFFFFF; text-shadow: 0 0 6px #3D8BFF, 0 0 18px #3D8BFF; } .pop-level.p2 { color: #FFFFFF; text-shadow: 0 0 6px #FF3B4E, 0 0 18px #FF3B4E; } .pop-level.p3 { color: #FFFFFF; text-shadow: 0 0 6px #A23BFF, 0 0 18px #A23BFF; } .pop-level.p4 { color: #FFFFFF; text-shadow: 0 0 6px #12D18E, 0 0 18px #12D18E; } .pop-level.p5 { color: #FFFFFF; text-shadow: 0 0 6px #FFD84D, 0 0 18px #FFD84D; }
.pchip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; vertical-align: middle; }

/* ---------- League chat (4 Nov 2026) ---------- */
.nav .badge.at { background: #FFD84D; color: var(--ink); }
.chat-card { margin-top: 14px; padding: 14px 14px 12px; border-radius: 24px; background: var(--ground-deep); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.chat-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.chat-card-top h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 600; font-size: 20px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-new { flex: none; padding: 2px 10px; border-radius: 999px; background: #FF3D6E; color: #FFFFFF; font-size: 12px; font-weight: 800; }
.chat-new.at { background: var(--yellow); color: var(--ink); }
.chat-peek { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.chat-peek li { padding: 8px 12px; border-radius: 14px; background: rgba(255, 255, 255, .08); font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.chat-peek b { color: var(--yellow); }
.chat-card .btn svg { margin-right: 6px; vertical-align: -3px; }
dialog.sheet.chat { overflow: hidden; }
.chat-in { display: flex; flex-direction: column; height: min(88vh, 760px); padding: 14px 14px calc(10px + env(safe-area-inset-bottom)); }
.chat-top { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 4px 8px; border-bottom: 1px solid var(--line); }
.chat-top h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 10px 2px; display: flex; flex-direction: column; gap: 4px; overscroll-behavior: contain; }
.chat-empty { margin: auto; padding: 24px; text-align: center; color: var(--muted); }
.chat-day { align-self: center; margin: 8px 0 4px; }
.chat-day span { padding: 2px 10px; border-radius: 999px; background: #F4F3FC; color: var(--muted); font-size: 12px; font-weight: 800; }
.msg { display: flex; align-items: flex-end; gap: 6px; max-width: 86%; }
.msg + .msg:not(.cont) { margin-top: 6px; }
.msg .mini-av { flex: 0 0 28px; width: 28px; height: 28px; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.bubble { position: relative; padding: 7px 11px 6px; border-radius: 16px 16px 16px 6px; background: #F4F3FC; color: var(--ink); min-width: 0; }
.msg.mine .bubble { border-radius: 16px 16px 6px 16px; background: var(--ground); color: #FFFFFF; }
.msg-name { display: block; padding: 0; border: 0; background: none; font-weight: 800; font-size: 13px; color: var(--ground); }
.msg-text { display: block; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.35; }
.msg-gone { display: block; font-size: 14px; opacity: .6; }
.msg-meta { display: block; margin-top: 2px; text-align: right; font-size: 11px; opacity: .65; }
.msg-del { padding: 0 0 0 6px; border: 0; background: none; color: inherit; font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }
.at { color: var(--ground); font-weight: 800; }
.msg.mine .at { color: var(--yellow); }
.at.me { padding: 0 4px; border-radius: 6px; background: var(--yellow); color: var(--ink) !important; }
.chat-peek .at { color: var(--sky); }
.chat-form { flex: none; padding-top: 8px; border-top: 1px solid var(--line); }
.chat-row { display: flex; align-items: flex-end; gap: 8px; }
.chat-row textarea { flex: 1 1 auto; font-family: var(--body); min-height: 44px; max-height: 120px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 16px; resize: none; font-size: 16px; line-height: 1.3; color: var(--ink); background: #FFFFFF; }
.chat-row textarea:focus { outline: none; border-color: var(--ground); }
.chat-row .btn { min-height: 44px; }
.chat-foot { margin: 6px 2px 0; font-size: 12px; color: var(--muted); }
.chat-sugg { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 8px; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 4px; border: 0; border-radius: 999px; background: #ECE9FF; color: var(--ink); font-weight: 800; font-size: 14px; }
.chip .mini-av { width: 24px; height: 24px; }
.av-opt { position: relative; }
.av-opt.locked > svg { filter: grayscale(1) brightness(.75); opacity: .5; }
.av-opt .lock { position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%); padding: 0 6px; border-radius: 999px; background: var(--ink); color: #FFFFFF; font-size: 10px; font-weight: 800; white-space: nowrap; }

/* ---------- King mode (admin only) ---------- */
.king-card { margin-top: 6px; padding: 16px; border-radius: 20px; color: #FFFFFF; background: linear-gradient(155deg, #1A1240 0%, #3522C9 60%, #A23BFF 100%); }
.king-card h3 { margin: 2px 0 10px; font-family: var(--display); font-weight: 600; font-size: 22px; }
.king-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.king-stats span { display: flex; flex-direction: column; padding: 8px; border-radius: 12px; background: rgba(255, 255, 255, .12); }
.king-stats b { font-family: var(--display); font-size: 22px; line-height: 1.1; }
.king-stats small { font-size: 11px; font-weight: 700; color: rgba(255, 255, 255, .8); line-height: 1.2; }
@media (max-width: 400px) { .king-stats { grid-template-columns: repeat(2, 1fr); } }
.king-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.king-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: #F4F3FC; }
.k-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; text-align: left; padding: 0; border: 0; background: none; color: var(--ink); line-height: 1.25; }
.k-main b { font-size: 15px; overflow-wrap: anywhere; }
.k-main small { font-size: 12px; color: var(--muted); }
.k-text { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.seg.light.six { grid-auto-flow: row; grid-template-columns: repeat(5, minmax(0, 1fr)) 36px; gap: 2px; }
.seg.light.six button { padding: 0 2px; font-size: 12px; }
