/* DrawPack arcade layer: skins, game colour worlds, lobby, player pages, bottom bar, toasts and modal.
   Loaded after the inline styles of the page. Shell tokens and shared game chrome live in src/game.html; the top bar, sidebar,
   bottom bar, dialogs, toasts and the lobby get their final look in the SHELL AND LOBBY section and the player pages in the PLAYER PAGES section, both at the end of this file;
   game boards live in games-a.css, games-b.css and games-c.css; Blackjack, Soccer Packs, Sky Dash and Road Hopper have a sheet each (ui-*.css), loaded after this one. */
/* ---------- skins (data-skin on <html>): they only touch the shell surfaces ---------- */
:root {
  --r-common: #9aa3b5; --r-uncommon: #3bd16f; --r-rare: #3d9bff; --r-epic: #a65cff; --r-legendary: #f5c542; --r-mythic: #ff4fd8;
  --bg-art: radial-gradient(900px 520px at 10% -10%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 62%), radial-gradient(760px 460px at 100% 0%, color-mix(in srgb, var(--info) 6%, transparent), transparent 60%);
  /* medal metals and text-safe versions of gold and success (the light skin darkens the last two) */
  --silver: #dbe1ee; --silver-2: #8e9ab4; --bronze: #e09a5b; --gold-fg: var(--gold); --ok-fg: var(--success);
  /* tile pattern layers, picked per world with --pat */
  --pat-stripes: repeating-linear-gradient(135deg, #fff 0 2px, transparent 2px 14px);
  --pat-dots: radial-gradient(#fff 2px, transparent 3px) 0 0 / 16px 16px;
  --pat-burst: repeating-conic-gradient(from 0deg at 50% 40%, #fff 0 8deg, transparent 8deg 20deg);
  --pat-grid: linear-gradient(#fff 2px, transparent 2px) 0 0 / 22px 22px, linear-gradient(90deg, #fff 2px, transparent 2px) 0 0 / 22px 22px;
}
:root[data-skin="midnight"] { --bg: #080b1a; --panel: #101730; --panel-2: #18213f; --line: #27335c; }
:root[data-skin="sunset"] { --bg: #140b12; --panel: #20131b; --panel-2: #2c1a26; --line: #452a39; }
:root[data-skin="forest"] { --bg: #08110e; --panel: #101c16; --panel-2: #18281f; --line: #283d30; }
:root[data-skin="light"] { color-scheme: light; --bg: #f3f4fa; --panel: #ffffff; --panel-2: #e9ecf6; --line: #d3d8e8; --fg: #141725; --muted: #565e78; --accent-2: #141725; --danger: #c41d3f; --gold-fg: #7d5200; --ok-fg: #075c33; --shadow-pop: 0 24px 60px -24px rgba(30, 35, 70, .45); }
/* in the light skin every game sits in a dark cabinet, so the game art keeps its contrast */
:root[data-skin="light"] .dk, :root[data-skin="light"] .overlay, :root[data-skin="light"] .maint, :root[data-skin="light"] .cmsg.creator, :root[data-skin="light"] .cmsg.silver, :root[data-skin="light"] .cmsg.bn {
  color-scheme: dark; --bg: #1b2247; --panel: #252d58; --panel-2: #2c3566; --line: #3d4880; --fg: #f4f6ff; --muted: #aab2d4; --accent-2: #ffffff; --danger: #ff7a90; --gold-fg: var(--gold); --ok-fg: var(--success);
  --accent-fg: color-mix(in srgb, var(--accent) 58%, var(--fg)); --well: color-mix(in srgb, var(--bg) 72%, var(--bg-2));
  --bg-2: color-mix(in srgb, var(--bg) 70%, var(--panel)); --panel-3: color-mix(in srgb, var(--panel-2) 86%, var(--fg)); --line-2: color-mix(in srgb, var(--line) 78%, var(--fg));
  --line-soft: color-mix(in srgb, var(--line) 55%, transparent); --fg-2: color-mix(in srgb, var(--fg) 78%, var(--muted)); --surface: var(--panel);
  --shadow: none; --shadow-pop: 0 28px 70px -22px rgba(4, 6, 26, .85);
  color: var(--fg);
}
:root[data-skin="light"] .dk { background: var(--bg); border-radius: var(--r-lg); padding: 18px; }

/* ---------- names the newer game sheets expect ----------
   ui-blackjack.css, ui-soccer.css, ui-sky.css and ui-hop.css were written against another token set. Each name they read is
   mapped onto a remake token here, so those games follow the skin and their own colour world. The remake itself never reads these.
   The first group is built from --fg, --muted, --bg and --shadow, so it is worked out again wherever the light skin keeps a dark cabinet. */
:root, :root[data-skin="light"] :is(.dk, .overlay, .maint, .cmsg.creator, .cmsg.silver, .cmsg.bn) {
  --hair: color-mix(in srgb, var(--fg) 9%, transparent); --hair-2: color-mix(in srgb, var(--fg) 16%, transparent);
  --dim: color-mix(in srgb, var(--muted) 76%, var(--bg)); --sh-1: var(--shadow);
}
:root { --r-2: 14px; --r-3: 20px; --r-4: 26px; --spring: cubic-bezier(.34, 1.45, .64, 1); --t-1: .14s; --t-2: .22s; --t-3: .36s; }
@keyframes uiIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes uiPop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
body { background: var(--bg-art), var(--bg); background-attachment: fixed; }
:root[data-bg="plain"] { --bg-art: none; }
:root[data-bg="grid"] { --bg-art: linear-gradient(color-mix(in srgb, var(--fg) 5%, transparent) 1px, transparent 1px) 0 0 / 100% 44px, linear-gradient(90deg, color-mix(in srgb, var(--fg) 5%, transparent) 1px, transparent 1px) 0 0 / 44px 100%; }
:root[data-bg="dots"] { --bg-art: radial-gradient(color-mix(in srgb, var(--fg) 12%, transparent) 1.2px, transparent 1.6px) 0 0 / 26px 26px; }
:root[data-bg="glow"] { --bg-art: radial-gradient(1200px 700px at 50% 110%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 65%); }

/* ---------- motion ---------- */
.rm *, .rm *::before, .rm *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
.view:not([hidden]) { animation: viewIn var(--t-panel) var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }
.view:fullscreen { background: var(--bg); padding: 20px; overflow: auto; align-content: start; }

/* ---------- game colour worlds ----------
   A game section, a tile, a nav link or the spotlight gets its world from its id.
   Anything with only a hue (style="--h:120") gets a world built from that hue, so an unknown game is still colourful. */
.view.dk, [data-g] {
  --g1: hsl(var(--h, 258) 92% 66%); --g2: hsl(calc(var(--h, 258) + 40) 92% 64%);
  --g3: hsl(calc(var(--h, 258) + 180) 90% 66%); --g4: hsl(var(--h, 258) 55% 9%); --g-ink: var(--ink);
}
/* WORLDS */
.view[data-view="wheel"], [data-g="wheel"] { --g1: #ff4fa3; --g2: #ffc93d; --g3: #35d6ff; --g4: #1f0b33; --pat: var(--pat-burst); }
.view[data-view="cases"], [data-g="cases"] { --g1: #ff8a1f; --g2: #ffd23d; --g3: #5c9bff; --g4: #111a2e; }
.view[data-view="mines"], [data-g="mines"] { --g1: #19e28f; --g2: #5ef2ff; --g3: #ff4757; --g4: #062a2c; --pat: var(--pat-grid); }
.view[data-view="crash"], [data-g="crash"] { --g1: #ff6a2b; --g2: #ffb02e; --g3: #9b6bff; --g4: #120c3a; --pat: var(--pat-dots); }
.view[data-view="plinko"], [data-g="plinko"] { --g1: #ff5fb8; --g2: #b6ff3d; --g3: #3fc8ff; --g4: #24104d; --pat: var(--pat-dots); }
.view[data-view="limbo"], [data-g="limbo"] { --g1: #2ff3ff; --g2: #b6ff3c; --g3: #ff58c8; --g4: #0b0730; --pat: var(--pat-burst); }
.view[data-view="dice"], [data-g="dice"] { --g1: #4d8dff; --g2: #2fe38c; --g3: #ff5c7a; --g4: #0a1438; }
.view[data-view="tower"], [data-g="tower"] { --g1: #ff9a3d; --g2: #ffd23f; --g3: #ff5a4a; --g4: #1d1040; --pat: var(--pat-grid); }
.view[data-view="coinflip"], [data-g="coinflip"] { --g1: #ffcf3d; --g2: #1fd6c1; --g3: #b98cff; --g4: #06262b; --pat: var(--pat-burst); }
.view[data-view="dice3d"], [data-g="dice3d"] { --g1: #ff3b4e; --g2: #fff4dc; --g3: #17c47a; --g4: #06281b; --pat: var(--pat-dots); --stage: radial-gradient(120% 90% at 50% 30%, #17a868, #06281b); }
.view[data-view="keno"], [data-g="keno"] { --g1: #3aa0ff; --g2: #ffd93d; --g3: #c08cff; --g4: #0b1245; --pat: var(--pat-dots); }
.view[data-view="scratch"], [data-g="scratch"] { --g1: #ff4f9a; --g2: #1fd1c1; --g3: #ffc43d; --g4: #2a1038; }
.view[data-view="boxes"], [data-g="boxes"] { --g1: #a47bff; --g2: #ffd64a; --g3: #ff6ac1; --g4: #1a0b3a; --pat: var(--pat-burst); }
.view[data-view="hilo"], [data-g="hilo"] { --g1: #ff4458; --g2: #ffc93d; --g3: #25c98a; --g4: #08301f; --stage: radial-gradient(120% 90% at 50% 30%, #12a36a, #08301f); }
.view[data-view="treasure"], [data-g="treasure"] { --g1: #f2c14e; --g2: #1ec8c8; --g3: #3fbf5f; --g4: #0b2f3a; --pat: var(--pat-dots); }
.view[data-view="slots"], [data-g="slots"] { --g1: #ff2e4d; --g2: #ffd23d; --g3: #3ad0ff; --g4: #2a0a2e; --pat: var(--pat-grid); }
.view[data-view="pachinko"], [data-g="pachinko"] { --g1: #ff7ab8; --g2: #2ff0e6; --g3: #ffb84a; --g4: #1a0b33; --pat: var(--pat-dots); }
.view[data-view="reaction"], [data-g="reaction"] { --g1: #2cff7a; --g2: #ffb52e; --g3: #ff3b3b; --g4: #0d1118; }
.view[data-view="memory"], [data-g="memory"] { --g1: #ff6fb1; --g2: #5cc8ff; --g3: #ffd84a; --g4: #141c4a; --pat: var(--pat-dots); }
.view[data-view="balldrop"], [data-g="balldrop"] { --g1: #ff7b24; --g2: #c6ff3d; --g3: #3d8bff; --g4: #0f1a45; }
.view[data-view="golf"], [data-g="golf"] { --g1: #37c85a; --g2: #a8f04a; --g3: #ff4b4b; --g4: #0c3a1c; }
.view[data-view="chicken"], [data-g="chicken"] { --g1: #ffd43d; --g2: #3fdc6b; --g3: #ff4a3d; --g4: #23263d; }
.view[data-view="blackjack"], [data-g="blackjack"] { --g1: #1fbf75; --g2: #ffd166; --g3: #ff4d5e; --g4: #06281b; }
.view[data-view="soccer"], [data-g="soccer"] { --g1: #12c48b; --g2: #e6fff6; --g3: #ffc93d; --g4: #062b22; }
.view[data-view="skydash"], [data-g="skydash"] { --g1: #45adf0; --g2: #8ff0ff; --g3: #ffd166; --g4: #0a1230; }
.view[data-view="roadhop"], [data-g="roadhop"] { --g1: #ff8f2e; --g2: #ffd23d; --g3: #45d0ff; --g4: #15182b; }
/* the newer game sheets call the game's main colour --gc */
:root, .view.dk, [data-g] { --gc: var(--g1); }

/* tile art colour classes: art in Arc.ART only uses these, so it follows the world */
.a1 { fill: var(--g1); } .a2 { fill: var(--g2); } .a3 { fill: var(--g3); } .a4 { fill: var(--g4); }
.aw { fill: #fff; } .ak { fill: rgba(8, 9, 18, .85); } .ah { fill: rgba(255, 255, 255, .35); } .ad { fill: rgba(0, 0, 0, .22); }
.s1, .s2, .s3, .s4, .sw, .sk { fill: none; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.s1 { stroke: var(--g1); } .s2 { stroke: var(--g2); } .s3 { stroke: var(--g3); } .s4 { stroke: var(--g4); } .sw { stroke: #fff; } .sk { stroke: rgba(8, 9, 18, .85); }

/* ---------- top bar bits made by script ---------- */

.av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; flex: none; background: var(--panel-2); }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av svg { width: 60%; height: 60%; }
.av.big { width: 64px; height: 64px; }

.emb { display: block; }

/* ---------- toasts, modal, reward reveal, quick settings ---------- */
#toasts { position: fixed; right: max(14px, env(safe-area-inset-right, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 70; display: grid; gap: 8px; width: min(320px, calc(100vw - 28px)); pointer-events: none; }

.reveal .rays { position: relative; width: 150px; height: 150px; display: grid; place-items: center; }
.reveal .rays::before { content: ""; position: absolute; inset: -14%; border-radius: 50%; background: conic-gradient(from 0deg, transparent, var(--rc), transparent 25%, var(--rc), transparent 50%, var(--rc), transparent 75%, var(--rc), transparent); opacity: .35; filter: blur(5px); animation: rays 7s linear infinite; }
.reveal .rays svg { width: 96px; height: 96px; position: relative; animation: pop 320ms var(--ease-pop); filter: drop-shadow(0 0 16px var(--rc)); }

#gfilters { display: flex; gap: 8px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 3px; }
#gfilters::-webkit-scrollbar { display: none; }

/* ---------- win and loss colours ---------- */

.pos { color: var(--success); }
.neg { color: var(--danger); }
:root[data-skin="light"] .view:not(.dk) .pos { color: color-mix(in srgb, var(--success) 48%, #000); }
:root[data-skin="light"] .view:not(.dk) .neg { color: color-mix(in srgb, var(--danger) 70%, #000); }

/* ---------- phone bottom bar ---------- */

@media (max-width: 699px) {

  .wrap { padding-bottom: 110px; }
  .wrap > :not(header) { width: calc(100% - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)); }
  #toasts { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  /* a win or reveal modal is open: toasts move to the top so they never cover its buttons */
  body:has(.overlay:not([hidden])) #toasts { bottom: auto; top: calc(var(--top-h) + 8px + env(safe-area-inset-top, 0px)); }
  #menu-btn, #mute { display: none; }
}

.at { font-family: var(--font-display); font-weight: 800; }

/* ---------- live chat ---------- */
.chat-btn { position: relative; }
.chat-btn[aria-expanded="true"] { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 60%, transparent); color: var(--accent-fg); }
.cbadge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--gold); color: var(--ink); font: 700 10.5px var(--font-mono); display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg-2); }
.chat { position: fixed; top: calc(8px + env(safe-area-inset-top, 0px)); right: max(8px, env(safe-area-inset-right, 0px)); bottom: calc(8px + env(safe-area-inset-bottom, 0px)); z-index: 37; width: min(372px, calc(100% - 16px)); display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(120% 260px at 100% 0%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%), linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-pop), inset 0 1px 0 rgba(255, 255, 255, .08); animation: slideIn var(--t-panel) var(--ease); }
.chat-head { display: flex; align-items: center; gap: 10px; min-height: var(--top-h); padding: 0 10px 0 16px; border-bottom: 1px solid var(--line); flex: none; }
.chat-head h2 { margin: 0; font: 800 20px var(--font-display); letter-spacing: -.01em; }
.chat-on { display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--success) 14%, transparent); font: 600 11.5px var(--font-mono); color: var(--ok-fg); white-space: nowrap; }
.chat-on i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok-fg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 26%, transparent); }
.chat.off .chat-on { background: var(--well); color: var(--muted); }
.chat.off .chat-on i { background: var(--muted); box-shadow: none; }
.chat-rules { position: relative; margin: 0; padding: 9px 16px 9px 40px; font-size: 11.5px; line-height: 1.45; color: var(--muted); background: color-mix(in srgb, var(--bg) 40%, transparent); border-bottom: 1px solid var(--line-soft); flex: none; }
.chat-rules::before { content: "i"; position: absolute; left: 16px; top: 10px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font: 700 10px var(--font-mono); color: var(--fg); background: var(--panel-3); }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; overscroll-behavior: contain; }
.chat-empty { margin: auto; padding: 12px 18px; border: 1px dashed var(--line-2); border-radius: var(--r-md); color: var(--fg-2); font-size: 13px; }
.cmsg { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 9px; align-items: start; animation: viewIn .2s ease; }
.cmsg .av { width: 32px; height: 32px; box-shadow: 0 0 0 1px var(--line-2); }
.cmeta { display: flex; align-items: center; gap: 6px; min-height: 18px; font-size: 12px; }
.cmeta b { font-weight: 700; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmeta .clv { flex: none; font: 700 10px var(--font-mono); color: var(--fg-2); background: color-mix(in srgb, var(--fg) 12%, transparent); border-radius: var(--r-pill); padding: 2px 7px; }
.cmeta time { margin-left: auto; font: 500 10px var(--font-mono); color: color-mix(in srgb, var(--muted) 65%, var(--fg)); flex: none; }
.cmsg p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.42; overflow-wrap: anywhere; color: var(--fg); background: color-mix(in srgb, var(--bg) 62%, var(--panel)); border: 1px solid var(--line-soft); border-radius: 4px 14px 14px 14px; padding: 7px 11px; width: fit-content; max-width: 100%; }
/* your own messages sit on the right */
.cmsg.mine { grid-template-columns: minmax(0, 1fr) 32px; }
.cmsg.mine .av { order: 2; }
.cmsg.mine .cmeta { flex-direction: row-reverse; }
.cmsg.mine .cmeta time { margin: 0 auto 0 0; }
.cmsg.mine p { margin-left: auto; border-radius: 14px 4px 14px 14px; background: color-mix(in srgb, var(--accent) 26%, var(--panel-2)); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.chat-err { min-height: 18px; padding: 0 16px; font-size: 12px; font-weight: 600; color: var(--danger); flex: none; }
.chat-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 40%, transparent); flex: none; }
.chat-form .ain { height: 44px; padding: 0 16px; border-radius: var(--r-pill); font: 500 14.5px var(--font-body); }
.chat-form .ain:focus { border-color: var(--accent); }
.chat-form .mini { height: 44px; padding: 0 20px; border-radius: var(--r-pill); font: 700 14px var(--font-body); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 94%, #fff), var(--accent)); color: var(--accent-ink); box-shadow: 0 2px 0 color-mix(in srgb, var(--accent) 55%, #000), 0 10px 22px -12px var(--accent); transition: transform var(--t-press) var(--ease), filter var(--t-ui) var(--ease); }
.chat-form .mini:hover { filter: brightness(1.08); }
.chat-form .mini:active { transform: translateY(2px); box-shadow: none; }
.chat-form .mini:disabled { background: var(--well); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-soft); cursor: not-allowed; filter: none; transform: none; }
/* toasts step aside while the chat is open, so they never cover the message box */
@media (min-width: 700px) { body:has(.chat:not([hidden])) #toasts { right: calc(min(372px, 100vw - 16px) + 24px); } }
@media (max-width: 699px) {
  .chat { inset: 0; width: 100%; border: 0; border-radius: 0; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
  body:has(.chat:not([hidden])) #toasts { bottom: auto; top: calc(var(--top-h) + 8px + env(safe-area-inset-top, 0px)); }
}

/* banner messages: a metal frame around a dark plate. Gold for the Creator, silver for names picked in api/chat.js */
.crtag { display: none; font: 700 9.5px var(--font-mono); letter-spacing: .12em; color: var(--ink); background: linear-gradient(135deg, #ffe9a3, var(--gold)); border-radius: var(--r-pill); padding: 3px 8px; }
.chat.is-creator .crtag { display: inline-block; }
.cmsg.creator, .cmsg.silver { --m1: #fff1bf; --m2: var(--gold); --m3: #a8690f; position: relative; isolation: isolate; padding: 10px 10px 11px; border: 2px solid transparent; border-radius: var(--r-md); color: var(--fg);
  background: radial-gradient(130% 120% at 0% 0%, color-mix(in srgb, var(--m2) 34%, transparent), transparent 58%) padding-box, radial-gradient(90% 100% at 100% 100%, color-mix(in srgb, var(--m2) 16%, transparent), transparent 60%) padding-box, linear-gradient(180deg, color-mix(in srgb, var(--bg) 80%, var(--panel-2)), var(--bg)) padding-box, linear-gradient(135deg, var(--m1), var(--m2) 26%, var(--m3) 50%, var(--m1) 72%, var(--m2) 88%, var(--m3)) border-box;
  box-shadow: 0 14px 30px -16px var(--m2), 0 0 0 1px color-mix(in srgb, var(--m2) 18%, transparent), inset 0 1px 0 rgba(255, 255, 255, .2); }
.cmsg.silver { --m1: #ffffff; --m2: var(--silver); --m3: var(--silver-2); }
/* the sheen: two soft light streaks across the plate */

.cmsg.creator .av, .cmsg.silver .av { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--m2), 0 0 16px 0 color-mix(in srgb, var(--m2) 70%, transparent); }
.cmsg.creator .cmeta b, .cmsg.silver .cmeta b { color: var(--m2); }
.cmsg.silver .cmeta b { color: #e4e9f2; }
.cmsg.creator .cmeta .clv, .cmsg.silver .cmeta .clv { color: var(--ink); background: linear-gradient(135deg, var(--m1), var(--m2)); letter-spacing: .08em; box-shadow: 0 1px 0 var(--m3); }
.cmsg.creator .cmeta time, .cmsg.silver .cmeta time { color: var(--fg-2); }
.cmsg.creator p, .cmsg.creator.mine p, .cmsg.silver p, .cmsg.silver.mine p { background: color-mix(in srgb, var(--m2) 16%, var(--panel)); border-color: color-mix(in srgb, var(--m2) 55%, transparent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.cmsg.creator p, .cmsg.creator.mine p { font-weight: 500; }

/* ================= HIGH DETAIL PASS: lit art, depth, motion and material for the lobby and player pages ================= */
.am { fill: url(#g-metal); } .ag { fill: url(#g-gold); }

/* ---------- idle loops inside tile art: only inside .art / .hs-l, and only while the tile is on screen ---------- */
.art [class*="an-"], .hs-l [class*="an-"] { transform-box: fill-box; transform-origin: 50% 50%; animation-play-state: paused; }

.art .an-spin { animation: aSpin 28s linear infinite; }
.art .an-bob, .hs-l .an-bob { animation: aBob 3.2s ease-in-out infinite; }
.art .an-bob2 { animation: aBob 3.9s ease-in-out -1.6s infinite; }
.art .an-twk, .hs-l .an-twk { animation: aTwk 2.6s ease-in-out infinite; }
.art .an-flick { animation: aFlick .36s ease-in-out infinite alternate; transform-origin: 50% 0; }
.art .an-blink, .hs-l .an-blink { animation: aBlink 4.2s ease-in-out infinite; }
.art .an-hop, .hs-l .an-hop { animation: aHop 2.4s cubic-bezier(.3, .7, .3, 1) infinite; transform-origin: 50% 100%; }
.art .an-needle { animation: aNeedle 4.6s ease-in-out infinite; transform-origin: 10% 88%; }
[data-g="treasure"] .art .an-needle { transform-origin: 50% 50%; animation-duration: 6s; }
.art .an-flag { animation: aFlag 1.8s ease-in-out infinite; transform-origin: 100% 50%; }
.art .an-lid { animation: aLid 3.4s ease-in-out infinite; transform-origin: 20% 100%; }
.art .an-rise { animation: aRise 2.2s ease-in infinite; }
.art .an-slide { animation: aSlide 5s ease-in-out infinite; }
.art .an-streak { animation: aStreak 1.4s linear infinite; }
.art .an-puff, .hs-l .an-puff { animation: aPuff 1.6s ease-out infinite; }
.art .an-sheen { animation: aSheen 4.5s ease-in-out infinite; }
.art .an-rub { animation: aRub 1.5s ease-in-out infinite alternate; }
.art .an-zap { animation: aZap 1.9s ease-in-out infinite; }
.art .an-lever { animation: aLever 5s ease-in-out infinite; }
.art .an-car { animation: aCar 3s ease-in-out infinite; }
.hs-l .an-carhero { animation: aCarHero 6.5s cubic-bezier(.45, 0, .7, 1) infinite; }
.hs-l .an-road { animation: aRoad 1.1s linear infinite; }
.hs-l .an-wing { animation: aWing 2.4s ease-in-out infinite; transform-origin: 20% 10%; }
@keyframes aSpin { to { transform: rotate(360deg); } }
@keyframes aBob { 50% { transform: translateY(-3.5px) rotate(-1.2deg); } }
@keyframes aTwk { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .25; transform: scale(.6); } }
@keyframes aFlick { from { transform: scale(1, 1); } to { transform: scale(.82, 1.22); } }
@keyframes aBlink { 0%, 44%, 50%, 100% { transform: scaleY(1); } 47% { transform: scaleY(.1); } }
@keyframes aHop { 0%, 55%, 100% { transform: translateY(0) scale(1, 1); } 62% { transform: translateY(0) scale(1.07, .9); } 76% { transform: translateY(-9px) scale(.95, 1.07); } 90% { transform: translateY(0) scale(1.05, .93); } }
@keyframes aNeedle { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-58deg); } 45% { transform: rotate(-44deg); } 70% { transform: rotate(18deg); } 82% { transform: rotate(8deg); } }
@keyframes aFlag { 50% { transform: skewY(7deg) scaleX(.93); } }
@keyframes aLid { 50% { transform: translateY(-5px) rotate(-3.5deg); } }
@keyframes aRise { 0% { transform: translateY(8px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-10px); opacity: 0; } }
@keyframes aSlide { 0%, 100% { transform: translateX(0); } 35% { transform: translateX(26px); } 70% { transform: translateX(-30px); } }
@keyframes aStreak { from { transform: translate(8px, -5px); opacity: 0; } 30% { opacity: .6; } to { transform: translate(-14px, 8px); opacity: 0; } }
@keyframes aPuff { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(1.25) translate(-6px, 5px); opacity: .15; } }
@keyframes aSheen { 0%, 60%, 100% { opacity: 0; transform: translateX(-12px); } 75% { opacity: 1; } 90% { opacity: 0; transform: translateX(14px); } }
@keyframes aRub { from { transform: translate(-4px, 5px) rotate(-8deg); } to { transform: translate(9px, -9px) rotate(8deg); } }
@keyframes aZap { 0%, 100% { transform: scale(1); } 8% { transform: scale(1.12) rotate(-3deg); } 16% { transform: scale(.98); } 24% { transform: scale(1.05); } 32% { transform: scale(1); } }
@keyframes aLever { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(26px); } 90% { transform: translateY(-2px); } }
@keyframes aCar { 50% { transform: translateX(-9px); } }
@keyframes aCarHero { 0% { transform: translateX(190px); } 100% { transform: translateX(-620px); } }
@keyframes aRoad { to { transform: translateX(-60px); } }
@keyframes aWing { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(-14deg); } 86% { transform: rotate(4deg); } 93% { transform: rotate(-8deg); } }

@keyframes favPop { 0% { transform: scale(.4) rotate(-40deg); } 55% { transform: scale(1.4) rotate(12deg); } 100% { transform: scale(1) rotate(0); } }

@media (prefers-reduced-motion: reduce) { .art [class*="an-"], .hs-l [class*="an-"] { animation: none !important; }  }
.rm .art [class*="an-"], .rm .hs-l [class*="an-"], .rm .new::after { animation: none !important; }

/* the sheen that crosses a revealed reward: a full-size layer moved with transform */
@keyframes btnShine { 0%, 60% { transform: translateX(-100%); } 90%, 100% { transform: translateX(100%); } }

.av svg.obj { width: 66%; height: 66%; }

.fly-coin { position: fixed; z-index: 90; left: 0; top: 0; width: 22px; height: 22px; margin: -11px; border-radius: 50%; pointer-events: none; background: var(--gold); box-shadow: inset 0 0 0 2px #c98510; }

/* the +/- number: a clear pill that rises from under the top bar into the coin chip */
.delta.fl { position: fixed; z-index: 60; font-size: 14px; padding: 4px 8px; border-radius: var(--r-sm); background: var(--panel-2); box-shadow: var(--shadow-pop); text-shadow: none; animation: deltaUp2 1s var(--ease) forwards; }
@keyframes deltaUp2 { 0% { opacity: 0; transform: translateY(14px) scale(.7); } 18% { opacity: 1; transform: translateY(0) scale(1.1); } 30% { transform: scale(1); } 75% { opacity: 1; transform: translateY(-4px); } 100% { opacity: 0; transform: translateY(-30px) scale(.8); } }

/* ---------- glints on medals and prize objects ---------- */
.medal .oglint, .obj .oglint { transform-box: fill-box; transform-origin: center; animation: aTwk 2.8s ease-in-out infinite; }
.locked .obj .oglint { display: none; }

/* ---------- chat panel ---------- */
@media (min-width: 700px) { .chat { top: calc(var(--top-h) + 10px + env(safe-area-inset-top, 0px)); } }
.chat { background: radial-gradient(120% 220px at 100% 0%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%), radial-gradient(color-mix(in srgb, var(--fg) 6%, transparent) 1px, transparent 1.4px) 0 0 / 18px 18px, linear-gradient(180deg, var(--panel-2), var(--panel)); box-shadow: var(--shadow-pop), 0 6px 0 color-mix(in srgb, var(--bg) 55%, #000), inset 0 1px 0 rgba(255, 255, 255, .12); }
.chat-head { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent); }

.chat-on { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success) 35%, transparent); }
.chat-on i { animation: livePulse 1.8s ease-in-out infinite; }
@keyframes livePulse { 50% { box-shadow: 0 0 0 6px transparent; } }
.chat.off .chat-on { box-shadow: inset 0 0 0 1px var(--line); } .chat.off .chat-on i { animation: aTwk 1.2s ease-in-out infinite; }
.chat-empty { margin: auto; padding: 8px 18px; border: 0; display: grid; justify-items: center; gap: 4px; text-align: center; }

.chat-empty b { font: 800 18px var(--font-display); color: var(--fg); } .chat-empty span { font-size: 13px; color: var(--fg-2); }

.cmsg .av { box-shadow: 0 0 0 2px var(--panel-2), 0 0 0 3px var(--line-2), 0 3px 6px rgba(0, 0, 0, .4); }
.cmsg p { background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 50%, var(--panel-2)), color-mix(in srgb, var(--bg) 66%, var(--panel))); box-shadow: 0 2px 0 color-mix(in srgb, var(--bg) 50%, #000), inset 0 1px 0 rgba(255, 255, 255, .06); }
.cmsg.mine p { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 38%, var(--panel-2)), color-mix(in srgb, var(--accent) 22%, var(--panel-2))); box-shadow: 0 2px 0 color-mix(in srgb, var(--accent) 30%, #000), inset 0 1px 0 rgba(255, 255, 255, .14); }
.chat-form { background: color-mix(in srgb, var(--bg) 55%, transparent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
.chat-form .ain { box-shadow: inset 0 2px 4px rgba(0, 0, 0, .45); }
.chat-form .mini { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 3px 0 color-mix(in srgb, var(--accent) 55%, #000), 0 10px 22px -12px var(--accent); }

/* ---------- toasts ---------- */
#toasts { gap: 10px; width: min(340px, calc(100vw - 28px)); }

/* ---------- reward reveal and how-to modal ---------- */

.rstage { position: relative; width: 100%; height: 216px; display: grid; place-items: center; }
.rbeam { position: absolute; left: 50%; bottom: 0; width: 240px; height: 260px; margin-left: -120px; background: linear-gradient(0deg, color-mix(in srgb, var(--rc) 55%, transparent), transparent 85%); clip-path: polygon(34% 100%, 66% 100%, 100% 0, 0 0); opacity: .5; animation: aTwk 2.4s ease-in-out infinite; }
.reveal .rays { width: 190px; height: 190px; }
.reveal .rays::before { inset: -24%; opacity: .55; filter: blur(2px); background: repeating-conic-gradient(var(--rc) 0 9deg, transparent 9deg 30deg); -webkit-mask-image: radial-gradient(circle, #000 25%, transparent 68%); mask-image: radial-gradient(circle, #000 25%, transparent 68%); }
.rframe { position: relative; width: 132px; height: 132px; border-radius: 22px; display: grid; place-items: center; overflow: hidden; border: 5px solid transparent; background: radial-gradient(70% 60% at 50% 42%, color-mix(in srgb, var(--rc) 60%, transparent), transparent 75%) padding-box, linear-gradient(180deg, color-mix(in srgb, var(--rc) 26%, var(--panel-2)), color-mix(in srgb, var(--rc) 10%, var(--bg))) padding-box, linear-gradient(145deg, #fff, var(--rc) 28%, color-mix(in srgb, var(--rc) 50%, #000) 52%, #fff 70%, var(--rc) 86%, color-mix(in srgb, var(--rc) 50%, #000)) border-box; box-shadow: 0 6px 0 color-mix(in srgb, var(--rc) 40%, #000), 0 0 40px -4px var(--rc), inset 0 2px 8px rgba(0, 0, 0, .4); animation: revealIn .7s var(--ease-pop); }
@keyframes revealIn { 0% { transform: scale(.2) rotate(-25deg); opacity: 0; } 55% { transform: scale(1.15) rotate(6deg); opacity: 1; } 75% { transform: scale(.95) rotate(-2deg); } }
.reveal .rays .rframe svg { width: 104px; height: 104px; animation: none; filter: none; }
.rsheen { position: absolute; top: -10%; bottom: -10%; left: 0; right: 0; transform: translateX(-100%); background: linear-gradient(110deg, transparent 33%, rgba(255, 255, 255, .7) 50%, transparent 67%); animation: btnShine 2.6s ease-in-out .6s infinite; }
.rsp { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px; background: #fff; clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); transform: rotate(calc(var(--i) * 60deg + 20deg)) translateX(calc(96px + var(--i) * 5px)); animation: aTwkR 1.8s ease-in-out calc(var(--i) * .27s) infinite; }
@keyframes aTwkR { 0%, 100% { opacity: 1; scale: 1; } 50% { opacity: .15; scale: .4; } }
/* a card for something an admin took away (Arc.pranks in arcade-core.js): the reward dialog's frame in a lighter navy,
   flat: no rays, glow, sparkles or 3D edge; the label is plain text */
.amodal.reveal.prank { gap: var(--s3); padding-top: var(--s4); background: var(--panel-3); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); }
.reveal.prank .rr { font: 600 var(--fs-meta) var(--font-body); color: var(--danger); background: none; padding: 0; border-radius: 0; box-shadow: none; text-shadow: none; }
.reveal.prank .pk-ic { display: grid; place-items: center; }
.reveal.prank .pk-ic svg { width: 48px; height: 48px; }
.reveal.prank .pk-ic.down svg { transform: rotate(180deg); }
.reveal.prank h3 { font-size: var(--fs-title); text-shadow: none; overflow-wrap: anywhere; }
.reveal.prank .pk-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s1); color: var(--fg); font-size: var(--fs-body); overflow-wrap: anywhere; }
.reveal.prank .pk-lines:empty { display: none; }
.reveal.prank .pk-note { margin: 0; width: 100%; color: var(--fg); font-size: var(--fs-body); line-height: 1.45; overflow-wrap: anywhere; }
.reveal.prank .note { margin: 0; color: var(--muted); font-size: var(--fs-meta); }
.reveal.prank .btn { margin-top: var(--s1); }

/* ---------- phone bottom bar: solid, raised ---------- */
@media (max-width: 699px) {

  #toasts { left: 12px; right: 12px; width: auto; bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
  body:has(.overlay:not([hidden])) #toasts, body:has(.chat:not([hidden])) #toasts { top: calc(var(--top-h) + 12px + env(safe-area-inset-top, 0px)); }
  .rstage { height: 190px; }
}
@media (prefers-reduced-motion: reduce) { .rsp, .rbeam, .oglint { animation: none !important; } }
.rm .rsp, .rm .rbeam, .rm .oglint, .rm .rsheen { animation: none !important; }

.iart .iflk { transform-box: fill-box; transform-origin: center; animation: iFlk 1.7s ease-in-out infinite alternate; }
@keyframes iFlk { from { opacity: .22; transform: scale(.92); } to { opacity: .5; transform: scale(1.06); } }
.rm .iflk { animation: none; }
@media (prefers-reduced-motion: reduce) { .iflk { animation: none; } }

.rframe svg.iart { position: relative; width: 78%; height: 78%; overflow: visible; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .5)); }

/* the favourite star never sits on the art's focal point */
[data-g="keno"]:not(.wide) .art svg, [data-g="tower"]:not(.wide) .art svg { transform: translate(-3%, 5%) scale(.93); }

/* ---------- toasts: fewer at once, and never on top of something you need ---------- */

@media (min-width: 700px) {
  body:has(.view:is([data-view="profile"], [data-view="progress"], [data-view="collection"], [data-view="stats"], [data-view="ranks"], [data-view="history"], [data-view="feedback"], [data-view="options"]):not([hidden])) #toasts { bottom: auto; top: calc(var(--top-h) + 14px); }
}
@media (max-width: 699px) {

  body:has(.overlay:not([hidden])) #toasts { top: calc(6px + env(safe-area-inset-top, 0px)); }
  body:has(.chat:not([hidden])) #toasts { top: auto; bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- fewer things moving at once: glints only twinkle where a reward is waiting ---------- */
.obj .oglint, .medal .oglint { animation: none; }
.rframe .oglint { animation: aTwk 2.800s ease-in-out infinite; }
.rm .oglint { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .oglint { animation: none !important; } }

/* ---------- chat: avatars are lit objects, the framed messages get one soft diagonal sheen instead of hard streaks ---------- */
.cmsg .av .obj { width: 64%; height: 64%; }

.chat-rules { background: color-mix(in srgb, var(--bg) 40%, transparent); box-shadow: inset 0 -1px 0 var(--line-soft); }

/* ---------- chat: emoji picker ---------- */
.chat-form { grid-template-columns: auto minmax(0, 1fr) auto; }
.chat-emo { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--fg-2); background: var(--well); box-shadow: inset 0 0 0 1px var(--line), inset 0 2px 4px rgba(0, 0, 0, .45); transition: color var(--t-ui) var(--ease), box-shadow var(--t-ui) var(--ease), transform var(--t-press) var(--ease); }
.chat-emo .ic { width: 22px; height: 22px; }
.chat-emo:hover { color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-2), inset 0 2px 4px rgba(0, 0, 0, .45); }
.chat-emo:active { transform: scale(.92); }
.chat-emo[aria-expanded="true"] { color: var(--accent-fg); background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.chat-emo:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.chat-pick { flex: none; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; margin: 0 12px 8px; padding: 8px; max-height: 176px; overflow-y: auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: inset 0 2px 5px -2px rgba(4, 6, 26, .5), 0 1px 0 rgba(255, 255, 255, .06); scrollbar-width: thin; scrollbar-color: var(--line) transparent; overscroll-behavior: contain; animation: viewIn var(--t-ui) var(--ease); }
.chat-pick[hidden] { display: none; }
.chat-pick button { aspect-ratio: 1; min-width: 0; display: grid; place-items: center; font-size: 21px; line-height: 1; border-radius: 9px; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; transition: background var(--t-press) var(--ease), transform var(--t-ui) var(--ease-pop); }
.chat-pick button:hover, .chat-pick button:focus-visible { background: var(--panel-3); transform: scale(1.14); }
.chat-pick button:active { transform: scale(.9); }

.chat-pick .ep-sep { grid-column: 1 / -1; height: 1px; margin: 5px 4px 2px; background: var(--line-soft); }
@media (max-width: 699px) { .chat-pick { max-height: min(176px, 30vh); } }
/* a message that is only a few emoji is shown big, without a bubble (inside a gold or silver banner too) */
.cmsg p.jumbo, .cmsg.mine p.jumbo, .cmsg.creator p.jumbo, .cmsg.silver p.jumbo, .cmsg.bn p.jumbo { font-size: 30px; line-height: 1.15; padding: 2px 4px; background: none; border-color: transparent; box-shadow: none; }

/* ---------- chat: the popup for a new message while the chat is closed ---------- */

.chatpop .cp-open { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: center; min-width: 0; padding: 5px 6px; border-radius: var(--r-sm); text-align: left; font: inherit; color: inherit; cursor: pointer; transition: background var(--t-ui) var(--ease); }
.chatpop .cp-open:hover { background: color-mix(in srgb, var(--fg) 7%, transparent); }
.chatpop .cp-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: var(--accent-ink); background: radial-gradient(80% 70% at 30% 10%, rgba(255, 255, 255, .6), transparent 60%), linear-gradient(180deg, var(--accent-fg), var(--accent)); box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 50%, #000), inset 0 1px 0 rgba(255, 255, 255, .5); animation: favPop .6s var(--ease-pop) .08s backwards; }
.chatpop .cp-ic .ic, .chatpop .cp-x .ic { padding: 0; border-radius: 0; background: none; box-shadow: none; }
.chatpop .cp-ic .ic { width: 22px; height: 22px; fill: currentColor; stroke: none; }
.chatpop.creator .cp-ic, .chatpop.silver .cp-ic { color: var(--ink); background: radial-gradient(80% 70% at 30% 10%, rgba(255, 255, 255, .7), transparent 60%), linear-gradient(180deg, #ffe9a3, var(--gold)); box-shadow: 0 3px 0 #a8690f, inset 0 1px 0 rgba(255, 255, 255, .6); }
.chatpop.silver .cp-ic { background: radial-gradient(80% 70% at 30% 10%, rgba(255, 255, 255, .8), transparent 60%), linear-gradient(180deg, #ffffff, var(--silver)); box-shadow: 0 3px 0 var(--silver-2), inset 0 1px 0 #fff; }
.chatpop .cp-body { display: grid; gap: 2px; min-width: 0; }
.chatpop .cp-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chatpop .cp-head b { font: 800 14px var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chatpop .cp-tag { flex: none; font: 700 9.5px var(--font-mono); font-style: normal; letter-spacing: .12em; color: var(--fg-2); background: color-mix(in srgb, var(--fg) 12%, transparent); border-radius: var(--r-pill); padding: 3px 8px; }
.chatpop.creator .cp-tag { color: var(--ink); background: linear-gradient(135deg, #ffe9a3, var(--gold)); }
.chatpop.silver .cp-tag { color: var(--ink); background: linear-gradient(135deg, #ffffff, var(--silver)); }
.chatpop .cp-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; max-height: 2.7em; font-size: 13px; font-weight: 500; line-height: 1.35; color: var(--fg); overflow-wrap: anywhere; }
.chatpop small { display: block; font: 500 10.5px var(--font-mono); color: var(--muted); }
.chatpop .cp-x { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); transition: background var(--t-ui) var(--ease), color var(--t-ui) var(--ease); }
.chatpop .cp-x:hover { background: color-mix(in srgb, var(--fg) 10%, transparent); color: var(--fg); }
.chatpop .cp-x .ic { width: 15px; height: 15px; }
/* the bar along the bottom runs out as the popup's six seconds do */
.chatpop .cp-bar { position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent-fg); opacity: .8; transform-origin: 0 50%; animation: cpBar 6s linear both; }
.chatpop.creator .cp-bar { background: var(--gold); }
.chatpop.silver .cp-bar { background: var(--silver); }
@keyframes cpBar { to { transform: scaleX(0); } }
.rm .chatpop .cp-bar, .rm .chatpop .cp-ic { animation: none; }
@media (prefers-reduced-motion: reduce) { .chatpop .cp-bar { display: none; } }

/* toasts sit under the top bar on these two pages as on the other player pages, clear of the main button */
@media (min-width: 700px) { body:has(.view:is([data-view="bank"], [data-view="luck"]):not([hidden])) #toasts { bottom: auto; top: calc(var(--top-h) + 14px); } }

/* ---------- Soccer Packs: base pieces (pack shop, the tear-open pack, player cards, the club) ----------
   Kept as on the main line. ui-soccer.css is loaded after this sheet and dresses them; it needs .flag, .sp-val, .sp-credit and the keyframes from here. */
.sp-packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.sp-pack { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: grid; gap: 8px; justify-items: center; text-align: center; box-shadow: var(--shadow); }
.sp-art { width: 96px; height: 128px; border-radius: 12px; background: linear-gradient(155deg, color-mix(in srgb, var(--pc) 85%, white), color-mix(in srgb, var(--pc) 55%, black)); display: grid; place-items: center; position: relative; overflow: hidden; box-shadow: 0 12px 24px -12px var(--pc), inset 0 0 0 2px #ffffff40; }
.sp-art::before, .sp-tear-top::before, .sp-tear-body::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, #ffffff22 0 6px, transparent 6px 18px); }
.sp-art span, .sp-tear-body span { position: relative; font-family: var(--font-display); font-weight: 800; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: #101318; writing-mode: vertical-rl; transform: rotate(180deg); }
.sp-pack b { font-family: var(--font-display); font-size: 17px; }
.sp-pack small { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.sp-pack .oddsl { max-width: 190px; }
.sp-board { padding: 0; overflow: hidden; }
.sp-stage { position: relative; min-height: 430px; display: grid; place-items: center; align-content: center; gap: 14px; padding: 22px 14px 30px; overflow: hidden; background: radial-gradient(ellipse at 50% 120%, #1d2a22 0%, #0b0d13 60%); text-align: center; }
.sp-stage > * { position: relative; z-index: 1; }
.sp-stage.sp-live { cursor: pointer; }
.sp-beams { position: absolute !important; inset: 0; z-index: 0 !important; pointer-events: none; background: conic-gradient(from 200deg at 20% -10%, transparent 0 8deg, color-mix(in srgb, var(--tc, #fff) 22%, transparent) 12deg, transparent 20deg), conic-gradient(from 140deg at 80% -10%, transparent 0 8deg, color-mix(in srgb, var(--tc, #fff) 22%, transparent) 12deg, transparent 20deg); animation: spBeams 3.2s ease-in-out infinite alternate; }
@keyframes spBeams { from { transform: translateX(-4%); opacity: .6; } to { transform: translateX(4%); opacity: 1; } }
.sp-idle { display: grid; gap: 8px; justify-items: center; color: var(--muted); max-width: 340px; }
.sp-idle svg { width: 64px; height: 64px; opacity: .9; }
.sp-idle b { color: var(--fg); font-family: var(--font-display); font-size: 20px; text-wrap: balance; }
.sp-idle span { font-size: 13px; }
.sp-stage.sp-flash::after { content: ""; position: absolute; inset: 0; z-index: 2; background: radial-gradient(circle, var(--tc) 0%, transparent 70%); animation: spFlash .5s ease-out forwards; pointer-events: none; }
@keyframes spFlash { from { opacity: .95; } to { opacity: 0; } }
.sp-hint { position: absolute !important; bottom: 8px; left: 0; right: 0; margin: 0; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #ffffff66; }
.sp-clue { display: grid; gap: 10px; justify-items: center; animation: spClue .45s cubic-bezier(.2, 1.4, .4, 1); color: #fff; }
.sp-clue small { font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--tc); }
.sp-clue b { font-family: var(--font-display); font-size: clamp(28px, 7vw, 46px); font-weight: 800; text-shadow: 0 0 30px var(--tc); }
.sp-clue .sp-big { font-size: clamp(54px, 14vw, 96px); line-height: 1; }
@keyframes spClue { from { transform: scale(.4); opacity: 0; } }
.flag { display: inline-block; width: 24px; height: 16px; border-radius: 3px; box-shadow: 0 0 0 1px #0004; flex: none; }
.flag.big { width: 120px; height: 80px; border-radius: 8px; box-shadow: 0 0 40px var(--tc); }
.sp-cards { display: flex; gap: 14px; justify-content: center; align-items: flex-end; flex-wrap: wrap; }
.sp-slot { display: grid; gap: 8px; justify-items: center; }
.sp-slot small { font-size: 11.5px; font-family: var(--font-mono); }
.sp-slot small.new { color: var(--accent); }
.sp-slot small.dup { color: var(--muted); }
.sp-slot.best .fc { transform: scale(1.08); margin: 8px 8px 10px; box-shadow: inset 0 0 0 2px #ffffff80, 0 0 40px -4px var(--tc); }
.sp-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; align-items: center; }
.sp-actions .big-btn { width: auto; padding: 13px 26px; font-size: 16px; }
.sp-actions .chip-btn { padding: 0 14px; min-height: 46px; font-family: var(--font-body); }
.sp-stage .note { text-align: center; }
/* player card */
.fc { --c1: #f2f4f8; --c2: #9aa3b5; --ink: #1b202b; width: 150px; border-radius: 14px; padding: 10px; background: linear-gradient(160deg, var(--c1), var(--c2)); color: var(--ink); text-align: left; position: relative; overflow: hidden; box-shadow: inset 0 0 0 2px #ffffff66, 0 10px 22px -12px #000; display: grid; gap: 4px; flex: none; }
.fc::after { content: ""; position: absolute; top: 0; right: 0; width: 30px; height: 30px; background: linear-gradient(225deg, #ffffff80 50%, transparent 50%); }
.fc.in { animation: spCard .5s cubic-bezier(.2, 1.3, .4, 1) both; }
.sp-slot:nth-child(2) .fc.in { animation-delay: .12s; }
.sp-slot:nth-child(3) .fc.in { animation-delay: .24s; }
@keyframes spCard { from { transform: translateY(40px) rotateY(80deg) scale(.8); opacity: 0; } }
.t-bronze { --c1: #e2b086; --c2: #8a5a2b; --ink: #2b1806; }
.t-silver { --c1: #f2f4f8; --c2: #9aa3b5; --ink: #1b202b; }
.t-gold { --c1: #ffeeb0; --c2: #d4a017; --ink: #2a1c00; }
.t-star { --c1: #b5f3ff; --c2: #1c7fd6; --ink: #04142b; }
.t-elite { --c1: #f0a6ff; --c2: #5a1fc4; --ink: #ffffff; }
.fc.t-legend { --ink: #241700; background: linear-gradient(135deg, #ffffff 0%, #ffe89a 25%, #b9f3ff 50%, #ffc9f0 75%, #ffffff 100%); background-size: 220% 220%; animation: spHolo 4s linear infinite; }
.fc.t-legend.in { animation: spCard .5s cubic-bezier(.2, 1.3, .4, 1) both, spHolo 4s linear infinite; }
@keyframes spHolo { to { background-position: 220% 0; } }
.fc-top { display: grid; grid-template-columns: auto 1fr; gap: 6px; align-items: end; }
.fc-rt { display: grid; gap: 3px; justify-items: center; }
.fc-rt b { font-family: var(--font-display); font-size: 30px; font-weight: 800; line-height: .9; }
.fc-rt span { font-family: var(--font-mono); font-size: 11px; font-weight: 700; }
.fc-face svg { width: 100%; height: 74px; display: block; }
.fc-name { font-family: var(--font-display); font-weight: 800; font-size: 14px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-top: 1px solid color-mix(in srgb, var(--ink) 30%, transparent); padding-top: 5px; }
.fc-club { font-size: 10.5px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px 6px; font-family: var(--font-mono); font-size: 9.5px; margin-top: 2px; }
.fc-stats b { font-size: 11.5px; margin-right: 2px; }
.fc.sm { width: 100%; padding: 8px; }
.fc.sm .fc-stats { display: none; }
.fc.sm .fc-rt b { font-size: 24px; }
.fc.sm .fc-face svg { height: 56px; }
.sp-club { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.sp-own { display: grid; gap: 6px; min-width: 0; }
.sp-own button { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px; font-size: 12px; font-weight: 700; color: var(--fg); }
.sp-own button:hover { border-color: var(--accent); }
.sp-own button.armed { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.sp-val { font-family: var(--font-mono); font-size: 12.5px; color: var(--gold); }
.sp-credit { margin: 0; text-align: right; font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; color: var(--muted); opacity: .55; }
@media (max-width: 520px) {
  .sp-packs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sp-pack { padding: 10px; }
  .sp-art { width: 66px; height: 88px; }
  .sp-pack .big-btn { font-size: 13.5px; padding: 12px 4px; }
  .sp-stage { min-height: 400px; padding-inline: 8px; }
  .sp-slot.best { flex-basis: 100%; }
  .fc { width: 138px; }
}

/* the pack you rip open by dragging across its top */
.sp-tear { --p: 0; width: 170px; height: 236px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; outline: none; animation: spPackIn .45s cubic-bezier(.2, 1.3, .4, 1); filter: drop-shadow(0 18px 26px #000a); }
.sp-tear:focus-visible { outline: 2px solid var(--accent); outline-offset: 8px; border-radius: 16px; }
.sp-tear.grab { cursor: grabbing; }
@keyframes spPackIn { from { transform: translateY(30px) scale(.7); opacity: 0; } }
.sp-tear-top, .sp-tear-body { position: absolute; left: 0; right: 0; overflow: hidden; background: linear-gradient(155deg, color-mix(in srgb, var(--pc) 85%, white), color-mix(in srgb, var(--pc) 55%, black)); box-shadow: inset 0 0 0 2px #ffffff40; }
.sp-tear-top { top: 0; height: 42px; border-radius: 14px 14px 0 0; transform-origin: 100% 100%; transform: rotate(calc(var(--p) * -16deg)) translateY(calc(var(--p) * -8px)); }
.sp-tear.from-right .sp-tear-top { transform-origin: 0 100%; transform: rotate(calc(var(--p) * 16deg)) translateY(calc(var(--p) * -8px)); }
.sp-tear-body { top: 42px; bottom: 0; border-radius: 0 0 14px 14px; border-top: 2px dashed #ffffffb0; display: grid; place-items: center; }
.sp-tear-body span { font-size: 22px; }
.sp-tear-cut { position: absolute; top: 40px; left: 0; width: 0; height: 4px; border-radius: 4px; background: #fff; box-shadow: 0 0 14px 3px #fff, 0 0 30px 6px var(--pc); z-index: 2; pointer-events: none; }
/* a dot slides along the tear line until you start, to show what to do */
.sp-tear::after { content: ""; position: absolute; top: 34px; left: 4%; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 0 14px #fff; z-index: 3; animation: spSwipe 1.6s ease-in-out infinite; pointer-events: none; }
.sp-tear.started::after { display: none; }
@keyframes spSwipe { 0% { left: 4%; opacity: 0; } 15% { opacity: 1; } 80% { left: 86%; opacity: 1; } 100% { left: 86%; opacity: 0; } }
.sp-tear.open { cursor: default; }
.sp-tear.open .sp-tear-top { animation: spRip .45s ease-in forwards; }
.sp-tear.open .sp-tear-body { animation: spBurst .45s ease-out forwards; }
.sp-tear.open .sp-tear-cut { opacity: 0; }
@keyframes spRip { to { transform: translate(40px, -150px) rotate(-70deg); opacity: 0; } }
@keyframes spBurst { to { transform: scale(1.12); filter: brightness(1.9) drop-shadow(0 0 34px var(--tc)); } }
.sp-tip { margin: 0; font-size: 14px; font-weight: 600; color: #ffffffd0; }
@media (max-width: 520px) { .sp-tear { width: 150px; height: 210px; } }
.sp-stage.sp-live .sp-tip, .sp-stage.sp-live .sp-auto { visibility: hidden; }

/* ================= SHELL AND LOBBY =================
   Flat navy chrome and picture tiles. Colour, gradients and glow belong to game art and tile thumbnails only.
   One sans family, four sizes (20 title, 16 row heading, 14 body, 12 meta), two radii (12 and 8), spacing from --s1 to --s7. */
:root {
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r-lg: 12px; --r-md: 12px; --r-sm: 8px; --r-xs: 8px;
  --fs-title: 20px; --fs-head: 16px; --fs-body: 14px; --fs-meta: 12px;
  --top-h: 56px; --surface: var(--panel); --shadow: none;
}
@media (max-width: 699px) { :root { --top-h: 52px; } }
/* the shell reads one family; game boards keep their display face */
.wrap > header, #sidenav, .bnav, .view:not(.dk), .dk > .view-title, .gmore, .amodal, .toast, .qpanel, .wrap > footer { --font-display: var(--font-body); }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- page frame ---------- */
.wrap { gap: var(--s5); }
.wrap > :not(header) { width: min(100% - 48px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px), var(--wrap-w)); }
.wrap > footer::before { content: none; }
.foot-note { margin: 0 0 var(--s2); font-size: var(--fs-meta); color: var(--muted); }
@media (min-width: 1200px) { .foot-note { display: none; } }
@media (max-width: 699px) {
  .wrap { gap: var(--s4); padding-bottom: calc(56px + var(--s5) + env(safe-area-inset-bottom, 0px)); }
  .wrap > :not(header) { width: calc(100% - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)); }
}

/* ---------- buttons, headings ---------- */
.btn, .pill-btn, .chip-btn, .tbtn { background: var(--panel-2); border: 1px solid transparent; border-radius: var(--r-sm); box-shadow: none; text-shadow: none; }
.btn:hover, .pill-btn:hover, .chip-btn:hover, .tbtn:hover { background: var(--panel-3); border-color: transparent; }
.btn.lg { border-radius: var(--r-sm); }
/* the one filled button of a screen: the player's accent on shell pages, the game's own colour on a game page */
.btn.primary, .btn.gold { background: var(--accent); border-color: transparent; color: var(--accent-ink); font-weight: 600; box-shadow: none; }
.btn.primary:hover, .btn.gold:hover { background: var(--accent); filter: brightness(1.08); }
.btn.primary:active, .btn.gold:active { transform: scale(.97); box-shadow: none; }
.dk .btn.primary, .dk .btn.gold, .dk .btn.primary:hover, .dk .btn.gold:hover { background: var(--g1); color: var(--g-ink); }
.btn:disabled, .btn.gold:disabled, .btn.primary:disabled, .dk .btn.primary:disabled, .dk .btn.gold:disabled { background: var(--well); border-color: transparent; color: var(--muted); filter: none; transform: none; }
.new { height: 20px; padding: 0 var(--s2); border-radius: var(--r-sm); background: var(--fg); color: var(--bg); font: 600 var(--fs-meta) var(--font-body); letter-spacing: 0; text-transform: none; }
.h2 { display: flex; align-items: baseline; gap: var(--s2); margin: 0 0 var(--s3); flex-wrap: wrap; }
.h2 h2 { margin: 0; font: 600 var(--fs-head)/1.3 var(--font-body); letter-spacing: 0; }
.h2 a { position: relative; margin-left: auto; color: var(--fg-2); font: 500 var(--fs-body) var(--font-body); text-decoration: none; }
.h2 a:hover { color: var(--fg); text-decoration: underline; }
@media (pointer: coarse), (max-width: 899px) { .h2 a::after { content: ""; position: absolute; inset: -12px; } }

/* ---------- top bar: logo, search, sound, chat, quick settings, coins, avatar ---------- */
.wrap > header { height: var(--top-h); gap: var(--s2); padding: 0 max(24px, env(safe-area-inset-right, 0px)) 0 max(24px, env(safe-area-inset-left, 0px)); background: var(--bg-2); backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 1px solid var(--line-soft); }
.wrap > header::after { content: none; }
.logo span { background: none; -webkit-background-clip: border-box; background-clip: border-box; -webkit-text-fill-color: currentColor; color: var(--accent-fg); }
.wrap > header .logo { margin-right: var(--s2); }
.search { height: 36px; min-width: 0; padding: 0 var(--s3) 0 36px; border-radius: var(--r-sm); border: 1px solid var(--line); color: var(--fg); font: 400 var(--fs-body) var(--font-body);
  background: var(--well) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aab2d4' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.500 4.500'/%3E%3C/svg%3E") 12px 50% / 16px 16px no-repeat; }
.search::placeholder { color: var(--muted); }
.search:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.hsearch { flex: 1; max-width: 420px; }
#hs-btn { display: none; }
.wrap > header .icon-btn, .wrap > header .menu-btn { width: 36px; height: 36px; border: 0; border-radius: var(--r-sm); background: none; box-shadow: none; color: var(--fg-2); }
.wrap > header .icon-btn:hover, .wrap > header .menu-btn:hover { background: var(--panel); color: var(--fg); }
.wrap > header .icon-btn .ic, .wrap > header .menu-btn .ic { width: 20px; height: 20px; }
.balance { height: 36px; gap: var(--s2); padding: 0 var(--s1) 0 0; border: 0; border-radius: var(--r-sm); background: var(--panel); box-shadow: none; }
.balance .coin { width: 18px; height: 18px; }
/* the link fills the pill's height, so the whole balance is the tap target */
.balance .bal-link { align-self: stretch; min-height: 36px; padding-left: var(--s2); }
.balance.pop { animation: balPop 320ms var(--ease); }
@keyframes balPop { 40% { transform: scale(1.08); } }
#refill, #refill:hover { background: var(--accent); border-radius: var(--r-sm); box-shadow: none; font: 600 13px/1 var(--font-body); }
#refill:disabled { background: var(--panel-2); font-family: var(--font-mono); }
@media (max-width: 699px) { #refill, #refill:disabled { box-shadow: var(--shadow-pop); } }
/* the avatar with its level: the way to the profile */
.pav { position: relative; display: block; flex: none; border-radius: 50%; text-decoration: none; }
.pav .av { width: 36px; height: 36px; }
.pav .plv { position: absolute; right: -4px; bottom: -4px; min-width: 20px; height: 20px; padding: 0 var(--s1); border-radius: 10px; display: grid; place-items: center; font: 600 11px/1 var(--font-body); color: var(--fg); background: var(--panel-2); border: 2px solid var(--bg-2); }
/* a zero-width mark where the tools of the top bar begin */
.wrap > header .pchip { width: 0; margin-left: calc(-1 * var(--s2)); }
@media (max-width: 899px) {
  .hsearch { display: none; }
  #hs-btn { display: grid; }
  .wrap > header.searching > * { visibility: hidden; }
  .wrap > header.searching > .hsearch { visibility: visible; display: block; position: absolute; left: var(--s4); right: var(--s4); top: 50%; z-index: 2; height: 40px; max-width: none; transform: translateY(-50%); }
}
@media (max-width: 699px) {
  .wrap > header { padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
  .wrap > header .logo { margin-right: auto; }
  .wrap > header .spacer, .pav { display: none; }
}
@media (max-width: 380px) {
  .wrap > header { gap: var(--s1); padding-inline: max(12px, env(safe-area-inset-left, 0px)) max(12px, env(safe-area-inset-right, 0px)); }
  .wrap > header .logo { flex: 0 1 auto; min-width: 0; overflow: hidden; padding-block: 3px; font-size: 18px; }
  .wrap > header .bal-num { font-size: 14px; padding-right: 2px; }
}

/* ---------- sidebar: one line icon and a label per link ---------- */
#sidenav { background: var(--bg-2); border-right: 1px solid var(--line-soft); box-shadow: none; }
@media (max-width: 1199px) { #sidenav { box-shadow: var(--shadow-pop); } }
.sidenav-head .logo::before { box-shadow: none; }
.sidenav nav { gap: 0; padding: var(--s1) var(--s2) 0; }
.nav-group { display: grid; gap: 0; margin-top: var(--s4); }
.nav-group:first-child { margin-top: 0; }
.nav-group > h3 { display: block; margin: 0; padding: var(--s1) var(--s3); font: 500 var(--fs-meta)/1.4 var(--font-body); letter-spacing: 0; text-transform: none; color: var(--muted); }
.nav-group > h3::after { content: none; }
.nav-link { position: relative; display: flex; align-items: center; gap: var(--s3); width: 100%; height: 40px; min-height: 40px; padding: 0 var(--s3); border: 0; border-radius: var(--r-sm); background: none; box-shadow: none; color: var(--fg-2); font: 500 var(--fs-body) var(--font-body); text-align: left; text-decoration: none; }
.nav-link .ic { width: 20px; height: 20px; flex: none; color: inherit; }
.nav-link .nl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-link:hover { background: var(--panel); color: var(--fg); }
.nav-link[aria-current="page"] { background: var(--accent-soft); box-shadow: none; color: var(--fg); }
.nav-link[aria-current="page"] .ic { color: var(--accent-fg); }
/* a reward is waiting on the Progress page */
.nav-link.due::after { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.nav-foot { position: sticky; bottom: 0; margin: auto calc(-1 * var(--s2)) 0; padding: var(--s3) var(--s5) var(--s4); background: var(--bg-2); border-top: 0; font-size: var(--fs-meta); line-height: 1.4; color: var(--muted); }
.nav-foot::before { content: none; }
/* shorter screens: tighter links so every Player link sits above the disclaimer */
@media (max-height: 940px) { .nav-link { height: 36px; min-height: 36px; } }
@media (max-height: 820px) { .nav-link { height: 32px; min-height: 32px; } .nav-group { margin-top: var(--s2); } }
/* game pages fold the sidebar to a rail (src/game.html) and its foot line goes with it, so the same line shows under the page; the Progress dot moves onto the icon */
@media (min-width: 1200px) { body.rail .foot-note { display: block; } body.rail .nav-link.due::after { position: absolute; top: 8px; right: 8px; } }

/* ---------- phone bottom bar: five equal slots ---------- */
.bnav { display: none; }
@media (max-width: 699px) {
  .bnav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 19; height: calc(56px + env(safe-area-inset-bottom, 0px)); padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); background: var(--bg-2); border-top: 1px solid var(--line-soft); }
  .bnav a, .bnav button { position: relative; display: grid; justify-items: center; align-content: center; gap: var(--s1); height: 56px; min-width: 44px; color: var(--muted); font: 500 var(--fs-meta)/1 var(--font-body); text-decoration: none; }
  .bnav .ic { width: 20px; height: 20px; }
  .bnav [aria-current="page"] { color: var(--accent-fg); }
  .bnav a.due::after { content: ""; position: absolute; top: 8px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
}

/* ---------- toasts: one quiet line ---------- */
.toast { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s2); padding: var(--s3) var(--s4); border-radius: var(--r-lg); background: var(--panel-2); color: var(--fg); box-shadow: var(--shadow-pop); font: 400 var(--fs-body)/1.4 var(--font-body); animation: toastIn 200ms var(--ease); }
.toast b { font-weight: 600; }
.toast span { color: var(--fg-2); font-variant-numeric: tabular-nums; }
.toast span:empty { display: none; }
.toast.out { opacity: 0; transition: opacity .3s; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }

/* ---------- dialogs: How to play, the reward reveal, quick settings ---------- */
.amodal { position: relative; width: min(440px, 100%); max-height: 86vh; overflow-y: auto; display: grid; gap: var(--s4); padding: var(--s5); border: 0; border-radius: var(--r-lg); background: var(--panel); box-shadow: var(--shadow-pop); animation: winIn var(--t-panel) var(--ease); }
.amodal h3 { margin: 0; font: 700 var(--fs-title)/1.2 var(--font-body); }
.amodal ol, .amodal ul { margin: 0; padding-left: 20px; display: grid; gap: var(--s2); color: var(--fg-2); font-size: var(--fs-body); line-height: 1.5; }
.amodal .close-row { display: flex; justify-content: flex-end; gap: var(--s2); }
.amodal .close-row .btn { min-width: 96px; }
.how-head { display: grid; gap: var(--s1); }
.how-head small { font: 400 var(--fs-meta) var(--font-body); color: var(--muted); }
.how-desc { margin: 0; font-size: var(--fs-body); line-height: 1.5; }
.reveal { overflow: hidden; text-align: center; justify-items: center; gap: var(--s2); padding-top: var(--s4); }
.reveal .note { font-size: var(--fs-body); color: var(--fg-2); }
.reveal .btn { width: 100%; margin-top: var(--s2); }
.qpanel { position: fixed; top: calc(var(--top-h) + 8px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); z-index: 38; width: min(300px, calc(100vw - 32px)); background: var(--panel); border: 0; box-shadow: var(--shadow-pop); animation: viewIn var(--t-ui) var(--ease); }

/* ---------- game page: one title bar, then the board ---------- */
.dk > .view-title { display: flex; align-items: center; gap: var(--s2); height: 44px; min-width: 0; }
.dk > .view-title > h1 { flex: 1; min-width: 0; margin: 0; align-self: center; font: 700 var(--fs-title)/1.2 var(--font-body); letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk > .view-title > .gtools { display: flex; flex: none; flex-wrap: nowrap; gap: var(--s1); justify-content: flex-end; }
.gtools .tbtn { width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--r-sm); background: none; color: var(--fg-2); }
.gtools .tbtn:hover { background: var(--panel-2); color: var(--fg); }
.gtools .tbtn .ic { width: 20px; height: 20px; }
.tbtn[aria-pressed="true"] { color: var(--fg); }
.gmore { position: relative; min-width: 0; margin-top: var(--s5); }

/* ---------- lobby ---------- */
.view[data-view="home"] { gap: var(--s4); }
#gfilters { display: flex; gap: var(--s2); min-width: 0; overflow-x: auto; scrollbar-width: none; }
#gfilters::-webkit-scrollbar { display: none; }
@media (min-width: 1200px) { #gfilters { display: none; } }

.fchip { flex: none; display: inline-flex; align-items: center; height: 36px; padding: 0 var(--s3); border-radius: var(--r-sm); background: var(--panel); color: var(--fg-2); font: 500 var(--fs-body) var(--font-body); }
.fchip:hover { background: var(--panel-2); color: var(--fg); }
.fchip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
/* the daily reward: one line, gone once it is claimed */
.drow { display: flex; align-items: center; gap: var(--s3); min-height: 48px; }
.drow b { font: 600 var(--fs-head) var(--font-body); }
.drow span { color: var(--muted); font-size: var(--fs-body); }
.drow .btn { margin-left: auto; }
.drow[hidden] { display: none; }
#home-games { display: grid; gap: var(--s6); min-width: 0; }
#home-games > * { min-width: 0; }
.row { position: relative; display: grid; gap: var(--s3); min-width: 0; }
.row-head { display: flex; align-items: center; gap: var(--s1); min-height: 32px; }
.row-head h2 { margin: 0 auto 0 0; font: 600 var(--fs-head)/1.3 var(--font-body); }
.rall { height: 32px; padding: 0 var(--s2); border-radius: var(--r-sm); color: var(--fg-2); font: 500 var(--fs-body) var(--font-body); }
.rall:hover { background: var(--panel); color: var(--fg); }
.row-nav { display: flex; gap: var(--s1); }
.row-nav button { width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--fg-2); }
.row-nav button:hover { background: var(--panel); color: var(--fg); }
.row-nav button:disabled { opacity: .35; cursor: default; background: none; }
.row-nav .ic { width: 16px; height: 16px; }
/* one line of tiles that scrolls sideways; the last one peeks in to show there is more */
.row > .strip, .gmore > .strip { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(148px, calc((100% - 72px) / 6.4), 200px); gap: var(--s3); overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--s1); scrollbar-width: none; padding: var(--s1); margin: calc(-1 * var(--s1)); }
.row > .strip::-webkit-scrollbar, .gmore > .strip::-webkit-scrollbar { display: none; }
.row > .strip > *, .gmore > .strip > * { scroll-snap-align: start; }
.ggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: var(--s3); }
.gempty { display: grid; justify-items: center; gap: var(--s3); padding: var(--s7) var(--s4); text-align: center; }
.gempty b { font: 600 var(--fs-head) var(--font-body); }

/* the tile: the picture, then the name */
.gcard { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: var(--s2); min-width: 0; border-radius: var(--r-lg); color: var(--fg); text-decoration: none; transition: transform 120ms var(--ease); }
.gcard .gbk, .gcard .art { grid-area: 1 / 1; border-radius: var(--r-lg); }
.gcard .gbk { aspect-ratio: 8 / 7; background: linear-gradient(160deg, var(--g1), var(--g2)); }
.gcard .art { display: grid; place-items: center; min-height: 0; overflow: hidden; pointer-events: none; }
.gcard .art svg { display: block; width: 92%; height: auto; max-height: 100%; overflow: visible; }
.gcard .art svg.emb { width: 44%; }
.gcard .gname { padding: 0 2px; font: 600 var(--fs-body)/1.3 var(--font-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard .new { position: absolute; z-index: 1; top: var(--s2); left: var(--s2); }
.gcard .favb { position: absolute; z-index: 1; top: var(--s2); right: var(--s2); width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center; background: rgba(8, 9, 18, .6); color: #fff; opacity: 0; transition: opacity 120ms var(--ease); }
.gcard .favb .ic { width: 16px; height: 16px; }
.gcard .favb[aria-pressed="true"] .ic { fill: currentColor; }
.gcard .favb:focus-visible { opacity: 1; }
@media (hover: hover) { .gcard:hover { transform: scale(1.03); } .gcard:hover .favb { opacity: 1; } }
@media (hover: none) { .gcard .favb { display: none; } }
.skel { aspect-ratio: 8 / 7; border-radius: var(--r-lg); background: var(--panel); }
.skel[style*="height"] { aspect-ratio: auto; }
/* tile art only moves while its tile is on screen */
.gcard.inview .art [class*="an-"] { animation-play-state: running; }
.gcard:not(.inview) .art [class*="an-"] { animation: none !important; }
.rm .gcard { transform: none !important; }
@media (prefers-reduced-motion: reduce) { .gcard { transform: none !important; } }

/* the mosaic: one large tile with the name over its lower edge, four standard tiles beside it */
.mosaic { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }
.gcard.gbig { grid-column: span 2; grid-row: span 2; display: block; overflow: hidden; min-height: 0; }
.gbig .gbk, .gbig .art { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; }
.gbig .art svg { width: 64%; }
.gbig[data-g="chicken"] .gbk { background: linear-gradient(180deg, #0c1038 0%, #2a2470 34%, #7a3f86 52%, #ff8a55 62%, #23263d 63%); }
.hs-l { position: absolute; inset: -3% -4%; display: block; }
.gbig .hs-l svg { width: 100%; height: 100%; max-height: none; }
.gbig .gname { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--s7) var(--s4) var(--s4); font: 700 var(--fs-title)/1.2 var(--font-body); color: #fff; background: linear-gradient(180deg, transparent, rgba(8, 9, 18, .82)); }

@media (max-width: 767px) { .ggrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); } }
@media (max-width: 699px) {
  #home-games { gap: var(--s5); }
  .row { gap: var(--s2); }
  .row-nav { display: none; }
  .row > .strip, .gmore > .strip { grid-auto-columns: calc((100% - 16px) / 2.4); gap: var(--s2); }
  .mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
  .gcard.gbig { grid-row: auto; aspect-ratio: 16 / 10; }
}
@media (max-width: 479px) { .ggrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ================= PLAYER PAGES =================
   Profile, Progress, Collection, Stats, Leaderboards, History, Feedback, Settings, Bank and Luck upgrade.
   A page is its title, then sections set apart by space and a short heading. Nothing sits in a box inside a box:
   a section has no background of its own, so the few surfaces (a slot, a day cell, an item frame) sit straight on the page. */
.view:has(> .ph) { gap: var(--s6); }
.ph { display: flex; align-items: baseline; gap: var(--s3); min-height: 44px; margin-bottom: calc(-1 * var(--s3)); }
.ph h1 { margin: 0; font: 700 var(--fs-title)/44px var(--font-body); letter-spacing: 0; }
.pn, .hn { font: 500 var(--fs-body) var(--font-body); color: var(--muted); font-variant-numeric: tabular-nums; }
.pcard { background: none; padding: 0; border-radius: 0; min-width: 0; }
.pstack { display: grid; gap: var(--s6); align-content: start; min-width: 0; }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6) var(--s7); align-items: start; }
.cols3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s6) var(--s7); align-items: start; }
.set { display: grid; gap: var(--s4); align-content: start; }
.set .h2 { margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: var(--s2); }
.h2 .filters, .h2 > .amt { margin-left: auto; }
.gempty p { margin: 0; max-width: 44ch; font-size: var(--fs-body); line-height: 1.45; color: var(--muted); }
.gempty p b { color: var(--fg); font-weight: 600; }
.amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt.mv { color: var(--fg-2); }
/* a thin bar: XP, a challenge, an achievement */
.pbar { height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.pbar i { display: block; height: 100%; border-radius: inherit; background: var(--fg-2); }
/* the coin beside an amount */
.chr, .arw, .rrew { display: inline-flex; align-items: center; gap: var(--s1); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chr svg, .arw svg, .rrew svg { width: 14px; height: 14px; flex: none; }
/* rules sit behind one closed line */
.how > summary { width: fit-content; padding: var(--s2) 0; cursor: pointer; font: 500 var(--fs-body) var(--font-body); color: var(--fg-2); }
.how > summary:hover { color: var(--fg); }
.how ol { display: grid; gap: var(--s2); max-width: 640px; margin: var(--s2) 0 0; padding-left: var(--s5); font-size: var(--fs-body); line-height: 1.45; color: var(--fg-2); }

/* ---------- profile ---------- */
.me { display: flex; align-items: center; gap: var(--s4); min-width: 0; }
.avx { position: relative; flex: none; }
.lvb { position: absolute; right: -4px; bottom: -4px; min-width: 24px; height: 24px; padding: 0 var(--s1); border-radius: 12px; display: grid; place-items: center; font: 600 var(--fs-meta)/1 var(--font-body); color: var(--fg); background: var(--panel-2); border: 2px solid var(--bg); }
.me > div { display: grid; gap: 2px; min-width: 0; }
.me b { font: 600 var(--fs-head)/1.3 var(--font-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me div > span { font-size: var(--fs-meta); color: var(--muted); }
.xp { display: grid; gap: var(--s1); }
.xp span { font-size: var(--fs-meta); color: var(--muted); font-variant-numeric: tabular-nums; }
.avs { display: flex; flex-wrap: wrap; gap: var(--s1); }
.avs button { padding: 2px; border-radius: 50%; border: 2px solid transparent; }
.avs button:hover { border-color: var(--line); }
.avs button[aria-pressed="true"] { border-color: var(--fg); }
.av.pick { width: 36px; height: 36px; }
.pcode { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.pcode b { font: 500 16px var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peds { display: grid; grid-template-columns: repeat(3, minmax(0, 128px)); gap: var(--s3); }
.pslot { aspect-ratio: 1; display: grid; place-items: center; border-radius: var(--r-lg); background: var(--panel); color: var(--muted); font: 400 24px/1 var(--font-body); text-decoration: none; }
.pslot:hover { background: var(--panel-2); color: var(--fg); }
.bwall { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.bdg .medal { display: block; width: 36px; height: auto; }
.bmore { display: inline-flex; align-items: center; height: 32px; padding: 0 var(--s3); border-radius: var(--r-sm); background: var(--panel); font-size: var(--fs-meta); color: var(--muted); }
/* the cards other scripts add to these pages (send coins on Profile, the weekly board on Leaderboards): their sub lines and notes stay out */
#player-transfer > .h2 > span, #player-transfer > .note, [data-weekly-card] > .h2 > span, [data-weekly-card] > .note { display: none; }
/* the limits of each stay as one short line */
#player-transfer-form::after { content: "Up to 1,000,000 coins, once every 30 seconds."; font-size: var(--fs-meta); color: var(--muted); }
[data-weekly-card] > .h2::after { content: "Resets Monday. Top 10 earn coins."; flex-basis: 100%; font-size: var(--fs-meta); color: var(--muted); }
#player-transfer .big-btn { justify-self: start; width: auto; min-width: 120px; }
#player-transfer .big-btn:not(:disabled) { background: var(--accent); color: var(--accent-ink); }
#player-transfer .gmsg:empty { display: none; }
#player-transfer-pending .st { min-height: 40px; font-size: var(--fs-body); color: var(--fg-2); }

/* ---------- collection: one frame, the rarity is its border colour ---------- */
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: var(--s3); }
.item { display: grid; gap: var(--s2); align-content: start; min-width: 0; padding: 0; background: none; border: 0; color: inherit; font: inherit; text-align: left; }
button.item { cursor: pointer; }
.ifr { position: relative; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border-radius: var(--r-lg); background: var(--panel); border: 2px solid var(--rc, var(--line)); }
.ifr svg { width: 72%; height: 72%; }
button.item:hover .ifr { background: var(--panel-2); }
button.item:focus-visible { outline: none; }
button.item:focus-visible .ifr { box-shadow: var(--ring); }
.item b { min-height: 0; font: 500 var(--fs-body)/1.3 var(--font-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item b:empty { display: none; }
.item.locked .ifr { border-color: color-mix(in srgb, var(--rc, var(--line)) 40%, transparent); }
.item.locked .ifr svg { filter: brightness(0); opacity: .28; }
.item.locked .iflk { animation: none; }
.lock { position: absolute; inset: 0; display: grid; place-items: center; font: 700 var(--fs-title)/1 var(--font-body); color: var(--muted); }
.item .cnt { position: absolute; right: var(--s1); bottom: var(--s1); padding: 2px var(--s1); border-radius: var(--r-sm); background: var(--bg); font: 500 var(--fs-meta)/1 var(--font-body); font-variant-numeric: tabular-nums; }
.items .item.shown .ifr { outline: 2px solid var(--fg); outline-offset: 2px; }

/* ---------- progress ---------- */
.road { list-style: none; display: flex; margin: var(--s4) 0 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.road::-webkit-scrollbar { display: none; }
.rn { position: relative; flex: 1 0 88px; display: grid; justify-items: center; align-content: start; gap: var(--s2); }
.rn::before { content: ""; position: absolute; top: 15px; right: 50%; width: 100%; height: 2px; background: var(--panel-3); }
.rn:first-child::before { content: none; }
.rn.past::before, .rn.here::before { background: var(--fg-2); }
.rnode { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-3); color: var(--fg-2); font: 600 var(--fs-meta)/1 var(--font-body); }
.rn.past .rnode { background: var(--fg-2); color: var(--bg); }
.rn.here .rnode { background: var(--fg); color: var(--bg); }
.rrew { font-size: var(--fs-meta); color: var(--fg-2); }
.cal { list-style: none; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s2); margin: 0 0 var(--s4); padding: 0; }
.cal li { position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 72px; padding: var(--s2) 2px; border-radius: var(--r-lg); background: var(--panel); }
.cal small { font-size: var(--fs-meta); color: var(--muted); }
.cal b { font: 600 var(--fs-body)/1.2 var(--font-body); font-variant-numeric: tabular-nums; }
.cal em { font-style: normal; font-size: var(--fs-meta); color: var(--muted); white-space: nowrap; }
.cal .next { background: var(--panel-3); }
.cal .done b { color: var(--muted); }
.stamp { position: absolute; top: 8px; right: 8px; width: 10px; height: 6px; border-left: 2px solid var(--ok-fg); border-bottom: 2px solid var(--ok-fg); transform: rotate(-45deg); }
.dwait { margin: 0; font-size: var(--fs-body); color: var(--muted); }
.dwait b { font: 500 var(--fs-body) var(--font-mono); color: var(--fg); }
.chl { display: grid; gap: var(--s4); }
.chx { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--s2) var(--s3); min-height: 40px; }
.chx > b { font: 500 var(--fs-body)/1.3 var(--font-body); }
.chr, .arw { font-size: var(--fs-body); font-weight: 500; color: var(--gold-fg); }
.chx .pbar { grid-column: 1 / -1; grid-row: 2; }
.cha { font-size: var(--fs-meta); color: var(--muted); }
.chx.claimed > b, .chx.claimed .chr { color: var(--muted); }
.achs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) var(--s7); }
.ach { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start; align-items: baseline; gap: 2px var(--s3); }
.ach > b { font: 500 var(--fs-body)/1.3 var(--font-body); color: var(--fg-2); }
.ach.got > b { color: var(--fg); font-weight: 600; }
.ach > span:not(.arw), .ach > em { grid-column: 1 / -1; font-style: normal; font-size: var(--fs-meta); line-height: 1.4; color: var(--muted); }
.ach .pbar { grid-column: 1 / -1; margin-top: var(--s1); }
.ach:not(.got) .arw { color: var(--muted); }

/* ---------- stats ---------- */
.nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); margin: 0; }
.nums div { display: grid; gap: 2px; min-width: 0; }
.nums dt { font-size: var(--fs-meta); color: var(--muted); }
.nums dd { margin: 0; font: 700 var(--fs-title)/1.2 var(--font-body); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wring { display: flex; align-items: center; gap: var(--s5); }
.cring { --p: 0; position: relative; flex: none; width: 96px; height: 96px; display: grid; place-items: center; }
.cring::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--ok-fg) calc(var(--p) * 1%), var(--panel-3) 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px)); mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px)); }
.cring > span { display: grid; justify-items: center; gap: 2px; }
.cring b { font: 700 var(--fs-title)/1 var(--font-body); font-variant-numeric: tabular-nums; }
.cring small { font-size: var(--fs-meta); color: var(--muted); }
.wring ul { flex: 1; min-width: 0; list-style: none; display: grid; gap: var(--s2); margin: 0; padding: 0; }
.wring li { display: flex; justify-content: space-between; gap: var(--s3); font-size: var(--fs-body); color: var(--muted); }
.wring li b { font-weight: 500; color: var(--fg); font-variant-numeric: tabular-nums; }
.bspark { display: block; width: 100%; height: 96px; color: var(--fg-2); overflow: visible; }
.lohi { display: flex; justify-content: space-between; gap: var(--s3); margin-top: var(--s2); font-size: var(--fs-meta); color: var(--muted); }
.lohi b { font-weight: 500; color: var(--fg); font-variant-numeric: tabular-nums; }
.cbars { display: grid; gap: var(--s3); }
.cbars div { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(3ch, auto); align-items: center; gap: var(--s3); font-size: var(--fs-body); }
.cbars span { color: var(--muted); }
.cbars i { height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.cbars u { display: block; height: 100%; border-radius: inherit; background: var(--fg-2); }
.cbars b { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.tblwrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-body); }
.tbl th { padding: var(--s2) var(--s3) var(--s2) 0; text-align: left; font: 500 var(--fs-meta) var(--font-body); color: var(--muted); white-space: nowrap; }
.tbl td { height: 40px; padding: var(--s1) var(--s3) var(--s1) 0; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.me td { font-weight: 600; }
.glink { color: inherit; font-weight: 500; text-decoration: none; }
.glink:hover { text-decoration: underline; }
.recs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2) var(--s7); }
.recs .stat { min-height: 32px; align-items: center; }

/* ---------- history: what, when, how much, the balance after ---------- */
.hday { max-width: 800px; }
.hlist { list-style: none; margin: 0; padding: 0; }
/* The two number columns are 104px, or as wide as the longest number on the page when that is more: history() in
   arcade-pages.js counts its characters into --hw-amt and --hw-bal (1ch is one digit). So an amount in the trillions
   or quadrillions is shown in full and the columns still line up. The name keeps at least 120px.
   The time column takes what is left after those three, and no more: a long time line ("05:26 AM, +75,000,000,000,000
   luck", "from your bank") is cut with three dots before a number is. Every row is a grid of its own, so a column
   that could grow with its text would also stand somewhere else in each row. */
.hrow { display: grid; grid-template-columns: minmax(120px, 1fr) fit-content(max(0px, calc(100% - 120px - 3 * var(--s3) - max(104px, calc(var(--hw-amt, 0) * 1ch)) - max(104px, calc(var(--hw-bal, 0) * 1ch))))) minmax(104px, calc(var(--hw-amt, 0) * 1ch)) minmax(104px, calc(var(--hw-bal, 0) * 1ch)); align-items: center; gap: var(--s3); min-height: 40px; font-size: var(--fs-body); }
.hrow > b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hrow > small { font-size: var(--fs-meta); color: var(--muted); white-space: nowrap; }
@media (min-width: 700px) { .hrow > small { overflow: hidden; text-overflow: ellipsis; } } /* wide rows: one line, cut with three dots */
@media (max-width: 699px) { .hrow > small { white-space: normal; overflow-wrap: anywhere; } } /* the stacked rows of a phone: a long time line goes on to a second line and does not run into the balance next to it */
.hrow > .amt, .hbal { text-align: right; overflow: hidden; text-overflow: ellipsis; }
.hbal { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hgrp summary { list-style: none; cursor: pointer; }
.hgrp summary::-webkit-details-marker, .hmore summary::-webkit-details-marker { display: none; }
.hgrp summary > b::after { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 0 3px var(--s2); border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); }
.hgrp details[open] summary > b::after { margin-bottom: 0; transform: rotate(-135deg); }
.hgrp details > .hlist { padding-left: var(--s4); }
.hmore summary { list-style: none; padding: var(--s2) 0; cursor: pointer; }
.hmore details[open] > summary { display: none; }

/* ---------- leaderboards: one plain list ---------- */
#rk-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 3px; margin: -3px; }
#rk-tabs::-webkit-scrollbar { display: none; }
.rk-card, [data-coin-card], [data-weekly-card] { max-width: 720px; }
.rk-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 32px; margin-bottom: var(--s2); font-size: var(--fs-meta); color: var(--muted); }
.rks { list-style: none; display: grid; gap: var(--s1); margin: 0; padding: 0; }
.rk { display: grid; grid-template-columns: 28px 32px minmax(0, 1fr) auto; align-items: center; gap: var(--s3); min-height: 44px; padding: 0 var(--s3) 0 0; border-radius: var(--r-sm); font-size: var(--fs-body); }
.rk-n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.rk .av { width: 32px; height: 32px; }
.rk-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-name em { margin-left: var(--s1); font-style: normal; font-size: var(--fs-meta); font-weight: 400; color: var(--muted); }
.rk > b { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rk.me { background: var(--panel); }
.rk-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s4); }
.rk-foot:empty { display: none; }
.rk-foot p { margin: 0; font-size: var(--fs-body); }
.rk-play { margin-left: auto; }
[data-weekly-claim], [data-skill-claim] { display: flex; width: fit-content; margin-bottom: var(--s3); }
/* the player's own row: the profile's ".me b" heading size stays out of the boards */
.rk.me > b { font: 500 var(--fs-body)/1.3 var(--font-body); font-variant-numeric: tabular-nums; }
/* the weekly card: plain sub heads, the same rows as the boards above (no picture), the skill tabs as chips */
.wk-h { margin: var(--s5) 0 var(--s2); font: 600 var(--fs-body)/1.3 var(--font-body); color: var(--fg); }
[data-weekly-card] .chl > .wk-h:first-child { margin-top: var(--s2); }
.rks.wk .rk { grid-template-columns: 28px minmax(0, 1fr) auto; }
.wk-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 3px; margin: -3px -3px var(--s2); }
.wk-tabs::-webkit-scrollbar { display: none; }

/* ---------- feedback: one form in one column ---------- */
.fb { max-width: 640px; }
#fb-text { height: auto; min-height: 128px; padding: var(--s3); resize: vertical; font: 400 var(--fs-body)/1.45 var(--font-body); }
.fb .fld > .lbl { font-size: var(--fs-meta); }
#fb-send { width: fit-content; min-width: 128px; }
.ideas { display: grid; gap: var(--s4); }
.idea { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: var(--s3); }
.vote { display: grid; justify-items: center; align-content: center; gap: 2px; width: 44px; min-height: 44px; border-radius: var(--r-sm); background: var(--panel); color: var(--fg-2); font: 500 var(--fs-meta) var(--font-body); font-variant-numeric: tabular-nums; }
.vote .ic { width: 16px; height: 16px; }
.vote:hover { background: var(--panel-2); color: var(--fg); }
.vote[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.idea-m { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); font-size: var(--fs-meta); color: var(--muted); }
.tagk, .tags { display: inline-flex; align-items: center; height: 20px; padding: 0 var(--s2); border-radius: var(--r-sm); background: var(--panel-2); color: var(--fg-2); font: 500 var(--fs-meta) var(--font-body); }
.tags.done { color: var(--ok-fg); }
.idea p { margin: var(--s1) 0 0; font-size: var(--fs-body); line-height: 1.45; overflow-wrap: anywhere; }
.idea.done p { color: var(--fg-2); }
.ch { display: grid; gap: 2px; }
.ch small { font-size: var(--fs-meta); color: var(--muted); }
.ch span { font-size: var(--fs-body); line-height: 1.4; overflow-wrap: anywhere; }

/* ---------- settings ---------- */
.rowx { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 40px; font-size: var(--fs-body); }
.sw-t { position: relative; flex: none; width: 44px; height: 24px; }
.sw-t input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sw-t i { display: block; height: 100%; pointer-events: none; border-radius: 12px; background: var(--panel-3); transition: background var(--t-ui) var(--ease); }
.sw-t i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--fg-2); transition: transform var(--t-ui) var(--ease); }
.sw-t input:checked + i { background: var(--accent); }
.sw-t input:checked + i::after { transform: translateX(20px); background: var(--accent-ink); }
.sw-t input:focus-visible + i { box-shadow: var(--ring); }
.skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--s2); }
.skinb { display: flex; align-items: center; gap: var(--s2); min-width: 0; height: 40px; padding: 0 var(--s3); border-radius: var(--r-sm); background: var(--panel); border: 1px solid transparent; color: var(--fg-2); font: 500 var(--fs-body) var(--font-body); white-space: nowrap; }
.skinb:hover { background: var(--panel-2); color: var(--fg); }
.skinb i { flex: none; display: flex; width: 24px; height: 16px; overflow: hidden; border-radius: 4px; }
.skinb i u { flex: 1; background: var(--a); }
.skinb i u:nth-child(2) { background: var(--b); }
.skinb i u:nth-child(3) { background: var(--c); }
.skinb[aria-pressed="true"] { border-color: var(--accent); color: var(--fg); }
.swatches { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.swb { width: 32px; height: 32px; border-radius: 50%; background: var(--c); }
.swb.cardb { height: 40px; border-radius: var(--r-sm); }
.swb[aria-pressed="true"] { outline: 2px solid var(--fg); outline-offset: 2px; }
#acc-custom { -webkit-appearance: none; appearance: none; width: 32px; height: 32px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 50%; background: none; cursor: pointer; }
#acc-custom::-webkit-color-swatch-wrapper { padding: 0; }
#acc-custom::-webkit-color-swatch { border: 0; }
#acc-custom::-moz-color-swatch { border: 0; }

/* ---------- bank and luck upgrade ---------- */
.bk-vault, .bk-move, .lk-buy { display: grid; gap: var(--s3); align-content: start; }
.bk-main { display: grid; gap: var(--s1); min-width: 0; }
.bk-main .lbl { font-size: var(--fs-body); color: var(--muted); }
.bk-main b { font: 700 var(--fs-title)/1.2 var(--font-body); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-bar { height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.bk-bar i { display: block; height: 100%; border-radius: inherit; background: var(--fg-2); }
.bk-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); }
.bk-quick .chip-btn { height: 36px; padding: 0; font: 500 var(--fs-body) var(--font-body); }
.bk-move .btn.lg, .lk-buy .btn.lg { width: 100%; white-space: normal; }
.bk-rows, .lk-steps { list-style: none; margin: 0; padding: 0; }
.bk-rows li { display: grid; grid-template-columns: minmax(0, 1fr) auto 104px; align-items: center; gap: var(--s3); min-height: 40px; font-size: var(--fs-body); }
.bk-rows b { font-weight: 500; }
.bk-rows small { font-size: var(--fs-meta); color: var(--muted); white-space: nowrap; }
.bk-rows em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.lk-steps li { display: grid; grid-template-columns: 16px 64px minmax(0, 1fr) 40px; align-items: center; gap: var(--s3); min-height: 40px; font-size: var(--fs-body); color: var(--fg-2); }
.lk-steps li > i { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.lk-steps b { font-weight: 500; }
.lk-steps span { text-align: right; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-steps em { font-style: normal; font-size: var(--fs-meta); color: var(--muted); text-align: right; }
.lk-steps li.got, .lk-steps li.next { color: var(--fg); }
.lk-buy .note a { color: var(--fg); }

@media (max-width: 899px) {
  .cols2 { grid-template-columns: minmax(0, 1fr); }
  .achs, .recs { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 699px) {
  .view:has(> .ph) { gap: var(--s5); }
  .pstack, .cols2, .cols3 { gap: var(--s5); }
  .items { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); }
  .nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal { gap: var(--s1); }
  .cal li { min-height: 64px; border-radius: var(--r-sm); }
  .cal em { font-size: 11px; }
  .stamp { top: 6px; right: 6px; width: 8px; height: 5px; }
  .tbl .hm { display: none; }
  .hrow { grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--s3); min-height: 48px; padding: var(--s1) 0; }
  .hrow > b { grid-area: 1 / 1; }
  .hrow > small { grid-area: 2 / 1; }
  .hrow > .amt { grid-area: 1 / 2; }
  .hbal { grid-area: 2 / 2; font-size: var(--fs-meta); }
  .bk-rows li { grid-template-columns: minmax(0, 1fr) auto auto; }
  .lk-steps li { grid-template-columns: 16px 56px minmax(0, 1fr) 36px; gap: var(--s2); }
}

/* ================= CHAT, FLAT =================
   The chat panel and its popup are shell: one flat surface with one elevation shadow, sentence case, no gloss.
   A Creator or picked name keeps one mark: a gold or silver edge on the message and the name in that colour. */
.chat { background: var(--panel); border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-pop); }
.chat-head { background: none; }
.chat-head h2 { font: 600 var(--fs-head) var(--font-body); letter-spacing: 0; }
.chat-on { height: 24px; padding: 0 var(--s2); border-radius: var(--r-sm); background: none; box-shadow: none; font: 500 var(--fs-meta) var(--font-body); }
.chat-on i, .chat.off .chat-on i { box-shadow: none; animation: none; }
.chat.off .chat-on { background: none; box-shadow: none; }
.chat-rules { padding: var(--s2) var(--s4); background: none; box-shadow: none; font-size: var(--fs-meta); }
.chat-rules::before { content: none; }
.chat-empty { border: 0; }
.chat-empty b { font: 600 var(--fs-head) var(--font-body); }
.cmsg .av { box-shadow: none; }
.cmeta .clv { padding: 0; border-radius: 0; background: none; box-shadow: none; color: var(--muted); font: 500 var(--fs-meta) var(--font-body); letter-spacing: 0; }
.cmeta time { font: 400 var(--fs-meta) var(--font-body); }
.cmsg:not(.creator):not(.silver):not(.bn) p { background: var(--panel-2); border: 0; border-radius: var(--r-lg); box-shadow: none; font-size: var(--fs-body); }
.cmsg.mine:not(.creator):not(.silver):not(.bn) p { background: var(--panel-3); }
.crtag { padding: 0 var(--s2); border-radius: var(--r-sm); background: var(--panel-2); color: var(--fg-2); font: 500 var(--fs-meta)/20px var(--font-body); letter-spacing: 0; }
.chat-form { background: none; box-shadow: none; }
.chat-form .ain { border-radius: var(--r-sm); box-shadow: none; font: 400 var(--fs-body) var(--font-body); }
.chat-form .mini, .chat-form .mini:active { border-radius: var(--r-sm); background: var(--accent); box-shadow: none; font: 600 var(--fs-body) var(--font-body); }
.chat-form .mini:disabled { background: var(--well); box-shadow: none; }
.chat-emo, .chat-emo:hover { border-radius: var(--r-sm); background: var(--panel-2); box-shadow: none; }
.chat-emo[aria-expanded="true"] { background: var(--panel-3); color: var(--fg); box-shadow: none; }
.chat-pick { background: var(--panel-2); border: 0; border-radius: var(--r-sm); box-shadow: none; }
.chat-pick button { border-radius: var(--r-sm); }
.chat-btn[aria-expanded="true"] { background: var(--panel-2); border-color: transparent; color: var(--fg); }
.cbadge { background: var(--accent); color: var(--accent-ink); box-shadow: none; font: 600 11px var(--font-body); }
.chatpop:not(.creator):not(.silver):not(.bn) .cp-ic { border-radius: var(--r-sm); background: var(--panel-2); color: var(--fg-2); box-shadow: none; animation: none; }
.chatpop .cp-head b { font: 600 var(--fs-body) var(--font-body); }
.chatpop:not(.creator):not(.silver):not(.bn) .cp-tag { padding: 0 var(--s2); border-radius: var(--r-sm); background: var(--panel-2); color: var(--fg-2); font: 500 var(--fs-meta)/20px var(--font-body); letter-spacing: 0; }
.chatpop small { font: 400 var(--fs-meta) var(--font-body); }
.chatpop:not(.creator):not(.silver):not(.bn) .cp-bar { background: var(--fg-2); }

/* ================= CHAT BANNERS GIVEN BY AN ADMIN =================
   An admin gives a player code one of these (lib/banners.js, api/chat.js sends it as m.tg, arcade-chat.js adds
   .bn .bn-<style>). Like the Creator and silver ones they are deliberately rich: a metal edge, a dark plate, the name
   in the style's colour and a short tag word. Every style sets the same few colours:
   --m1 light, --m2 main, --m3 dark, --bn-ink tag text, --bn-name the name, --bn-plate the plate, --bn-fx an extra layer
   on the plate (stars, stripes), --bn-edge the frame. Motion is slow and small, and stops with reduced motion.
   The same colours dress the new-message popup (.chatpop.bn). The defaults have no weight (:where), so each style's
   own colours below win. */
:where(.cmsg.bn, .chatpop.bn) {
  --m1: #ffffff; --m2: var(--silver); --m3: var(--silver-2); --bn-ink: #101420; --bn-name: var(--m2);
  --bn-plate: linear-gradient(180deg, color-mix(in srgb, var(--bg) 80%, var(--panel-2)), var(--bg));
  --bn-fx: linear-gradient(transparent, transparent); --bn-fx-size: auto;
  --bn-edge: linear-gradient(135deg, var(--m1), var(--m2) 26%, var(--m3) 50%, var(--m1) 72%, var(--m2) 88%, var(--m3));
}
.cmsg.bn { position: relative; isolation: isolate; padding: 10px 10px 11px; border: 2px solid transparent; border-radius: var(--r-md); color: var(--fg);
  background: radial-gradient(130% 120% at 0% 0%, color-mix(in srgb, var(--m2) 30%, transparent), transparent 58%) padding-box, radial-gradient(90% 100% at 100% 100%, color-mix(in srgb, var(--m2) 14%, transparent), transparent 60%) padding-box, var(--bn-fx) padding-box, var(--bn-plate) padding-box, var(--bn-edge) border-box;
  background-size: auto, auto, var(--bn-fx-size), auto, 240% 240%; background-position: 0 0, 0 0, 0 0, 0 0, 0% 50%;
  box-shadow: 0 14px 30px -16px var(--m2), 0 0 0 1px color-mix(in srgb, var(--m2) 18%, transparent), inset 0 1px 0 rgba(255, 255, 255, .16);
  animation: viewIn .2s ease, bnEdge 9s ease-in-out infinite alternate; }
.cmsg.bn .av { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--m2), 0 0 16px 0 color-mix(in srgb, var(--m2) 70%, transparent); }
.cmsg.bn .cmeta b { color: var(--bn-name); }
.cmsg.bn .cmeta .clv { padding: 0; background: none; box-shadow: none; color: var(--fg-2); font: 500 var(--fs-meta, 11px) var(--font-body); letter-spacing: 0; }
.cmsg.bn .cmeta time { color: var(--fg-2); }
.cmsg.bn p, .cmsg.bn.mine p { background: color-mix(in srgb, var(--m2) 15%, var(--panel)); border: 1px solid color-mix(in srgb, var(--m2) 50%, transparent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07); color: var(--fg); }
.cmsg.bn p.jumbo, .cmsg.bn.mine p.jumbo { background: none; border-color: transparent; box-shadow: none; }
/* the tag word next to the name */
.ctag { display: none; }
.cmsg.bn .ctag, .chatpop.bn .cp-tag { flex: none; display: inline-flex; align-items: center; gap: 4px; font: 800 9.5px/1 var(--font-mono); font-style: normal; letter-spacing: .12em; text-transform: uppercase; color: var(--bn-ink); background: linear-gradient(135deg, var(--m1), var(--m2)); border-radius: var(--r-pill); padding: 4px 7px 3px; box-shadow: 0 1px 0 var(--m3), inset 0 1px 0 rgba(255, 255, 255, .45); }

/* the popup: a thin frame in the style's colour, its icon and bar in the same colours */
.chatpop.bn { background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--m2) 22%, transparent), transparent 62%), var(--panel-2); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--m2) 70%, transparent), var(--shadow-pop), 0 12px 30px -16px var(--m2); }
.chatpop.bn .cp-ic { animation: none; color: var(--bn-ink); border-radius: 13px; background: radial-gradient(80% 70% at 30% 10%, rgba(255, 255, 255, .6), transparent 60%), linear-gradient(180deg, var(--m1), var(--m2)); box-shadow: 0 3px 0 var(--m3), inset 0 1px 0 rgba(255, 255, 255, .55); }
.chatpop.bn .cp-head b { color: var(--fg); }
.chatpop.bn .cp-bar { background: var(--m2); }
/* the popup on one line: the message, then its close button (the toast row would otherwise wrap the button under it) */
.toast.chatpop { position: relative; flex-wrap: nowrap; align-items: center; padding: 6px 6px 8px; }
.chatpop .cp-open { flex: 1; }

/* ---- the styles ---- */
.bn-silver { --m1: #ffffff; --m2: var(--silver); --m3: var(--silver-2); --bn-name: #e4e9f2; }
/* OG: black and gold, old arcade marquee stripes */
.bn-og { --m1: #ffe9a8; --m2: #d9a521; --m3: #4a3405; --bn-ink: #120d02; --bn-name: #f6cf5f;
  --bn-plate: linear-gradient(180deg, #14110a, #070604);
  --bn-fx: repeating-linear-gradient(0deg, rgba(255, 210, 90, .07) 0 2px, transparent 2px 7px);
  --bn-edge: repeating-linear-gradient(90deg, #f6cf5f 0 10px, #0b0904 10px 14px, #d9a521 14px 24px, #0b0904 24px 28px); }
.cmsg.bn-og .ctag, .chatpop.bn-og .cp-tag { color: #f6cf5f; background: #0b0904; box-shadow: inset 0 0 0 1.5px #d9a521, 0 1px 0 #000; font-family: var(--font-display); font-size: 10.5px; letter-spacing: .16em; text-shadow: 0 0 6px rgba(246, 207, 95, .55); }
.chatpop.bn-og .cp-ic { color: #f6cf5f; background: radial-gradient(80% 70% at 30% 10%, rgba(255, 230, 150, .25), transparent 60%), #0b0904; box-shadow: inset 0 0 0 2px #d9a521, 0 3px 0 #4a3405; }
/* Alien: neon green glow, with a little flying saucer on the tag */
.bn-alien { --m1: #d9ffe8; --m2: #39ff88; --m3: #0b6b35; --bn-ink: #022412; --bn-name: #6dffab;
  --bn-plate: radial-gradient(120% 90% at 50% 120%, rgba(57, 255, 136, .16), transparent 60%), linear-gradient(180deg, #06140c, #030805); }
.cmsg.bn-alien .cmeta b { text-shadow: 0 0 8px rgba(57, 255, 136, .6); }
.cmsg.bn-alien { animation: viewIn .2s ease, bnEdge 9s ease-in-out infinite alternate, bnGlow 3.2s ease-in-out infinite; }
.chatpop.bn-alien .cp-ic { animation: bnGlow 3.2s ease-in-out infinite; }
.cmsg.bn-alien .ctag::before, .chatpop.bn-alien .cp-tag::before { content: ""; width: 13px; height: 9px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 18'%3E%3Cpath d='M9 7a4 4 0 0 1 8 0z'/%3E%3Cellipse cx='13' cy='9.5' rx='12' ry='3.6'/%3E%3Cpath d='M7 13l-2 4h2l2-4zM19 13l2 4h-2l-2-4zM12 13h2v4h-2z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 18'%3E%3Cpath d='M9 7a4 4 0 0 1 8 0z'/%3E%3Cellipse cx='13' cy='9.5' rx='12' ry='3.6'/%3E%3Cpath d='M7 13l-2 4h2l2-4zM19 13l2 4h-2l-2-4zM12 13h2v4h-2z'/%3E%3C/svg%3E") center / contain no-repeat; }
/* Fire: embers rising from the bottom of the plate */
.bn-fire { --m1: #ffe3a1; --m2: #ff7a1a; --m3: #8a1a00; --bn-ink: #2a0800; --bn-name: #ffa04d;
  --bn-plate: radial-gradient(90% 70% at 50% 130%, rgba(255, 90, 20, .32), transparent 70%), linear-gradient(180deg, #150806, #0a0403);
  --bn-edge: linear-gradient(0deg, #8a1a00, #ff3d00 25%, #ff7a1a 50%, #ffd36b 75%, #ff7a1a); }
.cmsg.bn-fire { animation: viewIn .2s ease, bnEdge 4s ease-in-out infinite alternate, bnFlicker 2.6s ease-in-out infinite; }
/* Ice: frost on a dark blue plate */
.bn-ice { --m1: #f2fdff; --m2: #8fe3ff; --m3: #2f6f99; --bn-ink: #06202e; --bn-name: #b9eeff;
  --bn-plate: linear-gradient(160deg, rgba(185, 238, 255, .14), transparent 40%), linear-gradient(180deg, #0a1724, #050b12);
  --bn-fx: repeating-linear-gradient(60deg, rgba(220, 248, 255, .05) 0 1px, transparent 1px 9px); }
/* Toxic: lime on olive, with hazard stripes on the tag */
.bn-toxic { --m1: #f4ff9e; --m2: #b6f000; --m3: #3c5200; --bn-ink: #141a00; --bn-name: #cdfc3a;
  --bn-plate: radial-gradient(70% 60% at 85% 0%, rgba(182, 240, 0, .2), transparent 70%), linear-gradient(180deg, #10140a, #070905);
  --bn-edge: repeating-linear-gradient(45deg, #b6f000 0 8px, #1a2100 8px 14px); }
.cmsg.bn-toxic .ctag, .chatpop.bn-toxic .cp-tag { background: repeating-linear-gradient(45deg, #d6ff3a 0 5px, #b6f000 5px 10px); }
.cmsg.bn-toxic { animation: viewIn .2s ease, bnEdge 9s ease-in-out infinite alternate, bnGlow 3.6s ease-in-out infinite; }
/* Galaxy: stars on deep violet */
.bn-galaxy { --m1: #f3e3ff; --m2: #a774ff; --m3: #2c1170; --bn-ink: #12062e; --bn-name: #d2b6ff;
  --bn-plate: radial-gradient(80% 90% at 90% 10%, rgba(255, 110, 200, .18), transparent 60%), radial-gradient(90% 90% at 10% 100%, rgba(80, 140, 255, .2), transparent 60%), linear-gradient(180deg, #0e0820, #06030f);
  --bn-fx: radial-gradient(1px 1px at 12% 30%, #fff, transparent), radial-gradient(1px 1px at 38% 70%, #fff, transparent), radial-gradient(1.4px 1.4px at 66% 22%, #fff, transparent), radial-gradient(1px 1px at 84% 64%, #fff, transparent), radial-gradient(1px 1px at 52% 46%, #ffffffaa, transparent);
  --bn-fx-size: 140px 60px;
  --bn-edge: linear-gradient(135deg, #f3e3ff, #a774ff 25%, #4a6bff 50%, #ff6ec7 75%, #a774ff); }
.cmsg.bn-galaxy { animation: viewIn .2s ease, bnStars 40s linear infinite alternate; }
/* Rainbow: the whole spectrum runs slowly round the frame */
.bn-rainbow { --m1: #ffd1f0; --m2: #ff9a3d; --m3: #5b3cc4; --bn-ink: #1a1030; --bn-name: #fff;
  --bn-edge: linear-gradient(90deg, #ff4d4d, #ffa53d, #ffe14d, #4dff88, #4dc3ff, #8a6bff, #ff5ad1, #ff4d4d); }
.cmsg.bn-rainbow { animation: viewIn .2s ease, bnEdge 6s linear infinite alternate; }
.cmsg.bn-rainbow .cmeta b { color: #fff; background: linear-gradient(90deg, #ff8080, #ffc070, #fff080, #80ffb0, #80d8ff, #b8a0ff, #ff9ae0); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.cmsg.bn-rainbow .ctag, .chatpop.bn-rainbow .cp-tag, .chatpop.bn-rainbow .cp-ic { background: linear-gradient(90deg, #ff8080, #ffc070, #fff080, #80ffb0, #80d8ff, #b8a0ff); }
.chatpop.bn-rainbow .cp-bar { background: linear-gradient(90deg, #ff4d4d, #ffe14d, #4dff88, #4dc3ff, #ff5ad1); }
/* Diamond: cold white facets */
.bn-diamond { --m1: #ffffff; --m2: #bdf3ff; --m3: #4f8fb0; --bn-ink: #082230; --bn-name: #e3fbff;
  --bn-plate: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .09) 31% 36%, transparent 37% 60%, rgba(255, 255, 255, .06) 61% 64%, transparent 65%), linear-gradient(180deg, #0c1a24, #060d13);
  --bn-edge: conic-gradient(from 30deg, #ffffff, #bdf3ff, #7fc8e6, #ffffff, #d7f7ff, #8fd0ea, #ffffff); }
.cmsg.bn-diamond .ctag::after, .chatpop.bn-diamond .cp-tag::after { content: ""; width: 7px; height: 7px; background: currentColor; clip-path: polygon(50% 0, 100% 40%, 50% 100%, 0 40%); }
/* Ruby: deep red gem */
.bn-ruby { --m1: #ffd0dd; --m2: #ff2f6d; --m3: #6a0024; --bn-ink: #2a000d; --bn-name: #ff7aa0;
  --bn-plate: radial-gradient(80% 80% at 20% 0%, rgba(255, 47, 109, .22), transparent 65%), linear-gradient(180deg, #1a0710, #0b0307); }
/* Neon: pink and cyan tubes */
.bn-neon { --m1: #ffd6f6; --m2: #ff4fd8; --m3: #23d5ff; --bn-ink: #2a0024; --bn-name: #ff8ce6;
  --bn-plate: linear-gradient(180deg, #120a1c, #07040d);
  --bn-edge: linear-gradient(90deg, #ff4fd8, #23d5ff, #ff4fd8); }
.cmsg.bn-neon { box-shadow: 0 0 18px -6px #ff4fd8, 0 0 22px -10px #23d5ff, inset 0 0 12px -6px #23d5ff; animation: viewIn .2s ease, bnEdge 5s ease-in-out infinite alternate, bnNeon 3s ease-in-out infinite; }
.cmsg.bn-neon .cmeta b { text-shadow: 0 0 6px rgba(255, 79, 216, .7), 1px 0 0 rgba(35, 213, 255, .5); }
.cmsg.bn-neon p, .cmsg.bn-neon.mine p { border-color: rgba(35, 213, 255, .55); }
/* Shadow: dark smoke drifting over a near-black plate */
.bn-shadow { --m1: #c9ced8; --m2: #707787; --m3: #1d2028; --bn-ink: #e8ebf2; --bn-name: #d3d8e2;
  --bn-plate: radial-gradient(60% 80% at 15% 100%, rgba(120, 126, 140, .2), transparent 70%), radial-gradient(50% 70% at 85% 0%, rgba(90, 96, 110, .18), transparent 70%), linear-gradient(180deg, #0d0e12, #040406);
  --bn-edge: linear-gradient(135deg, #5d6372, #1d2028 35%, #8a90a0 60%, #1d2028 85%, #5d6372); }
.cmsg.bn-shadow .ctag, .chatpop.bn-shadow .cp-tag, .chatpop.bn-shadow .cp-ic { background: linear-gradient(135deg, #3a3f4b, #16181e); box-shadow: inset 0 0 0 1px #707787, 0 1px 0 #000; }
.cmsg.bn-shadow { box-shadow: 0 14px 30px -14px #000, 0 0 0 1px rgba(112, 119, 135, .25), inset 0 1px 0 rgba(255, 255, 255, .06); animation: viewIn .2s ease, bnSmoke 7s ease-in-out infinite alternate; }
/* Gold: a lighter gold than the Creator's, with no crown */
.bn-gold-lite { --m1: #fff4cf; --m2: #f0c25a; --m3: #8a6420; --bn-ink: #241800; --bn-name: #ffd77a; }

@keyframes bnEdge { to { background-position: 0 0, 0 0, 0 0, 0 0, 100% 50%; } }
@keyframes bnGlow { 50% { box-shadow: 0 14px 34px -14px var(--m2), 0 0 18px -4px color-mix(in srgb, var(--m2) 70%, transparent), 0 0 0 1px color-mix(in srgb, var(--m2) 30%, transparent); } }
@keyframes bnFlicker { 0%, 100% { box-shadow: 0 14px 30px -16px #ff7a1a, 0 0 0 1px rgba(255, 122, 26, .2); } 40% { box-shadow: 0 12px 34px -12px #ff3d00, 0 0 14px -6px #ffd36b; } 70% { box-shadow: 0 14px 28px -16px #ff7a1a, 0 0 10px -6px #ff3d00; } }
@keyframes bnStars { to { background-position: 0 0, 0 0, 140px 0, 0 0, 100% 50%; } }
@keyframes bnNeon { 50% { box-shadow: 0 0 24px -6px #ff4fd8, 0 0 28px -8px #23d5ff, inset 0 0 14px -6px #ff4fd8; } }
@keyframes bnSmoke { to { background-position: 30px 6px, -20px -4px, 0 0, 0 0, 100% 50%; } }
.rm .cmsg.bn, .rm .chatpop.bn .cp-ic { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .cmsg.bn, .chatpop.bn .cp-ic { animation: none !important; } }
/* the home-page admin box: Take all is red, and solid red once it asks for the second tap */
[data-quick-gift] .btn.danger { color: var(--danger); font-weight: 600; }
[data-quick-gift] .btn.danger.armed, [data-quick-gift] .btn.danger.armed:hover { background: var(--danger); color: #fff; }
[data-quick-gift] select.ain { min-height: 40px; font-family: var(--font-body); }
