/* =====================================================================================================
   Stick Brawl v4 concept kit: shared by every v4 concept page.
   1. tokens   2. text   3. panels + textures   4. buttons   5. pills   6. avatar, rank, flag, badge
   7. top bar   8. tiles   9. PLAY + mode plate   10. rarity cards   11. tab bar   12. XP bar
   13. toast, sheet, bubble   14. ad slot   15. screens + device frames   16. page chrome   17. motion

   Inside a game screen, 1 CSS px = 1 game canvas unit (UIKit.cs, the menus' 844-wide design). The device
   frames scale the whole screen, so the sizes here are the game's own: Header 40, Title 24, Button 20,
   Label 17, Body 15, Small 13. Small is the floor: 13 units = 11 pt on an iPhone 16.
   ===================================================================================================== */

/* ------------------------------------------------------------------ 1. tokens */
:root {
  /* surfaces (UIKit.cs) */
  --ink: #1D1B24;
  --panel: #1E1B2B;
  --panel-2: #2A2640;
  --panel-3: #3A3458;
  --panel-4: #4B4472;
  --cream: #FFF6E0;
  --cream-2: rgba(255, 246, 224, 0.78);
  --cream-3: rgba(255, 246, 224, 0.55);

  /* accents */
  --yellow: #FFD23F; --yellow-hi: #FFE98C; --yellow-lo: #F4AE00; --yellow-deep: #B97800;
  --pink: #FF4FA3; --blue: #2F7BFF; --green: #1FBF5C; --orange: #FF8A1F;
  --purple: #A43AF0; --cyan: #3FEAF5; --gold: #FFE03A; --red: #D42424;
  --alert: #FF3352;

  /* player colours (P1..P8) */
  --p1: #2F7BFF; --p2: #FF8A1F; --p3: #1FBF5C; --p4: #FF4FA3;
  --p5: #A43AF0; --p6: #3FEAF5; --p7: #FFE03A; --p8: #D42424;

  /* rarity */
  --common: #8E99B0; --common-hi: #D3D9E6; --common-lo: #555D72;
  --rare: #2F7BFF;   --rare-hi: #9CC2FF;   --rare-lo: #173FA0;
  --epic: #A43AF0;   --epic-hi: #DDA8FF;   --epic-lo: #5A1499;
  --legend: #FFB21F; --legend-hi: #FFF0A0; --legend-lo: #C24F00;

  /* type */
  --f-display: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --f-body: "Rubik", system-ui, -apple-system, sans-serif;
  --t-header: 40px; --t-title: 24px; --t-button: 20px; --t-label: 17px; --t-body: 15px; --t-small: 13px;

  /* shape */
  --bw: 3px;                         /* the ink outline */
  --r: 14px;                         /* UIKit's radius */
  --hard: 3px 6px 0 var(--ink);      /* UIKit's offset shadow: solid ink, no blur */
  --hard-sm: 2px 4px 0 var(--ink);
  --gloss: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.06));
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ------------------------------------------------------------------ 2. text */
/* the game's display text: white fill, ink outline, ink underlay */
.out {
  color: #fff;
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 2.5px 0 var(--ink);
}
.out--sm { -webkit-text-stroke-width: 3px; text-shadow: 0 1.5px 0 var(--ink); }
.out--y { color: var(--yellow); }
.out--c { color: var(--cream); }
.disp { font-family: var(--f-display); font-weight: 400; letter-spacing: 0.01em; line-height: 1; }
.cap { font-family: var(--f-body); font-weight: 800; font-size: var(--t-small); letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.15; }

/* ------------------------------------------------------------------ 3. panels + textures */
.panel {
  position: relative;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 52%),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.028) 0 6px, transparent 6px 12px),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.1), inset 0 -3px 0 rgba(0, 0, 0, 0.2), var(--hard);
}
.tex-dots { background-image: radial-gradient(rgba(255, 255, 255, 0.11) 1.3px, transparent 1.8px); background-size: 7px 7px; }
.tex-stripes { background-image: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.05) 0 6px, transparent 6px 12px); }

