/* ==========================================================================
   THE BOARD — the leaderboard hall of the speakeasy (js/board/*), the profile card (js/screens/profile.js),
   the results plaques and the rank-up (js/profile/callouts.js). Prefixes: bd- (board), pf- (profile), rc- (results).
   Only transform and opacity animate; the hall itself is one static canvas that drifts on the compositor.
   ========================================================================== */
:root {
  --bd-ink: #f6ecd8;
  --bd-dim: rgba(246, 230, 205, 0.72);
  --bd-faint: rgba(240, 222, 196, 0.62);
  --bd-line: rgba(255, 214, 150, 0.14);
  --bd-gold: #f2c869;
  --bd-gold-2: #b98128;
  --bd-glass: rgba(22, 13, 18, 0.72);
}

/* ---- the screen shell ---- */
.screen.bd-screen { max-width: none; padding: 0; overflow: hidden; }
body.bd-on .bg, body.bd-on #stage::before, body.bd-on #stage::after { display: none; }
/* the corner pair (☰ + music) comes from components.css */
.bd { position: relative; width: 100%; height: 100%; color: var(--bd-ink); font-family: var(--font-ui); }

/* ---- the hall: one painted canvas drifting slowly, the game's light, dust in the lamplight ---- */
.bd-scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #060307; pointer-events: none; }
.bd-drift { position: absolute; inset: 0; transform-origin: 50% 40%; animation: bd-drift 80s ease-in-out infinite alternate; }
.bd-drift canvas { display: block; width: 100%; height: 100%; }
@keyframes bd-drift { from { transform: scale(1.04) translate3d(-0.8%, 0.4%, 0); } to { transform: scale(1.09) translate3d(1.1%, -0.9%, 0); } }
.bd-tint {
  position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease;
  background:
    radial-gradient(70% 42% at 50% 12%, color-mix(in srgb, var(--t1, #ffcf8a) 20%, transparent), transparent 72%),
    radial-gradient(60% 46% at 92% 96%, color-mix(in srgb, var(--t2, #ff7ccb) 16%, transparent), transparent 72%),
    radial-gradient(46% 40% at 4% 64%, color-mix(in srgb, var(--t1, #ffcf8a) 10%, transparent), transparent 72%);
}
.bd-tint.is-on { opacity: 1; }
.bd-dust i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: rgba(255, 226, 180, 0.55); opacity: 0; animation: bd-mote 22s linear infinite; }
.bd-dust i:nth-child(odd) { width: 2px; height: 2px; animation-duration: 28s; }
@keyframes bd-mote { 0% { opacity: 0; transform: translate3d(0, 0, 0); } 12% { opacity: 0.7; } 80% { opacity: 0.35; } 100% { opacity: 0; transform: translate3d(36px, -140px, 0); } }

/* ---- the column ---- */
.bd-wrap {
  position: relative; z-index: 1; box-sizing: border-box; height: 100dvh; max-width: 820px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: calc(var(--safe-t) + 10px) calc(var(--safe-r) + 16px) calc(var(--safe-b) + 14px) calc(var(--safe-l) + 16px);
}

/* ---- the header: back, the title in neon over Art Deco rules, your emblem ---- */
.bd-head { position: relative; display: grid; grid-template-columns: 44px 1fr; grid-template-rows: 44px auto; align-items: center; padding-right: 0; }
.bd-back {
  grid-row: 1; grid-column: 1; position: relative; width: var(--cb, 36px); height: var(--cb, 36px); display: grid; place-items: center; border-radius: 50%;
  color: rgba(255, 240, 220, 0.9); font: 400 25px/1 var(--font-ui); text-decoration: none; padding-bottom: 3px; box-sizing: border-box;
  background: radial-gradient(120% 90% at 30% 15%, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 60%), rgba(20, 12, 16, 0.55);
  border: 1px solid rgba(255, 230, 200, 0.18); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 6px 18px rgba(0, 0, 0, 0.35);
}
.bd-back:active { transform: scale(0.94); }
.bd-back::after { content: ''; position: absolute; inset: calc((var(--cb, 36px) - 44px) / 2); }   /* (7a §0: the corner buttons' size — 36 pt — with a 44 pt tap area) */
.bd-title { grid-row: 1 / span 2; grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: none; padding-top: 4px; }
.bd-kicker { font: 700 9.5px/1 var(--font-mono); letter-spacing: 0.5em; padding-left: 0.5em; color: rgba(242, 200, 105, 0.82); margin-top: 6px; }
.bd-name {
  margin: 8px 0 0; font: 900 clamp(28px, 8.4vw, 46px)/1 var(--font-display); letter-spacing: 0.16em; padding-left: 0.16em;
  color: #fff6e6;
  text-shadow: 0 0 2px #fff, 0 0 10px rgba(255, 196, 110, 0.75), 0 0 28px rgba(255, 150, 60, 0.45), 0 0 60px color-mix(in srgb, var(--a1, #ffcf8a) 30%, transparent);
}
.bd-sub { display: flex; align-items: center; gap: 10px; font: 700 10px/1 var(--font-ui); letter-spacing: 0.42em; padding-left: 0.42em; color: var(--bd-dim); margin-top: 4px; }
.bd-sub::before, .bd-sub::after { content: ''; width: 46px; height: 8px; background: no-repeat center / 100% 100% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 8'%3E%3Cpath d='M0 4h36' stroke='%23f2c869' stroke-opacity='.7'/%3E%3Cpath d='M38 4l3-3 3 3-3 3z' fill='%23f2c869' fill-opacity='.85'/%3E%3C/svg%3E"); }
.bd-sub::after { transform: scaleX(-1); }
.bd-mebtn {
  position: absolute; top: 0; left: 52px; z-index: 2; height: 42px; min-width: 42px; display: flex; align-items: center; gap: 8px; padding: 0 6px;
  border-radius: 999px; color: var(--bd-ink);
  background: radial-gradient(120% 90% at 30% 15%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 60%), rgba(20, 12, 16, 0.55);
  border: 1px solid color-mix(in srgb, var(--rk, #f2c869) 40%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 18px color-mix(in srgb, var(--rk, #f2c869) 22%, transparent);
}
.bd-mebtn .rk-emb { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--rk) 55%, transparent)); }
.bd-mebtn-l { display: none; font: 700 10px/1 var(--font-ui); letter-spacing: 0.22em; padding-right: 8px; }
.bd-mebtn:active { transform: scale(0.95); }
.bd-head-pad { display: none; }

/* ---- game tabs: each lights the room in its own colours ---- */
.bd-games {
  display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; flex: none;
  margin: 2px -16px 0; padding: 4px 16px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent);
}
.bd-games::-webkit-scrollbar { display: none; }
.bd-gtab {
  flex: none; height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 15px; border-radius: 999px;
  font: 700 11.5px/1 var(--font-ui); letter-spacing: 0.14em; color: var(--bd-dim); white-space: nowrap;
  background: rgba(18, 11, 16, 0.62); border: 1px solid rgba(255, 225, 190, 0.13);
  transition: color 0.25s, border-color 0.25s, background-color 0.25s, transform 0.15s var(--ease);
}
.bd-gtab:active { transform: scale(0.96); }
.bd-gdot { width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, var(--a1), var(--a2)); box-shadow: 0 0 8px color-mix(in srgb, var(--a1) 70%, transparent); opacity: 0.75; }
.bd-gtab.is-on {
  color: #fff; border-color: color-mix(in srgb, var(--a1) 65%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--a1) 22%, rgba(18, 11, 16, 0.8)), color-mix(in srgb, var(--a2) 10%, rgba(18, 11, 16, 0.8)));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 18px color-mix(in srgb, var(--a1) 32%, transparent);
  text-shadow: 0 0 10px color-mix(in srgb, var(--a1) 70%, transparent);
}
.bd-gtab.is-on .bd-gdot { opacity: 1; }
.bd[data-game='prism'] .bd-gtab.is-on .bd-gdot, .bd-gtab[data-id='prism'] .bd-gdot { background: conic-gradient(#ff7ccb, #ffd27a, #9fe8ff, #a874ff, #ff7ccb); }

/* ---- segmented controls ---- */
.bd-ctrl { display: flex; gap: 8px; flex: none; }
.bd-seg { flex: 1; display: flex; padding: 3px; border-radius: 999px; background: rgba(10, 6, 10, 0.66); border: 1px solid rgba(255, 225, 190, 0.12); }
.bd-seg-b {
  flex: 1; min-height: 34px; padding: 0 8px; border-radius: 999px; font: 700 10.5px/1 var(--font-ui); letter-spacing: 0.16em; white-space: nowrap;
  color: var(--bd-dim); transition: color 0.2s, background-color 0.2s;
}
.bd-seg-b.is-on { color: #1a1007; background: linear-gradient(180deg, #ffe9b8, var(--bd-gold) 55%, #c99234); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 14px rgba(242, 200, 105, 0.35); }
.bd-seg-b:disabled { opacity: 0.38; }
.bd-picks { display: flex; flex-direction: column; gap: 8px; flex: none; }
.bd-picks[hidden] { display: none; }
.bd-diff { flex: none; }
.bd-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent); mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent); }
.bd-chips::-webkit-scrollbar { display: none; }
.bd-chip {
  flex: none; min-height: 32px; padding: 0 13px; border-radius: 999px; font: 700 10.5px/1 var(--font-ui); letter-spacing: 0.14em; white-space: nowrap;
  color: var(--bd-dim); background: rgba(14, 9, 13, 0.6); border: 1px solid rgba(255, 225, 190, 0.12);
}
.bd-chip.is-on { color: #fff; border-color: color-mix(in srgb, var(--a1, #f2c869) 60%, transparent); background: color-mix(in srgb, var(--a1, #f2c869) 16%, rgba(14, 9, 13, 0.7)); }

/* ---- the scoreboard ---- */
.bd-card {
  position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: 22px;
  background:
    radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--a1, #ffcf8a) 9%, transparent), transparent 60%),
    linear-gradient(180deg, rgba(30, 17, 20, 0.9), rgba(12, 7, 11, 0.94));
  border: 1px solid rgba(255, 214, 150, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 236, 200, 0.2), 0 30px 80px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(0, 0, 0, 0.55), 0 0 70px color-mix(in srgb, var(--a1, #ffcf8a) 12%, transparent);
}
.bd-card::before { content: ''; position: absolute; inset: 5px; border-radius: 18px; border: 1px solid rgba(255, 214, 150, 0.08); pointer-events: none; z-index: 2; }
.bd-card::after { content: ''; position: absolute; top: 0; left: 12%; right: 12%; height: 1px; background: linear-gradient(90deg, transparent, var(--a1, #f2c869), transparent); opacity: 0.8; pointer-events: none; z-index: 2; }
.bd-card-head { flex: none; padding: 16px 16px 0; }
.bd-plate { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-bottom: 12px; text-align: center; }
.bd-label { margin: 0; font: 900 14.5px/1.2 var(--font-display); letter-spacing: 0.18em; padding-left: 0.18em; color: #fff3dc; text-shadow: 0 0 14px color-mix(in srgb, var(--a1, #ffcf8a) 45%, transparent); }
.bd-when { font: 700 9.5px/1 var(--font-mono); letter-spacing: 0.24em; color: var(--bd-faint); }
.bd-cols, .bd-row, .bd-me { display: grid; grid-template-columns: 44px 36px minmax(0, 1fr) auto; align-items: center; column-gap: 10px; }
.bd-cols { padding: 8px 4px 8px; border-top: 1px solid var(--bd-line); font: 700 9px/1 var(--font-mono); letter-spacing: 0.24em; color: var(--bd-faint); }
.bd-cols span:nth-child(2) { grid-column: 2 / span 2; }
.bd-cols span:last-child { text-align: right; }
.bd-scroll { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: rgba(255, 214, 150, 0.2) transparent; }
.bd-rows { list-style: none; margin: 0; padding: 0 0 8px; }

/* rows */
.bd-row { position: relative; min-height: 56px; padding: 0 16px 0 20px; border-bottom: 1px solid rgba(255, 214, 150, 0.055); }
.bd-rank { font: 700 15px/1 var(--font-num); font-variant-numeric: tabular-nums; color: rgba(242, 210, 150, 0.75); text-align: center; }
.bd-who { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bd-n { font: 600 15px/1.15 var(--font-ui); color: #fff7ea; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-t { display: flex; align-items: center; gap: 5px; font: 600 11px/1 var(--font-num); letter-spacing: 0.04em; color: var(--bd-faint); font-variant-numeric: tabular-nums; }
.bd-crown { display: none; }
.bd-v { font: 700 17px/1 var(--font-num); font-variant-numeric: tabular-nums; color: #fff3dc; text-align: right; white-space: nowrap; }
.bd-v small { display: block; max-width: 96px; white-space: normal; text-align: right; font: 700 9px/1.35 var(--font-mono); letter-spacing: 0.12em; color: var(--bd-faint); }
.bd-end { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 22px 16px 14px; font: 700 9px/1 var(--font-mono); letter-spacing: 0.3em; color: rgba(242, 210, 150, 0.5); }
.bd-end::before, .bd-end::after { content: ''; width: 40px; height: 1px; background: linear-gradient(90deg, transparent, rgba(242, 200, 105, 0.5)); }
.bd-end::after { transform: scaleX(-1); }
.bd-card.is-cascade .bd-end { animation: bd-row-in 0.62s var(--ease) both; animation-delay: calc(var(--i) * 34ms + 120ms); }

/* the top three: lit gold, silver and bronze — elevated, never gaudy */
.bd-row.is-top { min-height: 68px; --m: #f2c869; background: linear-gradient(90deg, color-mix(in srgb, var(--m) 15%, transparent), color-mix(in srgb, var(--m) 4%, transparent) 55%, transparent); }
.bd-row.is-2 { --m: #d9e3f2; }
.bd-row.is-3 { --m: #e8a06a; }
.bd-row.is-top::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(180deg, transparent, var(--m), transparent); box-shadow: 0 0 12px var(--m); }
.bd-row.is-top .bd-n { font-size: 16.5px; }
.bd-row.is-top .bd-v { font-size: 19px; color: color-mix(in srgb, var(--m) 55%, #fff); text-shadow: 0 0 14px color-mix(in srgb, var(--m) 45%, transparent); }
.bd-row.is-1 { min-height: 76px; }
.bd-row.is-1 .bd-n { font-size: 18px; }
.bd-row.is-1 .bd-v { font-size: 21px; }
.bd-row.is-1::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.9;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 240, 200, 0.12) 50%, transparent 62%);
  transform: translateX(-100%); animation: bd-sweep 7s ease-in-out 1.2s infinite;
}
@keyframes bd-sweep { 0% { transform: translateX(-100%); } 22%, 100% { transform: translateX(100%); } }
.bd-medal {
  width: 32px; height: 32px; margin: 0 auto; display: grid; place-items: center; border-radius: 50%;
  font: 800 15px/1 var(--font-num); color: #2a1a06;
  background: radial-gradient(circle at 35% 28%, #fff9e0, #f6d27a 38%, #b8842c 78%, #6d4812);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.8), inset 0 -2px 3px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 220, 140, 0.5), 0 0 16px rgba(242, 200, 105, 0.5);
}
.bd-medal.is-silver { color: #1b2230; background: radial-gradient(circle at 35% 28%, #ffffff, #dfe7f3 40%, #8f9cb0 80%, #5a6578); box-shadow: inset 0 1px 1px #fff, inset 0 -2px 3px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(230, 238, 250, 0.5), 0 0 14px rgba(210, 225, 245, 0.35); }
.bd-medal.is-bronze { color: #2a1206; background: radial-gradient(circle at 35% 28%, #ffe6cf, #e6a06c 40%, #9a5a30 80%, #5e3216); box-shadow: inset 0 1px 1px rgba(255, 240, 225, 0.8), inset 0 -2px 3px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(240, 180, 130, 0.5), 0 0 14px rgba(232, 160, 106, 0.35); }
.bd-row.is-1 .bd-medal { width: 36px; height: 36px; font-size: 17px; }

/* your row, wherever it is in the list */
.bd-row.is-me { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 22%, transparent), color-mix(in srgb, var(--c) 5%, transparent) 70%); box-shadow: inset 3px 0 0 var(--c); }
.bd-row.is-me .bd-n { color: #fff; text-shadow: 0 0 12px color-mix(in srgb, var(--c) 60%, transparent); }

/* the cascade */
.bd-card.is-cascade .bd-row:not(.is-skel) { animation: bd-row-in 0.62s var(--ease) both; animation-delay: calc(var(--i) * 34ms); }
@keyframes bd-row-in { from { opacity: 0; transform: translate3d(0, 16px, 0) scale(0.985); } }

/* loading */
.bd-row.is-skel { pointer-events: none; }
.bd-sk-av { width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 220, 180, 0.06); }
.bd-sk-n { height: 12px; width: calc(40% + var(--i) * 4%); max-width: 70%; border-radius: 6px; background: rgba(255, 220, 180, 0.07); }
.bd-sk-v { height: 14px; width: 54px; border-radius: 6px; background: rgba(255, 220, 180, 0.07); }
.bd-row.is-skel { overflow: hidden; }
.bd-row.is-skel::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 230, 190, 0.05) 50%, transparent 70%); transform: translateX(-100%); animation: bd-sweep 1.6s ease-in-out infinite; animation-delay: calc(var(--i) * 60ms); }

/* empty / dark */
.bd-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 46px 28px; text-align: center; }
.bd-empty b { font: 900 12px/1.4 var(--font-display); letter-spacing: 0.2em; color: #fff0d6; }
.bd-empty span { font-size: 14px; line-height: 1.45; color: var(--bd-dim); max-width: 300px; }
.bd-empty-mark { opacity: 0.55; margin-bottom: 4px; }
.bd-empty.is-error b { color: #ffc2cf; }
.bd-retry { margin-top: 6px; min-height: 40px; padding: 0 18px; border-radius: 999px; font: 700 11px/1 var(--font-ui); letter-spacing: 0.2em; color: var(--bd-ink); border: 1px solid rgba(255, 220, 180, 0.3); background: rgba(255, 255, 255, 0.04); }
.bd-sentinel { height: 1px; }

/* your pinned row: always there, in your colour */
.bd-me {
  position: relative; z-index: 3; flex: none; min-height: 62px; padding: 0 16px 0 20px; --c: #f2c869;
  border-top: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 17%, rgba(18, 10, 15, 0.97)), rgba(10, 6, 10, 0.98));
  box-shadow: 0 -14px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 color-mix(in srgb, var(--c) 45%, transparent), inset 0 0 28px color-mix(in srgb, var(--c) 16%, transparent);
}
.bd-me[hidden] { display: none; }
.bd-me .bd-rank { color: var(--c); font-size: 15px; text-shadow: 0 0 12px color-mix(in srgb, var(--c) 70%, transparent); }
.bd-me-k { font: 700 9px/1 var(--font-mono); letter-spacing: 0.26em; color: color-mix(in srgb, var(--c) 70%, #fff); }
.bd-me .bd-n { display: flex; align-items: center; }
.bd-me .rk-badge { margin-left: 7px; }
.bd-me-note { grid-column: 1 / -1; text-align: center; font-size: 13px; color: var(--bd-dim); padding: 0 10px; }

/* ---- the public page: PLAY NOW ---- */
.bd-cta { flex: none; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.bd-play {
  position: relative; overflow: hidden; width: min(100%, 420px); min-height: 56px; display: grid; place-items: center; border-radius: 18px; text-decoration: none;
  font: 900 15px/1 var(--font-display); letter-spacing: 0.3em; padding-left: 0.3em; color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.06) 48%, rgba(255, 124, 203, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.36);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -10px 24px rgba(255, 124, 203, 0.16), 0 0 0 1px rgba(255, 124, 203, 0.3), 0 14px 40px rgba(255, 90, 180, 0.35);
  text-shadow: 0 0 14px rgba(255, 124, 203, 0.9);
}
.bd-play-sheen { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, 0.22) 50%, transparent 65%); transform: translateX(-110%); animation: bd-sweep 4.5s ease-in-out 1s infinite; }
.bd-play-l { position: relative; }
.bd-cta-line { font: 700 9px/1.4 var(--font-mono); letter-spacing: 0.2em; text-transform: uppercase; text-align: center; color: var(--bd-faint); }

/* ---- wide screens: the scoreboard on its own, the windows and the back bar either side ---- */
@media (min-width: 900px) {
  .bd-wrap { max-width: 780px; gap: 12px; padding-top: calc(var(--safe-t) + 18px); padding-bottom: 22px; }
  .bd-name { font-size: 52px; }
  .bd-mebtn { left: auto; right: 0; padding: 0 6px 0 6px; }
  .bd.is-public .bd-mebtn { display: none; }
  .bd-mebtn-l { display: inline; }
  .bd-games { justify-content: center; flex-wrap: wrap; margin: 4px 0 0; padding: 0; -webkit-mask-image: none; mask-image: none; overflow: visible; }
  .bd-ctrl { width: 560px; align-self: center; }
  .bd-picks { align-items: center; }
  .bd-chips { justify-content: center; flex-wrap: wrap; margin: 0; padding: 0; -webkit-mask-image: none; mask-image: none; overflow: visible; }
  .bd-diff { width: 360px; }
  .bd-row, .bd-me { padding: 0 26px 0 30px; column-gap: 14px; grid-template-columns: 52px 38px minmax(0, 1fr) auto; }
  .bd-cols { padding-left: 14px; padding-right: 14px; grid-template-columns: 52px 38px minmax(0, 1fr) auto; column-gap: 14px; }
  .bd-label { font-size: 17px; }
  .bd-row { min-height: 58px; }
  .bd-row.is-1 { min-height: 80px; }
}
/* phones: the corner buttons (music, settings) own the top row, the title sits under it */
@media (max-width: 899px) {
  .bd-head { grid-template-rows: 44px auto; }
  .bd-title { grid-row: 2; padding-top: 0; }
  .bd-kicker { position: absolute; top: 0; left: 50%; transform: translateX(-50%); height: 44px; display: flex; align-items: center; margin: 0; font-size: 8.5px; letter-spacing: 0.42em; white-space: nowrap; opacity: 0; }
  .bd-name { margin-top: 2px; }
}
@media (max-height: 700px) and (max-width: 899px) {
  .bd-kicker { display: none; }
  .bd-name { margin-top: 2px; font-size: 26px; }
  .bd-sub { display: none; }
  .bd-title { padding-top: 6px; }
  .bd-head { grid-template-rows: 44px 6px; }
}

/* ---- reduced effects ---- */
body.reduced-fx .bd-drift, body.reduced-fx .bd-dust, body.reduced-fx .bd-row.is-1::after, body.reduced-fx .bd-play-sheen { animation: none; }
body.reduced-fx .bd-dust { display: none; }
body.reduced-fx .bd-card.is-cascade .bd-row { animation-duration: 0.01s; animation-delay: 0s; }
@media (prefers-reduced-motion: reduce) {
  .bd-drift, .bd-dust i, .bd-row.is-1::after, .bd-play-sheen { animation: none; }
  .bd-card.is-cascade .bd-row { animation-duration: 0.01s; animation-delay: 0s; }
}

/* ==========================================================================
   THE PROFILE — a membership card to the speakeasy (js/screens/profile.js)
   ========================================================================== */
.screen.pf-screen { overflow: hidden; }
.pf-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) calc(var(--safe-b) + 28px); display: flex; flex-direction: column; gap: 18px; scrollbar-width: none; }
.pf-scroll::-webkit-scrollbar { display: none; }
.pf-card {
  position: relative; overflow: hidden; isolation: isolate; aspect-ratio: 1.586; max-height: 250px; width: 100%; box-sizing: border-box; flex: none;
  display: flex; flex-direction: column; justify-content: space-between; padding: 16px 18px 15px; border-radius: 22px; color: #fff;
  background:
    radial-gradient(110% 90% at 0% 0%, color-mix(in srgb, var(--c) 30%, transparent), transparent 55%),
    radial-gradient(90% 100% at 100% 100%, color-mix(in srgb, var(--rk) 24%, transparent), transparent 62%),
    linear-gradient(145deg, rgba(38, 22, 44, 0.94), rgba(12, 9, 24, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), inset 0 -1px 0 rgba(0, 0, 0, 0.5), 0 26px 60px rgba(0, 0, 0, 0.55), 0 0 46px color-mix(in srgb, var(--c) 22%, transparent);
}
.pf-card::before { content: ''; position: absolute; inset: 7px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.09); pointer-events: none; }
.pf-card::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.018) 0 2px, transparent 2px 7px); }
.pf-holo { position: absolute; inset: -30% -60%; z-index: 1; pointer-events: none; background: linear-gradient(112deg, transparent 42%, rgba(255, 255, 255, 0.16) 47%, rgba(255, 170, 235, 0.12) 50%, rgba(150, 220, 255, 0.12) 53%, transparent 58%); transform: translateX(-62%); }
.pf-card.is-lit .pf-holo { animation: pf-holo 2.6s var(--ease) 0.35s both; }
@keyframes pf-holo { from { transform: translateX(-62%); } to { transform: translateX(62%); } }
.pf-card-top { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; }
.pf-brand { font: 900 10px/1 var(--font-display); letter-spacing: 0.32em; color: rgba(255, 236, 210, 0.92); text-shadow: 0 0 10px rgba(255, 160, 220, 0.6); }
.pf-member { font: 700 9px/1 var(--font-mono); letter-spacing: 0.4em; padding: 4px 6px 4px 9px; color: rgba(255, 255, 255, 0.66); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 999px; }
.pf-card-mid { position: relative; z-index: 2; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.pf-av { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c) 20%, transparent), transparent 70%); box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent), inset 0 0 22px color-mix(in srgb, var(--c) 25%, transparent); }
.pf-id { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.pf-name { font: 700 24px/1.05 var(--font-ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 6px 10px; margin: -6px -10px; text-shadow: 0 0 14px color-mix(in srgb, var(--c) 45%, transparent); }
.pf-tag { font: 600 14px/1 var(--font-num); letter-spacing: 0.06em; color: rgba(255, 255, 255, 0.74); font-variant-numeric: tabular-nums; }
.pf-rank { font: 900 11px/1 var(--font-display); letter-spacing: 0.24em; color: var(--rk); text-shadow: 0 0 12px color-mix(in srgb, var(--rk) 60%, transparent); }
.pf-emb { margin-right: -2px; }
.pf-xp { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 7px; }
.pf-xp-bar { position: relative; height: 8px; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, 0.09); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5); }
.pf-xp-fill { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); border-radius: 99px; background: linear-gradient(90deg, color-mix(in srgb, var(--rk) 55%, #fff), var(--rk)); box-shadow: 0 0 14px var(--rk); transition: transform 1.5s var(--ease) 0.35s; }
.pf-card.is-lit .pf-xp-fill { transform: scaleX(max(0.015, var(--f))); }
.pf-xp-glint { position: absolute; top: 0; bottom: 0; left: 0; width: 30%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent); transform: translateX(-120%); }
.pf-card.is-lit .pf-xp-glint { animation: pf-glint 1.4s ease 1.7s both; }
@keyframes pf-glint { to { transform: translateX(380%); } }
.pf-xp-row { display: flex; justify-content: space-between; gap: 10px; font: 700 10px/1 var(--font-mono); letter-spacing: 0.16em; color: rgba(255, 255, 255, 0.68); }
.pf-xp-row b { font: 700 13px/1 var(--font-num); color: #fff; letter-spacing: 0.02em; }

.pf-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pf-actions .btn { min-height: 46px; font-size: 11px; letter-spacing: 0.16em; }
.pf-sec { display: flex; flex-direction: column; gap: 10px; }
.pf-h { margin: 6px 0 0; font: 900 11px/1 var(--font-display); letter-spacing: 0.3em; color: rgba(255, 236, 220, 0.86); }
.pf-why { margin: 0; font-size: 13px; line-height: 1.5; color: var(--gl-dim); }
.pf-link { align-self: flex-start; min-height: 40px; font: 600 13px/1.3 var(--font-ui); color: var(--gl-pink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 124, 203, 0.4); }

/* the key: a secret password card */
.pf-key {
  position: relative; cursor: pointer; border-radius: 18px; padding: 14px 16px 12px; outline: none;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.016) 0 6px, transparent 6px 12px), linear-gradient(180deg, #160d18, #0b0711);
  border: 1px dashed rgba(242, 200, 105, 0.5);
  box-shadow: inset 0 0 0 4px #0b0711, inset 0 0 0 5px rgba(242, 200, 105, 0.16), 0 14px 34px rgba(0, 0, 0, 0.45);
}
.pf-key:focus-visible { box-shadow: inset 0 0 0 4px #0b0711, inset 0 0 0 5px rgba(242, 200, 105, 0.5), 0 0 0 2px var(--gl-pink); }
.pf-key-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pf-key-k { font: 900 10px/1 var(--font-display); letter-spacing: 0.3em; color: #f2c869; }
.pf-key-s { font: 600 11px/1 var(--font-ui); font-style: italic; color: rgba(242, 200, 105, 0.7); }
.pf-key-val { margin: 12px 0 10px; text-align: center; }
.pf-key-text { display: inline-block; font: 700 clamp(17px, 5.2vw, 21px)/1.2 var(--font-mono); letter-spacing: 0.12em; color: rgba(255, 244, 220, 0.62); transition: color 0.3s, text-shadow 0.3s; }
.pf-key.is-shown .pf-key-text { color: #fff4dc; text-shadow: 0 0 14px rgba(242, 200, 105, 0.6); user-select: all; -webkit-user-select: all; }
.pf-key.is-none .pf-key-text { font-size: 13px; letter-spacing: 0.2em; }
.pf-key-actions { display: flex; align-items: center; gap: 8px; }
.pf-key-hint { flex: 1; font: 700 9px/1 var(--font-mono); letter-spacing: 0.24em; color: rgba(242, 200, 105, 0.66); }
.pf-key.is-shown .pf-key-hint { visibility: hidden; }
.pf-key-copy, .pf-key-new { min-height: 36px; padding: 0 14px; border-radius: 999px; font: 700 10.5px/1 var(--font-ui); letter-spacing: 0.16em; color: #1a1007; background: linear-gradient(180deg, #ffe9b8, #f2c869 55%, #c99234); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.pf-key-new { color: rgba(255, 236, 210, 0.86); background: transparent; border: 1px solid rgba(242, 200, 105, 0.35); box-shadow: none; }
.pf-key-new.is-armed { color: #ffc2cf; border-color: rgba(255, 120, 150, 0.6); font-size: 9.5px; letter-spacing: 0.06em; }
.pf-key.is-none .pf-key-copy, .pf-key.is-none .pf-key-hint { display: none; }
.pf-restore-box { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: var(--gl-bg); border: 1px solid var(--gl-line); }
.pf-key-in { font-family: var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; }

/* the opt-out switch */
.pf-switch { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--gl-bg); border: 1px solid var(--gl-line); cursor: pointer; }
.pf-switch-l { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.pf-switch-l b { font: 700 14.5px/1.3 var(--font-ui); color: var(--gl-text); }
.pf-switch-l small { font-size: 12.5px; color: var(--gl-dim); }
.pf-switch-in { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pf-switch-ui { flex: none; position: relative; width: 50px; height: 30px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); transition: background-color 0.25s; }
.pf-switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #e8eaf6; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); transition: transform 0.25s var(--ease); }
.pf-switch-in:checked + .pf-switch-ui { background: color-mix(in srgb, var(--gl-pink) 55%, transparent); border-color: rgba(255, 124, 203, 0.7); box-shadow: 0 0 14px rgba(255, 124, 203, 0.35); }
.pf-switch-in:checked + .pf-switch-ui::after { transform: translateX(20px); background: #fff; }
.pf-switch-in:focus-visible + .pf-switch-ui { outline: 2px solid var(--gl-pink); outline-offset: 2px; }
.pf-switch-in:disabled + .pf-switch-ui { opacity: 0.4; }

/* per-game cards: elegant, not a spreadsheet */
.pf-games { display: flex; flex-direction: column; gap: 12px; }
.pf-loading { padding: 18px; text-align: center; font-size: 13.5px; line-height: 1.5; color: var(--gl-dim); border-radius: 16px; border: 1px dashed var(--gl-line-2); }
.pf-game {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 15px; border-radius: 18px;
  background: radial-gradient(100% 80% at 100% 0%, color-mix(in srgb, var(--a1) 14%, transparent), transparent 60%), rgba(12, 11, 28, 0.7);
  border: 1px solid color-mix(in srgb, var(--a1) 30%, rgba(255, 255, 255, 0.1));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: bd-row-in 0.6s var(--ease) both; animation-delay: calc(var(--i) * 60ms);
}
.pf-game::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--a1), var(--a2), transparent); opacity: 0.85; }
.pf-game-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pf-game-n { font: 900 13px/1 var(--font-display); letter-spacing: 0.18em; color: #fff; text-shadow: 0 0 14px color-mix(in srgb, var(--a1) 60%, transparent); }
.pf-game-p { font: 700 9.5px/1 var(--font-mono); letter-spacing: 0.2em; color: var(--gl-dim); }
.pf-game-big { display: flex; gap: 22px; }
.pf-stat { display: flex; flex-direction: column; gap: 5px; }
.pf-stat b { font: 700 28px/1 var(--font-num); color: #fff; font-variant-numeric: tabular-nums; }
.pf-stat b.is-dim { color: rgba(255, 255, 255, 0.45); }
.pf-stat span { font: 700 9px/1.2 var(--font-mono); letter-spacing: 0.16em; color: var(--gl-dim); }
.pf-ranks { display: flex; flex-wrap: wrap; gap: 6px 14px; font: 700 9.5px/1 var(--font-mono); letter-spacing: 0.16em; color: var(--gl-dim); }
.pf-ranks b { font: 700 13px/1 var(--font-num); letter-spacing: 0.02em; color: color-mix(in srgb, var(--a1) 70%, #fff); }
.pf-hl { display: flex; flex-wrap: wrap; gap: 6px 16px; font: 700 9.5px/1.2 var(--font-mono); letter-spacing: 0.14em; color: var(--gl-dim); }
.pf-hl b { font: 700 14px/1 var(--font-num); letter-spacing: 0; color: #fff; }
.pf-recs { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.pf-rec { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 4px 10px; }
.pf-rec-l { font: 700 10px/1.3 var(--font-ui); letter-spacing: 0.14em; color: var(--gl-dim); }
.pf-rec-v { font: 700 17px/1 var(--font-num); color: #fff; text-align: right; }
.pf-rec .pf-ranks { grid-column: 1 / -1; }
.pf-unplayed { display: flex; flex-direction: column; gap: 8px; font: 700 9.5px/1 var(--font-mono); letter-spacing: 0.2em; color: var(--gl-dim); }
.pf-unplayed div { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-chip { padding: 7px 10px; border-radius: 999px; font: 700 9.5px/1 var(--font-ui); letter-spacing: 0.14em; color: rgba(255, 255, 255, 0.72); border: 1px solid color-mix(in srgb, var(--a1) 30%, transparent); }
.pf-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; font: 700 9.5px/1 var(--font-mono); letter-spacing: 0.18em; color: var(--text-faint); }
.pf-pid { min-height: 32px; font: 700 9.5px/1 var(--font-mono); letter-spacing: 0.1em; color: var(--text-faint); }

/* the key reminder sheet */
.pf-prompt .sheet { display: flex; flex-direction: column; gap: 14px; }
.pf-prompt-head { display: flex; align-items: center; gap: 14px; }
.pf-prompt-actions { display: flex; flex-direction: column; gap: 6px; }

/* ==========================================================================
   RESULTS — plaques on the podium, the XP line, the rank-up (js/profile/callouts.js)
   ========================================================================== */
.rc-slot:empty, .rc:empty { display: none; }
.rc { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.rc-plaque {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px 10px 12px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(44, 28, 18, 0.92), rgba(16, 10, 12, 0.94));
  border: 1px solid rgba(242, 200, 105, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 236, 200, 0.26), 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 26px rgba(242, 200, 105, 0.16);
  opacity: 0; transform: translate3d(0, 12px, 0) scale(0.96);
  transition: opacity 0.5s var(--ease), transform 0.7s var(--ease-back);
}
.rc-plaque.is-in { opacity: 1; transform: none; }
.rc-sweep { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 35%, rgba(255, 240, 200, 0.28) 50%, transparent 65%); transform: translateX(-110%); }
.rc-plaque.is-in .rc-sweep { animation: rc-sweep 1.1s ease 0.25s both; }
@keyframes rc-sweep { to { transform: translateX(110%); } }
.rc-mark { flex: none; width: 30px; height: 30px; background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath d='M15 2l5 13-5 13-5-13z' fill='%23f2c869'/%3E%3Cpath d='M15 2l5 13h-5z' fill='%23fff2c8'/%3E%3Cpath d='M2 15h7M21 15h7' stroke='%23f2c869' stroke-width='1.6' stroke-linecap='round'/%3E%3Ccircle cx='15' cy='15' r='12.5' fill='none' stroke='%23f2c869' stroke-opacity='.45'/%3E%3C/svg%3E"); filter: drop-shadow(0 0 6px rgba(242, 200, 105, 0.6)); }
.rc-plaque.is-top10 .rc-mark, .rc-plaque.is-world .rc-mark, .rc-plaque.is-week .rc-mark { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Ccircle cx='15' cy='15' r='12.5' fill='none' stroke='%23a6e9ff' stroke-opacity='.6'/%3E%3Cpath d='M3 15h24M15 3c-5 6-5 18 0 24M15 3c5 6 5 18 0 24' fill='none' stroke='%23a6e9ff' stroke-width='1.2'/%3E%3Ccircle cx='15' cy='15' r='3' fill='%23e8fbff'/%3E%3C/svg%3E"); filter: drop-shadow(0 0 6px rgba(140, 220, 255, 0.6)); }
.rc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rc-n { font: 900 13px/1.15 var(--font-display); letter-spacing: 0.14em; color: #fff4dc; text-shadow: 0 0 12px rgba(242, 200, 105, 0.6); font-variant-numeric: tabular-nums; }
.rc-n span { font-family: var(--font-num); font-weight: 700; font-size: 15px; letter-spacing: 0.02em; }
.rc-sub { font: 700 9.5px/1.4 var(--font-mono); letter-spacing: 0.12em; color: rgba(246, 230, 205, 0.74); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rc-val { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.rc-val b { font: 700 18px/1 var(--font-num); color: #fff; }
.rc-val small { font: 600 10px/1 var(--font-mono); color: rgba(246, 230, 205, 0.66); }
.rc-plaque.is-first { border-color: rgba(255, 220, 140, 0.8); background: radial-gradient(120% 140% at 0% 50%, rgba(242, 200, 105, 0.28), transparent 60%), linear-gradient(180deg, rgba(54, 36, 16, 0.95), rgba(20, 12, 10, 0.96)); box-shadow: inset 0 1px 0 rgba(255, 245, 220, 0.4), 0 12px 34px rgba(0, 0, 0, 0.45), 0 0 34px rgba(242, 200, 105, 0.35); }
.rc-plaque.is-first .rc-n { font-size: 15px; }
.rc-plaque.is-top10, .rc-plaque.is-world, .rc-plaque.is-week { border-color: rgba(160, 230, 255, 0.5); background: linear-gradient(180deg, rgba(16, 26, 40, 0.92), rgba(8, 10, 18, 0.94)); box-shadow: inset 0 1px 0 rgba(220, 245, 255, 0.26), 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 26px rgba(120, 210, 255, 0.18); }
.rc-plaque.is-top10 .rc-n, .rc-plaque.is-world .rc-n, .rc-plaque.is-week .rc-n { text-shadow: 0 0 12px rgba(140, 220, 255, 0.7); }
.rc-xp { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: rgba(12, 10, 24, 0.72); border: 1px solid color-mix(in srgb, var(--rk) 35%, transparent); opacity: 0; transform: translateY(8px); transition: opacity 0.5s var(--ease), transform 0.6s var(--ease); }
.rc-xp.is-in { opacity: 1; transform: none; }
.rc-xp-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rc-xp-top { display: flex; align-items: baseline; gap: 2px; min-width: 0; font: 700 10px/1 var(--font-mono); letter-spacing: 0.16em; color: var(--text-dim); }
.rc-xp-top b { font: 700 16px/1 var(--font-num); color: var(--rk); letter-spacing: 0; text-shadow: 0 0 10px color-mix(in srgb, var(--rk) 60%, transparent); }
.rc-xp-parts { margin-left: 8px; font-size: 8.5px; letter-spacing: 0.12em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-faint); }
.rc-xp-bar { position: relative; height: 6px; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, 0.08); }
.rc-xp-fill { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(var(--f0)); background: linear-gradient(90deg, color-mix(in srgb, var(--rk) 55%, #fff), var(--rk)); box-shadow: 0 0 10px var(--rk); transition: transform 1.3s var(--ease) 0.3s; }
.rc-xp.is-in .rc-xp-fill { transform: scaleX(max(0.02, var(--f))); }
.rc-xp-next { font: 700 8.5px/1.25 var(--font-mono); letter-spacing: 0.14em; color: var(--text-faint); text-align: right; max-width: 92px; }

/* RANK UP: the old emblem dissolves, the new one forges in light, the name resolves */
.rc-up { position: fixed; inset: 0; z-index: 400; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; cursor: pointer; opacity: 0; transition: opacity 0.35s ease; -webkit-tap-highlight-color: transparent; }
.rc-up.is-on { opacity: 1; }
.rc-up.is-out { opacity: 0; transition-duration: 0.45s; }
.rc-up-veil { position: absolute; inset: 0; background: radial-gradient(60% 50% at 50% 42%, color-mix(in srgb, var(--rk) 16%, rgba(6, 3, 10, 0.95)), rgba(4, 2, 8, 0.97) 70%); }
.rc-up-stage { position: relative; width: 240px; height: 240px; display: grid; grid-template: 100% / 100%; place-items: center; }
.rc-up-stage > * { grid-area: 1 / 1; }
.rc-up-rays { width: 420px; height: 420px; border-radius: 50%; opacity: 0; background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--rk) 34%, transparent) 0 4deg, transparent 4deg 15deg); -webkit-mask-image: radial-gradient(circle, #000 18%, transparent 68%); mask-image: radial-gradient(circle, #000 18%, transparent 68%); }
.rc-up.is-on .rc-up-rays { animation: rc-rays 3.4s ease 1.05s both; }
@keyframes rc-rays { 0% { opacity: 0; transform: rotate(-20deg) scale(0.6); } 20% { opacity: 1; } 100% { opacity: 0.55; transform: rotate(25deg) scale(1); } }
.rc-up.is-on .rc-up-old { animation: rc-old 1.1s var(--ease) both; }
@keyframes rc-old { 0%, 45% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(0.72) translateY(6px); } }
.rc-up-shards { position: relative; width: 0; height: 0; }
.rc-up-shards i { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 1px; background: var(--rk0); box-shadow: 0 0 8px var(--rk0); opacity: 0; transform: rotate(var(--a)) translateX(0); }
.rc-up.is-on .rc-up-shards i { animation: rc-shard 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) 0.55s both; }
@keyframes rc-shard { 0% { opacity: 0; transform: rotate(var(--a)) translateX(10px) scale(1); } 20% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--d)) scale(0.3); } }
.rc-up-ring { width: 120px; height: 120px; border-radius: 50%; border: 2px solid var(--rk); box-shadow: 0 0 30px var(--rk), inset 0 0 24px var(--rk); opacity: 0; }
.rc-up.is-on .rc-up-ring { animation: rc-ring 0.9s ease-out 1.1s both; }
@keyframes rc-ring { 0% { opacity: 0.95; transform: scale(0.2); } 100% { opacity: 0; transform: scale(2.6); } }
.rc-up-new { opacity: 0; }
.rc-up-new .rk-emb { filter: drop-shadow(0 0 22px color-mix(in srgb, var(--rk) 70%, transparent)) drop-shadow(0 0 50px color-mix(in srgb, var(--rk) 40%, transparent)); }
.rc-up.is-on .rc-up-new { animation: rc-new 0.9s cubic-bezier(0.2, 1.4, 0.3, 1) 1.12s both; }
@keyframes rc-new { 0% { opacity: 0; transform: scale(1.5); } 40% { opacity: 1; } 100% { opacity: 1; transform: scale(1); } }
.rc-up-kicker { position: relative; margin-top: 8px; font: 700 11px/1 var(--font-mono); letter-spacing: 0.6em; padding-left: 0.6em; color: rgba(255, 255, 255, 0.72); opacity: 0; }
.rc-up.is-on .rc-up-kicker { animation: rc-fade 0.6s ease 1.3s both; }
.rc-up-name { position: relative; display: flex; font: 900 clamp(34px, 11vw, 56px)/1 var(--font-display); letter-spacing: 0.14em; padding-left: 0.14em; color: #fff; text-shadow: 0 0 2px #fff, 0 0 16px var(--rk), 0 0 40px color-mix(in srgb, var(--rk) 60%, transparent); }
.rc-up-name span { opacity: 0; transform: translateY(10px); }
.rc-up.is-on .rc-up-name span { animation: rc-letter 0.5s var(--ease) both; animation-delay: calc(1.45s + var(--i) * 70ms); }
@keyframes rc-letter { to { opacity: 1; transform: none; } }
.rc-up-line { position: relative; font: 600 14px/1.4 var(--font-ui); font-style: italic; color: rgba(255, 255, 255, 0.8); opacity: 0; }
.rc-up.is-on .rc-up-line { animation: rc-fade 0.8s ease 2.1s both; }
.rc-up-skip { position: absolute; bottom: calc(var(--safe-b) + 34px); font: 700 9.5px/1 var(--font-mono); letter-spacing: 0.3em; color: rgba(255, 255, 255, 0.55); opacity: 0; }
.rc-up.is-on .rc-up-skip { animation: rc-fade 0.6s ease 2.4s both; }
@keyframes rc-fade { from { opacity: 0; } to { opacity: 1; } }
.rc-up.is-done .rc-up-old, .rc-up.is-done .rc-up-shards, .rc-up.is-done .rc-up-ring { animation: none; opacity: 0; }
.rc-up.is-done .rc-up-new, .rc-up.is-done .rc-up-kicker, .rc-up.is-done .rc-up-line, .rc-up.is-done .rc-up-name span { animation: none; opacity: 1; transform: none; }
body.reduced-fx .rc-up *, body.reduced-fx .rc-plaque, body.reduced-fx .rc-sweep, body.reduced-fx .pf-holo, body.reduced-fx .pf-xp-glint { animation-duration: 0.01s !important; animation-delay: 0s !important; transition-duration: 0.01s !important; }
@media (prefers-reduced-motion: reduce) {
  .rc-up *, .rc-plaque, .rc-sweep, .pf-holo, .pf-xp-glint, .pf-game { animation-duration: 0.01s !important; animation-delay: 0s !important; }
}

/* the public page's music on/off (mood music starts after the first tap) */
html body .music-btn.bd-music { top: calc(var(--safe-t) + 12px) !important; right: calc(var(--safe-r) + 12px) !important; border-radius: 50%; }   /* (beats the app corner rules) */
