:root {
  --bg: #0b0716;
  --bg2: #150c2a;
  --ink: #f3ecff;
  --muted: #a99cc8;
  --gold: #f2c14e;
  --crystal: #a86bff;
  --crystal2: #6fd3ff;
  --danger: #ff5a4f;
  --heal: #5dff9a;
  --panel: rgba(20, 12, 40, 0.82);
  --line: rgba(190, 160, 255, 0.22);
  --font-ui: "Inter", system-ui, sans-serif;
  --font-card: "Old Standard TT", Georgia, serif;
  --font-title: "Cinzel", "Old Standard TT", serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
/* ---------- app shell: the browser page never moves (no scroll, rubber-band, pull-to-refresh or zoom) ----------
   The page is pinned to the viewport; only the game's own panes scroll (see "scroll panes" below and the
   touchmove guard in main.js). */
html, body { margin: 0; position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; background: var(--bg); color: var(--ink); font-family: var(--font-ui);
  overflow: hidden; overscroll-behavior: none; overscroll-behavior-y: none; touch-action: none; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button { font: inherit; color: inherit; }
button, a, input, select, textarea, label, [role="button"] { touch-action: manipulation; } /* no double-tap zoom */
input, textarea, select, [contenteditable] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
img { -webkit-user-drag: none; }
/* phones and tablets: no text selection outside inputs, and 16px+ inputs so iOS never zooms on focus */
@media (hover: none) and (pointer: coarse) {
  body *:not(input):not(textarea):not(select):not([contenteditable]) { -webkit-user-select: none !important; user-select: none !important; }
  input, textarea, select { font-size: max(16px, 1em) !important; }
}
/* scroll panes: momentum touch scrolling, never chain into the page, a subtle gold scrollbar */
.lr-view, .grid, .page > .body, #rules .doc, #rules .rtoc, #deckbuilder .decklist .rows, .ranklist, #log, #tracker, .ci-info, .dl-menu, .story-body,
#select .detail .dt-info, #sheet .box.acctsheet, .decklistview, .lcs-rail, .lcs-main, .sTrack, .hq-row, [data-scroll] {
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: rgba(232, 186, 90, .45) transparent; }
.lr-view::-webkit-scrollbar, .grid::-webkit-scrollbar, .page > .body::-webkit-scrollbar, #rules .doc::-webkit-scrollbar, .ranklist::-webkit-scrollbar, .sTrack::-webkit-scrollbar,
#deckbuilder .decklist .rows::-webkit-scrollbar, #log::-webkit-scrollbar, #tracker::-webkit-scrollbar, .ci-info::-webkit-scrollbar { width: 6px; height: 6px; }
.lr-view::-webkit-scrollbar-thumb, .grid::-webkit-scrollbar-thumb, .page > .body::-webkit-scrollbar-thumb, #rules .doc::-webkit-scrollbar-thumb, .ranklist::-webkit-scrollbar-thumb, .sTrack::-webkit-scrollbar-thumb,
#deckbuilder .decklist .rows::-webkit-scrollbar-thumb, #log::-webkit-scrollbar-thumb, #tracker::-webkit-scrollbar-thumb, .ci-info::-webkit-scrollbar-thumb { background: rgba(232, 186, 90, .4); border-radius: 99px; }
/* "more to scroll" fade hints, toggled by main.js scrollHints() (data-more="top|bottom|both|left|right|x") */
[data-more="bottom"] { -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - 44px), transparent); }
[data-more="top"] { -webkit-mask-image: linear-gradient(0deg, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(0deg, #000 calc(100% - 44px), transparent); }
[data-more="both"] { -webkit-mask-image: linear-gradient(180deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(180deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); }
[data-more="right"] { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); }
[data-more="left"] { -webkit-mask-image: linear-gradient(270deg, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(270deg, #000 calc(100% - 44px), transparent); }
[data-more="x"] { -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); }

/* ---------- stage scaling ---------- */
/* #viewport is the safe area (notch / home bar in landscape stay clear); main.js fit() scales the stage into it */
#viewport { position: fixed; top: env(safe-area-inset-top, 0px); right: env(safe-area-inset-right, 0px); bottom: env(safe-area-inset-bottom, 0px); left: env(safe-area-inset-left, 0px);
  overscroll-behavior: none; overflow: hidden; overflow: clip; background: radial-gradient(ellipse at 50% 40%, #241244 0%, #0b0716 70%); }
#stage { position: absolute; left: 50%; top: 50%; width: 1600px; height: 900px; transform-origin: 50% 50%; overflow: hidden; overflow: clip; } /* clip: never a scroll container, so scrollIntoView/focus can't shift the stage */
.screen { position: absolute; inset: 0; display: none; }
.screen.on { display: block; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 1px solid rgba(242, 193, 78, 0.55); cursor: pointer;
  background: linear-gradient(180deg, rgba(90, 50, 160, 0.95), rgba(45, 22, 90, 0.95));
  color: #fff4d6; font-family: var(--font-title); font-weight: 700; letter-spacing: 0.08em;
  padding: 14px 30px; border-radius: 12px; font-size: 20px; text-transform: uppercase;
  box-shadow: 0 0 0 1px rgba(0,0,0,.4) inset, 0 8px 24px rgba(0,0,0,.45), 0 0 18px rgba(168,107,255,.25);
  transition: transform .18s cubic-bezier(.2,.8,.2,1.4), box-shadow .2s, filter .2s;
}
.btn:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 0 0 1px rgba(0,0,0,.4) inset, 0 12px 28px rgba(0,0,0,.5), 0 0 28px rgba(168,107,255,.55); filter: brightness(1.12); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.small { font-size: 14px; padding: 9px 16px; border-radius: 9px; }
.btn.gold { background: linear-gradient(180deg, #f6d06a, #b8811a); color: #2a1600; border-color: #ffe6a0; }
.btn.ghost { background: rgba(255,255,255,.06); border-color: var(--line); color: var(--ink); }
.btn[disabled] { opacity: .4; pointer-events: none; }

/* ---------- title ---------- */
#title video.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(1.1) brightness(.55); }
#title .veil { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(20,8,45,.1), rgba(8,4,20,.85) 75%), linear-gradient(0deg, rgba(8,4,20,.9), transparent 45%); }
#title .logo { position: absolute; left: 50%; top: 58px; width: 470px; transform: translateX(-50%); mix-blend-mode: screen; animation: logoFloat 6s ease-in-out infinite; }
@keyframes logoFloat { 50% { transform: translateX(-50%) translateY(-8px); } }
#title .tagline { position: absolute; top: 515px; width: 100%; text-align: center; font-family: var(--font-title); font-size: 26px; letter-spacing: .35em; color: #e9dcff; text-shadow: 0 0 20px rgba(168,107,255,.8); }
#title .menu { position: absolute; top: 575px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 12px; width: 360px; }
#title .menu .row { display: flex; gap: 12px; }
#title .menu .row .btn { flex: 1; font-size: 15px; padding: 11px 10px; }
#title .pack { position: absolute; width: 190px; filter: drop-shadow(0 20px 30px rgba(0,0,0,.6)); animation: packBob 7s ease-in-out infinite; }
@keyframes packBob { 50% { transform: translateY(-14px) rotate(var(--r2, 2deg)); } }
#title .credit { position: absolute; bottom: 14px; width: 100%; text-align: center; font-size: 12px; color: rgba(233,220,255,.55); letter-spacing: .12em; }

/* ---------- generic page chrome ---------- */
.page { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 0%, #2a1552 0%, #0e0820 60%); }
.page h1 { font-family: var(--font-title); font-size: 38px; margin: 0; letter-spacing: .12em; text-shadow: 0 0 22px rgba(168,107,255,.6); }
.page .top { position: absolute; top: 0; left: 0; right: 0; height: 84px; display: flex; align-items: center; gap: 20px; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(10,5,24,.6); backdrop-filter: blur(6px); z-index: 5; }
.page .top .spacer { flex: 1; }

/* ---------- leader select ---------- */
#select .leaders { position: absolute; top: 118px; left: 0; right: 0; display: flex; justify-content: center; gap: 22px; perspective: 1200px; }
.leaderPick { position: relative; width: 218px; cursor: pointer; transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.leaderPick .lc { width: 218px; height: 324px; }
.leaderPick:hover { transform: translateY(-10px); }
.leaderPick.sel { transform: translateY(-16px) scale(1.04); }
.leaderPick.sel .lc { box-shadow: 0 0 0 3px var(--gold), 0 0 40px var(--glow, #a86bff); }
.leaderPick .setname { text-align: center; margin-top: 12px; font-family: var(--font-title); font-size: 15px; letter-spacing: .2em; color: var(--c); }
#select .detail { position: absolute; left: 110px; right: 110px; top: 560px; height: 250px; display: grid; grid-template-columns: 200px 1fr 330px; gap: 34px; align-items: center; padding: 22px 30px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
#select .detail img.packart { width: 170px; filter: drop-shadow(0 12px 20px rgba(0,0,0,.6)); margin-top: -70px; }
#select .detail h2 { font-family: var(--font-title); margin: 0 0 4px; font-size: 30px; }
#select .detail .theme { color: var(--muted); letter-spacing: .15em; text-transform: uppercase; font-size: 13px; margin-bottom: 12px; }
#select .detail .ability { font-family: var(--font-card); font-size: 18px; line-height: 1.45; white-space: pre-line; }
#select .detail .side { display: flex; flex-direction: column; gap: 12px; }
#select .detail select { background: #1d1238; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; padding: 10px; font: inherit; }
#select .detail label { font-size: 12px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }

/* ---------- leader card ---------- */
.lc { position: relative; border-radius: 12px; overflow: hidden; background: #222; box-shadow: 0 10px 30px rgba(0,0,0,.55); container-type: inline-size; }
.lc img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lc .plate { position: absolute; left: 42%; right: 3%; bottom: 3.6%; height: 10.5%; display: grid; place-items: center; text-align: center; font-family: var(--font-card); font-weight: 700; color: #2a1740; font-size: 7.4cqw; line-height: 1.05; padding: 0 4%; }
.lc .lpow { position: absolute; left: 4%; bottom: 4%; width: 26%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-title); font-weight: 900; font-size: 11cqw; color: #fff; background: radial-gradient(circle at 35% 30%, #ff8b6b, #b8261d 70%); border: 2px solid #ffd7a8; box-shadow: 0 4px 10px rgba(0,0,0,.6); }
.lc .ltag { position: absolute; top: 3%; left: 4%; font-size: 6cqw; font-weight: 800; letter-spacing: .2em; color: #fff; background: rgba(0,0,0,.55); padding: 1.5% 4%; border-radius: 99px; text-transform: uppercase; }

/* ---------- board ---------- */
#game { background:
  radial-gradient(ellipse at 50% 50%, rgba(120,70,220,.16), transparent 60%),
  linear-gradient(180deg, #120a26 0%, #1a0f35 48%, #1a0f35 52%, #120a26 100%); }
#game::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, rgba(168,107,255,.14), transparent 38%), repeating-radial-gradient(circle at 50% 50%, rgba(242,193,78,.035) 0 1px, transparent 1px 46px); }
#game::after { content: ""; position: absolute; left: 50%; top: 50%; width: 120px; height: 150px; transform: translate(-50%,-50%); clip-path: polygon(50% 0, 100% 35%, 80% 100%, 20% 100%, 0 35%); background: linear-gradient(160deg, rgba(243,230,255,.18), rgba(168,107,255,.12) 45%, rgba(74,26,154,.08)); filter: blur(1px); pointer-events: none; }
.mat { position: absolute; border-radius: 14px; border: 1px dashed rgba(190,160,255,.18); background: rgba(255,255,255,.015); }
.mat.field { border-style: solid; border-color: rgba(190,160,255,.12); background: linear-gradient(180deg, rgba(168,107,255,.05), rgba(168,107,255,.015)); }
.mat .lbl { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 10px; letter-spacing: .25em; color: rgba(210,190,255,.35); text-transform: uppercase; }
.divider { position: absolute; left: 0; right: 0; top: 399px; height: 2px; background: linear-gradient(90deg, transparent, rgba(242,193,78,.5), transparent); }
.pile { position: absolute; width: 110px; height: 154px; }
.pile .back { position: absolute; inset: 0; border-radius: 9px; }
.pile .count { position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); min-width: 34px; padding: 3px 8px; font-weight: 800; font-size: 13px; text-align: center; border-radius: 99px; background: #0d0720; border: 1px solid var(--line); z-index: 2; }

#layer { position: absolute; inset: 0; pointer-events: none; }
#layer .card { pointer-events: auto; }
#fx { position: absolute; inset: 0; pointer-events: none; z-index: 900; }

/* ---------- card ---------- */
.card {
  position: absolute; left: 0; top: 0; width: 130px; height: 182px;
  transform-origin: 50% 50%; will-change: transform;
  transition: transform calc(.5s / var(--spd, 1)) cubic-bezier(.2,.75,.25,1), filter .25s, opacity .3s;
  perspective: 900px; cursor: pointer; container-type: inline-size;
}
.card.fast { transition-duration: .22s; }
.card.nomove { transition: none !important; }
.card .flip { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform calc(.55s / var(--spd, 1)) cubic-bezier(.3,.7,.2,1); }
.card.down .flip { transform: rotateY(180deg); }
.card .face, .card .backface { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 7.5cqw; overflow: hidden; }
.card .face { background: #1a1030; box-shadow: 0 6px 16px rgba(0,0,0,.55); }
.card .backface { transform: rotateY(180deg); }
.cardback { background:
  radial-gradient(circle at 50% 42%, rgba(168,107,255,.55), transparent 55%),
  repeating-linear-gradient(45deg, rgba(255,255,255,.04) 0 6px, transparent 6px 12px),
  linear-gradient(160deg, #3a1a78, #160a33 70%);
  border: 3px solid #c89b3c; box-shadow: inset 0 0 0 2px #2a1640, inset 0 0 22px rgba(0,0,0,.7), 0 6px 16px rgba(0,0,0,.55);
  border-radius: 7.5cqw; }
.cardback::after { content: ""; position: absolute; inset: 8%; background: url(../assets/ui/extra3.webp) center/118% no-repeat; mix-blend-mode: screen; opacity: .95; border-radius: 6px; }
.card .art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card .rules {
  position: absolute; left: 13.6%; right: 13.6%; top: 57.1%; height: 28.6%;
  background: radial-gradient(ellipse at 50% 40%, #f7ead0, #ecd8b0 80%);
  border-radius: 2cqw; padding: 3.2cqw 4cqw; display: flex; flex-direction: column; justify-content: center; gap: 1.6cqw;
  font-family: var(--font-card); color: #2b1a0c; text-align: center; overflow: hidden;
}
.card .rules .t { font-size: 5.3cqw; line-height: 1.18; white-space: pre-line; }
.card .rules .f { font-size: 4.2cqw; line-height: 1.15; font-style: italic; color: #6a4a2a; }
.card.tiny .rules .f { display: none; }
.card.tiny .rules .t { font-size: 5cqw; }
.page .top h1 { font-size: 30px; white-space: nowrap; }
.chip { white-space: nowrap; }
.card .stat { position: absolute; bottom: 3%; width: 25%; aspect-ratio: 1; display: grid; place-items: center; font-family: var(--font-title); font-weight: 900; font-size: 12.5cqw; color: #fff; border-radius: 50%; text-shadow: 0 1px 2px #000; box-shadow: 0 3px 8px rgba(0,0,0,.7); z-index: 3; transition: transform .25s; }
.card .stat.pow { left: 2%; background: radial-gradient(circle at 35% 30%, #ff9a7a, #b3231a 70%); border: 1.5px solid #ffd0a0; }
.card .stat.hp { right: 2%; background: radial-gradient(circle at 35% 30%, #8fe7ff, #1464b4 70%); border: 1.5px solid #cdf2ff; }
.card .stat.up { color: #b8ffcf; }
.card .stat.down { color: #ffd0cc; }
.card .stat.hurt { background: radial-gradient(circle at 35% 30%, #ffb0b0, #7a1010 70%); }
.card .stat.bump { animation: bump .45s cubic-bezier(.3,1.8,.4,1); }
@keyframes bump { 40% { transform: scale(1.45); } }
.card .kws { position: absolute; top: 20%; left: 2%; display: flex; flex-direction: column; gap: 1.5cqw; z-index: 3; }
.card .kws span { width: 15cqw; height: 15cqw; display: grid; place-items: center; border-radius: 50%; background: rgba(15,8,30,.85); border: 1px solid rgba(242,193,78,.7); font-size: 8.5cqw; }
.card .inf { position: absolute; top: 20%; right: 2%; display: flex; flex-direction: column; gap: 1cqw; z-index: 3; }
.card .inf i { width: 11cqw; height: 13cqw; background: linear-gradient(160deg, #e6ccff, #8a3dff 60%, #3b1280); clip-path: polygon(50% 0, 100% 35%, 80% 100%, 20% 100%, 0 35%); filter: drop-shadow(0 0 3px #b98aff); }
.card .costmod { position: absolute; top: 1%; right: 1%; width: 22%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-title); font-weight: 900; font-size: 12cqw; color: #1a3a00; background: radial-gradient(circle at 35% 30%, #d8ffb0, #5fbf2a 70%); border: 2px solid #f4ffe0; z-index: 4; box-shadow: 0 0 10px #8cff5a; }
.card .shine { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge; opacity: 0; transition: opacity .3s;
  background: linear-gradient(115deg, transparent 20%, rgba(255,120,220,.35) 38%, rgba(120,220,255,.4) 48%, rgba(255,255,160,.35) 58%, transparent 75%);
  background-size: 250% 250%; background-position: var(--sx, 50%) var(--sy, 50%); }
.card.foil .shine { opacity: .55; }
.card.foil:hover .shine { opacity: .9; }
.card.rested { filter: brightness(.72) saturate(.8); }
.card.sick .face::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(20,10,40,.35), transparent 40%); }

/* states & highlights */
.card.can .face { box-shadow: 0 0 0 2px #7dffb0, 0 0 18px rgba(125,255,176,.65), 0 6px 16px rgba(0,0,0,.55); }
.card.ready .face { box-shadow: 0 0 0 2px #ffd36e, 0 0 20px rgba(255,211,110,.7), 0 6px 16px rgba(0,0,0,.55); }
.card.target .face, .lcard.target { box-shadow: 0 0 0 3px #ff6a5a, 0 0 26px rgba(255,90,70,.9) !important; animation: pulse 1s ease-in-out infinite; }
.card.pick .face { box-shadow: 0 0 0 3px #6fd3ff, 0 0 26px rgba(111,211,255,.9) !important; animation: pulse 1s ease-in-out infinite; }
.card.selected .face { box-shadow: 0 0 0 3px #fff, 0 0 30px rgba(255,255,255,.8) !important; }
@keyframes pulse { 50% { filter: brightness(1.18); } }
.card.dragging { transition: none !important; z-index: 800 !important; }
.card.inhand:hover { z-index: 700 !important; }

/* tokens */
.token { position: absolute; inset: 0; border-radius: 7.5cqw; border: 3px solid var(--tc, #c89b3c); background: radial-gradient(circle at 50% 38%, rgba(255,255,255,.25), transparent 60%), linear-gradient(160deg, var(--tc2, #4a2b10), #120a20); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4cqw; color: #fff; font-family: var(--font-card); text-align: center; }
.token .ic { font-size: 34cqw; filter: drop-shadow(0 4px 8px rgba(0,0,0,.6)); }
.token .nm { font-size: 9cqw; font-weight: 700; line-height: 1.1; padding: 0 6cqw; }
.token .tt { font-size: 6cqw; opacity: .8; padding: 0 8cqw; }

/* leader on board */
.lcard { position: absolute; width: 130px; height: 193px; pointer-events: auto; cursor: pointer; transition: transform .45s cubic-bezier(.2,.75,.25,1), filter .25s; border-radius: 12px; }
.lcard .lc { width: 100%; height: 100%; }
.lcard.rested { filter: brightness(.7); }
.lcard.can .lc { box-shadow: 0 0 0 2px #ffd36e, 0 0 24px rgba(255,211,110,.8); }
.lcard .act { position: absolute; left: 50%; bottom: -40px; padding: 6px 10px; font-size: 12px; transform: translateX(-50%); white-space: nowrap; }
.lcard .inf { position: absolute; top: 14px; right: -10px; display: flex; flex-direction: column; gap: 3px; }
.lcard .inf i { width: 14px; height: 17px; background: linear-gradient(160deg, #e6ccff, #8a3dff 60%, #3b1280); clip-path: polygon(50% 0, 100% 35%, 80% 100%, 20% 100%, 0 35%); filter: drop-shadow(0 0 3px #b98aff); }

/* life */
.life { position: absolute; width: 96px; }
.life .lbl, .crystalbar .lbl { font-size: 10px; letter-spacing: .25em; color: rgba(210,190,255,.5); text-transform: uppercase; text-align: center; }
.lifecount { position: absolute; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-title); font-weight: 900; font-size: 21px; color: #fff; background: radial-gradient(circle at 35% 30%, #ff8b6b, #a3180f 70%); border: 2px solid #ffd7a8; box-shadow: 0 4px 12px rgba(0,0,0,.6), 0 0 16px rgba(255,90,70,.6); z-index: 300; transition: transform .3s; }
.lifecount::after { content: "LIFE"; position: absolute; top: 40px; font-size: 9px; letter-spacing: .2em; color: #ffb3a8; font-family: var(--font-ui); }

/* crystals */
.crystalbar { position: absolute; display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 99px; background: rgba(12,6,28,.7); border: 1px solid var(--line); pointer-events: auto; }
.crystalbar .num { font-family: var(--font-title); font-weight: 900; font-size: 16px; margin-left: 6px; color: #e8d6ff; min-width: 44px; }
.gem { width: 17px; height: 22px; clip-path: polygon(50% 0, 100% 35%, 80% 100%, 20% 100%, 0 35%); background: linear-gradient(160deg, #f3e6ff, #a86bff 45%, #4a1a9a); filter: drop-shadow(0 0 4px rgba(185,138,255,.9)); transition: transform .25s, opacity .25s, filter .25s; }
.gem.used { background: linear-gradient(160deg, #6a5a80, #3a2a55); filter: none; opacity: .55; }
.gem.temp { background: linear-gradient(160deg, #e9fbff, #6fd3ff 45%, #1a6a9a); filter: drop-shadow(0 0 4px rgba(111,211,255,.9)); }
.gem.mine.free { cursor: grab; }
.gem.mine.free:hover { transform: scale(1.3) translateY(-3px); }
.gem.pop { animation: gemPop .6s cubic-bezier(.2,1.6,.4,1); }
@keyframes gemPop { 0% { transform: scale(0) rotate(-40deg); } 100% { transform: scale(1); } }
.gem.lock { background: rgba(255,255,255,.07); filter: none; }

/* HUD */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 850; }
#hud > * { pointer-events: auto; }
#endTurn { position: absolute; right: 36px; top: 372px; width: 180px; }
#endTurn.theirs { background: linear-gradient(180deg, #3a2f52, #1e1830); color: #bbb; border-color: rgba(255,255,255,.15); }
#banner { position: absolute; left: 0; right: 0; top: 368px; height: 64px; display: grid; place-items: center; pointer-events: none; }
#banner .msg { font-family: var(--font-title); font-weight: 800; font-size: 22px; letter-spacing: .12em; padding: 10px 26px; border-radius: 99px; background: rgba(12,6,28,.85); border: 1px solid rgba(242,193,78,.5); box-shadow: 0 0 30px rgba(0,0,0,.6); opacity: 0; transform: translateY(8px); transition: all .3s; }
#banner .msg.on { opacity: 1; transform: none; }
#promptBar { position: absolute; left: 50%; top: 418px; transform: translateX(-50%); display: none; gap: 10px; align-items: center; padding: 8px 10px 8px 18px; border-radius: 14px; background: rgba(12,6,28,.92); border: 1px solid rgba(111,211,255,.6); box-shadow: 0 0 28px rgba(111,211,255,.3); z-index: 860; }
#promptBar.on { display: flex; }
#promptBar .ptxt { font-size: 15px; max-width: 560px; }
#sweep { position: absolute; left: 0; right: 0; top: 330px; height: 140px; display: grid; place-items: center; pointer-events: none; z-index: 880; }
#sweep .t { font-family: var(--font-title); font-weight: 900; font-size: 64px; letter-spacing: .18em; color: #fff; text-shadow: 0 0 30px var(--sc, #a86bff), 0 4px 10px #000; opacity: 0; }
#sweep.go .t { animation: sweep 1.5s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes sweep { 0% { opacity: 0; transform: translateX(-120px) skewX(-12deg); letter-spacing: .5em; } 25% { opacity: 1; transform: none; letter-spacing: .18em; } 70% { opacity: 1; } 100% { opacity: 0; transform: translateX(120px); } }
#topbar { position: absolute; top: 10px; right: 16px; display: flex; gap: 8px; z-index: 860; }
#topbar .btn { padding: 7px 12px; font-size: 12px; }
#log { position: absolute; right: 16px; top: 52px; width: 330px; max-height: 300px; overflow: auto; padding: 10px 12px; font-size: 12.5px; line-height: 1.45; border-radius: 12px; background: rgba(10,5,24,.9); border: 1px solid var(--line); display: none; z-index: 860; user-select: text; }
#log.on { display: block; }
#log .me { color: #d7c4ff; } #log .them { color: #ffc9c2; }
#playBtn { position: absolute; z-index: 870; display: none; }
#playBtn.on { display: block; }

/* preview */
#preview { position: absolute; top: 230px; width: 300px; height: 420px; pointer-events: none; z-index: 950; opacity: 0; transition: opacity .15s; }
#preview.on { opacity: 1; }
#preview .card { transition: none; width: 300px; height: 420px; }
#preview .keytips { position: absolute; top: 430px; left: 0; right: 0; display: flex; flex-direction: column; gap: 6px; }
#preview .keytips div { font-size: 13px; background: rgba(10,5,24,.92); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; }
#preview .keytips b { color: var(--gold); }

/* modal */
.modal { position: absolute; inset: 0; z-index: 990; display: none; place-items: center; background: rgba(5,2,14,.78); backdrop-filter: blur(6px); }
.modal.on { display: grid; }
.modal .box { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 28px 34px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.7); }
.modal h2 { font-family: var(--font-title); letter-spacing: .12em; margin: 0 0 16px; font-size: 30px; }
.modal .cards { display: flex; gap: 14px; justify-content: center; margin: 12px 0 22px; }
.modal .cards .card { position: relative; transition: transform .3s; }
.modal .cards .card:hover { transform: translateY(-8px) scale(1.04); }
.modal .actions { display: flex; gap: 14px; justify-content: center; }
#trailerModal video { width: 1180px; border-radius: 14px; box-shadow: 0 30px 80px #000; }

/* game over */
#over .box { min-width: 620px; position: relative; overflow: visible; }
#over .big { font-family: var(--font-title); font-weight: 900; font-size: 72px; letter-spacing: .2em; margin: 0; }
#over .big.win { color: #ffe08a; text-shadow: 0 0 40px rgba(242,193,78,.9); }
#over .big.lose { color: #ff9c92; text-shadow: 0 0 40px rgba(255,90,70,.7); }
#over .packs { display: flex; justify-content: center; gap: 12px; margin: 10px 0 18px; }
#over .packs img { width: 110px; filter: drop-shadow(0 10px 18px rgba(0,0,0,.6)); animation: packBob 5s ease-in-out infinite; }
#over .stats { color: var(--muted); margin-bottom: 20px; }

/* fx */
.float { position: absolute; font-family: var(--font-title); font-weight: 900; font-size: 34px; text-shadow: 0 2px 6px #000, 0 0 18px currentColor; pointer-events: none; animation: floatUp 1.1s cubic-bezier(.2,.8,.3,1) forwards; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -6px) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -60px) scale(1); } }
.spark { position: absolute; width: 8px; height: 8px; border-radius: 50%; pointer-events: none; }
.ring { position: absolute; border-radius: 50%; border: 4px solid rgba(255,140,90,.9); pointer-events: none; }
.bolt { position: absolute; height: 4px; transform-origin: 0 50%; pointer-events: none; background: linear-gradient(90deg, rgba(255,255,255,0), #fff, #b98aff); box-shadow: 0 0 14px #b98aff, 0 0 30px #6fd3ff; border-radius: 4px; }
.crack { position: absolute; font-family: var(--font-title); font-weight: 900; font-size: 44px; color: #ff6a5a; text-shadow: 0 0 24px #ff2a1a, 0 3px 8px #000; pointer-events: none; animation: floatUp 1.4s ease-out forwards; }
#arrow { position: absolute; inset: 0; pointer-events: none; z-index: 880; overflow: visible; }
.shake { animation: shake .45s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake { 20% { transform: translate(-6px, 3px); } 40% { transform: translate(6px, -3px); } 60% { transform: translate(-4px, 2px); } 80% { transform: translate(3px, -1px); } }

/* ---------- collection / deckbuilder ---------- */
.filters { display: flex; gap: 8px; align-items: center; }
.chip { padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line); background: rgba(255,255,255,.04); cursor: pointer; font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.chip.on { background: var(--c, #a86bff); color: #120a20; border-color: transparent; }
.search { background: #1d1238; color: var(--ink); border: 1px solid var(--line); border-radius: 99px; padding: 8px 14px; font: inherit; width: 200px; }
.grid { position: absolute; top: 96px; left: 30px; right: 30px; bottom: 16px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, 150px); gap: 18px 16px; justify-content: center; padding: 10px 6px 30px; }
.grid .slotc { position: relative; width: 150px; height: 210px; }
.grid .slotc .card { transition: transform .25s cubic-bezier(.2,.8,.2,1.3); width: 150px; height: 210px; }
.grid .slotc .card:hover { transform: translateY(-6px) scale(1.05); z-index: 5; }
.grid .slotc .qty { position: absolute; top: -8px; right: -8px; z-index: 6; background: var(--gold); color: #241400; font-weight: 900; border-radius: 99px; padding: 2px 8px; font-size: 13px; }
.grid .slotc.maxed .card { filter: grayscale(.7) brightness(.6); }
#inspect .box { display: grid; grid-template-columns: 420px 440px; gap: 34px; text-align: left; align-items: center; padding: 30px; }
#inspect .big { position: relative; width: 420px; height: 588px; perspective: 1100px; }
#inspect .big .card { width: 420px; height: 588px; transition: transform .12s linear; }
#inspect h3 { font-family: var(--font-title); font-size: 28px; margin: 0 0 6px; }
#inspect .meta { color: var(--muted); margin-bottom: 16px; letter-spacing: .06em; }
#inspect .rulesText { font-family: var(--font-card); font-size: 20px; line-height: 1.5; white-space: pre-line; margin-bottom: 14px; }
#inspect .flavorText { font-family: var(--font-card); font-style: italic; color: #d7c3a3; font-size: 17px; line-height: 1.5; }
#inspect .rar { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin-left: 8px; }
.r-Legendary { background: linear-gradient(90deg, #ffd36e, #ff8ad8); color: #2a1000; }
.r-Ultra-Rare { background: #b98aff; color: #1a0736; }
.r-Rare { background: #6fd3ff; color: #032035; }
.r-Un-common { background: #9ad99a; color: #062006; }
.r-Common { background: #444; color: #eee; }

#deckbuilder .grid { right: 400px; bottom: 112px; }
#deckbuilder .navbar { left: calc(50% - 200px); }
#deckbuilder .decklist { position: absolute; top: 96px; right: 24px; width: 360px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
#deckbuilder .decklist .rows { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
#deckbuilder .drow { display: grid; grid-template-columns: 28px 1fr 30px; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 8px; background: rgba(255,255,255,.04); cursor: pointer; font-size: 13px; border-left: 4px solid var(--c); }
#deckbuilder .drow:hover { background: rgba(255,90,70,.15); }
#deckbuilder .drow .cst { font-family: var(--font-title); font-weight: 900; text-align: center; color: #e9d7ff; }
#deckbuilder .drow .q { text-align: right; font-weight: 800; color: var(--gold); }
#deckbuilder .curve { display: flex; align-items: flex-end; gap: 4px; height: 60px; }
#deckbuilder .curve div { flex: 1; background: linear-gradient(0deg, #6a3dc0, #b98aff); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
#deckbuilder .curve div span { position: absolute; bottom: -16px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--muted); }
#deckbuilder .dcount { font-family: var(--font-title); font-size: 22px; }

/* ---------- rules ---------- */
#rules .doc { position: absolute; top: 96px; left: 50%; transform: translateX(-50%); width: 1100px; bottom: 16px; overflow-y: auto; padding: 10px 30px 40px; user-select: text; }
#rules .doc h2 { font-family: var(--font-title); letter-spacing: .1em; color: var(--gold); margin: 28px 0 10px; font-size: 24px; }
#rules .doc p, #rules .doc li { font-size: 16px; line-height: 1.6; color: #e6dcf7; }
#rules .doc .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
#rules .doc .kw { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; }
#rules .doc .kw b { color: #ffe08a; }
#rules .doc .callout { padding: 14px 18px; border-radius: 12px; background: rgba(168,107,255,.12); border: 1px solid var(--line); }

/* ---------- board ambience & feel ---------- */
#board0 { position: absolute; top: 0; bottom: 0; width: 1600px; }
.motes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.motes i { position: absolute; bottom: -20px; width: 6px; height: 6px; border-radius: 50%; background: #c9a2ff; box-shadow: 0 0 10px #a86bff, 0 0 20px #a86bff; opacity: 0; animation: mote linear infinite; }
.motes i:nth-child(3n) { background: #8fe7ff; box-shadow: 0 0 10px #6fd3ff; width: 4px; height: 4px; }
@keyframes mote { 0% { transform: translate(0, 0); opacity: 0; } 10% { opacity: .7; } 90% { opacity: .5; } 100% { transform: translate(40px, -960px); opacity: 0; } }
.mat.field.drop { border-color: rgba(125,255,176,.8); background: linear-gradient(180deg, rgba(125,255,176,.12), rgba(125,255,176,.03)); box-shadow: 0 0 40px rgba(125,255,176,.25) inset; }
.card .flip { transform: rotateX(0) rotateY(0); }
.card.inhand:not(.down):hover .flip, .grid .slotc .card:hover .flip { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .12s; }
.card.foil::after { content: ""; position: absolute; inset: -2px; border-radius: 8cqw; pointer-events: none; background: conic-gradient(from var(--ang, 0deg), transparent 0 70%, rgba(255,210,120,.7) 80%, transparent 90%); mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; padding: 2px; animation: spinAng 4s linear infinite; opacity: .8; }
@property --ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes spinAng { to { --ang: 360deg; } }
.card.down::after { display: none; }
.card.ready { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { translate: 0 -4px; } }

/* ---------- rotate prompt ---------- */
#rotate { position: fixed; inset: 0; z-index: 9999; display: none; place-items: center; background: radial-gradient(circle, #2a1552, #0b0716); text-align: center; padding: 30px; }
#rotate .ph { width: 70px; height: 120px; border: 4px solid #e9dcff; border-radius: 14px; margin: 0 auto 24px; animation: rot 2s ease-in-out infinite; }
@keyframes rot { 40%, 60% { transform: rotate(-90deg); } }
#rotate p { font-family: var(--font-title); letter-spacing: .1em; font-size: 20px; }
@media (orientation: portrait) and (max-width: 900px) { #rotate { display: grid; } }

/* ---------- hub ---------- */
#hub { background: radial-gradient(ellipse at 50% 45%, #2a1250 0%, #0b0716 70%); overflow: hidden; }
#hub .three { position: absolute; inset: 0; }
#hub .vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 50%, transparent 45%, rgba(5,2,14,.75)), linear-gradient(0deg, rgba(5,2,14,.9), transparent 22%); }
.hubtop { position: absolute; top: 18px; left: 24px; right: 24px; display: flex; align-items: center; gap: 14px; z-index: 5; }
.profile { display: flex; align-items: center; gap: 12px; padding: 6px 18px 6px 6px; border-radius: 99px; background: rgba(12,6,28,.75); border: 1px solid var(--line); backdrop-filter: blur(6px); }
.profile .av { width: 54px; height: 54px; border-radius: 50%; background-size: cover; background-position: 50% 18%; border: 2px solid var(--gold); box-shadow: 0 0 14px rgba(242,193,78,.5); }
.profile .lvl { font-family: var(--font-title); font-weight: 900; font-size: 16px; }
.profile .xp { width: 150px; height: 7px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; margin-top: 4px; }
.profile .xp i { display: block; height: 100%; background: linear-gradient(90deg, #a86bff, #6fd3ff); }
.pill { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 99px; background: rgba(12,6,28,.75); border: 1px solid var(--line); font-family: var(--font-title); font-weight: 900; font-size: 20px; backdrop-filter: blur(6px); }
.coin { width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff1b0, #f2c14e 45%, #9a6a10); box-shadow: 0 0 10px rgba(242,193,78,.7); }
.packicon { width: 20px; height: 28px; border-radius: 3px; background: linear-gradient(160deg, #c9a2ff, #6a2dd0); box-shadow: 0 0 10px rgba(168,107,255,.8); }
.iconbtn { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: rgba(12,6,28,.75); border: 1px solid var(--line); cursor: pointer; }
.iconbtn:hover { border-color: var(--gold); }
.hubleader { position: absolute; left: 110px; top: 128px; width: 330px; perspective: 1000px; z-index: 4; cursor: pointer; }
.hubleader .lc { width: 330px; height: 490px; transition: transform .15s; box-shadow: 0 30px 60px rgba(0,0,0,.7), 0 0 50px var(--glow, #a86bff); }
.hubleader .lc::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.28) 45%, transparent 60%); background-size: 250% 250%; animation: sheen 5s ease-in-out infinite; pointer-events: none; }
@keyframes sheen { 0%, 60% { background-position: 120% 0; } 100% { background-position: -60% 0; } }
.hubleader .change { margin-top: 18px; width: 100%; }
.hubright { position: absolute; right: 90px; top: 200px; width: 420px; display: flex; flex-direction: column; gap: 16px; align-items: stretch; z-index: 4; }
.hubright .deckline { text-align: center; color: var(--muted); letter-spacing: .12em; font-size: 14px; text-transform: uppercase; }
.bigplay { font-family: var(--font-title); font-weight: 900; font-size: 54px; letter-spacing: .14em; padding: 30px 20px; border-radius: 22px; border: 2px solid #ffe6a0; cursor: pointer; color: #2a1600;
  background: linear-gradient(180deg, #ffe08a, #f2c14e 45%, #b8811a); box-shadow: 0 0 0 4px rgba(0,0,0,.35), 0 20px 50px rgba(0,0,0,.6), 0 0 60px rgba(242,193,78,.55); animation: playPulse 2.2s ease-in-out infinite; position: relative; overflow: hidden; }
.bigplay::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.55) 48%, transparent 60%); background-size: 250% 100%; animation: sheen 3.2s ease-in-out infinite; }
.bigplay small { display: block; font-size: 15px; letter-spacing: .3em; margin-top: 4px; font-family: var(--font-ui); font-weight: 800; }
@keyframes playPulse { 50% { box-shadow: 0 0 0 4px rgba(0,0,0,.35), 0 20px 50px rgba(0,0,0,.6), 0 0 90px rgba(242,193,78,.85); transform: scale(1.015); } }
.hubstats { display: flex; gap: 10px; justify-content: center; }
.hubstats div { flex: 1; text-align: center; padding: 10px; border-radius: 14px; background: rgba(12,6,28,.65); border: 1px solid var(--line); }
.hubstats b { display: block; font-family: var(--font-title); font-size: 24px; }
.hubstats span { font-size: 11px; letter-spacing: .15em; color: var(--muted); text-transform: uppercase; }
.hublogo { position: absolute; left: 50%; top: 20px; width: 250px; transform: translateX(-50%); mix-blend-mode: screen; z-index: 3; pointer-events: none; }
.navbar { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; gap: 8px; padding: 8px; border-radius: 26px; background: rgba(12,6,28,.82); border: 1px solid var(--line); backdrop-filter: blur(10px); z-index: 6; box-shadow: 0 20px 40px rgba(0,0,0,.5); }
.navbar button { position: relative; appearance: none; border: 0; background: transparent; color: #cbb9ee; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 22px; border-radius: 18px; cursor: pointer; font-family: var(--font-title); font-weight: 800; font-size: 13px; letter-spacing: .1em; transition: background .2s, color .2s, transform .2s; }
.navbar button .ic { font-size: 26px; line-height: 1; filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); }
.navbar button:hover { background: rgba(168,107,255,.18); color: #fff; transform: translateY(-3px); }
.navbar button.on { background: linear-gradient(180deg, rgba(168,107,255,.45), rgba(90,40,170,.45)); color: #fff; }
.navbar .badge { position: absolute; top: 4px; right: 12px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: #ff4a3a; color: #fff; font: 800 12px var(--font-ui); display: grid; place-items: center; box-shadow: 0 0 10px #ff4a3a; }

/* ---------- shop / packs ---------- */
#shop .packs { position: absolute; top: 150px; left: 0; right: 0; display: flex; justify-content: center; gap: 26px; perspective: 1200px; }
.shoppack { width: 230px; display: flex; flex-direction: column; align-items: center; gap: 12px; cursor: pointer; }
.shoppack img { height: 340px; width: auto; max-width: 260px; object-fit: contain; filter: drop-shadow(0 26px 30px rgba(0,0,0,.7)); transition: transform .3s cubic-bezier(.2,.8,.2,1.4), filter .3s; animation: packBob 6s ease-in-out infinite; }
.shoppack:hover img { transform: translateY(-16px) rotate(-3deg) scale(1.06); filter: drop-shadow(0 36px 34px rgba(0,0,0,.7)) drop-shadow(0 0 26px var(--c)); }
.shoppack .nm { font-family: var(--font-title); font-weight: 900; letter-spacing: .2em; color: var(--c); }
.shoppack .price { display: flex; gap: 8px; align-items: center; font-family: var(--font-title); font-weight: 900; font-size: 20px; padding: 8px 18px; border-radius: 99px; background: rgba(12,6,28,.8); border: 1px solid var(--line); }
#shop .note { position: absolute; bottom: 120px; width: 100%; text-align: center; color: var(--muted); letter-spacing: .06em; }
#opening { position: absolute; inset: 0; z-index: 980; display: none; background: radial-gradient(ellipse at 50% 50%, #321566 0%, #0b0716 72%); }
#opening.on { display: block; }
#opening .three { position: absolute; inset: 0; }
#opening .hint { position: absolute; bottom: 130px; width: 100%; text-align: center; font-family: var(--font-title); font-size: 24px; letter-spacing: .25em; color: #f3e6ff; text-shadow: 0 0 20px #a86bff; animation: hintPulse 1.6s ease-in-out infinite; pointer-events: none; }
@keyframes hintPulse { 50% { opacity: .45; } }
#opening .bar { position: absolute; bottom: 40px; width: 100%; display: none; justify-content: center; gap: 14px; }
#opening .bar.on { display: flex; }
#opening .labels { position: absolute; left: 0; right: 0; top: 150px; height: 40px; pointer-events: none; }
#opening .labels span { position: absolute; transform: translateX(-50%); font: 900 14px var(--font-ui); letter-spacing: .15em; padding: 5px 12px; border-radius: 99px; background: #ff4a3a; color: #fff; box-shadow: 0 0 16px #ff4a3a; animation: pop .5s cubic-bezier(.2,1.8,.4,1); }
#opening .labels span.dupe { background: #555; box-shadow: none; }
@keyframes pop { from { transform: translateX(-50%) scale(0); } }
#opening .inspectTxt { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); width: 760px; text-align: center; padding: 14px 20px; border-radius: 14px; background: rgba(12,6,28,.85); border: 1px solid var(--line); display: none; }
#opening .inspectTxt.on { display: block; }
#opening .inspectTxt b { font-family: var(--font-title); font-size: 22px; }
#opening .inspectTxt p { font-family: var(--font-card); font-size: 17px; margin: 6px 0 0; white-space: pre-line; }
.owned0 .card { filter: grayscale(1) brightness(.4); }
.slotc .lock { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; z-index: 6; pointer-events: none; text-shadow: 0 0 10px #000; }
.progress { width: 220px; height: 8px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #f2c14e, #ff8ad8); }
/* ---------- phone (landscape) sizing ---------- */
body.mobile #topbar .btn { font-size: 22px; padding: 14px 22px; }
body.mobile #endTurn { width: 250px; font-size: 30px; padding: 22px 10px; top: 350px; }
body.mobile .crystalbar { transform: scale(1.45); transform-origin: 0 50%; }
body.mobile .crystalbar[data-side="1"] { transform-origin: 0 0; }
body.mobile #promptBar { top: 405px; padding: 14px 16px 14px 26px; }
body.mobile #promptBar .ptxt { font-size: 24px; max-width: 900px; }
body.mobile #promptBar .btn { font-size: 22px; padding: 14px 24px; }
body.mobile #banner .msg { font-size: 30px; }
body.mobile #playBtn { font-size: 26px; padding: 16px 30px; }
body.mobile .lcard .act { font-size: 18px; padding: 10px 14px; bottom: -52px; }
body.mobile .navbar { bottom: 16px; padding: 10px; }
body.mobile .navbar button { font-size: 20px; padding: 14px 34px; }
body.mobile .navbar button .ic { font-size: 40px; }
body.mobile .pill { font-size: 30px; padding: 12px 22px; }
body.mobile .coin { width: 34px; height: 34px; }
body.mobile .packicon { width: 26px; height: 36px; }
body.mobile .iconbtn { width: 72px; height: 72px; font-size: 32px; }
body.mobile .profile .lvl { font-size: 24px; }
body.mobile .profile .av { width: 72px; height: 72px; }
body.mobile .hubright { width: 520px; }
body.mobile .bigplay { font-size: 70px; }
body.mobile .hubstats b { font-size: 32px; }
body.mobile .hubstats span { font-size: 15px; }
body.mobile .deckline { font-size: 19px !important; }
body.mobile .hubleader .change { font-size: 26px; padding: 18px; }
body.mobile .btn { font-size: 24px; }
body.mobile .btn.small { font-size: 20px; padding: 12px 20px; }
body.mobile .page .top { height: 100px; }
body.mobile .page .top h1 { font-size: 38px; }
body.mobile .chip { font-size: 18px; padding: 10px 18px; }
body.mobile .modal h2 { font-size: 40px; }
body.mobile #opening .hint { font-size: 34px; }
body.mobile .shoppack .price { font-size: 28px; }
body.mobile .shoppack .nm { font-size: 22px; }
body.mobile #log { font-size: 18px; width: 460px; max-height: 420px; }
/* ---------- online: modes, waiting, account, ranks ---------- */
#sheet .box { min-width: 520px; max-width: 1100px; }
#sheet .box.wide { width: 1000px; }
#sheet .lead { color: var(--muted); font-size: 16px; line-height: 1.5; max-width: 640px; margin: 6px auto; }
#sheet .err { color: #ff9c92; min-height: 20px; margin: 8px 0; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 10px 0 18px; }
.mode { appearance: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 16px; border-radius: 18px; color: var(--ink);
  background: linear-gradient(180deg, rgba(90,50,160,.55), rgba(30,15,60,.7)); border: 1px solid var(--line); transition: transform .2s cubic-bezier(.2,.8,.2,1.4), border-color .2s, box-shadow .2s; }
.mode:hover { transform: translateY(-5px); border-color: var(--gold); box-shadow: 0 0 30px rgba(242,193,78,.3); }
.mode .mi { font-size: 48px; }
.mode b { font-family: var(--font-title); font-size: 24px; letter-spacing: .1em; }
.mode span:last-child { color: var(--muted); font-size: 13px; }
.mode.off { opacity: .4; cursor: not-allowed; }
.mode.off:hover { transform: none; box-shadow: none; border-color: var(--line); }
.modesub { color: var(--muted); margin-bottom: 18px; } .modesub a { color: var(--gold); }
.friend { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; text-align: center; }
.friend > div { padding: 22px; border-radius: 16px; background: rgba(255,255,255,.04); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.friend h3, .acct h3 { font-family: var(--font-title); margin: 0; letter-spacing: .1em; }
.friend p, .acct p { color: var(--muted); margin: 0; font-size: 14px; }
.codein { font: 900 34px var(--font-title); letter-spacing: .4em; text-align: center; text-transform: uppercase; width: 260px; padding: 10px; border-radius: 12px; background: #1d1238; color: #fff; border: 1px solid var(--line); }
.waiting { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 460px; }
.winfo { color: var(--muted); font-size: 16px; }
.roomcode { font: 900 64px var(--font-title); letter-spacing: .35em; color: #ffe08a; text-shadow: 0 0 24px rgba(242,193,78,.7); margin: 6px 0 12px; user-select: text; }
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 5px solid rgba(168,107,255,.25); border-top-color: #b98aff; animation: spin 1s linear infinite; margin: 10px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.acct { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 14px; }
.acct form { display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: 16px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.acct input { font: 16px var(--font-ui); padding: 11px 14px; border-radius: 10px; background: #1d1238; color: var(--ink); border: 1px solid var(--line); user-select: text; }
.netdot { font: 800 11px var(--font-ui); letter-spacing: .2em; padding: 6px 10px; border-radius: 99px; color: #ffb3a8; border: 1px solid rgba(255,90,70,.4); background: rgba(12,6,28,.7); }
.netdot.on { color: #9dffc4; border-color: rgba(93,255,154,.45); box-shadow: 0 0 12px rgba(93,255,154,.25); }
.ranklist { position: absolute; top: 110px; left: 50%; transform: translateX(-50%); width: 820px; bottom: 120px; overflow-y: auto; }
table.ranks { width: 100%; border-collapse: collapse; font-size: 17px; font-variant-numeric: tabular-nums; }
table.ranks th { text-align: left; color: var(--muted); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; padding: 10px 14px; border-bottom: 1px solid var(--line); }
table.ranks td { padding: 12px 14px; border-bottom: 1px solid rgba(190,160,255,.08); }
table.ranks tr:nth-child(-n+3) td:first-child { color: var(--gold); font-weight: 900; }
table.ranks tr.me td { background: rgba(168,107,255,.15); }
body.mobile .mode b { font-size: 32px; } body.mobile .mode span:last-child { font-size: 18px; } body.mobile table.ranks { font-size: 24px; }
body.mobile #sheet .lead { font-size: 22px; } body.mobile .acct input { font-size: 22px; }#over .overlead { display: flex; justify-content: center; margin: 6px 0 16px; perspective: 900px; }
#over .overlead .lc { width: 170px; height: 252px; animation: overLead 3.5s ease-in-out infinite; box-shadow: 0 20px 40px rgba(0,0,0,.6), 0 0 40px rgba(168,107,255,.45); }
@keyframes overLead { 50% { transform: translateY(-6px) rotateY(8deg); } }
/* ================= v3: solo, social, profile, deck lab, settings ================= */
.page > .body { position: absolute; top: 96px; left: 30px; right: 30px; bottom: 112px; overflow-y: auto; padding: 6px 6px 20px; }
.tabs { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.tab { appearance: none; border: 0; background: transparent; color: var(--muted); padding: 9px 16px; border-radius: 10px; font: 700 14px var(--font-ui); cursor: pointer; white-space: nowrap; }
.tab.on { background: linear-gradient(180deg, rgba(168,107,255,.55), rgba(90,40,170,.55)); color: #fff; }
.tab:hover:not(.on) { color: #fff; }
.eyebrow { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.playing { text-align: center; color: var(--muted); margin: 0 0 14px; } .playing a { color: var(--gold); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.two h3, .quests h3 { font-family: var(--font-title); letter-spacing: .1em; margin: 6px 0 10px; }
#toast { position: absolute; left: 50%; bottom: 130px; transform: translate(-50%, 20px); z-index: 1200; padding: 12px 22px; border-radius: 12px; background: rgba(12,6,28,.95); border: 1px solid rgba(242,193,78,.5); opacity: 0; transition: all .25s; pointer-events: none; font-weight: 600; max-width: 800px; text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
.err:empty { display: none; }

/* campaign */
.chapters { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.chapter { border-radius: 18px; padding: 16px; background: linear-gradient(180deg, color-mix(in srgb, var(--d) 70%, transparent), rgba(12,6,28,.8)); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); display: flex; flex-direction: column; gap: 10px; }
.chead { display: flex; flex-direction: column; } .chead span { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--c); } .chead b { font-family: var(--font-title); font-size: 22px; } .chead em { font-style: normal; color: var(--muted); font-size: 12px; }
.chapter p { font-size: 13px; line-height: 1.45; color: #d8ccef; margin: 0; min-height: 76px; }
.nodes { display: flex; flex-direction: column; gap: 8px; position: relative; }
.node { appearance: none; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--ink); font: 600 14px var(--font-ui); text-align: left; cursor: pointer; transition: transform .15s, border-color .15s; }
.node i { font-style: normal; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.08); flex: none; }
.node.open { border-color: var(--c); box-shadow: 0 0 16px color-mix(in srgb, var(--c) 35%, transparent); }
.node.open:hover { transform: translateX(4px); }
.node.won i { background: var(--c); color: #120a20; font-weight: 900; }
.node.locked { opacity: .45; cursor: not-allowed; }
.node.boss { border-width: 2px; } .node.boss span { font-family: var(--font-title); }
.nodedetail { display: grid; grid-template-columns: 170px 1fr; gap: 24px; align-items: center; text-align: left; }
.nodedetail .lc { width: 170px; height: 252px; }

/* boss */
.bosswrap { display: grid; grid-template-columns: 330px 1fr; gap: 50px; align-items: center; max-width: 1150px; margin: 10px auto; }
.bosscard .lc { width: 330px; height: 490px; box-shadow: 0 0 60px rgba(255,90,70,.45), 0 30px 60px rgba(0,0,0,.6); animation: overLead 4s ease-in-out infinite; }
.bossinfo h2 { font-family: var(--font-title); font-size: 46px; margin: 6px 0; color: #ffcf9a; }
.bossinfo .lead { text-align: left; margin: 8px 0; max-width: none; }
.rewardline { margin: 14px 0; } .rewardline .done { color: #7dffb0; font-weight: 800; }
.rotation { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 24px; } .rotation span { font-size: 12px; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); } .rotation span.on { color: #fff; border-color: var(--gold); }

/* puzzles */
.puzzles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; max-width: 1300px; margin: 10px auto; }
.puzzle { appearance: none; position: relative; text-align: left; display: flex; flex-direction: column; gap: 8px; padding: 18px; min-height: 170px; border-radius: 16px; border: 1px solid var(--line); background: linear-gradient(160deg, rgba(90,50,160,.4), rgba(20,10,40,.7)); color: var(--ink); cursor: pointer; transition: transform .15s, border-color .15s; }
.puzzle:hover { transform: translateY(-4px); border-color: var(--gold); }
.puzzle .n { font-family: var(--font-title); font-size: 34px; color: var(--gold); line-height: 1; }
.puzzle b { font-family: var(--font-title); font-size: 18px; } .puzzle em { font-style: normal; font-size: 13px; color: var(--muted); line-height: 1.4; flex: 1; }
.puzzle i { font-style: normal; font-weight: 800; font-size: 13px; color: #b98aff; } .puzzle.solved i { color: #7dffb0; } .puzzle.solved { border-color: rgba(125,255,176,.4); }

/* rift run */
.runintro { max-width: 1100px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.runintro h2 { font-family: var(--font-title); font-size: 40px; margin: 0; }
.runleaders { display: flex; gap: 14px; margin: 14px 0; }
.rl { cursor: pointer; border-radius: 12px; transition: transform .15s; } .rl .lc { width: 140px; height: 208px; } .rl:hover { transform: translateY(-6px); } .rl.on .lc { box-shadow: 0 0 0 3px var(--gold), 0 0 30px rgba(242,193,78,.6); }
.runhead { display: flex; align-items: center; justify-content: center; gap: 30px; margin-bottom: 18px; flex-wrap: wrap; }
.floors { display: flex; gap: 8px; } .floors span { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; border: 2px solid var(--line); color: var(--muted); }
.floors span.done { background: #5a3db0; color: #fff; border-color: #b98aff; } .floors span.cur { border-color: var(--gold); color: #fff; box-shadow: 0 0 16px rgba(242,193,78,.7); } .floors span.boss { color: #ff9c92; }
.lives { font-size: 24px; letter-spacing: 4px; }
.relics { display: flex; gap: 8px; } .relics span { padding: 6px 12px; border-radius: 99px; background: rgba(255,255,255,.06); border: 1px solid var(--line); font-size: 13px; }
.nextopp { display: grid; grid-template-columns: 240px 1fr; gap: 40px; align-items: center; max-width: 1000px; margin: 0 auto; }
.nextopp .lc { width: 240px; height: 356px; } .nextopp h2 { font-family: var(--font-title); font-size: 38px; margin: 6px 0; } .nextopp .lead { text-align: left; margin: 6px 0 18px; }
.offer { display: flex; gap: 22px; justify-content: center; align-items: stretch; margin: 16px 0; }
.offc { position: relative; width: 200px; height: 280px; cursor: pointer; transition: transform .2s; } .offc .card { width: 200px; height: 280px; } .offc:hover { transform: translateY(-10px) scale(1.03); }
.offr { appearance: none; width: 200px; border-radius: 16px; border: 1px solid var(--gold); background: linear-gradient(160deg, rgba(242,193,78,.2), rgba(20,10,40,.8)); color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; cursor: pointer; transition: transform .2s; }
.offr:hover { transform: translateY(-10px); } .offr i { font-style: normal; font-size: 54px; } .offr b { font-family: var(--font-title); font-size: 18px; } .offr em { font-style: normal; font-size: 13px; color: var(--muted); }
.decklistview { max-height: 520px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; min-width: 460px; text-align: left; }
.decklistview .drow, #stats .drow, .two .drow { display: grid; grid-template-columns: 28px 1fr 40px; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 8px; background: rgba(255,255,255,.04); border-left: 4px solid var(--c); font-size: 14px; }
.drow .cst { font-family: var(--font-title); font-weight: 900; text-align: center; } .drow .q { text-align: right; font-weight: 800; color: var(--gold); }

/* challenges */
.quests { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; max-width: 1300px; margin: 0 auto; }
.quest { display: grid; grid-template-columns: 1fr 70px 100px; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); margin-bottom: 10px; }
.quest b { font-size: 15px; } .quest span { font-size: 12px; color: var(--muted); }
.qbar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; margin: 8px 0 4px; } .qbar i { display: block; height: 100%; background: linear-gradient(90deg, #a86bff, #6fd3ff); }
.quest.ready { border-color: var(--gold); box-shadow: 0 0 20px rgba(242,193,78,.25); } .quest.claimed { opacity: .5; }
.qr { display: flex; align-items: center; gap: 6px; font-family: var(--font-title); font-weight: 900; } .qr .coin { width: 18px; height: 18px; }
.quest em { font-style: normal; color: #7dffb0; font-weight: 700; text-align: center; }

/* social */
.offline { max-width: 700px; margin: 60px auto; text-align: center; }
.clubhead { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; }
.clubhead h2 { font-family: var(--font-title); font-size: 36px; margin: 4px 0; } .clubhead .lead { text-align: left; margin: 0; }
.invite { text-align: center; color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #555; } .dot.on { background: #5dff9a; box-shadow: 0 0 8px #5dff9a; }
.livelist { display: flex; flex-direction: column; gap: 10px; max-width: 1100px; margin: 10px auto; }
.live { display: grid; grid-template-columns: 1fr 40px 1fr 220px 110px; gap: 12px; align-items: center; padding: 14px 18px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.live .vs b { font-size: 16px; } .live .vs span { color: var(--muted); font-size: 13px; display: block; } .live i { font-style: normal; color: var(--gold); font-family: var(--font-title); text-align: center; } .live em { font-style: normal; color: var(--muted); font-size: 13px; }
.trade { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--line); margin-bottom: 8px; }
.trade p { margin: 4px 0; font-size: 14px; } .trade .tb { display: flex; gap: 6px; flex-direction: column; } .trade.done { font-size: 13px; color: var(--muted); } .trade.done em { font-style: normal; text-transform: capitalize; }
.tradeform { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 16px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.tradeform input, .acct input { font: 15px var(--font-ui); padding: 10px 12px; border-radius: 10px; background: #1d1238; color: var(--ink); border: 1px solid var(--line); user-select: text; width: 100%; }
.tradeform label { font-size: 12px; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.picks { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; } .picks button { appearance: none; text-align: left; padding: 8px 10px; border-radius: 8px; border: 0; border-left: 4px solid var(--c); background: rgba(255,255,255,.06); color: var(--ink); cursor: pointer; font: 14px var(--font-ui); } .picks button span { color: var(--muted); font-size: 12px; float: right; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; } .chips span { padding: 5px 10px; border-radius: 99px; background: rgba(168,107,255,.25); cursor: pointer; font-size: 13px; }

/* profile */
table.hist td.win { color: #7dffb0; font-weight: 800; } table.hist td.loss { color: #ff9c92; }
.statnums { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 24px; }
.statnums div { text-align: center; padding: 16px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.statnums b { display: block; font-family: var(--font-title); font-size: 34px; font-variant-numeric: tabular-nums; } .statnums span { font-size: 12px; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }
.sbar { display: grid; grid-template-columns: 170px 1fr 50px 150px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 14px; }
.sbar > div { height: 10px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; } .sbar > div i { display: block; height: 100%; background: linear-gradient(90deg, #f2c14e, #7dffb0); }
.sbar b { text-align: right; font-variant-numeric: tabular-nums; } .sbar em { font-style: normal; color: var(--muted); font-size: 12px; }
.settings { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.set { display: flex; justify-content: space-between; align-items: center; gap: 30px; padding: 18px 20px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.set b { font-size: 17px; } .set p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(0,0,0,.3); border: 1px solid var(--line); flex: none; }
.seg button { appearance: none; border: 0; padding: 9px 16px; border-radius: 9px; background: transparent; color: var(--muted); font: 700 14px var(--font-ui); cursor: pointer; }
.seg button.on { background: linear-gradient(180deg, #f6d06a, #b8811a); color: #2a1600; }

/* deck lab & collection */
.tog { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.grid .slotc.unowned .card { filter: saturate(.35) brightness(.72); }
.nown { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 6; font: 800 10px var(--font-ui); letter-spacing: .12em; padding: 3px 8px; border-radius: 99px; background: rgba(12,6,28,.9); color: #ffb86b; border: 1px solid rgba(255,184,107,.5); pointer-events: none; white-space: nowrap; }
#deckbuilder .drow.ghostrow { opacity: .7; border-left-style: dashed; }
.codebox { width: 620px; max-width: 100%; height: 90px; font: 14px ui-monospace, monospace; padding: 12px; border-radius: 10px; background: #1d1238; color: var(--ink); border: 1px solid var(--line); resize: none; user-select: text; }
.shardbar { position: absolute; top: 96px; left: 30px; right: 30px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 14px; font-weight: 700; }
.shardbar span { display: flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; background: rgba(255,255,255,.05); border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); }
.shardbar span i { width: 10px; height: 13px; background: var(--c); clip-path: polygon(50% 0, 100% 35%, 80% 100%, 20% 100%, 0 35%); }
.shardbar em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 13px; }
.craftbox { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; } .craftbox .own { color: var(--muted); font-size: 14px; }

/* board extras */
#topbar .btn.on { background: rgba(242,193,78,.25); border-color: var(--gold); }
#tracker { position: absolute; left: 16px; top: 60px; width: 300px; max-height: 620px; overflow-y: auto; padding: 12px 14px; border-radius: 14px; background: rgba(10,5,24,.94); border: 1px solid var(--line); z-index: 870; display: none; font-size: 13px; }
#tracker.on { display: block; }
#tracker h4 { margin: 10px 0 6px; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); } #tracker h4:first-child { margin-top: 0; }
#tracker .tr { display: grid; grid-template-columns: 22px 1fr 30px; gap: 6px; padding: 3px 0; border-bottom: 1px solid rgba(190,160,255,.08); } #tracker .tr b { color: #e9d7ff; } #tracker .tr i { font-style: normal; text-align: right; color: var(--gold); } #tracker .tr span:only-child { grid-column: 1 / -1; }
#replayBar { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 880; display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 14px; background: rgba(12,6,28,.92); border: 1px solid rgba(242,193,78,.5); }
#replayBar > b { font-family: var(--font-title); letter-spacing: .2em; color: var(--gold); padding: 0 6px; }
body.mobile #tracker { width: 440px; font-size: 18px; max-height: 760px; } body.mobile .tab { font-size: 20px; padding: 12px 20px; } body.mobile .node { font-size: 18px; } body.mobile .chapter p { font-size: 16px; }
body.mobile .quest b { font-size: 20px; } body.mobile .set b { font-size: 22px; } body.mobile .set p { font-size: 18px; } body.mobile .seg button { font-size: 20px; padding: 12px 20px; }

/* graphics: low */
body.fx-low .motes, body.fx-low #game::after { display: none; }
body.fx-low .card.foil::after, body.fx-low .card .shine { display: none; }
body.fx-low .card.ready, body.fx-low .bigplay, body.fx-low .bigplay::after, body.fx-low .hubleader .lc::after, body.fx-low .shoppack img, body.fx-low #over .overlead .lc, body.fx-low .bosscard .lc { animation: none !important; }
body.fx-low #hub { background: radial-gradient(ellipse at 50% 45%, #2a1250 0%, #0b0716 70%); }

/* theme: midnight (true black) */
body.theme-midnight { --bg: #000; --panel: rgba(8,8,12,.92); }
body.theme-midnight #viewport, body.theme-midnight { background: #000; }
body.theme-midnight .page { background: #000; }
body.theme-midnight #game { background: linear-gradient(180deg, #030205 0%, #07050c 50%, #030205 100%); }
body.theme-midnight #hub { background: #000; }
body.theme-midnight .page .top { background: rgba(0,0,0,.85); }
body.theme-midnight .crystalbar, body.theme-midnight .navbar, body.theme-midnight #log, body.theme-midnight #tracker { background: rgba(4,4,8,.95); }
/* deck lab header fit */
#deckbuilder .top .btn, #deckbuilder .top h1, #deckbuilder .top .tog { white-space: nowrap; flex-shrink: 0; }
#deckbuilder .top .chip { padding: 6px 10px; font-size: 12px; }
#deckbuilder .top .filters { gap: 6px; }
#deckbuilder .top .search { width: 140px; }
#deckbuilder .decklist .search { min-width: 0; }

/* ---------- leader Commands, boss intents, pick modal, signatures ---------- */
.cmd { position: absolute; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; white-space: nowrap; padding: 5px 10px 5px 8px; border-radius: 99px; font: 700 12px/1 var(--font-ui, inherit); letter-spacing: .03em; color: #2a1800; background: linear-gradient(180deg, #ffe7a3, #d9a441); border: 1px solid #fff2c4; box-shadow: 0 4px 14px rgba(0,0,0,.5); cursor: pointer; z-index: 700; }
.cmd.theirs { pointer-events: none; opacity: .92; }
.cmd i { font-style: normal; font-size: 14px; }
.cmd b { display: grid; place-items: center; min-width: 20px; height: 20px; border-radius: 50%; background: #3b1280; color: #e9d7ff; font-size: 12px; }
.cmd.mine:not(.ready) { filter: grayscale(.55) brightness(.75); }
/* lane D: the ready pulse is an opacity loop on a glow layer (compositor) instead of a box-shadow repaint every frame */
.cmd.ready::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; box-shadow: 0 0 0 4px rgba(255,211,110,.35), 0 0 26px rgba(255,211,110,.8); opacity: 0; animation: cmdReady 1.6s ease-in-out infinite; }
.cmd.used { filter: grayscale(1) brightness(.5); text-decoration: line-through; }
@keyframes cmdReady { 50% { opacity: 1; } }
body.mobile .cmd { font-size: 16px; padding: 8px 14px 8px 10px; }
#game.splashing #intentBox, .splashing #intentBox { opacity: 0 !important; }
#intentBox { position: absolute; left: 400px; top: 318px; width: 330px; padding: 10px 14px 12px; border-radius: 14px; background: linear-gradient(160deg, rgba(60,10,16,.94), rgba(22,6,18,.94)); border: 1px solid rgba(255,106,90,.65); box-shadow: 0 0 24px rgba(255,90,70,.28); color: #ffe3de; z-index: 850; pointer-events: none; opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .3s; }
#intentBox.on { opacity: 1; transform: none; }
#intentBox.pop { animation: intentPop .5s cubic-bezier(.2,.9,.3,1.3); }
#intentBox .k { font: 800 11px/1 var(--font-ui, inherit); letter-spacing: .2em; color: #ff8a7a; }
#intentBox .n { font-family: var(--font-title); font-weight: 900; font-size: 22px; margin: 4px 0 2px; color: #fff; }
#intentBox .t { font-size: 14px; line-height: 1.35; }
#intentBox .h { margin-top: 6px; font-size: 12px; color: #9fe3ff; }
#intentBox.broken { border-color: rgba(111,211,255,.7); background: linear-gradient(160deg, rgba(10,30,50,.94), rgba(10,10,28,.94)); }
#intentBox.broken .k { color: #6fd3ff; } #intentBox.broken .n { text-decoration: line-through; opacity: .7; }
@keyframes intentPop { 0% { transform: scale(.9); } 60% { transform: scale(1.04); } 100% { transform: none; } }
body.mobile #intentBox { left: 400px; top: 314px; width: 400px; }
body.mobile #intentBox .n { font-size: 26px; } body.mobile #intentBox .t { font-size: 17px; }
#pickModal { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: rgba(8,4,18,.78); backdrop-filter: blur(4px); z-index: 900; }
#pickModal.on { display: flex; }
#pickModal .ptxt { font-family: var(--font-title); font-size: 28px; font-weight: 900; letter-spacing: .06em; color: #fff; text-shadow: 0 2px 10px #000; }
#pickModal .row { display: flex; gap: 28px; }
#pickModal .card.pickc { position: relative; width: 220px; height: 308px; cursor: pointer; animation: pickIn .45s cubic-bezier(.2,.9,.3,1.2) both; transition: transform .2s; }
#pickModal .card.pickc:hover { transform: translateY(-10px) scale(1.04); }
@keyframes pickIn { from { opacity: 0; transform: translateY(40px) rotateY(80deg); } to { opacity: 1; transform: none; } }
body.mobile #pickModal .card.pickc { width: 280px; height: 392px; }
#cmdSplash { position: absolute; left: 0; right: 0; top: 300px; display: grid; justify-items: center; pointer-events: none; z-index: 885; opacity: 0; }
#cmdSplash .k { font: 800 16px/1 var(--font-ui, inherit); letter-spacing: .5em; color: var(--sc, #f2c14e); }
#cmdSplash .n { font-family: var(--font-title); font-weight: 900; font-size: 60px; color: #fff; text-shadow: 0 0 34px var(--sc, #f2c14e), 0 4px 10px #000; }
#cmdSplash .x { max-width: 720px; text-align: center; font-size: 18px; color: #ffeec2; text-shadow: 0 2px 6px #000; }
#cmdSplash.go { animation: cmdSplash 1.9s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes cmdSplash { 0% { opacity: 0; transform: scale(1.4); } 15% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px); } }
.card .sigb { position: absolute; left: 89.58%; top: 14.2%; transform: translate(-50%, -50%); width: clamp(14px, 15cqw, 26px); height: clamp(14px, 15cqw, 26px); border-radius: 50%; display: grid; place-items: center; font-size: clamp(9px, 9cqw, 15px); line-height: 1; color: #3a2400; background: radial-gradient(circle at 35% 30%, #fff3c4, #e0a93a); border: 1px solid #fff; box-shadow: 0 0 10px rgba(255,211,110,.9); z-index: 4; pointer-events: none; }
body.fx-low .cmd.ready, body.fx-low .cmd.ready::after, body.fx-low #pickModal .card.pickc { animation: none; }
.ability.cmdline { margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: rgba(242,193,78,.1); border: 1px solid rgba(242,193,78,.4); }
.ability.cmdline b { color: #ffd36e; } .ability.cmdline i { color: var(--muted); font-style: normal; font-size: .85em; }
body.fx-low .cmd.ready::after { opacity: 1; } /* lane D: static ready glow on Graphics: Low */
