/* Pawnbreaker — Balatro-inspired UI (own recreation: CSS + WebGL, no Balatro assets). */
@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 300 900; font-display: swap; src: url('../vendor/fonts/rubik-cyrillic-ext-wght-normal.woff2') format('woff2'); unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 300 900; font-display: swap; src: url('../vendor/fonts/rubik-cyrillic-wght-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 300 900; font-display: swap; src: url('../vendor/fonts/rubik-latin-ext-wght-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 300 900; font-display: swap; src: url('../vendor/fonts/rubik-latin-wght-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
:root {
  /* palette roles (docs/art-direction.md): desaturated accents, ink outlines, tinted (never pure black) shadows */
  --ink: #0c1417; --panel: #2c3f46; --panel-2: #1f2f36; --panel-3: #3b545d; --txt: #f3f6f2; --muted: #a8bdc0;
  --red: #ec6f67; --red-d: #9a3f3a; --blue: #2899e4; --blue-d: #155f93; --orange: #e19a1c; --orange-d: #94600f;
  --green: #4aa877; --green-d: #276747; --purple: #9c70ed; --purple-d: #5c3fa3; --gold: #eabc52; --gold-d: #9c7a26;
  --common: #4f8fd6; --uncommon: #4fae74; --rare: #d9586a; --legendary: #9c70ed;
  --paper: #f3eee1; --paper-2: #e2d8c2;
  --shadow: 0 2px 0 rgba(6, 14, 16, .55);
  --sh-1: 0 3px 0 rgba(6, 16, 18, .55);
  --sh-2: 0 5px 0 rgba(6, 16, 18, .5), 0 12px 24px -10px rgba(4, 22, 20, .7);
  --sh-3: 0 8px 0 -1px rgba(10, 8, 30, .45), 0 22px 34px -12px rgba(10, 8, 34, .75);
  --ease: cubic-bezier(0.22, 1, 0.36, 1); --t-move: 500ms; --t-color: 300ms;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px;
  --z-app: 2; --z-pack: 40; --z-modal: 45; --z-menu: 52; --z-sheet: 54; --z-inspect: 58; --z-coach: 62; --z-toast: 66; --z-fx: 70; --z-skip: 100;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; min-height: 100dvh; color: var(--txt); background: #0d2a24;
  font-family: 'Rubik', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 15px; font-weight: 500; line-height: 1.25;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-shadow: var(--shadow);
  -webkit-user-select: none; user-select: none; touch-action: manipulation; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
.hidden { display: none !important; }
b, strong { font-weight: 700; }

/* ---------- background: WebGL swirl (fx.js) + CSS fallback + CRT overlay ---------- */
#bg { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: 0; image-rendering: pixelated; display: block; }
html.nogl #bg { display: none; }
html.nogl body { background: linear-gradient(130deg, #0b2b25, #155445, #0b2b25, #1d6b52); background-size: 400% 400%; animation: bgShift 24s ease infinite; }
html.nogl[data-theme="shop"] body { background-image: linear-gradient(130deg, #1c1240, #0b5a8f, #1c1240, #7a2240); }
html.nogl[data-theme="boss"] body { background-image: linear-gradient(130deg, #2a0309, #7d0d1c, #2a0309, #a8481a); }
html.nogl[data-theme="over"] body { background-image: linear-gradient(130deg, #19050a, #5e0f22, #19050a, #2e1760); }
@keyframes bgShift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
#crt { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px),
              radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%); }

#app { position: relative; z-index: 2; max-width: 520px; margin: 0 auto; min-height: 100dvh;
  padding: calc(var(--safe-t) + 4px) 8px calc(var(--safe-b) + 8px); display: flex; flex-direction: column; gap: 5px; }
#screen-game { gap: 5px; }
section { display: flex; flex-direction: column; gap: 6px; }

/* ---------- panels: thick dark outline + inner shadow ---------- */
.panel { background: var(--panel); border: 3px solid var(--ink); border-radius: 12px;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.28), inset 0 2px 0 rgba(255,255,255,.08), 0 4px 0 rgba(0,0,0,.45); }

/* ---------- HUD ---------- */
#hud { display: grid; grid-template-columns: 1fr 1.2fr 1.2fr 46px; gap: 4px; padding: 4px; align-items: stretch; }
.hud-box { background: var(--panel-2); border-radius: 8px; padding: 2px 6px; display: flex; flex-direction: row; gap: 6px; align-items: center; justify-content: center;
  box-shadow: inset 0 3px 0 rgba(0,0,0,.35); min-height: 36px; }
.hud-box small { font-size: 11px; color: var(--muted); text-transform: uppercase;  }
.hud-box b { font-size: 21px; line-height: 1; display: inline-flex; align-items: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hud-box small { white-space: nowrap; }
@media (max-width: 400px) { .hud-box { gap: 4px; padding: 2px 4px; } .hud-box small { font-size: 10px; letter-spacing: .02em; } .hud-box b { font-size: 19px; } }
.hb-round b { color: var(--orange); }
.hb-gold b { color: var(--gold); } .hb-gold .coin { margin-right: 2px; }
.hb-score b { color: var(--blue); }
.hb-round.boss { background: #4a0d18; } .hb-round.boss b { color: var(--red); }
.bump { animation: bump .45s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes bump { 0% { transform: scale(1); } 25% { transform: scale(1.35) rotate(-6deg); } 50% { transform: scale(1.15) rotate(5deg); } 100% { transform: scale(1); } }
.shake { animation: shake .4s linear; }
@keyframes shake { 0%,100% { transform: translate(0,0); } 20% { transform: translate(-4px,1px) rotate(-1deg); } 40% { transform: translate(4px,-1px) rotate(1deg); } 60% { transform: translate(-3px,0); } 80% { transform: translate(2px,1px); } }

/* ---------- buttons: saturated, chunky, pressed 3D ---------- */
.btn { font: inherit; color: #fff; text-shadow: var(--shadow); border: 3px solid var(--ink); border-radius: 10px; padding: 10px 16px; min-height: 48px; cursor: pointer;
  background: var(--panel-3); --d: #24343b; box-shadow: inset 0 -4px 0 var(--d), 0 4px 0 var(--ink); font-size: 17px; position: relative; transition: transform .06s; }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 -1px 0 var(--d), 0 1px 0 var(--ink); }
.btn:disabled { filter: saturate(.25) brightness(.6); cursor: default; }
.btn-red { background: var(--red); --d: var(--red-d); } .btn-blue { background: var(--blue); --d: var(--blue-d); }
.btn-orange { background: var(--orange); --d: var(--orange-d); } .btn-green { background: var(--green); --d: var(--green-d); }
.btn-purple { background: var(--purple); --d: var(--purple-d); }
.btn-big { font-size: 21px; padding: 12px 34px; min-height: 58px; }
.btn-icon { padding: 0; min-height: 36px; border-width: 2px; width: 100%; font-size: 19px; text-shadow: none; }
.controls { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 6px 0; }
.price-pill { margin-left: 8px; background: var(--ink); color: var(--gold); border-radius: 6px; padding: 2px 6px; font-size: 15px; }

/* in-game tool buttons: 4-up grid */
.game-controls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 2px 0 0; }
.tool { padding: 3px 2px 6px; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.tool .ico { font-size: 19px; line-height: 1; text-shadow: none; }
.tool .lbl { font-size: 11px; line-height: 1; white-space: nowrap; }
.tool .cnt { position: absolute; top: -9px; right: -6px; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 12px; background: #fff; color: var(--ink);
  border: 3px solid var(--ink); font-size: 13px; line-height: 18px; text-shadow: none; }
.tool .cnt.zero { background: #6e7f85; color: #233; }
#btn-confuse.armed { animation: armed 1s ease-in-out infinite; }
@keyframes armed { 50% { filter: brightness(1.35); box-shadow: inset 0 -4px 0 var(--d), 0 4px 0 var(--ink), 0 0 16px var(--purple); } }

/* ---------- bot: portrait + speech panel ---------- */
#botbar { display: flex; gap: 8px; align-items: stretch; padding: 4px 6px; }
.portrait { width: 50px; flex: 0 0 50px; border-radius: 9px; background: radial-gradient(circle at 50% 40%, #4f6d78, #1c2a30);
  border: 3px solid var(--ink); display: flex; align-items: center; justify-content: center; font-size: 27px; text-shadow: none;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.35); animation: idleBob 2.8s ease-in-out infinite; }
.portrait.talking { animation: talkBob .25s ease-in-out 4; }
@keyframes idleBob { 50% { transform: translateY(-2px) rotate(-2deg); } }
@keyframes talkBob { 50% { transform: scale(1.08) rotate(3deg); } }
.bot-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bot-id { display: flex; gap: 6px; align-items: baseline; white-space: nowrap; overflow: hidden; }
.bot-id b { font-size: 15px; color: var(--gold); } .bot-id small { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
#bubble { position: relative; background: #f4efe2; color: #1c1c1c; text-shadow: none; border: 3px solid var(--ink); border-radius: 8px; padding: 5px 8px;
  font-size: 13px; line-height: 1.2; min-height: 38px; display: flex; align-items: center; box-shadow: inset 0 -3px 0 #d6ccb4; }
#bubble::before { content: ''; position: absolute; left: -10px; top: 10px; border: 7px solid transparent; border-right: 8px solid var(--ink); border-left: 0; }
#bubble.hidden { display: flex !important; visibility: hidden; }
#bubble.pop { animation: pop .3s cubic-bezier(.3, 1.7, .5, 1); transform-origin: left center; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* ---------- boss banner ---------- */
#boss-banner { display: flex; gap: 8px; align-items: center; background: #5a0f1c; border: 3px solid var(--ink); border-radius: 10px; padding: 2px 6px; min-width: 0;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.35), 0 4px 0 rgba(0,0,0,.45); }
#boss-banner .chipmini { flex: 0 0 26px; height: 26px; font-size: 13px !important; border-width: 2px !important; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 19px; text-shadow: none;
  background: var(--bc, var(--red)); border: 3px solid var(--ink); box-shadow: inset 0 -3px 0 rgba(0,0,0,.35); animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#boss-banner > div { min-width: 0; } #boss-banner b { color: var(--red); font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#boss-banner small { font-size: 11px; color: #f4c9cf; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


/* ---------- board frame (board itself untouched) ---------- */
#board-frame { align-self: center; width: 100%; padding: 5px; background: #1a1410; border: 3px solid var(--ink); border-radius: 10px; box-shadow: inset 0 0 0 2px #3a2c20, 0 5px 0 rgba(0,0,0,.5); position: relative; }
#board-wrap { width: 100%; aspect-ratio: 1 / 1; border-radius: 3px; overflow: hidden; position: relative; }
#board { width: 100%; height: 100%; }
cg-board { background-color: #eeeed2;
  background-image: conic-gradient(#769656 0 25%, #eeeed2 0 50%, #769656 0 75%, #eeeed2 0);
  background-size: 25% 25%; }
cg-board square.last-move { background-color: rgba(255, 255, 51, 0.5); }
cg-board square.selected { background-color: rgba(255, 255, 51, 0.5); }
cg-board square.move-dest { background: radial-gradient(rgba(0, 0, 0, 0.14) 19%, rgba(0, 0, 0, 0) 20%); }
cg-board square.oc.move-dest { background: radial-gradient(transparent 0%, transparent 79%, rgba(0, 0, 0, 0.14) 80%); }
cg-board square.move-dest:hover { background: rgba(255, 255, 255, 0.25); }
cg-board square.check { background: radial-gradient(ellipse at center, #ff0000 0%, #e70000 25%, rgba(169,0,0,0) 89%); }
cg-board square.fog { background: #1f1d1b; box-shadow: inset 0 0 0 1px #2b2926; }
cg-board square.sanct { box-shadow: inset 0 0 0 3px #3fd6a0, inset 0 0 16px rgba(63,214,160,.8); }
cg-board square.treas { box-shadow: inset 0 0 0 3px #eabc52, inset 0 0 16px rgba(255,201,60,.8); }
cg-board square.boom { animation: boom .7s ease-out forwards; }
@keyframes boom { 0% { background: rgba(255,140,0,.95); } 100% { background: rgba(255,140,0,0); } }
.cg-wrap coords { font-family: -apple-system, "Segoe UI", sans-serif; font-weight: 700; font-size: 11px; opacity: 1; }
.cg-wrap coords.ranks { left: 3px; top: 0; }
.cg-wrap coords.ranks coord { transform: none; padding-top: 2px; }
.cg-wrap coords.files { left: 0; bottom: 0; height: 14px; text-transform: none; text-align: right; }
.cg-wrap coords.files coord { padding-right: 3px; }
.orientation-white .ranks :nth-child(odd), .orientation-white .files :nth-child(odd) { color: #eeeed2; }
.orientation-white .ranks :nth-child(even), .orientation-white .files :nth-child(even) { color: #769656; }
#infoline { padding: 3px 8px; min-height: 30px; display: flex; align-items: center; gap: 8px; }
#movelog { display: flex; gap: 6px; overflow-x: auto; white-space: nowrap; font-size: 15px; scrollbar-width: none; flex: 1; min-width: 0; }
#movelog::-webkit-scrollbar { display: none; }
#movelog .mn { color: var(--muted); } #movelog .mv { color: #fff; margin-right: 4px; }
#status { flex: 0 1 auto; max-width: 68%; text-align: right; font-size: 13px; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- floating reward text + particles ---------- */
.float { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 5; pointer-events: none; font-size: 27px; color: var(--gold);
  text-shadow: 0 3px 0 var(--ink), 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 -3px 0 var(--ink); animation: floatUp 1.1s ease-out forwards; white-space: nowrap; }
@keyframes floatUp { 0% { transform: translate(-50%, -20%) scale(.4); opacity: 0; } 20% { transform: translate(-50%, -50%) scale(1.25) rotate(-4deg); opacity: 1; }
  40% { transform: translate(-50%, -55%) scale(1) rotate(3deg); } 100% { transform: translate(-50%, -140%); opacity: 0; } }
.pt { position: fixed; z-index: 80; width: var(--s); height: var(--s); pointer-events: none; animation: pt .9s cubic-bezier(.2, .7, .4, 1) forwards; box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
.pt.em { background-color: transparent !important; background-size: contain; background-repeat: no-repeat; box-shadow: none; width: 16px; height: 16px; image-rendering: pixelated; }
@keyframes pt { 0% { transform: translate(-50%, -50%); opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 40px)) rotate(200deg); opacity: 0; } }

/* ---------- toast: sits above the tool buttons, never over the bot bar ---------- */
#toast { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 92px); transform: translateX(-50%); z-index: 60; pointer-events: none;
  background: var(--orange); color: #fff; font-size: 17px; padding: 8px 14px; border-radius: 10px; border: 3px solid var(--ink);
  box-shadow: inset 0 -4px 0 var(--orange-d), 0 4px 0 var(--ink); white-space: nowrap; max-width: 94vw; overflow: hidden; text-overflow: ellipsis; }
#toast.show { animation: toastIn .45s cubic-bezier(.3, 1.7, .5, 1); }
@keyframes toastIn { 0% { transform: translate(-50%, 30px) scale(.5); opacity: 0; } 100% { transform: translate(-50%, 0) scale(1); opacity: 1; } }

/* ---------- screen heads ---------- */
.screen-head { padding: 8px 10px; text-align: center; }
.title-big { margin: 0; font-size: 27px; font-weight: 700; color: #fff; 
  text-shadow: 0 3px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink); animation: titleWob 3s ease-in-out infinite; }
@keyframes titleWob { 50% { transform: rotate(-1.2deg) scale(1.02); } }
.sub { font-size: 13px; color: var(--muted); margin-top: 4px; } .sub b { color: #fff; } .sub .danger { color: var(--red); }
.gold-txt { color: var(--gold); font-size: 19px; }

/* ---------- cards (upgrades + tricks): jokers with tilt, sway, holo sheen ---------- */
.cards-row { display: flex; gap: 7px; justify-content: center; align-items: stretch; padding: 26px 0 16px; perspective: 700px; flex: 1; }
.card { --rc: var(--common); font: inherit; color: #222; text-shadow: none; flex: 1 1 0; max-width: 158px; min-width: 0; padding: 0; border: 0; background: none; cursor: pointer;
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
  animation: deal .55s cubic-bezier(.3, 1.5, .5, 1) backwards; animation-delay: calc(var(--i) * .1s); transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.card.r-uncommon { --rc: var(--uncommon); } .card.r-rare { --rc: var(--rare); } .card.r-legendary { --rc: var(--legendary); }
@keyframes deal { 0% { transform: translateY(160px) rotate(25deg) scale(.4); opacity: 0; } 100% { transform: none; opacity: 1; } }
.card-in { display: block; width: 100%; transform-style: preserve-3d; animation: sway 3.4s ease-in-out infinite; animation-delay: calc(var(--i) * -1.1s); }
.card.tilting .card-in { animation: none; transform: rotateX(var(--rx, 0)) rotateY(var(--ry, 0)) scale(1.05); transition: transform .08s; }
@keyframes sway { 0%, 100% { transform: rotate(var(--tilt, 0deg)) translateY(0); } 50% { transform: rotate(calc(var(--tilt, 0deg) * -1)) translateY(-6px); } }
.card:hover, .card:focus-visible { transform: translateY(-14px); z-index: 2; outline: none; }
.card:active { transform: translateY(-8px) scale(.97); }
.cface { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; overflow: hidden; min-height: 230px;
  background: #f4efe2; border: 3px solid var(--ink); border-radius: 11px; padding: 6px 5px 6px;
  box-shadow: inset 0 0 0 3px var(--rc), inset 0 -7px 0 rgba(0,0,0,.12), 0 7px 0 rgba(0,0,0,.5); }
.ctype { font-size: 11px; background: var(--ink); color: #fff; padding: 2px 6px; border-radius: 5px;  text-transform: uppercase; }
.cart { width: 60%; aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  background: radial-gradient(circle at 50% 35%, #fff, #e3dac6); border: 3px solid var(--rc); box-shadow: inset 0 -4px 0 rgba(0,0,0,.12); }
.cart img { width: 80%; height: 80%; filter: drop-shadow(0 3px 0 rgba(0,0,0,.25)); }
.cart .glyph { font-size: 27px; line-height: 1; }
.cname { font-size: 15px; text-align: center; line-height: 1.05; color: #1b1b1b; }
.cdesc { font-size: 13px; line-height: 1.1; text-align: center; color: #fff; background: var(--panel-2); border-radius: 7px; padding: 5px 4px; width: 100%; flex: 1;
  display: flex; align-items: center; justify-content: center; text-shadow: var(--shadow); }
.crar { font-size: 13px; color: #fff; background: var(--rc); border: 3px solid var(--ink); border-radius: 8px; padding: 2px 9px; text-shadow: var(--shadow);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); }
.sheen { position: absolute; inset: 0; pointer-events: none; border-radius: 8px; mix-blend-mode: soft-light; opacity: 0; }
.card.r-rare .sheen, .card.r-legendary .sheen { opacity: .8; background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,.9) 40%, transparent 55%, rgba(120,200,255,.7) 70%, transparent 85%);
  background-size: 250% 100%; background-position: var(--mx, 0%) 0; animation: holo 3.5s linear infinite; }
.card.r-legendary .sheen { background-image: linear-gradient(115deg, #ff5f6d55, #ffc37155, #47e89155, #3ac8ff55, #b06bff55, #ff5f6d55); mix-blend-mode: color; opacity: .55; }
.card.tilting .sheen { animation: none; }
@keyframes holo { to { background-position: 250% 0; } }

/* ---------- chest shop ---------- */
.chest { --rc: var(--common); font: inherit; color: #fff; padding: 0; border: 0; background: none; cursor: pointer; position: relative; display: flex; flex-direction: column; align-items: center;
  animation: deal .55s cubic-bezier(.3, 1.5, .5, 1) backwards; animation-delay: calc(var(--i) * .08s); transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.chest.r-uncommon { --rc: var(--uncommon); } .chest.r-rare { --rc: var(--rare); } .chest.r-legendary { --rc: var(--legendary); }
.chest .pack { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px 10px; overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--rc) 70%, #fff 30%), var(--rc) 45%, color-mix(in srgb, var(--rc) 60%, #000 40%));
  border: 3px solid var(--ink); border-radius: 6px; box-shadow: inset 0 -6px 0 rgba(0,0,0,.25), inset 0 3px 0 rgba(255,255,255,.25), 0 7px 0 rgba(0,0,0,.5);
  transform-style: preserve-3d; animation: sway 3.8s ease-in-out infinite; animation-delay: calc(var(--i) * -.9s); }
.chest .pack::before, .chest .pack::after { content: ''; position: absolute; left: 0; right: 0; height: 7px; pointer-events: none;
  background: radial-gradient(circle at 7px 0, var(--ink) 4px, transparent 4.5px) 0 0 / 14px 7px repeat-x; }
.chest .pack::before { top: 0; } .chest .pack::after { bottom: 0; transform: scaleY(-1); }
.chest .stripes { position: absolute; inset: 0; background: repeating-linear-gradient(45deg, rgba(255,255,255,.08) 0 6px, transparent 6px 12px); pointer-events: none; }
.chest.tilting .pack { animation: none; transform: rotateX(var(--rx, 0)) rotateY(var(--ry, 0)) scale(1.04); }
.chest:not(:disabled):active { transform: scale(.96); }
.chest:disabled { cursor: default; } .chest:disabled .pack { filter: saturate(.2) brightness(.55); }
.chest .price { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); z-index: 2; background: var(--panel-2); color: var(--gold); border: 3px solid var(--ink);
  font-size: 17px; padding: 2px 10px; border-radius: 8px; box-shadow: 0 3px 0 var(--ink); white-space: nowrap; }
.chest:disabled .price { color: var(--red); }
.chest .cicon { font-size: 37.33px; margin-top: 4px; line-height: 1.1; text-shadow: 0 4px 0 rgba(0,0,0,.35); position: relative; }
.chest .cname { color: #fff; font-size: 15px; text-shadow: 0 2px 0 var(--ink); position: relative; text-align: center; }
.chest .csize { font-size: 13px; background: var(--ink); padding: 1px 7px; border-radius: 5px; position: relative; }
.chest .cdesc { background: rgba(0,0,0,.4); font-size: 13px; margin-top: 3px; flex: 0 0 auto; min-height: 0; padding: 3px 4px; position: relative; }
.chest .buy { margin-top: 6px; position: relative; z-index: 1; font-size: 15px; background: var(--green); border: 3px solid var(--ink); border-radius: 8px; padding: 4px 16px; box-shadow: inset 0 -3px 0 var(--green-d), 0 3px 0 var(--ink); }
.chest:disabled .buy { background: #55656b; box-shadow: 0 3px 0 var(--ink); }

/* ---------- pack opening overlay ---------- */
#pack { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; justify-content: center; align-items: stretch;
  padding: calc(var(--safe-t) + 10px) 8px calc(var(--safe-b) + 20px); background: rgba(8, 4, 20, .88); }
#pack .cards-row { flex: 0; max-width: 520px; margin: 0 auto; width: 100%; }
.pack-title { text-align: center; color: #e2c8ff; } .pack-sub { text-align: center; margin: 4px 0 0; color: #fff; font-size: 15px; }
#pack-anim { position: absolute; left: 50%; top: 45%; width: 150px; height: 190px; margin: -95px 0 0 -75px; border-radius: 8px; border: 3px solid var(--ink);
  background: linear-gradient(160deg, #c99cf5, var(--legendary) 45%, #4b2a80); display: flex; align-items: center; justify-content: center; font-size: 64px; text-shadow: none;
  box-shadow: inset 0 -8px 0 rgba(0,0,0,.25), 0 8px 0 rgba(0,0,0,.5), 0 0 60px #9c70ed; }
#pack.opening #pack-anim { animation: packShake .75s ease-in forwards; }
#pack:not(.opening) #pack-anim { display: none; }
#pack.opening .pack-title, #pack.opening .pack-sub, #pack.opening #pack-cards, #pack.opening .btn { visibility: hidden; }
@keyframes packShake { 0% { transform: scale(.3) rotate(-20deg); } 25% { transform: scale(1.05) rotate(4deg); } 35% { transform: rotate(-6deg); } 45% { transform: rotate(7deg); }
  55% { transform: rotate(-8deg) scale(1.08); } 65% { transform: rotate(9deg) scale(1.12); } 80% { transform: scale(1.3); filter: brightness(2); } 100% { transform: scale(1.8); opacity: 0; filter: brightness(4); } }
#pack .btn { align-self: center; margin-top: 4px; }

/* ---------- modal (win, draw, resign, boss intro) ---------- */
#modal { position: fixed; inset: 0; z-index: 45; background: rgba(5, 10, 12, .62); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { width: min(420px, 100%); padding: 16px 14px 14px; text-align: center; animation: modalIn .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes modalIn { 0% { transform: translateY(80px) scale(.6); opacity: 0; } 100% { transform: none; opacity: 1; } }
.modal-body h2 { margin: 0 0 8px; font-weight: 700; font-size: 27px; text-shadow: 0 3px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink); }
.modal-body h2.win { color: var(--gold); } .modal-body h2.draw { color: var(--blue); } .modal-body h2.warn { color: var(--red); }
.modal-body p { margin: 6px 0; font-size: 15px; color: #e4eef0; }
.modal-btns { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.cash { background: var(--panel-2); border-radius: 9px; padding: 6px 10px; box-shadow: inset 0 3px 0 rgba(0,0,0,.35); text-align: left; }
.cash-row { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; font-size: 15px; border-bottom: 2px dashed rgba(255,255,255,.12); animation: rowIn .35s backwards; animation-delay: calc(var(--i) * .18s + .2s); }
.cash-row:last-child { border: 0; } .cash-row b { color: var(--gold); }
.cash-row.total { font-size: 19px; } .cash-row.total b { font-size: 23px; }
@keyframes rowIn { from { transform: translateX(-30px); opacity: 0; } }

/* boss intro: big spinning token */
.modal-box.bossbox { background: #3a0a14; }
.boss-card { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.boss-token { width: 120px; height: 120px; border-radius: 50%; background: var(--bc, var(--red)); border: 4px solid var(--ink); display: flex; align-items: center; justify-content: center;
  font-size: 52px; text-shadow: none; position: relative;
  box-shadow: inset 0 -8px 0 rgba(0,0,0,.3), inset 0 0 0 8px rgba(255,255,255,.15), 0 6px 0 var(--ink), 0 0 40px var(--bc, var(--red));
  animation: tokenIn .8s cubic-bezier(.3, 1.5, .5, 1), tokenFloat 2.6s 0.8s ease-in-out infinite; }
.boss-token::after { content: ''; position: absolute; inset: 10px; border-radius: 50%; border: 3px dashed rgba(0,0,0,.35); animation: spin 8s linear infinite; }
@keyframes tokenIn { 0% { transform: scale(0) rotate(-540deg); } 100% { transform: none; } }
@keyframes tokenFloat { 50% { transform: translateY(-6px) rotate(4deg); } }
.boss-card .tag { font-size: 13px; background: var(--ink); padding: 3px 8px; border-radius: 6px; color: var(--red);  }
.boss-card h2 { color: #fff; margin: 4px 0 0 !important; }
.boss-card h3 { margin: 0; font-weight: 700; font-size: 17px; color: var(--ink); background: var(--bc, var(--red)); border: 3px solid var(--ink); border-radius: 8px; padding: 3px 10px; text-shadow: none; }
.boss-card p { font-size: 15px; }

/* ---------- game over ---------- */
#screen-over { flex: 1; justify-content: center; }
.over-panel { padding: 14px 12px; text-align: center; display: flex; flex-direction: column; gap: 10px; animation: modalIn .5s cubic-bezier(.3, 1.6, .5, 1); }
.over-title { margin: 0; font-weight: 700; font-size: 34px; color: var(--red); line-height: 1;
  text-shadow: 0 4px 0 var(--ink), 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 -3px 0 var(--ink); animation: shake .5s .3s, titleWob 3s 1s ease-in-out infinite; }
.over-reason { font-size: 15px; color: #f1d3d6; margin: 0; }
.over-quote { display: flex; gap: 8px; align-items: stretch; text-align: left; }
.over-quote .portrait { animation: talkBob .3s ease-in-out 3; }
.over-quote .q { flex: 1; background: #f4efe2; color: #222; text-shadow: none; border: 3px solid var(--ink); border-radius: 8px; padding: 6px 8px; font-size: 13px; }
.over-quote .q b { color: #9a3f3a; display: block; font-size: 13px; margin-bottom: 2px; }
.stats { background: var(--panel-2); border-radius: 9px; padding: 4px 10px; box-shadow: inset 0 3px 0 rgba(0,0,0,.35); text-align: left; }
.stat { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 2px dashed rgba(255,255,255,.12); font-size: 15px;
  animation: rowIn .35s backwards; animation-delay: calc(var(--i) * .12s + .4s); }
.stat:last-child { border: 0; }
.stat b { background: var(--c, var(--blue)); border: 3px solid var(--ink); border-radius: 7px; padding: 1px 8px; font-size: 17px; min-width: 44px; text-align: center; }
.stat .txt { font-size: 13px; color: #fff; text-align: right; max-width: 62%; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; } }


/* ---------- pixel icons (js/pix.js): sizes on the 16px grid → crisp at DPR 3 ---------- */
.px { image-rendering: pixelated; image-rendering: crisp-edges; display: inline-block; vertical-align: middle; flex: 0 0 auto; }
.piece-art { display: inline-block; vertical-align: middle; flex: 0 0 auto; }
.i16 { width: 16px; height: 16px; } .i21 { width: 21.33px; height: 21.33px; } .i32 { width: 32px; height: 32px; }
.i37 { width: 37.33px; height: 37.33px; } .i48 { width: 48px; height: 48px; } .i64 { width: 64px; height: 64px; }
img.coin { width: 16px; height: 16px; margin-right: 3px; vertical-align: -2px; }
.portrait .px { width: 37.33px; height: 37.33px; }
#btn-voice .px { width: 21.33px; height: 21.33px; }
#boss-banner .chipmini { animation: none; background: var(--bc, var(--red)); }
#boss-banner .chipmini .px { width: 16px; height: 16px; }
.boss-token .px { width: 74.67px; height: 74.67px; filter: drop-shadow(0 4px 0 rgba(0,0,0,.35)); }
.boss-tip { font-size: 13px !important; color: #ffe08a !important; background: rgba(0,0,0,.3); border-radius: 7px; padding: 4px 8px; }
.tool .ico { display: flex; } .tool .ico .px { width: 21.33px; height: 21.33px; }
.cart .px { width: 58%; height: auto; aspect-ratio: 1; }

/* ---------- relic row (owned "jokers") ---------- */
.relic-row { padding: 4px 6px 6px; display: flex; flex-direction: column; gap: 3px; }
.rr-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); text-transform: uppercase; padding: 0 2px; }
.rr-head b { color: #fff; }
.rr-tiles { display: flex; gap: 5px; }
.rtile { --rc: var(--common); flex: 1 1 0; min-width: 0; max-width: 64px; height: 50px; position: relative; padding: 0; font: inherit; cursor: pointer;
  background: #f4efe2; border: 3px solid var(--ink); border-radius: 8px; display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 2px var(--rc), inset 0 -5px 0 rgba(0,0,0,.14), 0 3px 0 rgba(0,0,0,.5); animation: sway 3.6s ease-in-out infinite; }
.rtile:nth-child(2n) { animation-delay: -1.3s; } .rtile:nth-child(3n) { animation-delay: -2.1s; }
.rtile.r-uncommon { --rc: var(--uncommon); } .rtile.r-rare { --rc: var(--rare); } .rtile.r-legendary { --rc: var(--legendary); background: linear-gradient(135deg, #fff3f8, #efe4ff, #e4fbff); }
.rtile .px, .rtile .piece-art { width: 32px; height: 32px; }
.rtile.empty { background: rgba(0,0,0,.28); border: 3px dashed rgba(255,255,255,.18); box-shadow: none; animation: none; cursor: default; }
.rtile:active:not(.empty) { transform: scale(.92); }
.rbadge { position: absolute; right: -6px; top: -8px; background: var(--red); color: #fff; border: 2px solid var(--ink); border-radius: 6px; font-size: 11px; padding: 1px 3px; line-height: 1; }
.rtile.jiggle { animation: jiggle .6s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes jiggle { 0% { transform: scale(1); } 30% { transform: scale(1.3) rotate(-10deg); } 60% { transform: scale(1.1) rotate(8deg); } 100% { transform: scale(1); } }
.relic-row.compact { padding: 0; background: none; }
.relic-row.compact .rr-head { display: none; }
.relic-row.compact .rtile { height: 38px; max-width: 54px; border-width: 2px; }
.relic-row.compact .rtile .px, .relic-row.compact .rtile .piece-art { width: 26.67px; height: 26.67px; }
.relic-row.compact .rtile.empty { border-width: 2px; }

/* ---------- enhanced pieces: glow + corner gem drawn on the square, piece art untouched ---------- */
cg-board square.enh { --ec: #eabc52; box-shadow: inset 0 0 0 2px var(--ec), inset 0 0 14px var(--ec);
  background-image: radial-gradient(circle at 84% 16%, var(--ec) 0 8%, #0b1215 8.5% 13%, transparent 13.5%); }
cg-board square.enh-gold { --ec: #eabc52; } cg-board square.enh-steel { --ec: #c4d3d8; } cg-board square.enh-foil { --ec: #6cbbe6; }
cg-board square.enh-holo { --ec: #c58be8; animation: holoPulse 1.8s ease-in-out infinite; }
@keyframes holoPulse { 50% { filter: hue-rotate(70deg) brightness(1.15); } }
cg-board square.enh.used { box-shadow: inset 0 0 0 2px rgba(196,211,216,.35); background-image: none; }

/* ---------- toast: inline over the move-log strip during a game ---------- */
#toast { display: flex; align-items: center; justify-content: center; gap: 6px; }
#toast.inline { transform: none; font-size: 15px; padding: 0 8px; border-radius: 12px; box-shadow: inset 0 -4px 0 var(--orange-d); }
#toast.inline.show { animation: toastPop .35s cubic-bezier(.3, 1.7, .5, 1); }
@keyframes toastPop { 0% { transform: scaleY(.2); opacity: 0; } 100% { transform: none; opacity: 1; } }
.float .px { width: 26.67px; height: 26.67px; }

/* ---------- Balatro-style shop ---------- */
#screen-shop { gap: 6px; }
.shop { padding: 6px; display: flex; flex-direction: column; gap: 8px; background: #3a2a4d; }
.shop-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 4px; }
.shop-head .title-big { font-size: 23px; }
.shop-head .sub { margin: 0; text-align: right; }
.shop-top { display: grid; grid-template-columns: 104px 1fr; gap: 8px; background: rgba(0,0,0,.28); border-radius: 9px; padding: 8px 6px 8px; box-shadow: inset 0 3px 0 rgba(0,0,0,.35); }
.shop-btns { display: flex; flex-direction: column; gap: 8px; }
.shop-btns .btn { padding: 6px 6px; font-size: 15px; line-height: 1.05; }
#btn-next { flex: 1.3; } #btn-reroll { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
#btn-reroll .price-pill { margin: 0; }
.shelf { display: flex; gap: 8px; justify-content: space-around; align-items: flex-end; padding-top: 22px; perspective: 700px; min-height: 176px; }
.card.mini { max-width: 112px; }
.card.mini .cface { min-height: 150px; justify-content: flex-start; padding-top: 6px; }
.card.mini .cart { width: 72%; }
.card.mini .cname { font-size: 13px; flex: 1; display: flex; align-items: center; }
.card .price, .voucher .price, .chest .price { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); z-index: 3; background: var(--panel-2); color: var(--gold);
  border: 3px solid var(--ink); font-size: 15px; padding: 1px 8px; border-radius: 8px; box-shadow: 0 3px 0 var(--ink); white-space: nowrap; text-shadow: var(--shadow); }
.price.poor { color: var(--red); }
.card-sold { flex: 1; max-width: 112px; min-height: 150px; border: 3px dashed rgba(255,255,255,.2); border-radius: 11px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px; text-align: center; }
.card-sold.small { min-height: 118px; max-width: none; width: 100%; } .card-sold small { font-size: 11px; }
.shop-bottom { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.vslot, .pslot { background: rgba(0,0,0,.28); border-radius: 9px; padding: 4px 6px 8px; box-shadow: inset 0 3px 0 rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 18px; }
.slot-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; text-align: center; }
#packs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#packs .chest .pack { padding: 9px 4px 9px; min-height: 104px; justify-content: center; }
#packs .chest .cname { font-size: 13px; line-height: 1.05; }
#packs .chest .csize { font-size: 11px; }
.chest .cicon { margin-top: 2px; filter: drop-shadow(0 3px 0 rgba(0,0,0,.35)); }
.voucher { position: relative; font: inherit; color: #fff; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; animation: deal .55s cubic-bezier(.3, 1.5, .5, 1) backwards; }
.vface { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 104px; padding: 10px 4px;
  background: radial-gradient(circle at 50% 35%, #ffe7a3, #f0a43a 60%, #b5651d); border: 3px solid var(--ink); border-radius: 50% 50% 14px 14px / 30% 30% 14px 14px;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.35), inset 0 -6px 0 rgba(0,0,0,.25), 0 6px 0 rgba(0,0,0,.5); animation: sway 4s ease-in-out infinite; }
.vname { font-size: 13px; text-shadow: 0 2px 0 var(--ink); text-align: center; }
.voucher.big { width: 150px; cursor: default; } .voucher.big .vface { min-height: 180px; } .voucher.big .vname { font-size: 17px; }
#inv-line { padding: 5px 6px; }
.inv-row { display: flex; gap: 5px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.inv { background: var(--panel-2); border-radius: 8px; padding: 3px 6px; display: flex; align-items: center; gap: 4px; box-shadow: inset 0 3px 0 rgba(0,0,0,.35); min-height: 36px; }
.inv b { font-size: 17px; } .inv small { font-size: 11px; color: var(--muted); }
.inv-next { font-size: 13px; color: var(--gold); text-align: center; padding-top: 4px; }
.enh-chip { position: relative; flex: 0 0 auto; width: 40px; height: 36px; padding: 0; border: 3px solid var(--ink); border-radius: 8px; background: #f4efe2; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.enh-chip .piece-art { width: 26.67px; height: 26.67px; } .enh-chip .eb { position: absolute; right: -5px; top: -6px; }

/* ---------- pack overlay additions ---------- */
#pack-skip { min-width: 160px; }
.cart.enh-art { position: relative; box-shadow: inset 0 0 0 3px var(--ec), inset 0 0 18px var(--ec); }
.cart.enh-art .piece-art { width: 76%; height: 76%; }
.cart.enh-art .eb { position: absolute; right: -4px; top: -4px; }
.cname small { font-size: 11px; color: #555; }

/* ---------- tap-to-inspect sheet ---------- */
#inspect { position: fixed; inset: 0; z-index: 50; background: rgba(5, 8, 14, .7); display: flex; align-items: center; justify-content: center; padding: 16px; }
.ins-box { width: min(340px, 100%); padding: 14px 12px 12px; text-align: center; animation: modalIn .35s cubic-bezier(.3, 1.6, .5, 1); }
.ins-card { display: flex; justify-content: center; padding: 18px 0 6px; perspective: 700px; }
.ins-card .card { max-width: 190px; flex: 0 0 190px; animation: none; }
.ins-card .card .cface { min-height: 250px; } .ins-card .cdesc { font-size: 13px; }
.ins-card .chest.big { width: 150px; } .ins-card .chest.big .pack { min-height: 180px; justify-content: center; }
.ins-desc { font-size: 15px; margin: 6px 0; } .ins-note { font-size: 13px; color: var(--muted); margin: 6px 0; } .ins-note.warn { color: var(--red); }
.ins-state { margin: 4px 0; font-size: 15px; }
.ins-btns { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.ins-btns .btn { padding: 8px 12px; min-width: 48px; }
.mu { color: var(--red); } .ch { color: var(--blue); }

/* ---------- post-game gold breakdown ---------- */
.modal-box.paybox { max-height: calc(100dvh - 24px); overflow-y: auto; padding-top: 12px; }
.paybox h2.win { margin-bottom: 0 !important; } .paybox .reason { margin: 0 0 6px !important; font-size: 13px !important; }
.cash-sec { text-align: left; font-size: 13px; color: var(--muted); text-transform: uppercase; margin: 8px 2px 3px; }
.cash-sec small { text-transform: none; font-size: 11px; opacity: .8; margin-left: 4px; }
.cash-row span { display: flex; align-items: center; gap: 6px; text-align: left; }
.cash-row b.neg, .ttl-neg { color: var(--red) !important; }
.cash-row.total { margin-top: 8px; }
.cash-wallet { margin: 8px 0 2px !important; font-size: 15px !important; display: flex; align-items: center; justify-content: center; gap: 4px; }
.cash-wallet b { color: var(--gold); font-size: 19px; }
b.gold { color: var(--gold); }
/* "+$N" / "−$N" pops on the board square */
.sqpop { position: absolute; z-index: 30; pointer-events: none; display: flex; align-items: center; gap: 2px; transform: translate(-50%, -50%);
  font-size: 17px; padding: 1px 6px; border-radius: 8px; border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink); white-space: nowrap;
  animation: sqpop 1.4s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.sqpop.plus { background: #2b3b2a; color: var(--gold); } .sqpop.minus { background: var(--red); color: #fff; } .sqpop.saved { background: var(--blue); color: #fff; }
@keyframes sqpop { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.4); } 15% { opacity: 1; transform: translate(-50%, -95%) scale(1.15); } 70% { opacity: 1; transform: translate(-50%, -135%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -175%) scale(.9); } }
.hud-box.hurt { animation: hurt .5s ease-out; }
@keyframes hurt { 0%, 100% { transform: none; } 20% { transform: translateX(-4px); background: #7a2a2a; } 40% { transform: translateX(4px); } 60% { transform: translateX(-2px); } }
@media (prefers-reduced-motion: reduce) { .sqpop { animation-duration: 1.4s; } .hud-box.hurt { animation: none; } }
.over-relics { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; } .over-relics .piece-art { width: 21.33px; height: 21.33px; }
@media (max-height: 700px) { #botbar .portrait { width: 48px; flex-basis: 48px; } }
.card.mini .price { top: -22px; }
.card.mini .ctype { margin-top: 6px; }
body:has(#pack:not(.hidden)) #toast:not(.inline), body:has(#inspect:not(.hidden)) #toast:not(.inline) { top: calc(var(--safe-t) + 10px); bottom: auto; }
#pack .cards-row { margin-bottom: 30px; }
#pack .crar { z-index: 2; }
@media (max-height: 600px) { .shelf { min-height: 160px; } .card.mini .cface { min-height: 138px; } #screen-shop { gap: 4px; } }

/* ---------- type weights (Rubik variable) ---------- */
.btn, .tool .lbl, .ctype, .crar, .rbadge, .slot-lbl, .rr-head, .cash-sec, .hud-box small, .boss-card .tag, .inv small { font-weight: 700; }
.btn-big, .title-big, .modal-body h2, .boss-card h3, .over-title, .pack-title, .hud-box b, .price-pill, .stat b, .cash-row b, .cash-wallet b,
.gold-txt, .float, .chest .price, .inv b, .cname, .vname, #toast, .bot-id b, .sqpop { font-weight: 700; }
.cdesc, .bubble, .modal-body p, .ins-desc, .ins-note, .over-quote .q, .sub, .boss-tip { font-weight: 500; }
.hud-box small, .ctype, .rr-head, .cash-sec, .slot-lbl { letter-spacing: .04em; }

/* =====================================================================================
   v3 overhaul layer (t19): tokens, depth, cards, juice, menu, sheets, tutorial, coach.
   Motion is transform/opacity only; everything below is disabled by .rm / prefers-reduced-motion.
   ===================================================================================== */
.tnum, .hud-box b, .price, .price-pill, .cash-row b, .stat b, .mcount { font-variant-numeric: tabular-nums; }
h1, h2, h3, p, .cdesc, .ins-desc, .tut-card p, .coach-bubble p { text-wrap: pretty; }
h2, h3, .title-big { text-wrap: balance; }
.btn, .mbtn, .tool .lbl { font-weight: 600; }
.skip { position: fixed; left: 8px; top: calc(var(--safe-t) + 8px); z-index: var(--z-skip); background: var(--gold); color: var(--ink); text-shadow: none;
  padding: 8px 12px; border-radius: var(--r-md); font-weight: 600; transform: translateY(-200%); transition: transform var(--t-color) var(--ease); }
.skip:focus { transform: none; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: var(--r-md); }
.card:focus-visible, .chest:focus-visible, .voucher:focus-visible { outline: none; }
.card:focus-visible .cface, .chest:focus-visible .pack, .voucher:focus-visible .vface { outline: 3px solid var(--gold); outline-offset: 3px; }

/* grain + vignette: one fixed layer, no per-frame cost */
#crt { background:
  url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
  repeating-linear-gradient(0deg, rgba(0,0,0,.12) 0 1px, transparent 1px 3px),
  radial-gradient(ellipse at center, transparent 52%, rgba(4,10,14,.6) 100%); opacity: .9; }

/* depth: outline + bevel + tinted cast shadow */
.panel { border-color: var(--ink); box-shadow: inset 0 -4px 0 rgba(4,12,14,.3), inset 0 2px 0 rgba(255,255,255,.07), var(--sh-2); }
#hud { position: relative; z-index: 3; }
#hud .hud-box { border-radius: var(--r-sm); }
#btn-menu { width: 100%; min-height: 36px; padding: 0; border-width: 2px; } #btn-menu .px { width: 21.33px; height: 21.33px; }
.btn { transition: transform 80ms var(--ease), filter var(--t-color) var(--ease); box-shadow: inset 0 -4px 0 var(--d), inset 0 2px 0 rgba(255,255,255,.18), 0 4px 0 var(--ink), 0 10px 18px -10px rgba(4,16,18,.8); }
@media (hover: hover) { .btn:hover:not(:disabled) { filter: brightness(1.08); } }
.btn-sm { min-height: 40px; padding: 6px 12px; font-size: 14px; border-width: 2px; }
.btn-ghost { background: rgba(255,255,255,.06); --d: rgba(0,0,0,.25); border-color: rgba(12,20,23,.9); }
.btn-close { width: 44px; min-height: 44px; font-size: 18px; flex: 0 0 44px; }

/* screen transitions */
.enter { animation: screenIn var(--t-move) var(--ease) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
#modal.enter .modal-box, #inspect.enter .ins-box { animation: none; }
#modal.enter { animation: fadeIn 220ms var(--ease) both; } #modal.enter .modal-box { animation: modalIn2 var(--t-move) var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn2 { from { opacity: 0; transform: translateY(40px) scale(.92); } 60% { transform: translateY(-4px) scale(1.01); } to { opacity: 1; transform: none; } }

/* ---------------- cards: paper face, rarity rim, foil, float, flip-in deal ---------------- */
.card, .chest, .voucher { animation: none; }
.card { transition: transform 260ms var(--ease); }
.cface { background: linear-gradient(180deg, #fbf8ef, var(--paper) 40%, var(--paper-2)); border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 3px var(--rc), inset 0 0 0 5px rgba(255,255,255,.65), inset 0 -8px 0 rgba(60,40,10,.1), var(--sh-3); }
.card-in { transform-origin: 50% 90%; }
.cart { background: radial-gradient(circle at 50% 30%, #fff, #ece3cf 70%); box-shadow: inset 0 -4px 0 rgba(60,40,10,.12), 0 0 0 3px rgba(255,255,255,.7); }
.ctype { border-radius: var(--r-sm); font-size: 11px; letter-spacing: .05em; }
.cname { font-weight: 700; }
.cdesc { border-radius: var(--r-md); font-size: 12px; line-height: 1.25; padding: 6px; background: linear-gradient(180deg, #2a3c44, #1f2f36); }
.crar { border-radius: var(--r-sm); font-size: 12px; padding: 2px 8px; font-weight: 600; letter-spacing: .02em; }
.card .cback { display: none; }
/* square rarity flag: letter + colour, never colour alone */
.rflag { position: absolute; z-index: 3; top: 6px; right: 6px; display: flex; gap: 2px; padding: 3px; background: var(--rc); border: 2px solid var(--ink); border-radius: 4px; box-shadow: 0 2px 0 var(--ink); }
.rflag i { display: block; width: 4px; height: 4px; background: #fff; box-shadow: 0 1px 0 rgba(6,14,16,.5); }
.card.mini .rflag { top: 4px; right: 4px; }
.card.locked { cursor: default; } .card.locked .cface { filter: grayscale(1) brightness(.45); } .card.locked .cart .px { opacity: .5; }
/* foil by rarity — a transform-animated sheen layer (no background-position animation) */
.sheen { inset: -40%; border-radius: 0; opacity: 0; mix-blend-mode: soft-light; animation: none; background-size: auto; }
.card.r-uncommon .sheen { opacity: .55; background: linear-gradient(110deg, transparent 38%, rgba(255,255,255,.95) 48%, transparent 58%); transform: translateX(-30%); animation: sheenSweep 4.5s var(--ease) infinite; }
.card.r-rare .sheen { opacity: .75; background: linear-gradient(110deg, transparent 25%, rgba(255,255,255,.9) 38%, rgba(140,210,255,.8) 46%, rgba(255,190,240,.75) 54%, transparent 66%); transform: translateX(-30%); animation: sheenSweep 3.6s var(--ease) infinite; }
.card.r-legendary .sheen { opacity: .5; mix-blend-mode: color-dodge; background: conic-gradient(from 0deg, #ff8a8a66, #ffd98066, #8ff0b566, #86d4ff66, #c8a2ff66, #ff8a8a66); animation: foilSpin 7s linear infinite; }
.card.r-legendary .cface { box-shadow: inset 0 0 0 3px var(--rc), inset 0 0 0 5px rgba(255,255,255,.65), inset 0 -8px 0 rgba(60,40,10,.1), var(--sh-3), 0 0 22px -4px rgba(156,112,237,.65); }
@keyframes sheenSweep { 0%, 55% { transform: translateX(-45%); } 100% { transform: translateX(45%); } }
@keyframes foilSpin { to { transform: rotate(360deg); } }
.card.tilting .sheen { animation: none; transform: translateX(calc((var(--mx, 50%) - 50%) * .8)) translateY(calc((var(--my, 50%) - 50%) * .4)); }
.card.r-legendary.tilting .sheen { transform: rotate(calc(var(--ry, 0deg) * 8)); }
.card.tilting .card-in { transform: perspective(600px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0)) scale(1.06); }
/* idle float — staggered so a shelf never moves in lockstep */
.card-in { animation: float 3.6s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -0.9s); }
@keyframes float { 0%, 100% { transform: rotate(var(--tilt, 0deg)) translateY(0); } 50% { transform: rotate(calc(var(--tilt, 0deg) * -.6)) translateY(-5px); } }
/* deal: fly in from the deck, flip at the midpoint (scaleX through 0), back face hides on the swap */
.deal .card, #pack-cards.deal .card { animation: dealFly 620ms var(--ease) backwards; animation-delay: calc(var(--i, 0) * 60ms + 80ms); }
.deal .card .cface::after, #pack-cards.deal .card .cface::after { content: ''; position: absolute; inset: 0; z-index: 4; border-radius: inherit; pointer-events: none;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.1) 0 6px, transparent 6px 12px), radial-gradient(circle at 50% 50%, #5b3f9c, #2b1d52);
  box-shadow: inset 0 0 0 4px var(--ink), inset 0 0 0 7px var(--gold-d); animation: backOff 620ms steps(1, end) backwards; animation-delay: calc(var(--i, 0) * 60ms + 80ms); opacity: 0; }
@keyframes dealFly { 0% { opacity: 0; transform: translate(120px, -40px) rotate(14deg) scale(.7); } 15% { opacity: 1; } 45% { transform: translate(30px, -16px) rotate(4deg) scaleX(.04) scaleY(1.02); }
  75% { transform: translateY(-8px) scaleX(1.04) scaleY(.98); } 100% { transform: none; } }
@keyframes backOff { 0% { opacity: 1; } 45% { opacity: 1; } 46%, 100% { opacity: 0; } }
.deal .chest, .deal .voucher { animation: dropIn 560ms var(--ease) backwards; animation-delay: calc(var(--i, 0) * 60ms + 240ms); }
@keyframes dropIn { from { opacity: 0; transform: translateY(-30px) scale(.85); } 60% { transform: translateY(3px) scaleY(.96) scaleX(1.03); } to { opacity: 1; transform: none; } }
.chest .pack { border-radius: var(--r-md); box-shadow: inset 0 -6px 0 rgba(0,0,0,.25), inset 0 3px 0 rgba(255,255,255,.25), var(--sh-3); animation: float 3.8s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -1.1s); }
.chest.tilting .pack { transform: perspective(600px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0)) scale(1.04); }
.vface { box-shadow: inset 0 0 0 3px rgba(255,255,255,.35), inset 0 -6px 0 rgba(0,0,0,.25), var(--sh-3); animation: float 4.2s ease-in-out infinite; }
.voucher.tilting .vface { animation: none; transform: perspective(600px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0)) scale(1.04); }
.card .price, .voucher .price, .chest .price { border-radius: var(--r-sm); font-weight: 700; }
.fly-ghost { position: fixed; z-index: var(--z-fx); pointer-events: none; transform-origin: 50% 50%; will-change: transform, opacity; }
.fly-ghost .card { width: 100%; max-width: none; animation: none; } .fly-ghost .card-in { animation: none; } .fly-ghost .price { display: none; }
.rtile { border-radius: var(--r-md); box-shadow: inset 0 0 0 2px var(--rc), inset 0 -5px 0 rgba(60,40,10,.14), var(--sh-1); animation: float 3.6s ease-in-out infinite; }
.rtile.jiggle { animation: jiggle 600ms var(--ease); }
@keyframes jiggle { 0% { transform: scale(1); } 25% { transform: scale(1.32, .78) rotate(-8deg); } 55% { transform: scale(.92, 1.12) rotate(6deg); } 100% { transform: none; } }

/* ---------------- juice primitives used by fx.js ---------------- */
#fx-layer { position: fixed; inset: 0; z-index: var(--z-fx); pointer-events: none; overflow: hidden; }
.pt { position: fixed; animation: none; opacity: 0; will-change: transform, opacity; }
.pt.go { animation: pt 900ms cubic-bezier(.2, .7, .4, 1) forwards; }
img.flycoin { position: fixed; width: 18px; height: 18px; image-rendering: pixelated; z-index: var(--z-fx); pointer-events: none; will-change: transform, opacity; filter: drop-shadow(0 2px 0 rgba(6,14,16,.6)); }
img.flycoin.loss { filter: drop-shadow(0 2px 0 rgba(60,8,8,.7)); }
#hud-gold { display: inline-block; transform-origin: 50% 70%; }
.squash { animation: squash 420ms var(--ease); }
.squash-loss { animation: squashLoss 460ms var(--ease); color: var(--red); }
@keyframes squash { 0% { transform: none; } 30% { transform: scale(1.4, .7) translateY(2px); } 60% { transform: scale(.9, 1.2) translateY(-3px); } 100% { transform: none; } }
@keyframes squashLoss { 0% { transform: none; } 25% { transform: scale(.75, 1.25) rotate(-6deg); } 55% { transform: scale(1.1, .9) rotate(4deg); } 100% { transform: none; } }
.hitstop cg-pieces piece, .hitstop .sqpop { animation-play-state: paused !important; }
.hitstop { transform: scale(1.012); }
.flash { position: absolute; inset: 0; z-index: 20; pointer-events: none; background: #fff; border-radius: inherit; opacity: 0; animation: flash 240ms ease-out forwards; mix-blend-mode: screen; }
.flash.tint { animation: tint 260ms ease-out forwards; mix-blend-mode: normal; }
@keyframes flash { 0% { opacity: .55; } 100% { opacity: 0; } }
@keyframes tint { 0% { opacity: .18; } 100% { opacity: 0; } }
#board-wrap { isolation: isolate; }
.sqpop { border-radius: var(--r-sm); font-weight: 700; animation: sqpop2 1.3s var(--ease) forwards; }
@keyframes sqpop2 { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.3); } 14% { opacity: 1; transform: translate(-50%, -90%) scale(1.3, .8); } 26% { transform: translate(-50%, -110%) scale(.95, 1.08); }
  70% { opacity: 1; transform: translate(-50%, -130%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -170%) scale(.9); } }

/* ---------------- payout sequence ---------------- */
.paybox .cash-row { animation: none; }
.paybox .cash-row:not(.in) { opacity: 0; transform: translateX(-16px); }
.paybox .cash-row.in { animation: rowPop 420ms var(--ease) both; }
@keyframes rowPop { 0% { opacity: 0; transform: translateX(-16px); } 60% { opacity: 1; transform: translateX(2px) scale(1.02); } 100% { opacity: 1; transform: none; } }
.paybox .cash-row.total.in b { display: inline-block; animation: squash 500ms var(--ease); }
#pay-total { display: inline-block; }

/* ---------------- boss intro: stripe swipe + token slam ---------------- */
.modal-box.bossbox { position: relative; overflow: hidden; background: radial-gradient(circle at 50% 30%, #4d1420, #2a0a12); }
.boss-stripes { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.boss-stripes i { position: absolute; left: -10%; right: -10%; height: 34%; background: var(--bc, rgba(236,111,103,.35)); opacity: .0; transform: translateX(-120%) skewX(-18deg); }
.boss-stripes i:nth-child(1) { top: 4%; background: rgba(236,111,103,.28); animation: stripe 720ms var(--ease) 80ms both; }
.boss-stripes i:nth-child(2) { top: 36%; background: rgba(12,20,23,.55); animation: stripe 720ms var(--ease) 160ms both; }
.boss-stripes i:nth-child(3) { top: 68%; background: rgba(234,188,82,.22); animation: stripe 720ms var(--ease) 240ms both; }
@keyframes stripe { 0% { opacity: 1; transform: translateX(-120%) skewX(-18deg); } 55% { opacity: 1; transform: translateX(0) skewX(-18deg); } 100% { opacity: 0; transform: translateX(120%) skewX(-18deg); } }
.boss-card { position: relative; z-index: 1; }
.boss-token { animation: slam 620ms var(--ease) 300ms both, tokenFloat 2.6s 1s ease-in-out infinite; }
@keyframes slam { 0% { opacity: 0; transform: scale(2.6) rotate(-30deg); } 55% { opacity: 1; transform: scale(.82, 1.18) rotate(4deg); } 72% { transform: scale(1.14, .86); } 100% { opacity: 1; transform: none; } }
.boss-card h2, .boss-card h3, .boss-card p, .boss-card .tag { animation: rise 500ms var(--ease) both; }
.boss-card .tag { animation-delay: 120ms; } .boss-card h2 { animation-delay: 620ms; } .boss-card h3 { animation-delay: 680ms; } .boss-card p { animation-delay: 740ms; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------------- full-screen layers: menu & sheets ---------------- */
.layer { position: fixed; inset: 0; z-index: var(--z-sheet); }
#screen-menu { z-index: var(--z-menu); display: flex; justify-content: center; overflow-y: auto; overscroll-behavior: contain;
  padding: calc(var(--safe-t) + var(--s5)) var(--s4) calc(var(--safe-b) + var(--s4));
  background: radial-gradient(ellipse at 50% 30%, transparent 30%, rgba(6,10,24,.55) 100%); }
#screen-menu.leaving { animation: fadeOut 260ms var(--ease) forwards; }
@keyframes fadeOut { to { opacity: 0; } }
.menu-wrap { width: min(360px, 100%); min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s4); }
.logo { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; line-height: .95; transform-origin: 50% 80%;
  animation: logoIdle 4.8s ease-in-out infinite; }
.logo-ico { display: block; margin-bottom: var(--s2); animation: float 3s ease-in-out infinite; filter: drop-shadow(0 4px 0 rgba(6,14,16,.6)); }
.logo-ico .px { width: 64px; height: 64px; }
.logo-l1, .logo-l2 { display: block; font-weight: 700; letter-spacing: -.01em; text-shadow: 0 4px 0 var(--ink), 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 -3px 0 var(--ink), 3px 3px 0 var(--ink), -3px 3px 0 var(--ink), 0 10px 18px rgba(6,10,30,.6); }
.logo-l1 { font-size: 30px; color: #fff; }
.logo-l2 { font-size: 48px; color: var(--gold); margin-top: 2px; }
#screen-menu.open .logo-l1 { animation: logoDrop 700ms var(--ease) both; }
#screen-menu.open .logo-l2 { animation: logoDrop 760ms var(--ease) 90ms both; }
@keyframes logoDrop { 0% { opacity: 0; transform: translateY(-40px) scale(1.3, .6); } 55% { opacity: 1; transform: translateY(4px) scale(.94, 1.1); } 80% { transform: scale(1.03, .97); } 100% { transform: none; } }
@keyframes logoIdle { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg) scale(1.02); } }
.logo.boing { animation: boing 600ms var(--ease); }
@keyframes boing { 0% { transform: none; } 25% { transform: scale(1.18, .82); } 50% { transform: scale(.9, 1.12) rotate(-3deg); } 75% { transform: scale(1.04, .96) rotate(2deg); } 100% { transform: none; } }
.tagline { margin: 0; font-size: 16px; color: var(--muted); text-align: center; line-height: 1.4; max-width: 30ch; }
.tagline span { display: inline-block; opacity: 0; }
.tagline.go span { animation: word 500ms var(--ease) both; animation-delay: calc(var(--i) * 60ms + 500ms); }
@keyframes word { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.save-chip { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-md); font-size: 14px;
  background: rgba(12,20,23,.55); border: 2px solid rgba(255,255,255,.08); text-align: center; }
.save-chip small { width: 100%; color: var(--muted); font-size: 12px; }
.menu-list { display: flex; flex-direction: column; gap: var(--s3); width: 100%; }
.mbtn { font: inherit; font-size: 18px; font-weight: 600; color: #fff; text-shadow: var(--shadow); position: relative; min-height: 56px; width: 100%; cursor: pointer;
  display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s4); text-align: left;
  background: var(--panel-3); --d: #24363d; border: 3px solid var(--ink); border-radius: var(--r-lg);
  box-shadow: inset 0 -5px 0 var(--d), inset 0 2px 0 rgba(255,255,255,.14), 0 5px 0 var(--ink), 0 14px 22px -12px rgba(4,10,30,.8);
  transition: transform 120ms var(--ease), filter var(--t-color) var(--ease); }
.mbtn.primary { background: var(--green); --d: var(--green-d); font-size: 20px; min-height: 64px; }
.mbtn .mico { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: var(--r-sm); background: rgba(12,20,23,.35); box-shadow: inset 0 2px 0 rgba(0,0,0,.25); }
.mbtn .mcount { margin-left: auto; font-size: 14px; color: var(--gold); background: var(--ink); border-radius: var(--r-sm); padding: 2px 8px; }
.mbtn:active { transform: translateY(3px); box-shadow: inset 0 -2px 0 var(--d), 0 2px 0 var(--ink); }
@media (hover: hover) { .mbtn:hover { transform: translateX(4px); filter: brightness(1.08); } }
.mbtn:focus-visible { outline-offset: 4px; border-radius: var(--r-lg); }
#screen-menu.open .mbtn { animation: mIn 500ms var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms + 260ms); }
@keyframes mIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
.menu-foot { margin: 0; font-size: 14px; color: var(--muted); }

.sheet { display: flex; align-items: flex-end; justify-content: center; background: rgba(4,8,14,.6); }
.sheet.open { animation: fadeIn 220ms var(--ease) both; }
.sheet.leaving { animation: fadeOut 240ms var(--ease) forwards; }
.sheet-box { width: min(520px, 100%); max-height: calc(100dvh - var(--safe-t) - 24px); overflow-y: auto; overscroll-behavior: contain;
  padding: var(--s4) var(--s4) calc(var(--safe-b) + var(--s4)); border-radius: var(--r-xl) var(--r-xl) 0 0; border-bottom: 0; background: linear-gradient(180deg, #33484f, var(--panel)); }
.sheet-box.tall { height: calc(100dvh - var(--safe-t) - 24px); }
.sheet.open .sheet-box, .sheet.open .tut-box { animation: sheetUp var(--t-move) var(--ease) both; }
.sheet.leaving .sheet-box { animation: sheetDown 240ms var(--ease) forwards; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheetDown { to { transform: translateY(100%); } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.sheet-title { margin: 0; font-size: 24px; font-weight: 700; text-shadow: 0 3px 0 var(--ink); }
.sheet-sub { margin: 4px 0 var(--s4); color: var(--muted); font-size: 14px; }
.sheet-note { margin: var(--s4) 0 0; color: var(--muted); font-size: 12px; text-align: center; }
#sheet-pause .sheet-title { text-align: center; } #sheet-pause .sheet-sub { text-align: center; }
/* settings */
.set-h { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: var(--s4) 0 var(--s2); }
.set-h:first-child { margin-top: 0; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid rgba(255,255,255,.07); min-height: 52px; }
.set-lbl { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; } .set-lbl b { font-size: 16px; font-weight: 600; } .set-lbl small { font-size: 12px; color: var(--muted); }
.switch { flex: 0 0 auto; width: 56px; height: 34px; border-radius: 17px; border: 3px solid var(--ink); background: #1a272c; position: relative; cursor: pointer; padding: 0;
  box-shadow: inset 0 3px 0 rgba(0,0,0,.35); transition: background var(--t-color) var(--ease); }
.switch span { position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #c9d4d6; box-shadow: 0 2px 0 var(--ink); transition: transform var(--t-color) var(--ease); }
.switch.on { background: var(--green); } .switch.on span { transform: translateX(22px); background: #fff; }
.switch::after { content: attr(data-off); position: absolute; right: 100%; margin-right: 8px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted); }
.switch.on::after { content: attr(data-on); color: var(--gold); }
.seg { display: flex; flex: 0 0 auto; border: 3px solid var(--ink); border-radius: var(--r-md); overflow: hidden; background: #1a272c; }
.seg button { font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); background: none; border: 0; padding: 0 10px; min-height: 38px; cursor: pointer; }
.seg button + button { border-left: 2px solid var(--ink); }
.seg button.on { background: var(--blue); color: #fff; text-shadow: var(--shadow); }
@media (max-width: 360px) { .set-row { flex-wrap: wrap; } .set-row.nw { flex-wrap: nowrap; } .set-row.nw .vol { flex-basis: 120px; min-width: 96px; } .seg button { padding: 0 8px; } }
/* tutorial */
#tutorial { align-items: center; padding: calc(var(--safe-t) + 12px) var(--s3) calc(var(--safe-b) + 12px); background: rgba(4,8,14,.72); }
.tut-box { width: min(420px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: var(--s3); }
#tut-step { flex: 1 1 auto; min-height: 0; touch-action: pan-y; }
.tut-card { background: linear-gradient(180deg, #fbf8ef, var(--paper) 50%, var(--paper-2)); color: #1d2326; text-shadow: none; border: 3px solid var(--ink); border-radius: var(--r-xl);
  padding: var(--s5) var(--s4) var(--s4); text-align: center; position: relative; box-shadow: inset 0 0 0 3px var(--gold), inset 0 -8px 0 rgba(60,40,10,.1), var(--sh-3);
  animation: tutIn var(--t-move) var(--ease) both; }
@keyframes tutIn { from { opacity: 0; transform: translateX(24px) rotate(1.5deg); } to { opacity: 1; transform: none; } }
.tut-ico { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); width: 56px; height: 56px; display: grid; place-items: center; border-radius: var(--r-lg); background: var(--panel); border: 3px solid var(--ink); box-shadow: var(--sh-1); }
.tut-n { display: block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #6b6150; margin-top: 4px; }
.tut-card h2 { margin: 4px 0 var(--s3); font-size: 24px; font-weight: 700; color: #1d2326; }
.tut-card p { margin: var(--s3) 0 0; font-size: 16px; line-height: 1.45; color: #2c3438; }
.demo { display: flex; align-items: center; justify-content: center; gap: var(--s3); min-height: 120px; border-radius: var(--r-lg); background: #2a3c44; box-shadow: inset 0 4px 0 rgba(0,0,0,.3); padding: var(--s3); color: #fff; text-shadow: var(--shadow); }
.demo .dp { width: 64px; height: 64px; border-radius: var(--r-md); display: grid; place-items: center; background: #eeeed2; box-shadow: inset 0 0 0 3px #769656, 0 4px 0 var(--ink); }
.demo .dp.b { background: #769656; box-shadow: inset 0 0 0 3px #eeeed2, 0 4px 0 var(--ink); }
.demo .dp img { width: 52px; height: 52px; }
.demo .vs { font-weight: 700; color: var(--gold); font-size: 20px; }
.demo .arrow { width: 28px; height: 4px; background: var(--gold); position: relative; border-radius: 2px; }
.demo .arrow::after { content: ''; position: absolute; right: -4px; top: -6px; border: 8px solid transparent; border-left: 10px solid var(--gold); border-right: 0; }
.demo .gain { display: inline-flex; align-items: center; gap: 4px; font-size: 20px; font-weight: 700; color: var(--gold); padding: 4px 10px; background: #1f2b2a; border: 2px solid var(--ink); border-radius: var(--r-sm); animation: gainPop 1.8s var(--ease) infinite; }
.demo .gain.neg { color: #fff; background: var(--red); }
.demo .hit { animation: hitPulse 1.8s var(--ease) infinite; }
@keyframes gainPop { 0%, 30% { opacity: 0; transform: translateY(8px) scale(.6); } 45% { opacity: 1; transform: translateY(-4px) scale(1.2, .85); } 60%, 90% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-10px); } }
@keyframes hitPulse { 0%, 25% { transform: none; } 32% { transform: scale(1.18, .84); } 42% { transform: scale(.94, 1.06); } 55%, 100% { transform: none; } }
.demo-cards { gap: var(--s4); padding: var(--s5) var(--s3) var(--s3); }
.demo-cards .card { flex: 0 0 104px; max-width: 104px; } .demo-cards .card .cface { min-height: 132px; }
.demo-chest .chest { width: 132px; } .demo-chest .chest .pack { min-height: 100px; justify-content: center; }
.boss-chip { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-3); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); animation: float 2.8s ease-in-out infinite; animation-delay: calc(var(--i) * -.7s); }
.boss-chip:nth-child(1) { background: #b9cf45; } .boss-chip:nth-child(2) { background: var(--purple); } .boss-chip:nth-child(3) { background: var(--red); }
.dots { display: flex; justify-content: center; gap: 4px; }
.dots .dot { width: 32px; height: 32px; padding: 0; border: 0; background: none; cursor: pointer; position: relative; }
.dots .dot::after { content: ''; position: absolute; inset: 11px; border-radius: 50%; background: rgba(255,255,255,.28); transition: transform var(--t-color) var(--ease), background var(--t-color) var(--ease); }
.dots .dot.on::after { background: var(--gold); transform: scale(1.4); }
.tut-nav { display: grid; grid-template-columns: 1fr 1.6fr; gap: var(--s3); }
.tut-box .sheet-title { color: #fff; }
/* collection */
.coll-sub { margin: 0 0 var(--s4); font-size: 14px; color: var(--muted); }
.coll-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s5) var(--s3); padding: var(--s2) 0 var(--s4); perspective: 700px; }
.coll-grid .card.mini { max-width: none; } .coll-grid .card.mini .cface { min-height: 132px; }
.coll-grid .card-in { animation: none; }
/* coach marks */
#coach { position: fixed; inset: 0; z-index: var(--z-coach); }
.coach-hole { position: fixed; border-radius: var(--r-lg); box-shadow: 0 0 0 9999px rgba(4,8,14,.68); pointer-events: none; transition: none; }
.coach-hole::after { content: ''; position: absolute; inset: -4px; border: 3px solid var(--gold); border-radius: inherit; animation: coachPulse 1.6s ease-in-out infinite; }
@keyframes coachPulse { 50% { opacity: .4; transform: scale(1.02); } }
.coach-bubble { position: fixed; left: var(--s3); right: var(--s3); max-width: 420px; margin: 0 auto; padding: var(--s4); background: linear-gradient(180deg, #33484f, var(--panel)); }
#coach.open .coach-bubble { animation: modalIn2 var(--t-move) var(--ease) both; }
.coach-bubble p { margin: 0 0 var(--s3); font-size: 16px; line-height: 1.45; }
.coach-btns { display: flex; gap: var(--s2); justify-content: flex-end; flex-wrap: wrap; }

/* inspect → bottom sheet */
#inspect { z-index: var(--z-inspect); align-items: flex-end; padding: 0; background: rgba(4,8,14,.66); }
.ins-box { width: min(520px, 100%); border-radius: var(--r-xl) var(--r-xl) 0 0; border-bottom: 0; padding: var(--s3) var(--s4) calc(var(--safe-b) + var(--s4)); animation: none;
  background: linear-gradient(180deg, #33484f, var(--panel)); max-height: 92dvh; overflow-y: auto; }
#inspect.enter { animation: fadeIn 200ms var(--ease) both; } #inspect.enter .ins-box { animation: sheetUp var(--t-move) var(--ease) both; }
.ins-box::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.25); margin: 0 auto var(--s2); }
.ins-card .card { animation: none; } .ins-card .card-in { animation: float 3.6s ease-in-out infinite; }
#inspect.enter .ins-card .card { animation: dealFly 560ms var(--ease) 80ms backwards; }

/* z-index scale */
#pack { z-index: var(--z-pack); background: radial-gradient(ellipse at 50% 40%, rgba(60,36,110,.85), rgba(8,4,20,.94)); }
#modal { z-index: var(--z-modal); } #toast { z-index: var(--z-toast); }
#toast { border-radius: var(--r-md); font-weight: 600; }

/* HUD gold during a loss */
.hud-box.hurt { animation: hurt2 500ms var(--ease); }
@keyframes hurt2 { 0%, 100% { transform: none; } 20% { transform: translateX(-5px) rotate(-2deg); } 45% { transform: translateX(4px) rotate(1deg); } 70% { transform: translateX(-2px); } }
#screen-over .controls { gap: var(--s3); }

/* typography snaps to the scale 12/14/16/18/20/24/30/36/48 */
html, body { font-size: 16px; }
.hud-box small, .rr-head, .slot-lbl, .tool .lbl, .rbadge { font-size: 12px; }
.sub, .bot-id small, .cash-sec, .ins-note, .boss-tip, .over-quote .q, .chest .csize, .inv-next, .cdesc { font-size: 14px; }
#packs .chest .csize { font-size: 12px; } .cdesc { font-size: 12px; }
.title-big, .modal-body h2 { font-size: 30px; } .over-title { font-size: 36px; } .shop-head .title-big { font-size: 24px; }
.hud-box b { font-size: 20px; } .btn { font-size: 16px; } .btn-big { font-size: 20px; }
@media (max-width: 400px) { .hud-box b { font-size: 18px; } }

/* reduced motion: OS setting or the in-game toggle (.rm) — keep fades, drop movement */
html.rm *, html.rm *::before, html.rm *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
html.rm .tagline span { opacity: 1; }
html.rm .paybox .cash-row:not(.in) { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .tagline span { opacity: 1; } .card-in, .chest .pack, .vface, .rtile, .logo, .logo-ico { animation: none !important; } }

/* ---- t19 review fixes ---- */
[hidden] { display: none !important; }
#tutorial { background: rgba(6,10,16,.93); }
.tut-n { margin-top: 22px; }
.menu-wrap { margin-inline: auto; }

/* HUD: «Раунд N из 9» + gold (t27) */
#hud { grid-template-columns: 1.25fr 1fr 46px; }
.hb-round b { font-size: 20px; }
/* opening target strip */
#open-goal { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 3px 8px; border-radius: var(--r-md, 12px);
  background: linear-gradient(180deg, #23323a, #1b272d); border: 2px solid var(--ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), var(--sh-1); font-size: 12px; }
#open-goal.hidden { display: none; }
#open-goal .og-ico { flex: none; display: grid; }
#open-goal .og-name { flex: none; display: flex; flex-direction: column; line-height: 1.1; }
#open-goal .og-name b { font-size: 12px; font-weight: 700; color: var(--gold); white-space: nowrap; }
#open-goal .og-name small { font-size: 10px; color: var(--muted); white-space: nowrap; }
#open-goal .og-line { flex: 1; min-width: 0; display: flex; gap: 3px; align-items: baseline; overflow: hidden; white-space: nowrap; font-variant-numeric: tabular-nums; color: #8ea1a8; }
#open-goal .og-line .mn { color: #5f7178; margin-left: 2px; }
#open-goal .gm { padding: 0 2px; border-radius: 3px; }
#open-goal .gm.done { color: #fff; }
#open-goal .gm.done.w { color: #bff0d0; }
#open-goal .gm.next { color: var(--ink); background: var(--gold); font-weight: 700; }
#open-goal .gm.bot { color: #fff; box-shadow: inset 0 0 0 1px #8ea1a8; }
#open-goal .gm.off { text-decoration: line-through; opacity: .55; }
#open-goal .og-pay { flex: none; font-weight: 700; color: var(--gold); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
#open-goal .og-pay.got { color: #7fe0a6; }
#open-goal .og-pay.off, #open-goal.missed .og-name b { color: var(--muted); }
html:not(.rm) #open-goal.intro { animation: goalIn 600ms var(--ease) both; }
@keyframes goalIn { 0% { opacity: 0; transform: translateY(-8px) scale(.96); } 60% { opacity: 1; transform: translateY(0) scale(1.03); } 100% { transform: none; } }
@media (max-width: 380px) { #open-goal .og-name small { display: none; } #open-goal { gap: 6px; font-size: 11px; } }
.boss-why { font-style: italic; opacity: .85; margin-bottom: 4px; }
.boss-book { font-size: 13px; margin-top: 8px; padding: 6px 8px; border-radius: 8px; background: rgba(6,10,16,.35); display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; }
.boss-book b { color: var(--gold); font-variant-numeric: tabular-nums; }
.over-title.won { color: var(--gold); }
.coll-sec { margin: 14px 0 6px; font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.deb-list { display: grid; gap: 6px; }
.deb-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); border: 2px solid var(--ink); }
.deb-row b { font-size: 14px; } .deb-row small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.deb-row .rule { font-size: 12px; color: var(--gold); }
.deb-row.locked b, .deb-row.locked small { opacity: .45; }
.demo-debut { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #fff; }
.demo-debut b { color: var(--gold); font-size: 16px; }
.demo-debut .tline { font-variant-numeric: tabular-nums; font-size: 15px; color: #8ea1a8; }
.demo-debut .tline i { font-style: normal; color: #5f7178; margin-right: 2px; }
.demo-debut .tline .done { color: #bff0d0; } .demo-debut .tline .next { color: var(--ink); background: var(--gold); border-radius: 3px; padding: 0 3px; font-weight: 700; }
#open-goal .og-line { gap: 6px; position: relative; }
#open-goal .og-line .fm { display: inline-flex; gap: 3px; align-items: baseline; flex: none; }
#open-goal .og-line.more { -webkit-mask-image: linear-gradient(90deg, #000 80%, transparent); mask-image: linear-gradient(90deg, #000 80%, transparent); }
#tutorial{background:rgba(6,10,16,.97)}
/* ---------- t29: upgrade chests (3 / 5 / 8 cards), per-enhancement board badge ---------- */
cg-board square.enh { overflow: hidden; background-image: var(--eb, none), radial-gradient(circle at 84% 16%, #0b1215 0 15%, transparent 15.5%);
  background-size: 30% 30%, 100% 100%; background-position: 95% 5%, 0 0; background-repeat: no-repeat; image-rendering: pixelated; }
cg-board square.enh::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.5) 50%, transparent 62%); transform: translateX(-130%); animation: enhGlint 5s ease-in-out infinite; }
@keyframes enhGlint { 0%, 70% { transform: translateX(-130%); } 90%, 100% { transform: translateX(130%); } }
html.rm cg-board square.enh::after { animation: none; display: none; }
cg-board square.enh.used { background-image: none; }
cg-board square.enh.used::after { display: none; }
#pack-cards.grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 6px; max-width: 520px; }
#pack-cards.grid .card.compact { flex: 0 0 calc((100% - 12px) / 3); width: auto; min-width: 0; }
#pack-cards.grid[data-n="8"] .card.compact { flex-basis: calc((100% - 18px) / 4); }
.card.compact .cface { padding: 6px 4px 8px; gap: 3px; }
.card.compact .ctype { font-size: 9px; }
.card.compact .cart { width: 100%; aspect-ratio: 1; height: auto; max-height: 64px; }
.card.compact .cart .piece-art { width: 70%; height: 70%; }
.card.compact .cname { font-size: 12px; line-height: 1.05; }
.card.compact .cname small { font-size: 10px; font-weight: 500; opacity: .8; }
.card.compact .cdesc { font-size: 10px; line-height: 1.15; min-height: 0; }
.card.compact .crepl { font-size: 9px; color: #a7362f; font-style: italic; line-height: 1.1; }
#pack-cards[data-n="8"] .card.compact .cdesc { display: none; }
.enhcard.sel { transform: translateY(-8px) scale(1.04); z-index: 3; }
.enhcard.sel .card-in { box-shadow: 0 0 0 3px var(--gold), 0 0 22px var(--ec); border-radius: inherit; }
.enhcard.taken, .enhcard.blocked { filter: grayscale(.75) brightness(.7); cursor: default; }
.enhcard.taken { filter: none; }
.enhcard.taken .cface { opacity: .55; }
.enhcard .ctaken { position: absolute; inset: 0; display: grid; place-items: center; z-index: 5; }
.enhcard .ctaken img { width: 42px; height: 42px; filter: drop-shadow(0 2px 0 #0b1215); }
html:not(.rm) .enhcard.taken .ctaken img { animation: takenPop 380ms var(--ease) both; }
@keyframes takenPop { 0% { transform: scale(.2); opacity: 0; } 70% { transform: scale(1.2); opacity: 1; } 100% { transform: scale(1); } }
html:not(.rm) .enhcard { transition: transform 160ms var(--ease), filter 200ms; }
#pack-detail { max-width: 520px; width: 100%; margin: 6px auto 0; padding: 8px 10px; border-radius: 12px; background: rgba(20,12,40,.75); border: 2px solid #3a2a66; color: #fff; min-height: 46px; }
#pack-detail.hidden { display: none; }
#pack-detail .pd-hint { margin: 6px 0; text-align: center; color: #c9b3f5; font-size: 13px; }
#pack-detail .pd-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#pack-detail .pd-head b { font-size: 15px; }
#pack-detail .pd-head small { margin-left: auto; color: #c9b3f5; font-size: 12px; }
#pack-detail .pd-rar { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: #2a3a40; }
#pack-detail .pd-rar.r-uncommon { background: #23704a; } #pack-detail .pd-rar.r-rare { background: #a7362f; } #pack-detail .pd-rar.r-legendary { background: #5b36a8; }
#pack-detail .pd-desc { margin: 4px 0 6px; font-size: 13px; line-height: 1.3; }
#pack-detail .pd-desc em { color: #ffb4a8; font-style: normal; }
#pack-detail .pd-go { width: 100%; padding: 8px; font-size: 15px; }
#status[data-enh] { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.cdesc em { font-style: normal; color: #a7362f; font-size: 11px; }
@media (max-height: 600px) { #pack .pack-title { font-size: 18px; margin: 0; } #pack .cards-row { margin-bottom: 8px; } .card.compact .cart { max-height: 50px; } #pack-detail .pd-desc { font-size: 12px; } }
.coll-enh { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.enh-row { display: grid; grid-template-columns: 34px 1fr; gap: 2px 8px; align-items: center; padding: 6px 8px; border-radius: 10px; background: var(--panel-2); border: 2px solid var(--ink); }
.enh-row .ei { grid-row: span 2; width: 34px; height: 34px; border-radius: 8px; background: #f4efe2; display: grid; place-items: center; box-shadow: inset 0 0 0 2px var(--ec); }
.enh-row b { font-size: 13px; } .enh-row small { font-size: 11px; color: var(--muted); line-height: 1.2; }
.enh-row.locked .ei img { filter: brightness(0) opacity(.35); } .enh-row.locked b, .enh-row.locked small { opacity: .5; }
.demo-chest { display: flex; align-items: center; justify-content: center; gap: 6px; }
.demo-chest .chest { transform: scale(.8); }
.dmini { position: relative; width: 46px; height: 58px; border-radius: 8px; background: #f4efe2; border: 3px solid var(--ink); box-shadow: inset 0 0 0 2px var(--ec), 0 3px 0 var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dmini .piece-art { width: 30px; height: 30px; } .dmini .eb { position: absolute; right: -6px; top: -6px; } .dmini small { font-size: 10px; color: #0b1215; font-weight: 700; }
html:not(.rm) .tut-card.on .dmini { animation: dealFly 520ms var(--ease) backwards; animation-delay: calc(var(--i) * 90ms + 200ms); }
/* t29 fix: compact chest cards must not inherit the tall card min-height; overlay scrolls if it ever overflows */
.card.compact { max-width: 140px; }
.card.compact .cface { min-height: 0; }
.card.compact .cart { width: min(78%, 64px); max-height: none; }
#pack-cards[data-n="8"] .card.compact .cart { width: min(80%, 56px); }
#pack { justify-content: safe center; overflow-y: auto; overscroll-behavior: contain; }
#pack-skip { flex: 0 0 auto; margin-top: 8px; align-self: center; }
@media (max-height: 600px) { .card.compact .cart { width: min(70%, 46px); } #pack-cards[data-n="8"] .card.compact .cart { width: min(70%, 40px); } .card.compact .cface { padding: 4px 3px 5px; gap: 2px; } #pack-cards.grid { gap: 6px 5px; } }
#pack-cards[data-n="8"] .card.compact .cname { font-size: clamp(9.5px, 3.2vw, 12px); letter-spacing: -.2px; overflow-wrap: anywhere; max-width: 100%; }
#pack-cards[data-n="8"] .card.compact .ctype { font-size: clamp(7px, 2.2vw, 9px); padding: 1px 3px; max-width: 100%; overflow: hidden; text-overflow: clip; white-space: nowrap; }
#pack-cards[data-n="8"] .card.compact .rflag { display: none; }
#pack-cards[data-n="8"] .card.compact .cname small { font-size: clamp(8.5px, 2.7vw, 10px); }
.enhcard .rflag { display: none; } /* rarity is already named on the card */
/* t29: 320px shop shelf could overflow by a few px with long relic names */
.shelf { overflow-x: clip; overflow-y: visible; } .shelf .card { min-width: 0; }
.card.mini .card-in, .card.mini .cface { min-width: 0; max-width: 100%; }
.card.mini .cname { overflow-wrap: anywhere; font-size: clamp(11px, 3.4vw, 13px); }
.shop-top { grid-template-columns: 104px minmax(0, 1fr); }
.shop-bottom { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } #packs { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } #packs .chest { min-width: 0; } #packs .chest .cname { hyphens: auto; } @media (max-width: 340px) { #packs .chest .cname { font-size: 11.5px; letter-spacing: -.2px; } }

/* ---------- t30: languages ---------- */
/* CJK: no bundled fonts — system families per script; Rubik still renders digits/latin ($, SAN) */
html[lang="zh-Hans"] body { font-family: 'Rubik', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Noto Sans SC', system-ui, sans-serif; }
html[lang="ja"] body { font-family: 'Rubik', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', 'Noto Sans CJK JP', 'Noto Sans JP', system-ui, sans-serif; }
html[lang="ko"] body { font-family: 'Rubik', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans CJK KR', 'Noto Sans KR', system-ui, sans-serif; }
html[data-script="cjk"] * { letter-spacing: 0 !important; }
html[data-script="cjk"] .ctype, html[data-script="cjk"] .hud-box small { text-transform: none; }
html[data-script="cjk"] body { line-height: 1.35; }
html[lang="zh-Hans"], html[lang="ja"] { word-break: normal; line-break: strict; }
html[lang="ko"] { word-break: keep-all; }
/* long words (de/tr/ru) may hyphenate instead of overflowing */
html:not([data-script="cjk"]) .btn, html:not([data-script="cjk"]) .cname, html:not([data-script="cjk"]) .ctype, html:not([data-script="cjk"]) .mbtn { hyphens: auto; -webkit-hyphens: auto; }
.lang-btn { position: absolute; z-index: 3; top: calc(var(--safe-t) + 10px); right: 12px; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 10px; font-size: 14px; }
.lang-btn .pix { width: 18px; height: 18px; }
.lang-grid { width: 100%; align-self: stretch; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lang-opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 8px 12px; font: inherit; font-size: 16px; font-weight: 600; text-align: left;
  color: var(--txt); background: var(--panel-2); border: 2px solid var(--ink); border-radius: var(--r-md); box-shadow: var(--sh-1); cursor: pointer; text-shadow: var(--shadow); }
.lang-opt small { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.lang-opt.on { background: var(--blue); box-shadow: 0 3px 0 var(--blue-d); }
.lang-opt.on small { color: #fff; }
.lang-opt:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.lang-opt b { min-width: 0; font-weight: 600; }
/* SE fixes: «Следующий раунд» in the 104px column, rarity dots vs. type label, shop height */
#btn-next { overflow-wrap: anywhere; font-size: clamp(12px, 3.9vw, 15px); padding-left: 4px; padding-right: 4px; }
.card.mini .ctype { max-width: calc(100% - 4px); overflow-wrap: anywhere; line-height: 1.1; }
.card.mini .rflag { top: 3px; right: 3px; padding: 2px; }
.card.mini .rflag i { width: 3px; height: 3px; }

/* t30: short screens (iPhone SE) — the shop must fit in 568px in every language */
.card.mini .ctype { font-size: 10px; letter-spacing: .02em; padding-left: 4px; padding-right: 4px; overflow-wrap: normal; hyphens: auto; }
@media (max-height: 600px) {
  #relics-shop .rtile { height: 40px; }
  #relics-shop { padding-top: 3px; padding-bottom: 4px; }
  .shop.panel { gap: 5px; padding: 5px; }
  .shop-head .title-big { font-size: 19px; }
  .shop-head .sub { font-size: 12px; line-height: 1.2; }
  .shop-top { padding-top: 5px; padding-bottom: 5px; }
  .shelf { min-height: 148px; padding-top: 18px; }
  .card.mini .cface { min-height: 128px; }
  .vslot, .pslot { gap: 15px; padding: 2px 6px 5px; }
  #packs .chest .pack { min-height: 92px; padding-top: 7px; padding-bottom: 7px; }
  .vface { min-height: 92px; padding-top: 7px; padding-bottom: 7px; }
  #inv-line { padding: 3px 6px; }
  .inv { min-height: 32px; }
}
/* t30: long opening names (de/fr/es…) may wrap instead of squeezing the move line */
#open-goal .og-name { flex: 0 1 auto; max-width: 42%; min-width: 0; }
#open-goal .og-name b, #open-goal .og-name small { white-space: normal; overflow-wrap: anywhere; }
#open-goal .og-line { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
@media (max-width: 380px) {
  .card.mini .ctype, .card.compact .ctype { font-size: 9px; letter-spacing: 0; padding-left: 3px; padding-right: 3px; }
}
@media (max-height: 700px) {
  #packs .chest .cname { font-size: 12px; }
  #packs .chest .csize { font-size: 10px; padding: 0 4px; }
  #packs .chest .cicon { margin-top: 0; }
}
#pack-cards[data-n="8"] .card.compact .ctype { letter-spacing: 0; padding: 1px 2px; }
@media (max-height: 600px) { .vslot, .pslot { gap: 13px; } .shop-btns { gap: 6px; } }
.vname { max-width: 100%; overflow-wrap: anywhere; hyphens: auto; }
@media (max-width: 380px) { .vslot .vname { font-size: 12px; } }

/* volume sliders (Music / Sounds) — chunky, thumb ≥ 28px for touch; --p is the filled share */
.vol { -webkit-appearance: none; appearance: none; flex: 0 1 170px; min-width: 110px; height: 34px; background: transparent; cursor: pointer; margin: 0; touch-action: pan-y; }
.vol::-webkit-slider-runnable-track { height: 12px; border-radius: 6px; border: 3px solid var(--ink); background: linear-gradient(90deg, var(--gold) var(--p, 50%), #1a272c var(--p, 50%)); }
.vol::-moz-range-track { height: 6px; border-radius: 6px; border: 3px solid var(--ink); background: linear-gradient(90deg, var(--gold) var(--p, 50%), #1a272c var(--p, 50%)); }
.vol::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); box-shadow: 0 2px 0 var(--ink); }
.vol::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); box-shadow: 0 2px 0 var(--ink); }
.vol:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
.vol.off { opacity: 0.45; }
.set-note { margin: 2px 0 10px; font-size: 12px; color: var(--muted); line-height: 1.35; }

/* ---------- t32: new run sheet (side + thinking level) ---------- */
.nr-h { margin: var(--s3) 0 var(--s2); font-size: 15px; color: var(--muted); font-weight: 600; }
.nr-sides { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.nr-side { font: inherit; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px; min-height: 88px; border: 3px solid var(--ink); border-radius: var(--r-md);
  background: #1a272c; color: var(--muted); font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: 0 4px 0 var(--ink); }
.nr-side img, .nr-side .q { width: 44px; height: 44px; }
.nr-side .q { display: grid; place-items: center; font-size: 30px; color: var(--gold, #eabc52); text-shadow: 0 3px 0 var(--ink); }
.nr-side .rnd { position: relative; width: 44px; height: 44px; }
.nr-side .rnd img { position: absolute; width: 32px; height: 32px; }
.nr-side .rnd img:first-child { left: 0; top: 0; } .nr-side .rnd img:last-child { right: 0; bottom: 0; }
.nr-side.on { background: var(--blue); color: #fff; text-shadow: var(--shadow); transform: translateY(-2px); }
.nr-tiers { display: flex; flex-direction: column; gap: 6px; }
.nr-tier { font: inherit; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; text-align: left; padding: 6px 10px; min-height: 48px; border: 3px solid var(--ink);
  border-radius: var(--r-md); background: #1a272c; color: #fff; cursor: pointer; }
.nr-tier .n { font-size: 20px; font-weight: 700; color: var(--orange); text-align: center; }
.nr-tier b { font-size: 14px; display: block; } .nr-tier small { color: var(--muted); font-size: 12px; display: block; line-height: 1.25; }
.nr-tier .rec { display: flex; gap: 2px; } .nr-tier .rec img { width: 20px; height: 20px; padding: 1px; border-radius: 50%; background: #b9c6cc; }
.nr-tier.on { background: #23485e; border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue) inset; }
.nr-tier.locked { opacity: .55; cursor: not-allowed; } .nr-tier.locked .n { color: var(--muted); }
.nr-detail { margin-top: var(--s3); padding: 8px 10px; border-radius: var(--r-md); background: var(--panel-2); font-size: 13px; color: var(--muted); box-shadow: inset 0 3px 0 rgba(0,0,0,.35); }
.nr-detail b { color: #fff; }
.nr-detail ul { margin: 4px 0 0; padding-left: 18px; } .nr-detail li { margin: 2px 0; }
.nr-start { width: 100%; margin-top: var(--s4); position: sticky; bottom: 0; z-index: 2; box-shadow: 0 -10px 18px 6px rgba(28, 40, 46, .85), var(--btn-shadow, 0 5px 0 var(--ink)); }
.nr-tier.locked { min-height: 40px; padding: 4px 10px; } .nr-tier.locked small { font-size: 11px; }
.stat.unlock span { color: var(--gold, #eabc52); font-weight: 700; }
.demo-tiers { display: flex; gap: 4px; justify-content: center; margin-top: 6px; }
.demo-tiers .tchip { width: 26px; height: 26px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 6px; background: #23485e; font-weight: 700; color: var(--orange); }
.demo-tiers .tchip.locked { background: #1a272c; }

/* ---------------- Pawnbreaker: logo, version tag, feedback ---------------- */
.logo-name { font-size: clamp(40px, 12.5vw, 54px); letter-spacing: -.005em; white-space: nowrap; }
#screen-menu.open .logo-name { animation: logoDrop 720ms var(--ease) both; }
#screen-menu { padding-bottom: calc(var(--safe-b) + 30px); }
.ver-tag { position: absolute; z-index: 2; left: calc(env(safe-area-inset-left, 0px) + 12px); bottom: calc(var(--safe-b) + 8px);
  font-size: 11px; font-weight: 500; letter-spacing: .04em; color: var(--muted); opacity: .6; pointer-events: none; user-select: none; }
.fb-chip { position: absolute; z-index: 3; top: calc(var(--safe-t) + 10px); left: calc(env(safe-area-inset-left, 0px) + 12px);
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 10px; font-size: 14px; }
.fb-chip .pix, .over-fb .pix { width: 18px; height: 18px; }
.lang-btn { right: calc(env(safe-area-inset-right, 0px) + 12px); }

.fb-box { display: flex; flex-direction: column; }
.fb-sub { margin: -4px 0 var(--s4); color: var(--muted); font-size: 14px; line-height: 1.35; }
.fb-field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 var(--s4); border: 0; padding: 0; min-width: 0; }
.fb-lbl { font-size: 15px; font-weight: 600; }
.fb-lbl small { font-weight: 400; color: var(--muted); font-size: 13px; }
.fb-field textarea, .fb-field input[type="text"], .fb-field input[type="email"] {
  -webkit-user-select: text; user-select: text; width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; color: #fff;
  background: rgba(6,12,20,.55); border: 3px solid var(--ink); border-radius: 10px; padding: 10px 12px; outline: none;
  box-shadow: inset 0 3px 0 rgba(0,0,0,.25); transition: border-color 150ms var(--ease), background 150ms var(--ease); }
.fb-field textarea { min-height: 76px; resize: vertical; line-height: 1.35; }
.fb-field textarea::placeholder, .fb-field input::placeholder { color: rgba(255,255,255,.38); }
.fb-field textarea:focus, .fb-field input:focus { border-color: var(--gold); background: rgba(6,12,20,.75); }
.fb-field .bad { border-color: #e2574c; }
.fb-stars { display: flex; gap: 6px; }
.fb-star { flex: 1 1 0; max-width: 56px; aspect-ratio: 1; min-height: 44px; display: grid; place-items: center; font: inherit; font-size: 26px; line-height: 1;
  color: rgba(255,255,255,.28); background: var(--panel-2); border: 3px solid var(--ink); border-radius: 10px; cursor: pointer;
  box-shadow: 0 3px 0 var(--ink); transition: transform 120ms var(--ease), color 120ms var(--ease), background 120ms var(--ease); }
.fb-star.on { color: var(--gold); background: #3a3020; text-shadow: 0 2px 0 var(--ink); }
.fb-star:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.fb-star:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.fb-err { margin: 0 0 var(--s3); color: #ff8a80; font-size: 14px; font-weight: 600; }
.fb-err:empty { display: none; }
.fb-err a, .fb-alt a, .fb-done a { color: var(--gold); }
.fb-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.fb-dev { margin: 0 0 var(--s4); font-size: 13px; color: var(--muted); }
.fb-dev summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; gap: 6px; }
.fb-dev p { margin: 4px 0 6px; line-height: 1.35; }
.fb-dev pre { margin: 0; max-height: 140px; overflow: auto; white-space: pre-wrap; word-break: break-word; font: 12px/1.35 ui-monospace, Menlo, monospace;
  background: rgba(6,12,20,.5); border: 2px solid var(--ink); border-radius: 8px; padding: 8px; -webkit-user-select: text; user-select: text; }
.fb-actions { display: flex; flex-direction: column; gap: var(--s2); }
.fb-actions .btn { width: 100%; }
.fb-alt { margin: var(--s3) 0 0; text-align: center; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.fb-done { text-align: center; padding: var(--s4) 0 var(--s2); display: flex; flex-direction: column; align-items: center; gap: var(--s3); }
.fb-done-ico .pix { width: 56px; height: 56px; animation: float 3s ease-in-out infinite; }
.fb-done h3 { margin: 0; font-size: 26px; color: var(--gold); text-shadow: 0 3px 0 var(--ink); }
.fb-done p { margin: 0; color: var(--muted); line-height: 1.4; max-width: 34ch; }
.fb-done .btn { min-width: 160px; }
.over-fb { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 4px; font-size: 14px; color: var(--muted); }
.over-fb .btn { display: inline-flex; align-items: center; gap: 6px; }
.ver-note { opacity: .7; }
@media (prefers-reduced-motion: reduce) { .fb-done-ico .pix { animation: none; } }
.fb-chip.icon-only { width: 40px; padding: 6px; justify-content: center; }
.fb-chip.icon-only > span { display: none; }

/* ---------- v0.2: pre-run opening choice (#opening) — same card language as the chests ---------- */
#opening { position: fixed; inset: 0; z-index: var(--z-pack); display: flex; flex-direction: column; justify-content: safe center; align-items: stretch; gap: 4px;
  height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: calc(var(--safe-t) + 50px) calc(env(safe-area-inset-right, 0px) + 8px) calc(var(--safe-b) + 14px) calc(env(safe-area-inset-left, 0px) + 8px);
  background: radial-gradient(ellipse at 50% 40%, rgba(60,36,110,.85), rgba(8,4,20,.94)); }
#opening.hidden { display: none; }
#opening .op-top { position: absolute; top: calc(var(--safe-t) + 8px); left: calc(env(safe-area-inset-left, 0px) + 10px); right: calc(env(safe-area-inset-right, 0px) + 10px); display: flex; justify-content: space-between; align-items: center; }
#opening .op-wallet { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 10px; background: rgba(20,12,40,.8); border: 2px solid #3a2a66; color: #ffd76a; font-size: 17px; }
#opening .pack-title { text-align: center; margin: 0; align-self: center; max-width: calc(100% - 16px); }
#opening .pack-sub { text-align: center; margin: 0 auto 6px; color: #c9b3f5; font-size: 13px; max-width: 520px; line-height: 1.3; }
#op-cards { flex: 0 0 auto; max-width: 540px; margin: 0 auto 12px; width: 100%; gap: 6px; }
.op-card[data-still] { animation: none; }
.op-card .cface { min-height: 0; gap: 4px; padding: 6px 5px 7px; }
.op-board { display: grid; grid-template-columns: repeat(8, 1fr); width: 100%; max-width: 128px; aspect-ratio: 1; border: 2px solid var(--ink); border-radius: 4px; overflow: hidden; flex: 0 0 auto; }
.op-board i { display: block; position: relative; background: #b58863; }
.op-board i.l { background: #f0d9b5; }
.op-board i.lm { box-shadow: inset 0 0 0 40px rgba(155, 199, 0, .45); }
.op-board img { position: absolute; inset: 0; width: 100%; height: 100%; }
.op-card .cname { font-size: 14px; min-height: 2.1em; display: flex; align-items: center; justify-content: center; overflow-wrap: anywhere; }
.op-line { font-size: 11px; line-height: 1.2; color: #3a3550; text-align: center; min-height: 2.4em; overflow-wrap: anywhere; }
.op-bonus { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: #fff; background: var(--panel-2); border-radius: 6px; padding: 2px 5px; text-shadow: var(--shadow); }
.op-boss { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; font-size: 11px; line-height: 1.1; color: #fff; background: var(--rc); border: 2px solid var(--ink); border-radius: 7px; padding: 3px 4px; text-shadow: var(--shadow); }
.op-boss img { flex: 0 0 auto; }
.op-card.sel { transform: translateY(-16px) scale(1.04); z-index: 3; }
.op-card.sel .cface { box-shadow: inset 0 0 0 3px var(--rc), 0 0 0 3px #ffd76a, 0 0 22px 4px rgba(255, 215, 106, .55), 0 7px 0 rgba(0,0,0,.5); }
.op-card.picked { animation: opPicked .62s cubic-bezier(.3, 1.4, .5, 1) forwards; z-index: 4; pointer-events: none; }
.op-card.gone { animation: opGone .4s ease-in forwards; pointer-events: none; }
@keyframes opPicked { 0% { transform: translateY(-16px) scale(1.04); } 45% { transform: translateY(-40px) scale(1.25); opacity: 1; } 100% { transform: translateY(-140px) scale(.6); opacity: 0; } }
@keyframes opGone { to { transform: translateY(120px) rotate(12deg) scale(.7); opacity: 0; } }
#op-detail { max-width: 540px; width: 100%; margin: 0 auto; padding: 8px 10px; border-radius: 12px; background: rgba(20,12,40,.75); border: 2px solid #3a2a66; color: #fff; min-height: 46px; }
#op-detail .pd-hint { margin: 6px 0; text-align: center; color: #c9b3f5; font-size: 13px; }
#op-detail .pd-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#op-detail .pd-head b { font-size: 15px; }
#op-detail .pd-head small { margin-left: auto; color: #c9b3f5; font-size: 12px; }
#op-detail .pd-desc { margin: 4px 0 6px; font-size: 13px; line-height: 1.3; }
#op-detail .pd-go { width: 100%; padding: 8px; font-size: 15px; }
#op-reroll { align-self: center; margin-top: 8px; min-width: 180px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
#op-reroll.free { box-shadow: 0 0 0 3px #ffd76a, 0 0 16px rgba(255, 215, 106, .5); }
#open-goal .og-star { font-style: normal; color: #ffd76a; margin-right: 3px; text-shadow: 0 1px 0 var(--ink); }
.demo-pick { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: flex-end; }
.demo-pick .dpk { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 31%; padding: 6px 3px; border-radius: 8px; background: #f4efe2; color: #1b1b1b; border: 2px solid var(--ink); font-size: 11px; text-align: center; line-height: 1.1;
  animation: deal .55s cubic-bezier(.3, 1.5, .5, 1) backwards; animation-delay: calc(var(--i) * .1s); }
.demo-pick .dpk.on { transform: translateY(-8px); box-shadow: 0 0 0 3px #ffd76a; }
.demo-pick .dpk-free { flex-basis: 100%; display: inline-flex; justify-content: center; align-items: center; gap: 5px; color: #ffd76a; font-size: 13px; }
@media (max-width: 380px) { .op-card .cname { font-size: 12px; } .op-line, .op-boss { font-size: 10px; } #op-cards { gap: 4px; } .op-card .cface { padding: 5px 3px 6px; } }
@media (max-height: 620px) { #opening { justify-content: flex-start; } #opening .pack-title { font-size: 18px; } #op-cards { margin-bottom: 8px; } .op-board { max-width: 92px; } .op-line { display: none; } #op-detail .pd-desc { font-size: 12px; } }
@media (prefers-reduced-motion: reduce) { .op-card.picked, .op-card.gone { animation: none; } }
#opening > * { flex-shrink: 0; }
#op-menu { width: 44px; height: 40px; flex: 0 0 auto; }
@media (min-width: 760px) and (min-height: 760px) { #op-cards { max-width: 640px; gap: 12px; } .op-card { max-width: 200px; } .op-board { max-width: 168px; } .op-card .cname { font-size: 16px; } .op-line, .op-bonus, .op-boss { font-size: 12px; } #op-detail { max-width: 640px; } }

/* ===== v0.3: nine new bosses ===== */
cg-board square.mine { background: radial-gradient(circle, #ec6f67 0 9%, #33434a 10% 22%, transparent 23%), repeating-linear-gradient(45deg, rgba(234,188,82,.38) 0 6px, rgba(11,18,21,.28) 6px 12px); box-shadow: inset 0 0 0 2px rgba(234,188,82,.75); }
cg-board square.hill { box-shadow: inset 0 0 0 3px rgba(225,154,28,.85); background: rgba(234,188,82,.22); }
cg-board square.locked { box-shadow: inset 0 0 0 3px #45b87f; background: repeating-linear-gradient(-45deg, rgba(69,184,127,.28) 0 5px, transparent 5px 10px); }
cg-board square.masked { background: radial-gradient(circle at 50% 18%, rgba(156,112,237,.55) 0 16%, transparent 17%); }
cg-board square.revived { animation: revive .9s ease-out; box-shadow: inset 0 0 0 3px #9be8b8; }
@keyframes revive { 0% { background: rgba(155,232,184,.9); } 100% { background: rgba(155,232,184,0); } }
#boss-banner .bb-stat { flex: 0 0 auto; font-style: normal; font-weight: 800; font-size: 11px; color: #fff3c4; background: rgba(0,0,0,.35); border: 2px solid var(--bc, var(--red)); border-radius: 8px; padding: 1px 5px; white-space: nowrap; margin-left: auto; }