/* ------------------------------------------------------------------ 4. buttons */
.btn {
  --a: var(--yellow-hi); --b: var(--yellow); --c: var(--yellow-lo); --txt: var(--ink);
  --sx: 3px; --sy: 6px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--a) 0%, var(--b) 46%, var(--c) 100%);
  box-shadow: inset 0 -5px 0 rgba(120, 60, 0, 0.16), inset 0 2px 0 rgba(255, 255, 255, 0.55), var(--sx) var(--sy) 0 var(--ink);
  font: 400 var(--t-button) / 1 var(--f-display);
  letter-spacing: 0.02em;
  color: var(--txt);
  cursor: pointer;
  user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.09s ease, box-shadow 0.09s ease, filter 0.2s;
  touch-action: manipulation;
}
/* UIKit's gloss: the top half, inset 3% each side */
.btn::before {
  content: ""; position: absolute; left: 4%; right: 4%; top: 7%; height: 42%;
  border-radius: calc(var(--r) - 5px) calc(var(--r) - 5px) 50% 50% / calc(var(--r) - 5px) calc(var(--r) - 5px) 30% 30%;
  background: var(--gloss); opacity: 0.55; pointer-events: none;
}
.btn > * { position: relative; }
.btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.btn--dark { --a: #4D4675; --b: var(--panel-3); --c: var(--panel-2); --txt: #fff; box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.22), inset 0 2px 0 rgba(255, 255, 255, 0.16), var(--sx) var(--sy) 0 var(--ink); }
.btn--dark::before { opacity: 0.22; }
.btn--green { --a: #7BEFA5; --b: var(--green); --c: #0F9442; --txt: #fff; }
.btn--pink { --a: #FF9ACB; --b: var(--pink); --c: #D12A7F; --txt: #fff; }
.btn--blue { --a: #8AB6FF; --b: var(--blue); --c: #1C52C4; --txt: #fff; }
.btn--dark .lbl, .btn--green .lbl, .btn--pink .lbl, .btn--blue .lbl { color: #fff; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 0 2px 0 var(--ink); }
.btn--icon { width: 44px; min-height: 44px; height: 44px; padding: 0; border-radius: 12px; }
.btn--icon svg { width: 28px; height: 28px; }
.btn--sm { min-height: 34px; padding: 0 14px; font-size: 17px; border-radius: 11px; --sx: 2px; --sy: 4px; }
.btn[disabled], .btn.is-off {
  --a: #B4B0C4; --b: #8F8AA3; --c: #6C6782; --txt: rgba(29, 27, 36, 0.62);
  cursor: not-allowed;
}
.btn[disabled] .lbl, .btn.is-off .lbl { -webkit-text-stroke: 0; text-shadow: none; color: rgba(29, 27, 36, 0.6); }

/* press: squash down onto the shadow, then spring back */
.btn.is-down { transform: translate(var(--sx), calc(var(--sy) - 2px)) scale(1.04, 0.92); box-shadow: inset 0 -3px 0 rgba(120, 60, 0, 0.16), inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 2px 0 var(--ink); }
.press.is-down:not(.btn) { transform: translate(1px, 3px) scale(0.975); }
.is-pop { animation: sb-pop 0.46s var(--spring); }
@keyframes sb-pop {
  0% { transform: translate(2px, 3px) scale(1.06, 0.9); }
  40% { transform: translate(0, -2px) scale(0.96, 1.06); }
  70% { transform: scale(1.02, 0.98); }
  100% { transform: none; }
}

/* ------------------------------------------------------------------ 5. currency pills */
.pill {
  position: relative;
  display: inline-flex; align-items: center;
  height: 36px; min-width: 104px;
  margin-left: 20px; padding: 0 14px 0 30px;
  border: var(--bw) solid var(--ink); border-radius: 999px;
  background: linear-gradient(180deg, #121019, #26213A);
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.4), inset 0 -2px 0 rgba(255, 255, 255, 0.08), var(--hard-sm);
}
.pill__ico { position: absolute; left: -21px; top: 50%; width: 42px; height: 42px; transform: translateY(-52%); filter: drop-shadow(1px 2px 0 rgba(29, 27, 36, 0.55)); }
.pill__ico svg { width: 100%; height: 100%; display: block; }
.pill__num { font: 400 20px / 1 var(--f-display); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; flex: 1; text-align: right; }
.pill--gem { padding-right: 5px; }
.pill__plus {
  margin-left: 10px;
  display: grid; place-items: center;
  width: 28px; height: 28px; padding: 0;
  border: 2.5px solid var(--ink); border-radius: 9px;
  background: linear-gradient(180deg, #7BEFA5, var(--green) 50%, #0F9442);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), inset 0 -2px 0 rgba(0, 0, 0, 0.18);
  cursor: pointer;
}
.pill__plus svg { width: 18px; height: 18px; }
.pill.is-bump { animation: pill-bump 0.32s var(--spring); }
.pill.is-bump .pill__ico { animation: ico-bump 0.32s var(--spring); }
@keyframes pill-bump { 50% { transform: scale(1.08); } }
@keyframes ico-bump { 50% { transform: translateY(-52%) scale(1.25) rotate(-8deg); } }
.plus-pop { position: absolute; right: 6px; top: 100%; font: 400 18px / 1 var(--f-display); color: var(--yellow); -webkit-text-stroke: 3.5px var(--ink); paint-order: stroke fill; pointer-events: none; animation: plus-pop 1.2s var(--out) forwards; white-space: nowrap; }
@keyframes plus-pop { 0% { opacity: 0; transform: translateY(-4px) scale(0.6); } 18% { opacity: 1; transform: translateY(4px) scale(1.15); } 70% { opacity: 1; transform: translateY(8px) scale(1); } 100% { opacity: 0; transform: translateY(14px); } }

/* ------------------------------------------------------------------ 6. avatar, rank, flag, badge */
.ava {
  --xp: 0.72; --ring: var(--yellow);
  position: relative; flex: none;
  width: 58px; height: 58px; padding: 5px;
  border: var(--bw) solid var(--ink); border-radius: 50%;
  background: conic-gradient(var(--ring) calc(var(--xp) * 360deg), #15121F 0);
  box-shadow: var(--hard-sm);
}
.ava::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(29, 27, 36, 0.6); pointer-events: none; }
.ava__img { display: block; width: 100%; height: 100%; border-radius: 50%; border: 2.5px solid var(--ink); overflow: hidden; background: radial-gradient(circle at 50% 30%, #6AA6FF, #2F7BFF 55%, #1946B5); }
.ava__img svg { width: 100%; height: 100%; display: block; }
.ava__lvl {
  position: absolute; right: -9px; bottom: -7px;
  min-width: 26px; height: 24px; padding: 0 4px;
  display: grid; place-items: center;
  font: 400 15px / 1 var(--f-display); color: var(--ink);
  background: linear-gradient(180deg, var(--yellow-hi), var(--yellow) 50%, var(--yellow-lo));
  border: 2.5px solid var(--ink); border-radius: 8px;
  box-shadow: 1px 2px 0 var(--ink);
}
/* cosmetic frames (unlockables): drawn around the ring */
.ava--gold { border-color: var(--ink); box-shadow: 0 0 0 3px #FFC21A, 0 0 0 6px var(--ink), 2px 6px 0 6px var(--ink); }
.ava--epic { box-shadow: 0 0 0 3px var(--epic), 0 0 0 6px var(--ink), 0 0 16px 4px rgba(164, 58, 240, 0.55), 2px 6px 0 6px var(--ink); }

.rank { display: inline-block; width: 18px; height: 20px; flex: none; }
.rank svg { width: 100%; height: 100%; display: block; }
.flag { display: inline-block; width: 21px; height: 14px; flex: none; border: 2px solid var(--ink); border-radius: 3px; }
.flag--in { background: radial-gradient(circle at 50% 50%, #0A2C8A 0 1.6px, transparent 2.2px), linear-gradient(#FF9933 0 33.4%, #fff 33.4% 66.6%, #138808 66.6%); }

.badge {
  position: absolute; z-index: 3; top: -6px; right: -12px;
  min-width: 22px; height: 22px; padding: 0 5px;
  display: grid; place-items: center;
  font: 400 14px / 1 var(--f-display); color: #fff; letter-spacing: 0;
  -webkit-text-stroke: 0;
  background: linear-gradient(180deg, #FF7A8C, var(--alert) 55%, #D41A3A);
  border: 2.5px solid var(--ink); border-radius: 999px;
  box-shadow: 1px 2px 0 var(--ink), inset 0 2px 0 rgba(255, 255, 255, 0.35);
}
.badge--dot { min-width: 15px; width: 15px; height: 15px; padding: 0; top: -3px; right: -6px; }
.badge--new { background: linear-gradient(180deg, var(--yellow-hi), var(--yellow) 55%, var(--yellow-lo)); color: var(--ink); font-size: 12px; }
.badge.is-new { animation: badge-pop 0.6s var(--spring) both, badge-ring 1.6s 0.6s ease-out infinite; }
@keyframes badge-pop { 0% { transform: scale(0); } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes badge-ring { 0% { box-shadow: 1px 2px 0 var(--ink), 0 0 0 0 rgba(255, 51, 82, 0.7); } 100% { box-shadow: 1px 2px 0 var(--ink), 0 0 0 12px rgba(255, 51, 82, 0); } }

/* ------------------------------------------------------------------ 7. top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; position: relative; z-index: 6; }
.topbar__end { display: flex; align-items: center; gap: 10px; }
.achip {
  position: relative; display: flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 16px 0 0; margin: 0; margin-left: 2px;
  border: var(--bw) solid var(--ink); border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 55%), linear-gradient(180deg, var(--panel-3), var(--panel-2));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.1), var(--hard-sm);
  color: inherit; text-align: left; cursor: pointer; font: inherit;
}
.achip .ava { margin: -10px 0 -10px -6px; }
.achip__txt { display: flex; flex-direction: column; gap: 4px; }
.achip__name { font: 400 19px / 1 var(--f-display); letter-spacing: 0.02em; }
.achip__meta { display: flex; align-items: center; gap: 5px; font: 800 var(--t-small) / 1 var(--f-body); letter-spacing: 0.05em; color: var(--cream-2); }

/* ------------------------------------------------------------------ 8. tiles (mode buttons with art) */
.tile {
  --a: var(--orange); --a-hi: #FFC07A; --a-lo: #C9530A;
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  min-height: 0; padding: 6px 10px 6px 6px; width: 100%;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  border: var(--bw) solid var(--ink); border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 50%),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.028) 0 6px, transparent 6px 12px),
    linear-gradient(180deg, var(--panel-3), var(--panel-2) 60%, var(--panel));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.12), inset 0 -3px 0 rgba(0, 0, 0, 0.22), var(--hard);
  transition: transform 0.09s ease;
}
.tile__art {
  position: relative; align-self: stretch; aspect-ratio: 1; height: 100%; max-height: 100%;
  border: var(--bw) solid var(--ink); border-radius: 11px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 18%, var(--a-hi), var(--a) 52%, var(--a-lo));
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.18), inset 0 2px 0 rgba(255, 255, 255, 0.35);
}
.tile__art::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, 0.22) 1.2px, transparent 1.7px); background-size: 6px 6px; -webkit-mask-image: linear-gradient(200deg, #000, transparent 60%); mask-image: linear-gradient(200deg, #000, transparent 60%); pointer-events: none; }
.tile__txt { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.tile__t { font: 400 25px / 1 var(--f-display); letter-spacing: 0.02em; }
.tile__s { font: 800 var(--t-small) / 1.18 var(--f-body); letter-spacing: 0.05em; color: var(--cream-2); text-transform: uppercase; text-wrap: balance; }
.tile__go { width: 22px; height: 22px; opacity: 0.9; }
.tile__go svg { width: 100%; height: 100%; display: block; }

/* ------------------------------------------------------------------ 9. PLAY + mode plate */
.playbox { position: relative; display: flex; flex-direction: column; align-items: stretch; }
.playbox__glow { position: absolute; left: -14px; right: -14px; bottom: -12px; height: 118px; border-radius: 34px; background: radial-gradient(60% 70% at 50% 55%, rgba(255, 210, 63, 0.75), rgba(255, 170, 0, 0.25) 55%, transparent 75%); filter: blur(8px); animation: play-glow 1.8s ease-in-out infinite; pointer-events: none; }
@keyframes play-glow { 0%, 100% { opacity: 0.5; transform: scale(0.96); } 50% { opacity: 1; transform: scale(1.04); } }
.mode {
  position: relative; z-index: 1; align-self: center;
  display: flex; align-items: center; gap: 9px;
  width: calc(100% - 22px); height: 46px; margin-bottom: -8px; padding: 0 10px 8px 8px;
  border: var(--bw) solid var(--ink); border-bottom: 0; border-radius: 15px 15px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 60%), linear-gradient(180deg, var(--panel-3), var(--panel-2));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.12);
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.mode__ico { width: 34px; height: 24px; flex: none; }
.mode__ico svg { width: 100%; height: 100%; display: block; }
.mode__txt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mode__txt small { font: 800 var(--t-small) / 1 var(--f-body); letter-spacing: 0.08em; color: var(--yellow); white-space: nowrap; }
.mode__txt b { font: 400 19px / 1 var(--f-display); letter-spacing: 0.02em; white-space: nowrap; }
.mode__chev { width: 22px; height: 22px; flex: none; }
.mode__chev svg { width: 100%; height: 100%; display: block; }

.btn--play {
  z-index: 2; width: 100%; height: 100px; flex-direction: column; gap: 3px; padding: 0 12px;
  border-width: 3.5px; border-radius: 20px; --sx: 4px; --sy: 8px; overflow: hidden;
  box-shadow: inset 0 -8px 0 rgba(170, 85, 0, 0.22), inset 0 3px 0 rgba(255, 255, 255, 0.65), var(--sx) var(--sy) 0 var(--ink);
}
.btn--play::before { top: 6%; height: 40%; opacity: 0.7; }
.btn--play__row { display: flex; align-items: center; gap: 8px; }
.btn--play__row b { font: 400 52px / 0.86 var(--f-display); letter-spacing: 0.03em; color: var(--ink); text-shadow: 0 2px 0 rgba(255, 255, 255, 0.5); }
.btn--play__row .ico { width: 36px; height: 36px; margin-top: -2px; }
.btn--play__row .ico svg { width: 100%; height: 100%; display: block; }
.btn--play__sub { font: 800 var(--t-small) / 1 var(--f-body); letter-spacing: 0.12em; color: rgba(29, 27, 36, 0.72); }
.btn--play__off { display: none; align-items: center; gap: 7px; font: 800 var(--t-small) / 1.1 var(--f-body); letter-spacing: 0.04em; color: #fff; text-align: left; background: rgba(29, 27, 36, 0.8); border-radius: 10px; padding: 4px 10px 4px 6px; }
.btn--play__off svg { width: 22px; height: 22px; display: block; }
.btn--play .tex { position: absolute; inset: 0; background-image: radial-gradient(rgba(150, 70, 0, 0.22) 1.6px, transparent 2.1px); background-size: 7px 7px; -webkit-mask-image: linear-gradient(160deg, transparent 45%, #000 100%); mask-image: linear-gradient(160deg, transparent 45%, #000 100%); pointer-events: none; }
.btn--play .sheen { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; }
.btn--play .sheen::before { content: ""; position: absolute; top: -30%; bottom: -30%; left: -60%; width: 32%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.8) 45%, transparent 75%); transform: skewX(-20deg); animation: sheen 3.8s ease-in-out infinite; }
@keyframes sheen { 0%, 64% { left: -60%; } 100% { left: 135%; } }
.kbd { display: none; position: absolute; z-index: 3; left: -10px; bottom: -4px; font: 800 12px / 1 var(--f-body); letter-spacing: 0.06em; color: var(--ink); background: #FFF6E0; border: 2.5px solid var(--ink); border-bottom-width: 4px; border-radius: 7px; padding: 4px 6px 3px; transform: rotate(-6deg); box-shadow: 1px 2px 0 rgba(29, 27, 36, 0.5); }

/* ------------------------------------------------------------------ 10. rarity cards */
.card {
  --rc: var(--common); --rc-hi: var(--common-hi); --rc-lo: var(--common-lo);
  position: relative; display: flex; flex-direction: column;
  width: 118px; height: 156px; overflow: hidden;
  border: var(--bw) solid var(--ink); border-radius: 14px;
  background: radial-gradient(110% 75% at 50% 30%, var(--rc-hi), var(--rc) 50%, var(--rc-lo) 100%);
  box-shadow: var(--hard);
  isolation: isolate;
}
.card::before { content: ""; position: absolute; inset: 4px 4px 34px; border-radius: 9px; border: 2px solid rgba(255, 255, 255, 0.45); box-shadow: inset 0 0 0 2px rgba(29, 27, 36, 0.12); pointer-events: none; z-index: 2; }
.card__art { position: relative; flex: 1; display: grid; place-items: start center; padding-top: 6px; overflow: hidden; z-index: 1; }
.ava__img .fig { width: 100%; height: 100%; }
.card__art .fig { width: 88px !important; height: 88px !important; }
.card__name { position: absolute; z-index: 3; left: 0; right: 0; bottom: 36px; text-align: center; font: 400 15px / 1 var(--f-display); letter-spacing: 0.03em; }
.card__rib { position: relative; z-index: 3; height: 31px; display: grid; place-items: center; border-top: var(--bw) solid var(--ink); background: linear-gradient(180deg, var(--rc), var(--rc-lo)); font: 400 15px / 1 var(--f-display); letter-spacing: 0.06em; }
.card[data-r="rare"] { --rc: var(--rare); --rc-hi: var(--rare-hi); --rc-lo: var(--rare-lo); }
.card[data-r="epic"] { --rc: var(--epic); --rc-hi: var(--epic-hi); --rc-lo: var(--epic-lo); }
.card[data-r="legendary"] { --rc: var(--legend); --rc-hi: var(--legend-hi); --rc-lo: var(--legend-lo); }
.card[data-r="epic"] .card__art { background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.09) 0 7px, transparent 7px 14px); }
.card[data-r="legendary"] .card__art::before { content: ""; position: absolute; left: 50%; top: 42%; width: 260px; height: 260px; margin: -130px 0 0 -130px; background: repeating-conic-gradient(rgba(255, 255, 255, 0.32) 0 9deg, transparent 9deg 22.5deg); border-radius: 50%; -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 62%); mask-image: radial-gradient(circle, #000 20%, transparent 62%); animation: spin 14s linear infinite; }
.card[data-r="legendary"]::after { content: ""; position: absolute; z-index: 4; top: -20%; bottom: -20%; left: -70%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.7) 50%, transparent); transform: skewX(-18deg); animation: sheen 3.2s ease-in-out infinite; pointer-events: none; }
.card[data-r="legendary"] { box-shadow: 0 0 0 0 transparent, var(--hard), 0 0 22px 2px rgba(255, 178, 31, 0.55); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ 11. tab bar */
.tabs {
  position: absolute; z-index: 20; left: 0; right: 0; bottom: 0;
  height: calc(var(--tabh) + var(--sb));
  padding: 0 calc(var(--sr) + 8px) var(--sb) calc(var(--sl) + 8px);
  display: flex; align-items: stretch;
  border-top: var(--bw) solid var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 38%),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.022) 0 6px, transparent 6px 12px),
    linear-gradient(180deg, #2E2948, var(--panel) 72%, #171424);
  box-shadow: 0 -4px 0 rgba(29, 27, 36, 0.28), inset 0 2px 0 rgba(255, 255, 255, 0.08);
}
.tab {
  position: relative; z-index: 1; flex: 1 1 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  padding: 2px 0 1px; border: 0; background: none; cursor: pointer; color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.tab + .tab::before { content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: rgba(0, 0, 0, 0.4); box-shadow: 1px 0 0 rgba(255, 255, 255, 0.06); transition: opacity 0.2s; }
.tab.is-on::before, .tab.is-on + .tab::before { opacity: 0; }
.tab__ico { position: relative; width: 34px; height: 34px; transition: transform 0.5s var(--spring), filter 0.3s; filter: saturate(0.7) brightness(0.9); }
.tab__ico > svg { width: 100%; height: 100%; display: block; }
.tab__lbl { font: 400 14px / 1 var(--f-display); letter-spacing: 0.04em; color: var(--cream-2); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; transition: color 0.2s, transform 0.5s var(--spring); }
.tab.is-on .tab__ico { transform: translateY(-11px) scale(1.24); filter: drop-shadow(1px 2px 0 rgba(29, 27, 36, 0.45)); }
.tab.is-on .tab__lbl { color: var(--ink); -webkit-text-stroke: 0; transform: translateY(-6px); }
.tab .badge { top: -5px; right: -13px; }
.tab.is-on .badge { transform: scale(0.75); }
.tabs__ind {
  position: absolute; z-index: 0; left: 0; top: -13px; bottom: calc(var(--sb) + 3px);
  width: var(--iw, 0px); transform: translateX(var(--ix, 0px));
  border: var(--bw) solid var(--ink); border-radius: 16px 16px 12px 12px;
  background: linear-gradient(180deg, var(--yellow-hi), var(--yellow) 42%, var(--yellow-lo));
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.65), inset 0 -4px 0 rgba(150, 80, 0, 0.2), 2px 4px 0 var(--ink);
  transition: transform 0.5s var(--spring), width 0.5s var(--spring);
}
.tabs__ind::before { content: ""; position: absolute; left: 6%; right: 6%; top: 5px; height: 34%; border-radius: 10px 10px 40% 40%; background: var(--gloss); opacity: 0.6; }
.tabs__ind::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background-image: radial-gradient(rgba(150, 70, 0, 0.2) 1.3px, transparent 1.8px); background-size: 6px 6px; -webkit-mask-image: linear-gradient(transparent 40%, #000); mask-image: linear-gradient(transparent 40%, #000); }
.tabs.no-anim .tabs__ind { transition: none; }

/* ------------------------------------------------------------------ 12. XP bar */
.xp { position: relative; display: flex; align-items: center; height: 30px; }
.xp__lv {
  position: relative; z-index: 2; flex: none; width: 40px; height: 40px; margin-right: -14px;
  display: grid; place-items: center;
  font: 400 19px / 1 var(--f-display); color: var(--ink);
  border: var(--bw) solid var(--ink); border-radius: 12px; transform: rotate(45deg);
  background: linear-gradient(135deg, var(--yellow-hi), var(--yellow) 50%, var(--yellow-lo));
  box-shadow: 2px 3px 0 var(--ink);
}
.xp__lv span { transform: rotate(-45deg); }
.xp__track { position: relative; flex: 1; height: 26px; overflow: hidden; border: var(--bw) solid var(--ink); border-radius: 999px; background: #14111F; box-shadow: inset 0 4px 0 rgba(0, 0, 0, 0.45), var(--hard-sm); }
.xp__fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--v, 0) * 100%); min-width: 0;
  border-right: var(--bw) solid var(--ink); border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, #FFF0A6, var(--yellow) 42%, #F59B00);
  transition: width 1.3s var(--out);
}
.xp__fill::before { content: ""; position: absolute; left: 8px; right: 6px; top: 3px; height: 30%; border-radius: 99px; background: rgba(255, 255, 255, 0.6); }
.xp__fill::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.28) 0 7px, transparent 7px 14px); background-size: 20px 20px; animation: stripes 0.9s linear infinite; border-radius: inherit; }
@keyframes stripes { to { background-position: 20px 0; } }
.xp__txt { position: absolute; inset: 0; display: grid; place-items: center; padding-left: 14px; font: 400 15px / 1 var(--f-display); letter-spacing: 0.04em; }

/* ------------------------------------------------------------------ 13. toast, sheet, emote bubble */
.toast {
  position: absolute; z-index: 30; left: 50%; top: 60px;
  display: flex; align-items: center; gap: 12px;
  padding: 7px 8px 7px 7px; width: max-content;
  border: var(--bw) solid var(--ink); border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), transparent 55%), linear-gradient(180deg, var(--panel-3), var(--panel-2));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.12), var(--hard), 0 0 0 5px rgba(255, 210, 63, 0.0);
  transform: translateX(-50%);
}
.toast::before { content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); }
.toast::after { content: ""; position: absolute; left: 14px; bottom: 4px; height: 3px; width: calc(100% - 28px); border-radius: 3px; background: var(--yellow); transform-origin: left; animation: toast-timer 4.5s linear forwards; }
@keyframes toast-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.toast.is-in { animation: toast-in 0.6s var(--spring) both; }
@keyframes toast-in { 0% { transform: translate(-50%, -40px) scale(0.85); opacity: 0; } 100% { transform: translate(-50%, 0) scale(1); opacity: 1; } }
.toast--tr { left: auto; right: calc(var(--sr) + 8px); top: 58px; transform: none; }
.toast--tr.is-in { animation-name: toast-in-tr; }
@keyframes toast-in-tr { 0% { transform: translateX(60px) scale(0.9); opacity: 0; } 100% { transform: none; opacity: 1; } }
.toast--static { position: relative; left: auto; top: auto; width: 100%; max-width: 440px; transform: none; }
.toast--static.is-in { animation-name: toast-in-static; }
.toast--static .toast__body { flex: 1; min-width: 0; }
@keyframes toast-in-static { 0% { transform: translateY(-24px) scale(0.9); opacity: 0; } 100% { transform: none; opacity: 1; } }
.toast__ico { position: relative; width: 52px; height: 52px; flex: none; display: grid; place-items: center; border: var(--bw) solid var(--ink); border-radius: 13px; background: radial-gradient(circle at 50% 35%, #FFF3B0, var(--yellow) 55%, var(--yellow-lo)); box-shadow: inset 0 -4px 0 rgba(150, 80, 0, 0.25); overflow: hidden; }
.toast__ico::before { content: ""; position: absolute; inset: -20px; background: repeating-conic-gradient(rgba(255, 255, 255, 0.45) 0 12deg, transparent 12deg 30deg); animation: spin 8s linear infinite; }
.toast__ico svg { position: relative; width: 40px; height: 40px; }
.toast__body { display: flex; flex-direction: column; gap: 4px; padding-right: 4px; }
.toast__t { font: 400 20px / 1 var(--f-display); letter-spacing: 0.02em; }
.toast__s { font: 800 var(--t-small) / 1 var(--f-body); letter-spacing: 0.05em; color: var(--cream-2); text-transform: uppercase; }
.toast__rw { display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 12px 0 6px; border: var(--bw) solid var(--ink); border-radius: 12px; background: linear-gradient(180deg, #7BEFA5, var(--green) 50%, #0F9442); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 2px 3px 0 var(--ink); }
.toast__rw svg { width: 28px; height: 28px; display: block; }
.toast__rw b { font: 400 20px / 1 var(--f-display); }

.sheet-wrap { position: absolute; inset: 0; z-index: 40; display: none; }
.sheet-wrap.is-open { display: block; }
.sheet-dim { position: absolute; inset: 0; background: radial-gradient(70% 80% at 50% 50%, rgba(18, 15, 32, 0.62), rgba(12, 10, 22, 0.88)); animation: fade 0.25s ease both; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: absolute; left: 50%; top: 52%; width: min(640px, calc(100% - 40px));
  padding: 38px 20px 20px;
  border: var(--bw) solid var(--ink); border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 40%),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.025) 0 6px, transparent 6px 12px),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.1), 4px 8px 0 var(--ink);
  transform: translate(-50%, -50%);
  animation: sheet-in 0.5s var(--spring) both;
}
@keyframes sheet-in { from { transform: translate(-50%, -36%) scale(0.9); opacity: 0; } }
.sheet__title {
  position: absolute; left: 50%; top: -24px; transform: translateX(-50%);
  height: 46px; padding: 0 34px; display: grid; place-items: center;
  font: 400 var(--t-title) / 1 var(--f-display); letter-spacing: 0.03em; color: var(--ink); white-space: nowrap;
  background: linear-gradient(180deg, var(--yellow-hi), var(--yellow) 50%, var(--yellow-lo));
  border: var(--bw) solid var(--ink);
  clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 50%, 100% 100%, 0 100%, 14px 50%);
  filter: drop-shadow(2px 4px 0 var(--ink));
}
.sheet__ribbon { position: absolute; left: 50%; top: -24px; transform: translateX(-50%); filter: drop-shadow(2px 4px 0 var(--ink)); }
.sheet__ribbon span {
  display: grid; place-items: center; height: 46px; padding: 0 40px;
  font: 400 var(--t-title) / 1 var(--f-display); letter-spacing: 0.03em; color: var(--ink); white-space: nowrap;
  background: linear-gradient(180deg, var(--ink), var(--ink)) padding-box;
  position: relative;
}
.sheet__ribbon span::before { content: ""; position: absolute; inset: 0; background: var(--ink); clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 50%, 100% 100%, 0 100%, 16px 50%); }
.sheet__ribbon span::after { content: ""; position: absolute; inset: 3px 4px; background: linear-gradient(180deg, var(--yellow-hi), var(--yellow) 50%, var(--yellow-lo)); clip-path: polygon(0 0, 100% 0, calc(100% - 13px) 50%, 100% 100%, 0 100%, 13px 50%); }
.sheet__ribbon i { position: relative; z-index: 1; font-style: normal; }
.sheet__x { position: absolute; right: -14px; top: -14px; width: 42px; height: 42px; padding: 0; border-radius: 50%; --a: #FF9AA8; --b: #FF4D63; --c: #D11F3D; }
.sheet__x svg { width: 22px; height: 22px; }

.bubble {
  position: absolute; z-index: 8; pointer-events: none;
  padding: 7px 12px 6px; white-space: nowrap;
  font: 400 19px / 1 var(--f-display); letter-spacing: 0.03em; color: var(--ink);
  background: #fff; border: var(--bw) solid var(--ink); border-radius: 14px;
  box-shadow: 2px 4px 0 var(--ink);
  transform-origin: 20% 120%;
  animation: bubble 1.9s var(--spring) both;
}
.bubble::after { content: ""; position: absolute; left: 14px; bottom: -11px; width: 14px; height: 14px; background: #fff; border-right: var(--bw) solid var(--ink); border-bottom: var(--bw) solid var(--ink); transform: skewX(30deg) rotate(45deg) scale(0.8); }
@keyframes bubble { 0% { transform: scale(0) rotate(-12deg); opacity: 0; } 14% { transform: scale(1.12) rotate(3deg); opacity: 1; } 22% { transform: scale(1) rotate(-2deg); } 84% { transform: scale(1) rotate(-2deg); opacity: 1; } 100% { transform: scale(0.85) translateY(-8px); opacity: 0; } }

/* ------------------------------------------------------------------ 14. banner ad slot (menus only) */
.ad-slot { position: relative; width: 375px; height: 59px; flex: none; }  /* 320 x 50 pt = 375 x 59 units at the iPhone 16's menu scale */
.ad {
  position: absolute; inset: 0; overflow: hidden;
  display: flex; align-items: center; gap: 10px; padding: 0 10px 0 9px;
  font-family: Roboto, Arial, Helvetica, sans-serif; color: #202124;
  background: linear-gradient(180deg, #FFFFFF, #F1F3F4);
  border: 1px solid #C6C9CE;
  box-shadow: 0 0 0 3px rgba(29, 27, 36, 0.9), 2px 5px 0 3px rgba(29, 27, 36, 0.55);
  border-radius: 3px;
}
.ad__badge { position: absolute; left: 50%; top: 0; transform: translateX(-50%); font: 700 11px / 1 Arial, sans-serif; color: #fff; background: #4A4A4A; padding: 2px 8px 3px; border-radius: 0 0 4px 4px; letter-spacing: 0.02em; }
.ad__icon { width: 38px; height: 38px; flex: none; border-radius: 8px; background: linear-gradient(135deg, #34A853, #1A73E8); position: relative; }
.ad__icon::after { content: ""; position: absolute; inset: 10px; border: 3px solid #fff; border-radius: 50%; }
.ad__txt { flex: 1; font: 400 13.5px / 1.2 Roboto, Arial, sans-serif; padding-top: 9px; min-width: 0; }
.ad__txt b { display: block; font-weight: 700; font-size: 14px; }
.ad__cta { flex: none; font: 700 13px / 1 Arial, sans-serif; color: #fff; background: #1A73E8; padding: 9px 14px; border-radius: 4px; letter-spacing: 0.04em; }
.ad__choices { position: absolute; right: 0; top: 0; width: 15px; height: 15px; display: grid; place-items: center; font: 700 10px / 1 Georgia, serif; font-style: italic; color: #fff; background: #00AECD; border-radius: 0 0 0 4px; }

/* ------------------------------------------------------------------ 15. screens + device frames */
.scr {
  --sl: 0px; --sr: 0px; --sb: 0px; --tabh: 54px;
  position: relative; overflow: hidden;
  font-family: var(--f-body); color: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  user-select: none; -webkit-user-select: none;
}
.scr[data-dev="phone"] { --sl: 69px; --sr: 69px; --sb: 25px; }   /* iPhone 16 landscape: 59 / 59 / 21 pt at the 0.853 menu scale */
.scr *, .scr *::before, .scr *::after { box-sizing: border-box; }
:where(.scr) button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
/* the menus' layout box: inside the safe area plus UIKit's 8-unit margin, above the tab bar */
.lay {
  position: absolute; z-index: 5;
  left: calc(var(--sl) + 8px); right: calc(var(--sr) + 8px);
  top: 8px; bottom: calc(var(--sb) + var(--tabh) + 8px);
  display: grid; grid-template-rows: 44px minmax(0, 1fr) 59px; row-gap: 8px;
}
.lay > .topbar { grid-column: 1 / -1; grid-row: 1; }

/* safe-area overlay (page toggle) */
.safe-ov { position: absolute; inset: 0; z-index: 90; pointer-events: none; display: none; }
.show-safe .safe-ov { display: block; }
.safe-ov i { position: absolute; background: repeating-linear-gradient(45deg, rgba(255, 51, 82, 0.34) 0 4px, rgba(255, 51, 82, 0.08) 4px 10px); }
.safe-ov .l { left: 0; top: 0; bottom: 0; width: var(--sl); }
.safe-ov .r { right: 0; top: 0; bottom: 0; width: var(--sr); }
.safe-ov .b { left: var(--sl); right: var(--sr); bottom: 0; height: var(--sb); }
.safe-ov .m { left: calc(var(--sl) + 8px); right: calc(var(--sr) + 8px); top: 8px; bottom: calc(var(--sb) + 8px); background: none; outline: 2px dashed rgba(63, 234, 245, 0.95); outline-offset: 0; }

.dev { position: relative; }
.dev__fit { position: relative; width: 100%; }
.dev__body { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.dev--phone .dev__body {
  width: 1026px; height: 488px; padding: 14px; border-radius: 80px;
  background: linear-gradient(150deg, #5A5A63 0%, #24242A 18%, #0B0B0E 50%, #2A2A31 82%, #5E5E68 100%);
  box-shadow: inset 0 0 0 2px #74747E, inset 0 0 0 5px #0B0B0E, 0 40px 60px -28px rgba(30, 24, 60, 0.55), 0 14px 26px -12px rgba(30, 24, 60, 0.35);
}
.dev--phone .dev__body::before, .dev--phone .dev__body::after { content: ""; position: absolute; background: linear-gradient(180deg, #6B6B75, #2A2A30); border-radius: 3px; }
.dev--phone .dev__body::before { left: 150px; bottom: -4px; width: 120px; height: 5px; box-shadow: 150px 0 0 #3B3B43; }   /* volume (bottom edge) */
.dev--phone .dev__body::after { right: 230px; top: -4px; width: 90px; height: 5px; box-shadow: -300px 0 0 #3B3B43; }        /* power + camera control (top edge) */
.dev--phone .dev__screen { width: 998px; height: 460px; border-radius: 66px; background: #000; isolation: isolate; clip-path: inset(0 round 66px); }
.dev__island { position: absolute; z-index: 60; left: 27px; top: 50%; width: 42px; height: 146px; margin-top: -73px; border-radius: 22px; background: #000; box-shadow: inset 0 0 0 1px #111; }
.dev__island::after { content: ""; position: absolute; left: 50%; top: 20px; width: 13px; height: 13px; margin-left: -6.5px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #2B3550, #0A0D16 60%); }
.dev__home { position: absolute; z-index: 60; left: 50%; bottom: 9px; width: 158px; height: 6px; margin-left: -79px; border-radius: 3px; background: rgba(255, 255, 255, 0.78); }

.dev--desk .dev__body { width: 892px; height: 586px; }
.dev--desk .dev__bezel { position: relative; padding: 16px; border-radius: 18px; background: linear-gradient(180deg, #24232B, #0E0E12); box-shadow: inset 0 0 0 2px #3A3944, 0 24px 40px -22px rgba(30, 24, 60, 0.5); }
.dev--desk .dev__screen { width: 860px; height: 484px; border-radius: 4px; background: #000; isolation: isolate; }
.dev__neck { position: absolute; left: 50%; top: 514px; width: 120px; height: 58px; margin-left: -60px; background: linear-gradient(90deg, #A9A8B3, #E1E0E8 45%, #9796A2); clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%); }
.dev__base { position: absolute; left: 50%; top: 568px; width: 300px; height: 16px; margin-left: -150px; border-radius: 8px 8px 12px 12px; background: linear-gradient(180deg, #ECEBF2, #A5A4B0); box-shadow: 0 10px 18px -8px rgba(30, 24, 60, 0.45); }

.cursor { display: none; position: absolute; z-index: 70; width: 26px; height: 32px; pointer-events: none; filter: drop-shadow(1px 2px 1px rgba(0, 0, 0, 0.4)); }
.scr[data-dev="desk"] .cursor { display: block; }
.scr[data-dev="desk"] .kbd { display: block; }

/* full-size viewer */
.viewer { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: rgba(14, 12, 24, 0.94); }
.viewer__stage { position: relative; }
.viewer__close { position: fixed; z-index: 1001; right: 14px; top: 14px; }

/* ------------------------------------------------------------------ 16. neutral page chrome */
:root {
  --pg-bg: #F3F2EE; --pg-card: #FFFFFF; --pg-ink: #1D1B24; --pg-ink-2: #5E5B6B; --pg-ink-3: #8C899A;
  --pg-rule: #E3E0D8; --pg-good: #1E8A4C; --pg-bad: #C0392F; --pg-tag: #1D1B24;
}
.pg { margin: 0; background: var(--pg-bg); color: var(--pg-ink); font: 400 15.5px / 1.55 var(--f-body); -webkit-font-smoothing: antialiased; color-scheme: light; }
.pg *, .pg *::before, .pg *::after { box-sizing: border-box; }
.pg-wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px 80px; }
.pg-bar { position: sticky; top: 0; z-index: 100; background: rgba(243, 242, 238, 0.9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--pg-rule); }
.pg-bar__in { max-width: 1180px; margin: 0 auto; padding: 9px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.pg-bar__brand { font: 400 17px / 1 var(--f-display); letter-spacing: 0.02em; margin-right: auto; display: flex; align-items: center; gap: 8px; }
.pg-bar__brand i { width: 22px; height: 22px; border-radius: 6px; background: var(--yellow); border: 2px solid var(--ink); box-shadow: 1px 2px 0 var(--ink); display: inline-grid; place-items: center; }
.pg-bar nav { display: flex; gap: 2px; flex-wrap: wrap; }
.pg-bar nav a { color: var(--pg-ink-2); text-decoration: none; font-weight: 500; font-size: 14px; padding: 5px 9px; border-radius: 8px; }
.pg-bar nav a:hover { background: #E8E6E0; color: var(--pg-ink); }
.pg-btn { display: inline-flex; align-items: center; gap: 7px; font: 600 14px / 1 var(--f-body); color: var(--pg-ink); background: var(--pg-card); border: 1px solid #D5D2C9; border-radius: 9px; padding: 8px 12px; cursor: pointer; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04); }
.pg-btn:hover { border-color: #B9B5AA; }
.pg-btn:active { transform: translateY(1px); }
.pg-btn--dark { background: var(--pg-ink); color: #fff; border-color: var(--pg-ink); }
.pg-btn svg { width: 16px; height: 16px; }
.pg-tog { display: inline-flex; align-items: center; gap: 8px; font: 500 14px / 1 var(--f-body); color: var(--pg-ink-2); cursor: pointer; user-select: none; }
.pg-tog input { appearance: none; -webkit-appearance: none; width: 34px; height: 20px; margin: 0; border-radius: 99px; background: #D3D0C7; position: relative; cursor: pointer; transition: background 0.2s; }
.pg-tog input::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
.pg-tog input:checked { background: var(--pg-ink); }
.pg-tog input:checked::after { transform: translateX(14px); }

.pg-head { padding: 44px 0 10px; display: grid; gap: 14px; }
.pg-eyebrow { font: 700 12px / 1 var(--f-body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--pg-ink-3); }
.pg-h1 { margin: 0; font: 400 clamp(36px, 6vw, 58px) / 0.98 var(--f-display); letter-spacing: 0.005em; }
.pg-lede { margin: 0; max-width: 68ch; color: var(--pg-ink-2); font-size: 16.5px; }
.pg-try { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.pg-try span { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 500; color: var(--pg-ink-2); background: var(--pg-card); border: 1px solid var(--pg-rule); border-radius: 99px; padding: 5px 11px 5px 6px; }
.pg-try b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--pg-ink); color: #fff; font-size: 11px; font-weight: 700; }

.pg-sec { padding-top: 52px; scroll-margin-top: 56px; }
.pg-sec__head { display: grid; gap: 6px; margin-bottom: 20px; }
.pg-sec__num { font: 700 12px / 1 var(--f-body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--pg-ink-3); }
.pg-h2 { margin: 0; font: 400 clamp(26px, 3.6vw, 36px) / 1.05 var(--f-display); letter-spacing: 0.01em; }
.pg-sec__sub { margin: 0; color: var(--pg-ink-2); max-width: 72ch; }
.pg-h3 { margin: 0; font: 400 26px / 1.05 var(--f-display); letter-spacing: 0.01em; }
.pg-card { background: var(--pg-card); border: 1px solid var(--pg-rule); border-radius: 14px; padding: 16px; }
.pg-label { font: 700 11.5px / 1 var(--f-body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--pg-ink-3); }
.pg-note { font-size: 13.5px; color: var(--pg-ink-2); line-height: 1.45; }
.pg-tag { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 11px; background: var(--yellow); border: 2.5px solid var(--ink); box-shadow: 2px 3px 0 var(--ink); font: 400 24px / 1 var(--f-display); color: var(--ink); }
.pg-rec { display: inline-flex; align-items: center; gap: 6px; font: 700 11.5px / 1 var(--f-body); letter-spacing: 0.1em; text-transform: uppercase; color: #fff; background: var(--pg-good); border-radius: 99px; padding: 5px 10px; }
.pg-pc { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; }
.pg-pc ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 5px; font-size: 14.5px; line-height: 1.45; }
.pg-pc .plus li::marker { content: "+  "; color: var(--pg-good); font-weight: 800; }
.pg-pc .minus li::marker { content: "\2212  "; color: var(--pg-bad); font-weight: 800; }
.pg-cap { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 12.5px; color: var(--pg-ink-3); }
.pg-cap button { font: 600 12.5px / 1 var(--f-body); color: var(--pg-ink-2); background: none; border: 1px solid var(--pg-rule); border-radius: 7px; padding: 5px 8px; cursor: pointer; }
.pg-cap button:hover { color: var(--pg-ink); border-color: #C9C5BA; }
.pg-foot { margin-top: 64px; padding-top: 22px; border-top: 1px solid var(--pg-rule); color: var(--pg-ink-3); font-size: 13.5px; }

@media (max-width: 760px) {
  .pg { font-size: 15px; }
  .pg-wrap, .pg-bar__in { padding-left: 16px; padding-right: 16px; }
  .pg-pc { grid-template-columns: 1fr; }
  .pg-head { padding-top: 28px; }
  .pg-sec { padding-top: 40px; }
}

/* ------------------------------------------------------------------ 17. motion */
@media (prefers-reduced-motion: reduce) {
  .scr *, .scr *::before, .scr *::after, .pg-kit *, .pg-kit *::before, .pg-kit *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
}
.rm .scr *, .rm .scr *::before, .rm .scr *::after, .rm .pg-kit *, .rm .pg-kit *::before, .rm .pg-kit *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }

/* ------------------------------------------------------------------ 18. fighters + crowd (drawn by kit.js) */
.fig { position: relative; display: block; -webkit-tap-highlight-color: transparent; }
.fig__svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fig__aura { transform-box: fill-box; transform-origin: center; animation: aura 2.2s ease-in-out infinite alternate; }
@keyframes aura { from { opacity: 0.65; transform: scale(0.94); } to { opacity: 1; transform: scale(1.06); } }
.crowd__svg { display: block; width: 100%; height: 100%; }
.crowd__bob { animation: crowd-bob 1.2s ease-in-out infinite alternate; }
.crowd__arm { animation: crowd-arm 1.5s ease-in-out infinite alternate; }
@keyframes crowd-bob { to { transform: translateY(-3px); } }
@keyframes crowd-arm { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }
.arena__svg { display: block; width: 100%; height: 100%; }

/* =====================================================================================================
   19. COMIC SPLASH pieces (01c and later pages): paper, slanted ink panels, rays, halftone, shouted words,
   speech + caption boxes, tape, bursts, comic badges, stickers for the top bar, comic tab bars, the slam entrance.
   ===================================================================================================== */
:root {
  --paper: #FFF4DA; --paper-2: #F7E4BD; --paper-dot: rgba(120, 72, 20, 0.11);
  --lean: 0.075;   /* every vertical panel edge leans "/" by this fraction of the panel's height */
  --burst: polygon(50% 0%, 61.3% 15.4%, 79.7% 9.1%, 81.3% 27.3%, 97.6% 34.5%, 86.8% 50%, 97.4% 65.4%, 79.5% 71.4%, 80.7% 92.2%, 62.2% 87.5%, 50% 100%, 38.5% 85.4%, 19.4% 92.1%, 19% 72.5%, 0.6% 66%, 10.7% 50%, 2.4% 34.5%, 19.5% 27.9%, 20.3% 9.1%, 38.3% 14.1%);
}

/* paper: calm cream, halftone only near the edges */
.paper { position: absolute; inset: 0; background: radial-gradient(120% 95% at 50% 45%, var(--paper) 55%, var(--paper-2) 100%); }
.paper::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(var(--paper-dot) 1.25px, transparent 1.7px); background-size: 7px 7px; -webkit-mask-image: radial-gradient(75% 85% at 50% 45%, transparent 45%, #000 100%); mask-image: radial-gradient(75% 85% at 50% 45%, transparent 45%, #000 100%); }
.paper::after { content: ""; position: absolute; inset: 0; opacity: 0.35; background: repeating-linear-gradient(0deg, rgba(150, 110, 60, 0.05) 0 1px, transparent 1px 3px); mix-blend-mode: multiply; pointer-events: none; }

/* slanted ink panel: <x class="cp" style="--lt:..;--rb:.."><i class="cp__ink"></i><span class="cp__in">..</span></x>
   --lt/--lb/--rt/--rb move the left-top / left-bottom / right-top / right-bottom corners inward, as a fraction of the panel's HEIGHT,
   so every panel's edges lean at the same angle whatever its size */
.cp {
  container-type: size; position: relative; display: block; min-width: 0; min-height: 0;
  margin: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left;
  --poly: polygon(calc(var(--lt, 0) * 100cqh) 0, calc(100% - var(--rt, 0) * 100cqh) 0, calc(100% - var(--rb, 0) * 100cqh) 100%, calc(var(--lb, 0) * 100cqh) 100%);
  filter: drop-shadow(3px 5px 0 var(--ink));
  transition: transform 0.1s ease, filter 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}
.cp__ink { position: absolute; inset: 0; background: var(--ink); clip-path: var(--poly); }
.cp__in { position: absolute; inset: 3.5px; overflow: hidden; clip-path: var(--poly); background: var(--cp-bg, #fff); }
.cp__top { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
button.cp, .cp[role="button"] { cursor: pointer; }
.cp.is-down { transform: translate(1px, 3px) scale(0.985); filter: drop-shadow(1px 2px 0 var(--ink)); }
.cp.is-pop { animation: cp-pop 0.42s var(--spring); }
@keyframes cp-pop { 0% { transform: translate(1px, 3px) scale(0.97); } 45% { transform: scale(1.025) rotate(-0.4deg); } 100% { transform: none; } }

.rays { position: absolute; left: var(--rx, 50%); top: var(--ry, 50%); width: 1100px; height: 1100px; margin: -550px 0 0 -550px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(var(--ray, rgba(255, 255, 255, 0.2)) 0 6.5deg, transparent 6.5deg 17deg);
  -webkit-mask-image: radial-gradient(circle, #000 5%, transparent var(--ray-fade, 48%)); mask-image: radial-gradient(circle, #000 5%, transparent var(--ray-fade, 48%));
  animation: spin 50s linear infinite; }
.ht { position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(var(--dot, rgba(255, 255, 255, 0.14)) var(--dot-r, 1.5px), transparent calc(var(--dot-r, 1.5px) + 0.5px)); background-size: var(--dot-s, 7px) var(--dot-s, 7px);
  -webkit-mask-image: var(--ht-mask, linear-gradient(200deg, transparent 30%, #000 95%)); mask-image: var(--ht-mask, linear-gradient(200deg, transparent 30%, #000 95%)); }
.speed { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(var(--sp-a, -62deg), transparent 0 22px, var(--sp-c, rgba(255, 255, 255, 0.16)) 22px 24px); -webkit-mask-image: linear-gradient(90deg, #000, transparent 32%); mask-image: linear-gradient(90deg, #000, transparent 32%); }

/* shouted words */
.sfx { display: inline-block; font: 400 var(--sfx, 56px) / 1 var(--f-display); letter-spacing: 0.02em; white-space: nowrap; color: #fff; -webkit-text-stroke: calc(var(--sfx, 56px) * 0.12) var(--ink); paint-order: stroke fill; text-shadow: calc(var(--sfx, 56px) * 0.06) calc(var(--sfx, 56px) * 0.08) 0 var(--ink); transform: rotate(var(--rot, -6deg)); }
.sfx--y { color: var(--yellow); }
.sfx--p { color: var(--pink); }
.action { position: absolute; z-index: 30; pointer-events: none; display: grid; place-items: center; translate: -50% -50%; rotate: var(--r, -8deg); animation: action-pop 1.15s var(--spring) both; }
.action__burst { position: absolute; width: calc(100% + 30px); height: calc(100% + 46px); background: var(--ink); clip-path: var(--burst); }
.action__burst::after { content: ""; position: absolute; inset: 4px; background: radial-gradient(circle at 50% 45%, #FFF7C2, var(--yellow) 55%, #FFB21F); clip-path: var(--burst); }
.action b { position: relative; font: 400 30px / 1 var(--f-display); letter-spacing: 0.02em; color: #fff; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; text-shadow: 2px 3px 0 var(--ink); white-space: nowrap; padding: 0 6px; }
@keyframes action-pop { 0% { scale: 0.2; opacity: 0; } 16% { scale: 1.3; opacity: 1; } 28% { scale: 0.94; } 40% { scale: 1.04; } 78% { scale: 1; opacity: 1; translate: -50% -50%; } 100% { scale: 1.08; opacity: 0; translate: -50% -70%; } }

/* speech + caption boxes */
.speech { position: absolute; z-index: 8; padding: 8px 13px 7px; font: 400 17px / 1.05 var(--f-display); letter-spacing: 0.03em; color: var(--ink); text-align: center; background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: 3px 4px 0 var(--ink); }
.speech::before { content: ""; position: absolute; top: 100%; left: var(--tail, 26px); width: 24px; height: 19px; margin-top: 0; background: var(--ink); clip-path: polygon(0 0, 100% 0, 6% 100%); }
.speech::after { content: ""; position: absolute; top: 100%; left: calc(var(--tail, 26px) + 4px); width: 15px; height: 12px; margin-top: -3px; background: #fff; clip-path: polygon(0 0, 100% 0, 4% 100%); }
.speech--r::before { left: auto; right: var(--tail, 26px); clip-path: polygon(0 0, 100% 0, 94% 100%); }
.speech--r::after { left: auto; right: calc(var(--tail, 26px) + 4px); clip-path: polygon(0 0, 100% 0, 96% 100%); }
.caption { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px 5px; font: 400 16px / 1 var(--f-display); letter-spacing: 0.03em; color: var(--ink); background: #FFF6E0; border: 3px solid var(--ink); box-shadow: 3px 4px 0 var(--ink); transform: rotate(var(--rot, -2deg)); white-space: nowrap; }
.caption--y { background: var(--yellow); }
.caption--k { background: var(--ink); color: #fff; box-shadow: 3px 4px 0 rgba(29, 27, 36, 0.35); }
.caption small { font: 800 12px / 1 var(--f-body); letter-spacing: 0.08em; color: rgba(29, 27, 36, 0.62); }
.tape { position: absolute; width: 46px; height: 16px; background: rgba(255, 239, 190, 0.82); border-left: 2px dashed rgba(170, 130, 60, 0.35); border-right: 2px dashed rgba(170, 130, 60, 0.35); box-shadow: 0 1px 2px rgba(80, 50, 10, 0.25); transform: rotate(var(--rot, -32deg)); z-index: 3; }

/* bursts: jagged ink-outlined stars (NEW!, VS!, impact) */
.burst { position: absolute; display: grid; place-items: center; width: var(--bs, 60px); aspect-ratio: 1.25; background: var(--ink); clip-path: var(--burst); }
.burst::before { content: ""; position: absolute; inset: 3px; background: var(--burst-fill, radial-gradient(circle at 50% 45%, #FFF7C2, var(--yellow) 55%, #FFB21F)); clip-path: var(--burst); }
.burst b { position: relative; font: 400 calc(var(--bs, 60px) * 0.27) / 1 var(--f-display); color: var(--ink); letter-spacing: 0.02em; transform: rotate(-8deg); }

/* comic badges: number / "!" bubbles */
.cbadge { position: absolute; z-index: 4; top: -9px; right: -14px; min-width: 24px; height: 23px; padding: 0 6px; display: grid; place-items: center; font: 400 15px / 1 var(--f-display); color: #fff; background: var(--alert); border: 2.5px solid var(--ink); border-radius: 12px 12px 12px 3px; box-shadow: 2px 2px 0 var(--ink); transform: rotate(8deg); }
.cbadge--bang { background: #fff; color: var(--alert); font-size: 17px; min-width: 22px; padding: 0; }
.cbadge.is-new { animation: badge-pop 0.6s var(--spring) both; }
.burst.is-new { animation: new-pop 0.7s var(--spring) both, new-wobble 1.6s 0.7s ease-in-out infinite; }
@keyframes new-pop { 0% { scale: 0; rotate: -40deg; } 70% { scale: 1.2; rotate: 6deg; } 100% { scale: 1; rotate: 0deg; } }
@keyframes new-wobble { 50% { scale: 1.1; rotate: -6deg; } }

/* slam entrance: add .slam to a screen; children with data-slam (no transform of their own) slam in, staggered by --i */
.slam [data-slam] { animation: slam 0.42s cubic-bezier(0.2, 1.45, 0.45, 1) backwards; animation-delay: calc(var(--i, 0) * 46ms); }
@keyframes slam { 0% { opacity: 0; transform: translate(var(--sx, 0px), var(--sy, -22px)) scale(1.3) rotate(var(--sr, -3deg)); } 55% { opacity: 1; transform: scale(0.95) rotate(0.6deg); } 100% { opacity: 1; transform: none; } }
.slam .slam-shake { animation: slam-shake 0.26s 0.3s ease-out; }
@keyframes slam-shake { 20% { transform: translate(-4px, 3px); } 40% { transform: translate(4px, -2px); } 60% { transform: translate(-2px, 2px); } 80% { transform: translate(1px, -1px); } }
.thwack { position: absolute; z-index: 25; pointer-events: none; width: 150px; aspect-ratio: 1.25; translate: -50% -50%; background: var(--ink); clip-path: var(--burst); animation: thwack 0.5s ease-out both; }
.thwack b { position: absolute; inset: 0; display: grid; place-items: center; font: 400 26px / 1 var(--f-display); color: #fff; letter-spacing: 0.04em; transform: rotate(-10deg); }
@keyframes thwack { 0% { scale: 0.3; opacity: 0; } 25% { scale: 1.08; opacity: 1; } 60% { scale: 1; opacity: 1; } 100% { scale: 1.25; opacity: 0; } }

/* comic stickers for the top bar */
.cchip { position: relative; display: flex; align-items: center; gap: 9px; height: 48px; padding: 0 15px 0 0; margin-left: 4px; border: 3px solid var(--ink); border-radius: 12px; background: #FFF6E0; box-shadow: 3px 4px 0 var(--ink); transform: rotate(-1.5deg); cursor: pointer; font: inherit; color: var(--ink); }
.cchip .ava { margin: -6px 0 -6px -8px; transform: rotate(1.5deg); box-shadow: 2px 3px 0 var(--ink); }
.cchip__name { font: 400 19px / 1 var(--f-display); letter-spacing: 0.02em; color: var(--ink); }
.cchip__meta { display: flex; align-items: center; gap: 5px; font: 800 var(--t-small) / 1 var(--f-body); letter-spacing: 0.05em; color: rgba(29, 27, 36, 0.7); }
.cpill { position: relative; display: inline-flex; align-items: center; height: 36px; min-width: 100px; margin-left: 20px; padding: 0 12px 0 28px; border: 3px solid var(--ink); border-radius: 999px; background: #FFF6E0; box-shadow: 2px 4px 0 var(--ink); transform: rotate(var(--rot, 1.2deg)); }
.cpill .pill__ico { left: -20px; }
.cpill .pill__num { color: var(--ink); -webkit-text-stroke: 0; text-shadow: none; }
.cpill .pill__plus { transform: rotate(-6deg); box-shadow: 1px 2px 0 var(--ink); }
.cpill.is-bump { animation: pill-bump 0.32s var(--spring); }
.cgear { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border: 3px solid var(--ink); border-radius: 50%; background: var(--yellow); box-shadow: 2px 4px 0 var(--ink); cursor: pointer; transform: rotate(-8deg); }
.cgear svg { width: 30px; height: 30px; display: block; }
.cgear.is-down, .cchip.is-down, .pill__plus.is-down { transform: translate(1px, 3px) scale(0.96); box-shadow: 0 1px 0 var(--ink); }

/* comic tab bar, variant (a): a strip of slanted panels; the active one is a burst panel that pops up */
.ctabs { position: absolute; z-index: 20; left: 0; right: 0; bottom: 0; height: calc(var(--tabh) + var(--sb)); padding: 0 calc(var(--sr) + 8px) var(--sb) calc(var(--sl) + 8px); display: flex; gap: 8px; align-items: stretch; }
.ctabs--a { padding-top: 4px; padding-bottom: calc(var(--sb) + 3px); }
.ctabs--a::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--sb) + 26px); background: linear-gradient(180deg, transparent, rgba(247, 228, 189, 0.9) 40%); pointer-events: none; }
.ctab { position: relative; flex: 1 1 0; min-width: 0; border: 0; padding: 0; background: none; cursor: pointer; color: var(--ink); -webkit-tap-highlight-color: transparent; }
.ctabs--a .ctab { --lt: var(--lean); --rb: var(--lean); }
.ctab .cp { position: absolute; inset: 0; --cp-bg: #FFF6E0; }
.ctab__c { position: absolute; inset: 0 0 3px; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; pointer-events: none; }
.ctab__ico { position: relative; width: 28px; height: 28px; transition: transform 0.45s var(--spring); }
.ctab__ico > svg { width: 100%; height: 100%; display: block; }
.ctab__lbl { font: 400 14px / 1 var(--f-display); letter-spacing: 0.05em; color: var(--ink); }
.ctabs--a .ctab.is-on { flex-grow: 1.25; z-index: 2; }
.ctabs--a .ctab.is-on .cp { inset: -14px -4px 0; --cp-bg: radial-gradient(circle at 50% 40%, #FFF3A6, var(--yellow) 55%, #FFAE1A); }
.ctabs--a .ctab.is-on .cp .rays { --ray: rgba(255, 255, 255, 0.5); --ray-fade: 40%; }
.ctabs--a .ctab:not(.is-on) .cp .rays { display: none; }
.ctabs--a .ctab.is-on .ctab__c { top: -14px; }
.ctabs--a .ctab.is-on .ctab__ico { transform: scale(1.35) translateY(-3px) rotate(-6deg); }
.ctabs--a .ctab.is-on .ctab__lbl { font-size: 16px; }
.ctab.is-tap .cp, .ctab.is-tap .ctab__c { animation: tab-slam 0.45s var(--spring); }
@keyframes tab-slam { 0% { transform: scale(0.8) rotate(-4deg); } 55% { transform: scale(1.1) rotate(2deg); } 100% { transform: none; } }

/* comic tab bar, variant (b): torn paper strip; the active tab gets a sunburst and a bold inked label */
.ctabs--b { gap: 0; height: calc(var(--tabh) + var(--sb) + 6px);
  --torn: polygon(0 9px, 3% 4px, 6% 10px, 9% 3px, 12% 8px, 15% 2px, 19% 9px, 22% 4px, 25% 10px, 28% 3px, 32% 8px, 35% 1px, 38% 9px, 42% 4px, 45% 10px, 48% 2px, 52% 8px, 55% 3px, 58% 10px, 62% 4px, 65% 9px, 68% 2px, 72% 8px, 75% 4px, 78% 10px, 82% 3px, 85% 9px, 88% 2px, 92% 8px, 95% 4px, 98% 10px, 100% 5px, 100% 100%, 0 100%); }
.ctabs--b::before { content: ""; position: absolute; inset: -3px 0 0; background: var(--ink); clip-path: var(--torn); }
.ctabs--b::after { content: ""; position: absolute; inset: 0; clip-path: var(--torn); background: repeating-linear-gradient(0deg, rgba(150, 110, 60, 0.06) 0 1px, transparent 1px 4px), linear-gradient(180deg, #FFFDF4, #FBEFD2); }
.ctabs--b > * { z-index: 1; }
.ctabs--b .ctab { margin-top: 10px; }
.ctabs--b .ctab + .ctab::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 8px; width: 2.5px; background: var(--ink); opacity: 0.18; transform: rotate(8deg); }
.ctabs--b .ctab__burst { position: absolute; left: 50%; top: 46%; width: 64px; aspect-ratio: 1.15; translate: -50% -50%; scale: 0; background: var(--ink); clip-path: var(--burst); transition: scale 0.4s var(--spring); }
.ctabs--b .ctab__burst::before { content: ""; position: absolute; inset: 3px; background: radial-gradient(circle at 50% 45%, #FFF7C2, var(--yellow) 55%, #FFB21F); clip-path: var(--burst); }
.ctabs--b .ctab.is-on .ctab__burst { scale: 1; animation: spin 18s linear infinite; }
.ctabs--b .ctab.is-on .ctab__ico { transform: scale(1.18) translateY(-3px); }
.ctabs--b .ctab__lbl { color: rgba(29, 27, 36, 0.62); transition: color 0.2s; }
.ctabs--b .ctab.is-on .ctab__lbl { color: var(--ink); font-size: 15px; background: var(--yellow); padding: 2px 5px 1px; border: 2px solid var(--ink); transform: rotate(-3deg); box-shadow: 2px 2px 0 var(--ink); }
.ctab .cbadge { top: -8px; right: -16px; }
.ctab .burst { top: -16px; right: -26px; --bs: 44px; z-index: 4; }

/* iPad 12.9" (4:3) landscape: 1366 x 1024 pt; the menus' scale gives 860 x 645 units; home indicator 20 pt */
.dev--ipad .dev__body { width: 908px; height: 693px; padding: 24px; border-radius: 46px; background: linear-gradient(150deg, #4C4C55 0%, #1E1E24 20%, #0B0B0E 55%, #2A2A31 85%, #57575F 100%); box-shadow: inset 0 0 0 2px #6E6E78, inset 0 0 0 5px #0B0B0E, 0 40px 60px -28px rgba(30, 24, 60, 0.55), 0 14px 26px -12px rgba(30, 24, 60, 0.35); }
.dev--ipad .dev__screen { width: 860px; height: 645px; border-radius: 22px; background: #000; isolation: isolate; }
.dev__cam { position: absolute; left: 50%; top: 9px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #2B3550, #07090F 65%); }
.scr[data-dev="ipad"] { --sb: 13px; }
.scr[data-dev="ipad"] .dev__home, .dev--ipad .dev__home { width: 150px; margin-left: -75px; bottom: 5px; }

/* ------------------------------------------------------------------ 20. comic Home base + Wi-Fi pieces (01d and later) */
.scr:not(.st-navb) .ctabs--b { display: none; }
.scr.st-navb .ctabs--a { display: none; }
.ctab .burst { display: none; }
.cad { position: relative; display: flex; align-items: end; justify-content: flex-start; padding-left: 9px; }
.cad .ad-slot { box-shadow: 0 0 0 5px #FFF6E0, 0 0 0 8px var(--ink), 4px 7px 0 8px var(--ink); }
.cad .ad { box-shadow: none; border-radius: 0; }
.cad .tape { top: 50%; margin-top: -20px; width: 16px; height: 40px; --rot: 8deg; border: 0; border-top: 2px dashed rgba(170, 130, 60, 0.35); border-bottom: 2px dashed rgba(170, 130, 60, 0.35); }
.cad__tag { position: absolute; left: 22px; top: -21px; z-index: 2; }
.cad__tag .caption { --rot: -3deg; font-size: 12px; padding: 3px 7px 2px; box-shadow: 2px 2px 0 var(--ink); }

/* pulsing Wi-Fi rings: <i class="wpulse"><i></i><i></i><i></i></i> centred on --wx --wy */
.wpulse { position: absolute; left: var(--wx, 50%); top: var(--wy, 50%); width: 0; height: 0; pointer-events: none; }
.wpulse > i { position: absolute; left: calc(var(--wr, 120px) * -1); top: calc(var(--wr, 120px) * -1); width: calc(var(--wr, 120px) * 2); height: calc(var(--wr, 120px) * 2); border-radius: 50%; border: 3px solid var(--wc, rgba(255, 255, 255, 0.75)); box-shadow: 0 0 0 2px rgba(29, 27, 36, 0.25), inset 0 0 0 2px rgba(29, 27, 36, 0.18); opacity: 0; animation: wpulse 2.4s cubic-bezier(0.2, 0.7, 0.3, 1) infinite; }
.wpulse > i:nth-child(2) { animation-delay: 0.8s; }
.wpulse > i:nth-child(3) { animation-delay: 1.6s; }
@keyframes wpulse { 0% { transform: scale(0.15); opacity: 0.95; } 70% { opacity: 0.35; } 100% { transform: scale(1); opacity: 0; } }
.wico { position: relative; display: grid; place-items: center; }
.wico svg { width: 100%; height: 100%; display: block; }
.wico--beat svg { animation: wbeat 1.2s ease-in-out infinite; transform-origin: 50% 80%; }
@keyframes wbeat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.12) rotate(-3deg); } 24% { transform: scale(0.98); } }

/* "searching nearby..." caption: the words swap, the dots tick */
.wsearch { display: inline-flex; align-items: center; gap: 6px; }
.wsearch [data-wcycle] { display: inline-block; }
.wsearch [data-wcycle].is-swap { animation: wswap 0.4s var(--spring); }
@keyframes wswap { from { opacity: 0; transform: translateY(6px) rotate(-3deg); } }
.wdots { display: inline-flex; gap: 3px; }
.wdots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: wdot 1.2s ease-in-out infinite; }
.wdots i:nth-child(2) { animation-delay: 0.2s; }
.wdots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes wdot { 0%, 60%, 100% { opacity: 0.25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* a friend's fighter dropping into place: animates whenever it becomes displayed */
.wdrop { animation: wdrop 0.55s cubic-bezier(0.3, 1.5, 0.5, 1) backwards; animation-delay: var(--dd, 0s); }
@keyframes wdrop { 0% { opacity: 0; transform: translateY(-140%) rotate(-8deg); } 60% { opacity: 1; transform: translateY(4%) scaleY(0.88); } 100% { transform: none; } }
.wpuff { position: absolute; left: 50%; bottom: 14px; width: 80%; height: 14px; translate: -50% 0; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, 0.95), transparent); opacity: 0; pointer-events: none; animation: wpuff 0.6s ease-out backwards; animation-delay: calc(var(--dd, 0s) + 0.3s); }
@keyframes wpuff { 0% { opacity: 0; transform: scaleX(0.3); } 30% { opacity: 1; } 100% { opacity: 0; transform: scaleX(1.6); } }
.wslam { animation: slam 0.42s cubic-bezier(0.2, 1.45, 0.45, 1) backwards; animation-delay: var(--dd, 0s); }
/* the Wi-Fi sim shows [data-wshow] pieces by state */
[data-wsim] [data-wshow] { display: none; }
[data-wstate="search"] [data-wshow~="search"], [data-wstate="f1"] [data-wshow~="f1"], [data-wstate="f2"] [data-wshow~="f2"], [data-wstate="f3"] [data-wshow~="f3"], [data-wstate="none"] [data-wshow~="none"] { display: var(--wd, block); }
@media (prefers-reduced-motion: reduce) { .wpulse > i { animation: none !important; opacity: 0.45; transform: scale(0.55); } .wpulse > i:nth-child(2) { transform: scale(0.8); opacity: 0.25; } .wpulse > i:nth-child(3) { display: none; } }
.rm .wpulse > i { animation: none !important; opacity: 0.45; transform: scale(0.55); }
.rm .wpulse > i:nth-child(2) { transform: scale(0.8); opacity: 0.25; }
.rm .wpulse > i:nth-child(3) { display: none; }

/* name tag under a fighter: name + flag + Wi-Fi strength */
.wtag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px 2px; font: 400 13px / 1 var(--f-display); letter-spacing: 0.03em; color: var(--ink); background: #FFF6E0; border: 2.5px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); white-space: nowrap; transform: rotate(var(--rot, -2deg)); }
.wtag .flag { width: 17px; height: 12px; border-width: 1.6px; border-radius: 2px; }
.wtag .wbars { width: 15px; height: 15px; }
.wtag .wbars svg { width: 100%; height: 100%; display: block; }

/* comic radar: rings, a cross, a rotating sweep and blips */
.radar { position: absolute; border-radius: 50%; overflow: hidden; border: 3.5px solid var(--ink); box-shadow: 3px 5px 0 var(--ink);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.0) 0 22%, rgba(255, 255, 255, 0.55) 22.6% 23.4%, transparent 24% 46%, rgba(255, 255, 255, 0.55) 46.6% 47.4%, transparent 48% 70%, rgba(255, 255, 255, 0.55) 70.6% 71.4%, transparent 72%), radial-gradient(circle at 50% 45%, #2BB3D9, #0F6E9E 70%, #0A4A75); }
.radar::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent calc(50% - 1px), rgba(255, 255, 255, 0.45) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)), linear-gradient(0deg, transparent calc(50% - 1px), rgba(255, 255, 255, 0.45) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)); }
.radar__sweep { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, rgba(160, 255, 250, 0.75), rgba(160, 255, 250, 0.0) 70deg, transparent 360deg); animation: spin 2.6s linear infinite; }
.radar__dots { position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1.3px, transparent 1.8px); background-size: 7px 7px; }
.radar__blip { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--yellow); border: 2.5px solid var(--ink); opacity: 0; }
.radar__blip::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid var(--yellow); opacity: 0; }
.radar__blip.is-on { opacity: 1; animation: blip-in 0.45s var(--spring) backwards; }
.radar__blip.is-on::after { animation: blip-ping 1.4s 0.3s ease-out infinite; }
@keyframes blip-in { from { transform: scale(0); } }
@keyframes blip-ping { 0% { opacity: 1; transform: scale(0.4); } 100% { opacity: 0; transform: scale(1.6); } }
.radar__me { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); }

/* sticker buttons for panels (HOST / JOIN / START!) */
.sbtn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 14px; font: 400 19px / 1 var(--f-display); letter-spacing: 0.03em; color: var(--ink); background: var(--sb-c, var(--yellow)); border: 3px solid var(--ink); border-radius: 10px; box-shadow: 3px 4px 0 var(--ink), inset 0 2px 0 rgba(255, 255, 255, 0.55); transform: rotate(var(--rot, -2deg)); cursor: pointer; white-space: nowrap; }
.sbtn svg { width: 22px; height: 22px; display: block; }
.sbtn--g { --sb-c: var(--green); color: #fff; }
.sbtn--g .t, .sbtn--k .t { color: #fff; -webkit-text-stroke: 3.5px var(--ink); paint-order: stroke fill; }
.sbtn--c { --sb-c: #FFF6E0; }
.sbtn--k { --sb-c: var(--ink); color: #fff; }
.sbtn.is-down { transform: rotate(var(--rot, -2deg)) translate(1px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.sbtn.is-glow { animation: sbtn-glow 1.6s ease-in-out infinite; }
@keyframes sbtn-glow { 50% { box-shadow: 3px 4px 0 var(--ink), 0 0 0 6px rgba(255, 210, 63, 0.55), 0 0 22px 6px rgba(255, 210, 63, 0.5); } }

/* big burst button (LET'S BRAWL!, START!, JOIN!) */
.bbtn { position: relative; display: grid; place-items: center; width: var(--bw2, 200px); aspect-ratio: 1.7; padding: 0; border: 0; background: none; cursor: pointer; filter: drop-shadow(4px 6px 0 var(--ink)); }
.bbtn::before { content: ""; position: absolute; inset: 0; background: var(--ink); clip-path: var(--burst); }
.bbtn::after { content: ""; position: absolute; inset: 4px; background: var(--bb-c, radial-gradient(circle at 50% 42%, #FFF6B8, var(--yellow) 50%, #FFA81A)); clip-path: var(--burst); }
.bbtn > * { position: relative; z-index: 1; }
.bbtn .sfx { --rot: -6deg; }
.bbtn.is-pulse { animation: bbtn-pulse 1.5s ease-in-out infinite; }
@keyframes bbtn-pulse { 50% { transform: scale(1.06) rotate(2deg); } }
.bbtn.is-down { transform: scale(0.92); filter: drop-shadow(1px 2px 0 var(--ink)); }
.bbtn[disabled] { filter: grayscale(1) drop-shadow(3px 4px 0 var(--ink)); opacity: 0.6; cursor: not-allowed; animation: none; }

/* ------------------------------------------------------------------ 21. forms, profile and sheets (02 and later) */
/* comic text field with an optional dice button */
.cfield { position: relative; display: grid; gap: 6px; min-width: 0; }
.clabel { justify-self: start; font: 400 14px / 1 var(--f-display); letter-spacing: 0.06em; color: var(--ink); background: var(--yellow); padding: 4px 8px 3px; border: 2.5px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); transform: rotate(-2deg); }
.cinput { position: relative; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 5px 0 12px; background: #fff; border: 3px solid var(--ink); box-shadow: 3px 4px 0 var(--ink); transform: rotate(-0.6deg); min-width: 0; }
.cinput__val { flex: 1; min-width: 0; display: flex; align-items: center; font: 400 24px / 1 var(--f-display); letter-spacing: 0.02em; color: var(--ink); white-space: nowrap; overflow: hidden; }
.cinput__val i { flex: none; width: 3px; height: 26px; margin-left: 2px; background: var(--ink); animation: caret 1s steps(2) infinite; }
.cinput__val .ph { color: rgba(29, 27, 36, 0.35); }
.cinput__n { flex: none; font: 800 12px / 1 var(--f-body); letter-spacing: 0.04em; color: rgba(29, 27, 36, 0.5); }
.cinput.is-err { background: #FFE6EA; animation: cshake 0.42s ease-out; }
.cinput.is-err .cinput__n { color: var(--alert); }
.cinput.is-ok { background: #E8FFF0; }
@keyframes cshake { 20% { transform: translateX(-6px) rotate(-1.4deg); } 40% { transform: translateX(5px) rotate(0.4deg); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
@keyframes caret { 50% { opacity: 0; } }
.dicebtn { flex: none; width: 40px; height: 40px; padding: 0; display: grid; place-items: center; background: var(--yellow); border: 3px solid var(--ink); border-radius: 9px; box-shadow: 2px 3px 0 var(--ink); cursor: pointer; transform: rotate(4deg); }
.dicebtn svg { width: 28px; height: 28px; display: block; }
.dicebtn.is-roll svg { animation: roll 0.5s cubic-bezier(0.3, 1.4, 0.5, 1); }
@keyframes roll { from { transform: rotate(-300deg) scale(0.6); } }
.cmsg { justify-self: start; display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 3px 4px; font: 400 15px / 1 var(--f-display); letter-spacing: 0.04em; color: #fff; background: var(--ink); transform: rotate(-1.5deg); box-shadow: 2px 3px 0 rgba(29, 27, 36, 0.3); animation: cmsg-in 0.4s var(--spring); }
.cmsg b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--alert); font: 400 15px / 1 var(--f-display); }
.cmsg--ok { background: var(--green); color: #fff; }
.cmsg--ok b { background: #fff; color: var(--green); }
@keyframes cmsg-in { from { opacity: 0; transform: translateY(-6px) rotate(-6deg) scale(0.8); } }

/* number wheel (age): horizontal by default, .awheel--v vertical */
.awheel { position: relative; display: flex; align-items: center; gap: 6px; }
.awheel__arr { flex: none; width: 34px; height: 34px; padding: 0; display: grid; place-items: center; background: #FFF6E0; border: 3px solid var(--ink); border-radius: 50%; box-shadow: 2px 3px 0 var(--ink); cursor: pointer; }
.awheel__arr svg { width: 20px; height: 20px; display: block; }
.awheel__arr.l svg { transform: rotate(90deg); }
.awheel__arr.r svg { transform: rotate(-90deg); }
.awheel__track { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; height: 56px; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent); mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent); }
.awheel__n { flex: none; width: 38px; text-align: center; font: 400 22px / 1 var(--f-display); color: rgba(29, 27, 36, 0.45); cursor: pointer; transition: transform 0.25s var(--spring); }
.awheel__n[data-d="1"] { color: rgba(29, 27, 36, 0.7); transform: scale(1.08); }
.awheel__n.is-on { width: 58px; height: 50px; display: grid; place-items: center; font-size: 36px; color: var(--ink); background: var(--yellow); border: 3px solid var(--ink); box-shadow: 3px 4px 0 var(--ink); transform: rotate(-3deg); }
.awheel.is-pop .awheel__n.is-on { animation: wpop 0.35s var(--spring); }
@keyframes wpop { from { transform: rotate(-3deg) scale(0.7); } }
.awheel--v { flex-direction: column; }
.awheel--v .awheel__arr.l svg { transform: rotate(180deg); }
.awheel--v .awheel__arr.r svg { transform: none; }
.awheel--v .awheel__track { flex-direction: column; height: auto; width: 120px; gap: 2px; -webkit-mask-image: linear-gradient(180deg, transparent, #000 25%, #000 75%, transparent); mask-image: linear-gradient(180deg, transparent, #000 25%, #000 75%, transparent); }
.awheel--v .awheel__n { width: auto; height: 30px; display: grid; place-items: center; }
.awheel--v .awheel__n.is-on { width: 92px; height: 58px; font-size: 42px; }

/* country picker button */
.ccountry { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 6px 0 8px; background: #fff; border: 3px solid var(--ink); box-shadow: 3px 4px 0 var(--ink); cursor: pointer; transform: rotate(0.6deg); font: inherit; color: var(--ink); text-align: left; min-width: 0; }
.ccountry .fl { flex: none; width: 48px; height: 32px; }
.ccountry .fl svg { width: 100%; height: 100%; display: block; }
.ccountry b { display: block; font: 400 22px / 1 var(--f-display); letter-spacing: 0.02em; white-space: nowrap; }
.ccountry small { display: block; margin-top: 3px; font: 800 12px / 1 var(--f-body); letter-spacing: 0.06em; color: var(--green); white-space: nowrap; }
.ccountry .ch { flex: none; margin-left: auto; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; background: var(--ink); }
.ccountry .ch svg { width: 20px; height: 20px; display: block; }
.privacy { display: inline-flex; align-items: center; gap: 6px; font: 700 13px / 1.25 var(--f-body); color: rgba(29, 27, 36, 0.72); }
.privacy svg { width: 18px; height: 18px; flex: none; display: block; }

/* comic modal sheet (in-screen) */
.ksheet { position: absolute; inset: 0; z-index: 45; display: none; }
.ksheet.is-open { display: block; }
.ksheet__dim { position: absolute; inset: 0; background: rgba(29, 27, 36, 0.55); }
.ksheet__dim::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(29, 27, 36, 0.35) 1.6px, transparent 2.1px); background-size: 8px 8px; }
.ksheet__p { position: absolute; left: 50%; top: calc(50% + 6px); width: var(--sw, 600px); height: var(--sh, 320px); translate: -50% -50%; --cp-bg: #FFF6E0; --lt: 0.03; --rb: 0.03; }
.ksheet.is-open .ksheet__p, .ksheet.is-open .ksheet__t, .ksheet.is-open .ksheet__x { animation: sheet-slam 0.42s cubic-bezier(0.2, 1.45, 0.45, 1) both; }
@keyframes sheet-slam { from { opacity: 0; transform: scale(1.18) rotate(-2deg); } }
.ksheet__p .cp__in { padding: 34px 26px 16px; }
.ksheet__p .ht { --dot: rgba(120, 72, 20, 0.1); --ht-mask: none; }
.ksheet__t { position: absolute; left: 50%; top: calc(50% + 6px - var(--sh, 320px) / 2 - 20px); z-index: 3; translate: -50% 0; }
.ksheet__t .caption { --rot: -2deg; font-size: 24px; padding: 8px 18px 6px; }
.ksheet__x { position: absolute; z-index: 3; left: calc(50% + var(--sw, 600px) / 2 - 26px); top: calc(50% + 6px - var(--sh, 320px) / 2 - 18px); width: 42px; height: 42px; padding: 0; display: grid; place-items: center; border: 3px solid var(--ink); border-radius: 50%; background: #FF4D63; box-shadow: 2px 4px 0 var(--ink); cursor: pointer; transform: rotate(8deg); }
.ksheet__x svg { width: 20px; height: 20px; display: block; }

/* search field */
.csearch { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 10px; background: #fff; border: 3px solid var(--ink); box-shadow: 3px 4px 0 var(--ink); transform: rotate(-0.5deg); }
.csearch svg { width: 24px; height: 24px; flex: none; display: block; }
.csearch input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: 400 19px / 1 var(--f-display); letter-spacing: 0.03em; color: var(--ink); text-transform: uppercase; }
.csearch input::placeholder { color: rgba(29, 27, 36, 0.38); }

/* country rows */
.crows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px 10px; }
.crow { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 8px; background: #fff; border: 3px solid var(--ink); box-shadow: 2px 3px 0 var(--ink); cursor: pointer; font: 400 15px / 1 var(--f-display); letter-spacing: 0.02em; color: var(--ink); text-align: left; min-width: 0; }
.crow .fl { flex: none; width: 36px; height: 24px; }
.crow .fl svg { width: 100%; height: 100%; display: block; }
.crow span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crow.is-on { background: var(--yellow); transform: rotate(-1.5deg); }
.crow.is-on::after { content: ""; flex: none; margin-left: auto; width: 20px; height: 20px; border-radius: 50%; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5 L10 16.5 L18 8' fill='none' stroke='%23fff' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat; border: 2px solid var(--ink); }

/* profile pieces */
.ava--xl { width: 112px; height: 112px; padding: 8px; border-width: 3.5px; box-shadow: 3px 5px 0 var(--ink); }
.ava--xl .ava__img { border-width: 3px; }
.ava--xl .ava__lvl { min-width: 38px; height: 32px; font-size: 20px; right: -10px; bottom: -6px; border-width: 3px; }
.tplate { position: relative; display: inline-grid; place-items: center; height: 30px; padding: 0 22px; filter: drop-shadow(2px 3px 0 var(--ink)); cursor: pointer; border: 0; background: none; }
.tplate::before { content: ""; position: absolute; inset: 0; background: var(--ink); clip-path: polygon(0 0, 100% 0, calc(100% - 11px) 50%, 100% 100%, 0 100%, 11px 50%); }
.tplate::after { content: ""; position: absolute; inset: 3px 4px; background: var(--tp, linear-gradient(180deg, var(--yellow-hi), var(--yellow) 55%, var(--yellow-lo))); clip-path: polygon(0 0, 100% 0, calc(100% - 9px) 50%, 100% 100%, 0 100%, 9px 50%); }
.tplate b { position: relative; z-index: 1; font: 400 15px / 1 var(--f-display); letter-spacing: 0.06em; color: var(--ink); white-space: nowrap; }
.pencil { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; background: #fff; border: 2.5px solid var(--ink); border-radius: 50%; box-shadow: 2px 2px 0 var(--ink); cursor: pointer; }
.pencil svg { width: 22px; height: 22px; display: block; }
.stat { position: relative; display: grid; align-content: center; justify-items: start; gap: 3px; padding: 6px 8px 6px 10px; background: #fff; border: 3px solid var(--ink); box-shadow: 2px 3px 0 var(--ink); min-width: 0; transform: rotate(var(--rot, 0deg)); }
.stat b { font: 400 23px / 1 var(--f-display); letter-spacing: 0.01em; color: var(--ink); white-space: nowrap; }
.stat small { font: 800 12px / 1 var(--f-body); letter-spacing: 0.07em; color: rgba(29, 27, 36, 0.62); white-space: nowrap; }
.stat .ico { position: absolute; right: 5px; top: 5px; width: 24px; height: 24px; }
.stat .ico svg { width: 100%; height: 100%; display: block; }
.slotx { position: relative; display: grid; place-items: center; border: 3px dashed rgba(29, 27, 36, 0.4); background: rgba(255, 255, 255, 0.5); font: 400 15px / 1 var(--f-display); letter-spacing: 0.04em; color: rgba(29, 27, 36, 0.5); cursor: pointer; }
.slotx::before { content: "+"; display: block; font-size: 28px; margin-bottom: -10px; }

/* avatar grid cells */
.avgrid { display: grid; grid-template-columns: repeat(var(--cols, 8), minmax(0, 1fr)); gap: 8px; }
.avc { position: relative; aspect-ratio: 1; padding: 0; border: 3px solid var(--ink); border-radius: 14px; overflow: hidden; background: var(--avbg, #9CC2FF); box-shadow: 2px 3px 0 var(--ink); cursor: pointer; }
.avc > .face { position: absolute; inset: 0; display: grid; place-items: center; }
.avc > .face > * { width: 100%; height: 100%; }
.avc > .face > svg { width: 84%; height: 84%; }
.avc.is-on { box-shadow: 0 0 0 3px var(--yellow), 0 0 0 6px var(--ink), 2px 3px 0 6px var(--ink); transform: rotate(-3deg) scale(1.04); z-index: 2; }
.avc.is-on::after { content: ""; position: absolute; right: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5 L10 16.5 L18 8' fill='none' stroke='%23fff' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 15px no-repeat; border: 2px solid var(--ink); }
.avc.is-lock > .face { filter: grayscale(1) brightness(0.75) contrast(0.9); opacity: 0.75; }
.avc.is-lock .lk { position: absolute; left: 50%; top: 38%; width: 24px; height: 24px; translate: -50% -50%; }
.avc.is-lock .lk svg { width: 100%; height: 100%; display: block; }
.avc .req { position: absolute; left: 0; right: 0; bottom: 0; height: 18px; display: grid; place-items: center; background: var(--ink); color: #fff; font: 400 12px / 1 var(--f-display); letter-spacing: 0.04em; white-space: nowrap; }
.avc.is-lock.is-peek { box-shadow: 0 0 0 3px var(--alert), 2px 3px 0 3px var(--ink); }

/* rank strip */
.tier { display: block; }
.tier svg { width: 100%; height: 100%; display: block; overflow: visible; }
.tier.is-off { filter: grayscale(1) brightness(0.9); opacity: 0.45; }
[data-fit] { display: block; min-width: 0; max-width: 100%; overflow: hidden; white-space: nowrap; }
[data-fit].is-clip { text-overflow: ellipsis; }
/* ?still renders: freeze entrance animations at their end state */
.still-anim [data-slam], .still-anim .slam-late, .still-anim .wslam, .still-anim .wdrop, .still-anim .wpuff, .still-anim .ksheet__p, .still-anim .ksheet__t, .still-anim .ksheet__x { animation: none !important; }
.awheel--v .awheel__arr { display: none; }

/* =====================================================================================================
   22. SPOTLIGHT STAGE (the chosen theme, 17 Oct): a dark arena, a lit podium, a crowd, dark indigo sticker panels.
   Builders in kit.js: SB.stage (data-stage), SB.cone (data-cone), SB.podium (data-podium). Comic pieces (bursts,
   action words) stay for big moments only.
   ===================================================================================================== */
:root {
  --sp-wall-1: #5A47A0; --sp-wall-2: #3A2D73; --sp-wall-3: #231B49; --sp-wall-4: #140F2A; --sp-base: #120E24;
  --sp-floor-1: #1C163A; --sp-floor-2: #0F0C20;
  --sp-cone: #FFF6E0; --sp-beam-l: #FF4FA3; --sp-beam-r: #3F9AFF;
  --sp-card: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 52%), linear-gradient(180deg, var(--panel-3), var(--panel-2) 60%, var(--panel));
  --sp-glow: 0 0 18px 4px rgba(255, 210, 63, 0.45);
}
.stg { position: absolute; inset: 0; overflow: hidden; background: var(--sp-base); }
.stg__wall { position: absolute; inset: 0; background: radial-gradient(52% 70% at var(--stx, 50%) var(--sty, 34%), var(--sp-wall-1) 0%, var(--sp-wall-2) 30%, var(--sp-wall-3) 62%, var(--sp-wall-4) 100%); }
.stg__wall::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1.3px, transparent 1.8px); background-size: 9px 9px; -webkit-mask-image: radial-gradient(48% 58% at var(--stx, 50%) 36%, #000, transparent 80%); mask-image: radial-gradient(48% 58% at var(--stx, 50%) 36%, #000, transparent 80%); }
.stg__beam { position: absolute; top: -60px; width: 210px; height: 560px; transform-origin: 50% 0; animation: beam 7s ease-in-out infinite alternate; pointer-events: none; }
.stg__beam svg { width: 100%; height: 100%; display: block; overflow: visible; }
.stg__beam--l { left: 6%; --r0: -34deg; --r1: -18deg; }
.stg__beam--r { right: 6%; --r0: 32deg; --r1: 18deg; animation-delay: -3.5s; }
@keyframes beam { from { transform: rotate(var(--r0)); } to { transform: rotate(var(--r1)); } }
.stg__crowd { position: absolute; left: 0; right: 0; height: 150px; bottom: var(--crowd-b, 150px); opacity: 0.95; -webkit-mask-image: linear-gradient(90deg, #000 0 30%, rgba(0, 0, 0, 0.3) 41%, rgba(0, 0, 0, 0.3) 59%, #000 70%); mask-image: linear-gradient(90deg, #000 0 30%, rgba(0, 0, 0, 0.3) 41%, rgba(0, 0, 0, 0.3) 59%, #000 70%); }
.stg__floor { position: absolute; left: 0; right: 0; bottom: 0; height: var(--floor-h, 152px); background: linear-gradient(180deg, var(--sp-floor-1), var(--sp-floor-2)); border-top: 3px solid #0B0918; }
.stg__floor::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 48px); -webkit-mask-image: linear-gradient(#000, transparent); mask-image: linear-gradient(#000, transparent); }
.spot { position: absolute; pointer-events: none; animation: spot 4s ease-in-out infinite alternate; }
@keyframes spot { from { opacity: 0.85; } to { opacity: 1; } }
.spot__lamp { position: absolute; width: 58px; height: 22px; margin-left: -29px; border: 3px solid var(--ink); border-top: 0; border-radius: 0 0 14px 14px; background: linear-gradient(180deg, #3A3458, #1E1B2B); z-index: 1; }
.spot__lamp::after { content: ""; position: absolute; left: 7px; right: 7px; bottom: -6px; height: 9px; border-radius: 50%; background: #FFF6E0; box-shadow: 0 0 14px 6px rgba(255, 240, 200, 0.75); }
.podium { position: absolute; width: 300px; height: 70px; margin-left: -150px; }
/* name tag for a fighter on stage */
.ntag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px 0 5px; font: 400 13.5px / 1 var(--f-display); letter-spacing: 0.03em; color: #fff; background: linear-gradient(180deg, var(--panel-3), var(--panel)); border: 2.5px solid var(--ink); border-radius: 8px; box-shadow: 2px 3px 0 var(--ink); white-space: nowrap; }
.ntag .flag { width: 18px; height: 12px; border-width: 1.6px; border-radius: 2px; }
.ntag .lv { font-size: 11.5px; color: var(--ink); background: var(--yellow); border-radius: 4px; padding: 2px 3px 1px; }
.ntag--you { background: linear-gradient(180deg, var(--yellow-hi), var(--yellow) 55%, var(--yellow-lo)); color: var(--ink); }
/* a dark sticker card (lists, players, rewards) */
.dcard { position: relative; border: var(--bw) solid var(--ink); border-radius: 14px; background: var(--sp-card); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.12), inset 0 -3px 0 rgba(0, 0, 0, 0.22), var(--hard); }
.dcard.is-lit { background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 52%), linear-gradient(180deg, #4D4677, var(--panel-3) 60%, var(--panel-2)); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.16), var(--hard), var(--sp-glow); }
.dlabel { font: 800 var(--t-small) / 1 var(--f-body); letter-spacing: 0.08em; color: var(--cream-3); text-transform: uppercase; }
.dtitle { font: 400 var(--t-title) / 1 var(--f-display); letter-spacing: 0.02em; color: #fff; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 0 2.5px 0 var(--ink); }
/* gentle motion for the spotlight theme: rise in, no slam */
.rise [data-rise] { animation: rise 0.45s var(--out) backwards; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.walkin { animation: walkin 1.3s linear backwards; animation-delay: var(--dd, 0s); }
@keyframes walkin { from { transform: translateX(var(--from, -220px)); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .walkin, .rise [data-rise], .stg__beam, .spot { animation: none !important; } }
.rm .walkin, .rm .rise [data-rise], .rm .stg__beam, .rm .spot { animation: none !important; }
.still-anim .walkin, .still-anim .rise [data-rise], .still-anim .wslam { animation: none !important; }
