/* The Crypto Rabbit Hole TCG — neon/cyber UI. Landscape first; works on phones held sideways. */
:root {
  --bg: #05030c;
  --panel: rgba(12, 8, 26, 0.86);
  --panel-solid: #0d0920;
  --line: rgba(140, 120, 255, 0.28);
  --text: #eef0ff;
  --muted: #9a9cc4;
  --cyan: #38f3ff;
  --magenta: #ff4fd8;
  --gold: #ffc23d;
  --green: #22ff7a;
  --blue: #2f86ff;
  --purple: #b04dff;
  --red: #ff4060;
  --me: var(--cyan);
  --opp: var(--magenta);
  --card-w: clamp(64px, 7.4vw, 118px);
  --hud-h: 58px;
  --font: 'Outfit', system-ui, sans-serif;
  --display: 'Russo One', 'Arial Black', sans-serif;
  --mono: 'Share Tech Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); overflow: hidden; overscroll-behavior: none; }
body { touch-action: none; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; }
#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }

/* ------------------------------------------------------------ buttons */
.btn {
  position: relative; cursor: pointer; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(40, 30, 80, 0.85), rgba(16, 10, 34, 0.9));
  border-radius: 12px; padding: 10px 18px; font-weight: 700; letter-spacing: 0.02em; color: var(--text);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset, 0 6px 18px rgba(0, 0, 0, 0.4); transition: transform 0.12s, box-shadow 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--cyan); box-shadow: 0 0 18px rgba(56, 243, 255, 0.35), 0 6px 18px rgba(0, 0, 0, 0.4); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn.primary { border-color: rgba(56, 243, 255, 0.7); background: linear-gradient(180deg, #1ad6ff, #6a3cff); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.btn.primary:hover { box-shadow: 0 0 28px rgba(56, 243, 255, 0.6); }
.btn.danger { border-color: rgba(255, 64, 96, 0.6); background: linear-gradient(180deg, rgba(120, 20, 40, 0.9), rgba(50, 8, 20, 0.95)); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.big { padding: 14px 26px; font-size: 1.05rem; }
.btn.warn { border-color: rgba(255, 194, 61, 0.8); background: linear-gradient(180deg, #ffb52e, #e0561f); color: #1a0d00; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 18px; }
.icon-btn:hover { border-color: var(--cyan); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.03) inset; }

/* ------------------------------------------------------------ screens */
.screen { position: fixed; inset: 0; display: none; }
.screen.active { display: block; }
.title-inner { position: relative; height: 100%; display: flex; align-items: center; justify-content: center; gap: clamp(10px, 4vw, 60px); padding: 64px 24px 44px; }
.title-main { display: flex; flex-direction: column; align-items: center; gap: clamp(12px, 3vh, 30px); }
.logo { text-align: center; }
.logo-img { display: block; width: min(640px, 54vw); height: auto; filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 14px rgba(176, 77, 255, 0.75)) drop-shadow(0 10px 30px rgba(0, 0, 0, 0.6)); animation: logo-in 1.1s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes logo-in { from { opacity: 0; transform: translateY(-18px) scale(0.92); } }
.logo-tcg { display: block; margin-top: 6px; font-family: var(--mono); letter-spacing: 0.55em; color: var(--cyan); font-size: clamp(0.72rem, 1.3vw, 1rem); text-transform: uppercase; text-shadow: 0 0 14px rgba(56, 243, 255, 0.6); }
.menu { display: grid; gap: 10px; width: min(400px, 84vw); animation: menu-in 0.7s 0.25s both; }
@keyframes menu-in { from { opacity: 0; transform: translateY(16px); } }
.menu .btn.big { display: flex; align-items: center; gap: 12px; text-align: left; }
.menu .btn.big small { margin-left: auto; font-weight: 500; font-size: 0.78rem; color: var(--muted); }
.menu .btn.primary.big small { color: rgba(255, 255, 255, 0.8); }
.menu .mi { font-size: 1.25rem; width: 1.6em; text-align: center; }
.menu-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn.small { padding: 6px 12px; font-size: 0.82rem; font-weight: 600; }
.menu .btn.ghost.small { color: var(--muted); justify-self: center; }
.online-count { font-family: var(--mono); }
.title-host { position: absolute; right: clamp(8px, 3vw, 60px); bottom: 0; width: clamp(200px, 27vw, 400px); animation: host-in 0.9s 0.4s cubic-bezier(.2, 1.2, .4, 1) both; pointer-events: none; }
.title-host::after { content: ''; position: absolute; left: -20%; right: -20%; bottom: -40px; height: 140px; z-index: -1;
  background: radial-gradient(ellipse at 50% 70%, rgba(255, 79, 216, 0.45), rgba(106, 60, 255, 0.25) 45%, transparent 72%); filter: blur(6px); }
@keyframes host-in { from { opacity: 0; transform: translateY(40px); } }
.host-art { display: block; width: 100%; height: auto; transform-origin: 50% 100%; animation: host-sway 6s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(176, 77, 255, 0.4));
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%); mask-image: linear-gradient(to bottom, #000 72%, transparent 100%); }
@keyframes host-sway { 50% { transform: rotate(-1.2deg) scale(1.01); } }
.host-bubble { position: absolute; bottom: 100%; right: 22%; margin-bottom: 4px; width: max-content; max-width: 240px; padding: 10px 14px; border-radius: 16px 16px 4px 16px; background: rgba(255, 255, 255, 0.95); color: #1b0d38; font-weight: 600; font-size: 0.92rem; box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45); transition: opacity 0.3s, transform 0.3s; }
.host-bubble.swap { opacity: 0; transform: translateY(6px); }
.title-foot { position: absolute; bottom: 12px; left: 0; right: 0; margin: 0; font-family: var(--mono); color: var(--muted); letter-spacing: 0.2em; font-size: 0.78rem; text-align: center; }
.profile-chip { position: absolute; top: 14px; right: 16px; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; text-align: left; }
.profile-chip:hover { border-color: var(--cyan); }
.chip-text b { display: block; font-size: 0.9rem; }
.chip-text small { color: var(--muted); font-size: 0.72rem; }
.avatar.sm { width: 34px; height: 34px; border-width: 2px; }
.avatar.xl { width: 84px; height: 84px; border-width: 3px; }
.avatar[style*="--frame"], .pfp-opt { border-color: var(--frame); box-shadow: 0 0 14px var(--frame); }
.avatar.card-pfp, .pfp-opt.card-pfp { background-size: 210%; background-position: 50% 30%; }
@media (max-width: 760px), (max-height: 520px) { .title-host { display: none; } }
@media (max-height: 520px) {
  .title-inner { padding: 50px 16px 28px; }
  .logo-img { width: min(380px, 50vw); }
  .menu { gap: 6px; }
  .menu .btn.big { padding: 8px 16px; font-size: 0.9rem; }
  .menu .btn { padding: 7px 12px; font-size: 0.85rem; }
  .title-foot { display: none; }
}

/* setup */
#setup { z-index: 21; display: none; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 100%, rgba(106, 60, 255, 0.4), rgba(5, 3, 12, 0.92)); }
#setup.active { display: flex; }
.setup-panel { position: relative; width: min(980px, 94vw); max-height: 94vh; overflow: auto; padding: 22px 26px; }
.setup-panel h2 { margin: 4px 0 14px; text-align: center; font-family: var(--display); font-weight: 400; letter-spacing: 0.05em; }
.setup-panel .back { position: absolute; left: 12px; top: 12px; }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.setup-col h3 { margin: 0 0 8px; font-size: 0.9rem; color: var(--muted); letter-spacing: 0.15em; text-transform: uppercase; }
.deck-pick { display: grid; gap: 8px; }
.deck-opt { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); cursor: pointer; text-align: left; }
.deck-opt img { width: 56px; border-radius: 6px; }
.deck-opt b { display: block; font-size: 1rem; }
.deck-opt small { color: var(--muted); font-size: 0.8rem; line-height: 1.25; display: block; }
.deck-opt.on { border-color: var(--cyan); box-shadow: 0 0 18px rgba(56, 243, 255, 0.3); background: rgba(56, 243, 255, 0.08); }
.setup-options { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin: 16px 0; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.opt select, .opt input { accent-color: var(--cyan); }
select { background: #140e2c; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; }
.start { display: block; margin: 0 auto; }
.setup-vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: start; }
.vs-side h3 { margin: 0 0 8px; font-size: 0.85rem; color: var(--muted); letter-spacing: 0.15em; text-transform: uppercase; }
.vs-mid { align-self: center; font-family: var(--display); font-size: 2rem; color: var(--magenta); text-shadow: 0 0 18px rgba(255, 79, 216, 0.6); }
.opp-card { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; padding: 6px 10px; border-radius: 12px; background: rgba(255, 79, 216, 0.08); border: 1px solid rgba(255, 79, 216, 0.35); }
.opp-card[hidden] { display: none; }
.opp-card img { width: 64px; height: 64px; object-fit: cover; object-position: top; border-radius: 10px; }
.opp-card small { display: block; color: var(--muted); font-size: 0.78rem; }
.deck-opt { cursor: default; }
.locked-decks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.deck-opt.locked { opacity: 0.5; filter: grayscale(0.7); }
@media (max-width: 760px), (max-height: 520px) { .setup-vs { grid-template-columns: 1fr 1fr; } .vs-mid { display: none; } .locked-decks { display: none; } .setup-panel { padding: 14px 16px; } }

/* online lobby, leaderboards, profile */
#online, #boards { z-index: 21; display: none; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 100%, rgba(106, 60, 255, 0.4), rgba(5, 3, 12, 0.94)); }
#online.active, #boards.active { display: flex; }
.lobby-panel, .boards-panel { position: relative; width: min(620px, 94vw); max-height: 94vh; overflow: auto; padding: 22px 26px; touch-action: pan-y; }
.lobby-panel h2, .boards-panel h2 { margin: 4px 0 6px; text-align: center; font-family: var(--display); font-weight: 400; letter-spacing: 0.05em; }
.lobby-panel .back, .boards-panel .back { position: absolute; left: 12px; top: 12px; }
.net-status { text-align: center; margin: 0 0 14px; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.net-status.online { color: var(--green); } .net-status.offline { color: var(--red); }
.lobby-body { display: grid; gap: 14px; }
.lobby-name { display: flex; align-items: center; gap: 10px; }
.lobby-name > span { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.text-in { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.35); color: var(--text); font: inherit; user-select: text; -webkit-user-select: text; }
.text-in:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 12px rgba(56, 243, 255, 0.3); }
.code-in { text-transform: uppercase; font-family: var(--mono); letter-spacing: 0.3em; text-align: center; max-width: 170px; }
.btn.quick { display: grid; gap: 2px; text-align: center; padding: 18px; font-size: 1.25rem; }
.btn.quick small { font-size: 0.8rem; font-weight: 500; opacity: 0.85; }
.lobby-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.join { display: flex; gap: 8px; }
.lobby-error { color: var(--red); text-align: center; margin: 0; }
.lobby-notes { margin: 0; padding-left: 18px; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.lobby-wait, .lobby-soon { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 10px 0; }
.lobby-wait h3, .lobby-soon h3 { margin: 6px 0 0; }
.lobby-wait p, .lobby-soon p { margin: 0; color: var(--muted); max-width: 420px; }
.room-code { font-family: var(--mono); font-size: 2.6rem; letter-spacing: 0.35em; padding: 8px 18px 8px 28px; border-radius: 14px; border: 1px dashed var(--cyan); color: var(--cyan); cursor: copy; text-shadow: 0 0 14px rgba(56, 243, 255, 0.6); }
.board-tabs, .board-period { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 10px; }
.tab { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); cursor: pointer; font-size: 0.85rem; }
.tab.small { font-size: 0.78rem; padding: 4px 10px; }
.tab.on { border-color: var(--cyan); background: rgba(56, 243, 255, 0.14); color: #fff; }
.board-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.board-list li { display: grid; grid-template-columns: 46px 34px 1fr auto auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid transparent; }
.board-list li.me { border-color: var(--cyan); background: rgba(56, 243, 255, 0.08); }
.board-list li.sep { margin-top: 8px; grid-template-columns: 46px 1fr auto; }
.board-list li.empty { display: grid; justify-items: center; grid-template-columns: 1fr; color: var(--muted); padding: 22px; }
.board-list .rank { font-family: var(--mono); text-align: center; }
.board-list .val { font-family: var(--display); color: var(--gold); }
.board-list small { color: var(--muted); font-size: 0.75rem; }
.board-list li.rank-1 { background: linear-gradient(90deg, rgba(255, 194, 61, 0.16), rgba(255, 255, 255, 0.03)); }
.board-foot { text-align: center; color: var(--muted); font-size: 0.8rem; display: grid; gap: 8px; justify-items: center; }
#profile { z-index: 45; }
.profile-box { position: relative; width: min(560px, 94vw); max-height: 92vh; overflow: auto; padding: 22px 24px; display: grid; gap: 12px; touch-action: pan-y; }
.profile-box h3 { margin: 6px 0 0; font-size: 0.85rem; color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase; }
.close-x { position: absolute; top: 8px; right: 8px; padding: 6px 10px; }
.prof-head { display: flex; align-items: center; gap: 16px; }
.prof-head h2 { margin: 0 0 4px; font-family: var(--display); font-weight: 400; }
.access-badge { font-size: 0.75rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.access-badge.account { color: var(--cyan); border-color: rgba(56, 243, 255, 0.5); }
.access-badge.wallet { color: var(--gold); border-color: rgba(255, 194, 61, 0.6); }
.muted { color: var(--muted); margin: 0; }
.pfp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.pfp-opt { aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--frame, var(--line)); background-size: cover; background-position: center; cursor: pointer; opacity: 0.7; box-shadow: none; }
.pfp-opt.on { opacity: 1; box-shadow: 0 0 16px var(--frame); transform: scale(1.06); }
.frame-row { display: flex; gap: 8px; }
.frame-opt { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--frame); background: transparent; cursor: pointer; }
.frame-opt.on { box-shadow: 0 0 12px var(--frame); background: var(--frame); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat-grid div { display: grid; text-align: center; padding: 8px 4px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); }
.stat-grid b { font-family: var(--display); font-size: 1.2rem; color: var(--cyan); }
.stat-grid small { color: var(--muted); font-size: 0.72rem; }
.recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 0.88rem; }
.recent li { display: flex; gap: 6px; align-items: baseline; }
.recent li small { margin-left: auto; color: var(--muted); }
.recent li.won b { color: var(--green); } .recent li.lost b { color: var(--red); }
.signin { display: grid; gap: 8px; }
.signin p { margin: 0; }
.signin-more { display: flex; gap: 8px; flex-wrap: wrap; }
.muted.small { font-size: 0.78rem; }
.perks ul { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; gap: 6px; }
.perks li { display: grid; gap: 2px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); opacity: 0.6; }
.perks li.on { opacity: 1; border-color: rgba(56, 243, 255, 0.45); }
.perks li span { color: var(--muted); font-size: 0.84rem; }
.prof-foot { display: flex; justify-content: space-between; }
.danger-text { color: var(--red); }

/* online table extras */
.turn-timer { position: absolute; left: 50%; top: calc(var(--hud-h) + 4px); transform: translateX(-50%); padding: 3px 12px; border-radius: 999px; font-family: var(--mono); font-size: 0.85rem; background: var(--panel); border: 1px solid var(--line); color: var(--muted); pointer-events: none; }
#game > .turn-timer { pointer-events: none; }
.turn-timer.mine { color: var(--cyan); border-color: rgba(56, 243, 255, 0.5); }
.turn-timer.low { color: var(--red); border-color: var(--red); }
.turn-timer[hidden], .emotes[hidden] { display: none; }
.emotes { position: absolute; right: 14px; bottom: calc(14px + 2 * 46px + 60px); display: flex; flex-direction: row-reverse; align-items: flex-end; gap: 8px; }
.emote-tray { display: none; flex-wrap: wrap; gap: 6px; max-width: 320px; padding: 8px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.emotes.open .emote-tray { display: flex; }
.emote-btn { padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); cursor: pointer; font-size: 0.85rem; }
.emote-btn:hover { border-color: var(--cyan); }
.emote-pop { position: absolute; z-index: 30; padding: 10px 16px; border-radius: 18px; background: #fff; color: #1b0d38; font-weight: 700; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5); pointer-events: none; animation: emote 2.6s ease both; }
#game > .emote-pop { pointer-events: none; }
.emote-pop.opp { top: calc(var(--hud-h) + 16px); left: 70px; border-top-left-radius: 4px; }
.emote-pop.me { bottom: calc(14px + 3 * 46px + 30px); left: 70px; border-bottom-left-radius: 4px; }
@keyframes emote { 0% { opacity: 0; transform: scale(0.6); } 10% { opacity: 1; transform: scale(1.05); } 16% { transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }
@media (max-height: 520px) { .emotes { bottom: calc(10px + 2 * 36px + 46px); right: 8px; } .lobby-panel, .boards-panel { padding: 12px 16px; } .room-code { font-size: 1.8rem; } .stat-grid { grid-template-columns: repeat(4, 1fr); } }


/* ------------------------------------------------------------ HUD */
#game { pointer-events: none; z-index: 5; }
#game > * { pointer-events: auto; }
.hud-top { position: absolute; top: 0; left: 0; right: 0; height: var(--hud-h); display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: linear-gradient(180deg, rgba(5, 3, 12, 0.92), rgba(5, 3, 12, 0)); pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.seat { display: flex; align-items: center; gap: 8px; min-width: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-size: 0.9rem; flex: none;
  background: radial-gradient(circle at 35% 30%, #3a2a70, #120a28); border: 2px solid var(--opp); box-shadow: 0 0 14px var(--opp); background-size: cover; background-position: center; }
.avatar.me { border-color: var(--me); box-shadow: 0 0 14px var(--me); }
.avatar.active { animation: pulse-ring 1.4s ease-in-out infinite; }
@keyframes pulse-ring { 50% { box-shadow: 0 0 26px currentColor, 0 0 0 4px rgba(255, 255, 255, 0.12); } }
.seat-name { font-weight: 800; font-size: 0.95rem; white-space: nowrap; }
.seat-stats { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); display: flex; gap: 10px; white-space: nowrap; }
.seat-stats .rekt { color: var(--red); font-weight: 700; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.4; } }
.lanes-done { color: var(--gold); }
.steps { flex: 1; display: flex; justify-content: center; gap: 4px; list-style: none; margin: 0; padding: 0; min-width: 0; }
.steps li { font-family: var(--mono); font-size: 0.72rem; padding: 5px 9px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.08); color: var(--muted); white-space: nowrap; background: rgba(10, 6, 24, 0.6); }
.steps li.done { opacity: 0.45; }
.steps li.now { color: #001018; background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 16px rgba(56, 243, 255, 0.6); font-weight: 700; }
.steps.opp li.now { background: var(--magenta); border-color: var(--magenta); box-shadow: 0 0 16px rgba(255, 79, 216, 0.6); color: #19001a; }
.hud-right { display: flex; gap: 6px; }
.seat-me { position: absolute; left: 12px; bottom: calc(var(--card-w) * 1.05 + 18px); }
.opp-hand { position: absolute; top: calc(var(--hud-h) - 4px); left: 14px; display: flex; pointer-events: none; }
.opp-hand .back { width: calc(var(--card-w) * 0.3); aspect-ratio: 1890/2640; margin: 0 -6px; border-radius: 5px; background: url(../assets/cards/sm/back.webp) center/cover; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6); transform: rotate(180deg); }
.opp-hand .count { margin-left: 14px; align-self: center; font-family: var(--mono); color: var(--muted); font-size: 0.8rem; }

/* centre guidance: one line on the board's centre rail, plus a Skip button when there's nothing to play */
.guide { position: absolute; left: 50%; top: var(--guide-y, 45%); transform: translate(-50%, -50%); z-index: 6; pointer-events: none;
  display: flex; align-items: center; gap: 10px; max-width: min(820px, 80vw); opacity: 0; transition: opacity 0.3s; }
.guide.show { opacity: 1; }
.g-line { font-weight: 600; font-size: clamp(0.8rem, 1.3vw, 1rem); letter-spacing: 0.01em; padding: 6px 18px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(180deg, rgba(14, 10, 30, 0.88), rgba(6, 4, 16, 0.88)); border: 1px solid rgba(255, 255, 255, 0.1); color: #e7e9ff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
.g-line.mine { border-color: rgba(56, 243, 255, 0.55); box-shadow: 0 0 22px rgba(56, 243, 255, 0.18), 0 8px 24px rgba(0, 0, 0, 0.45); }
.g-line.good { border-color: rgba(34, 255, 122, 0.5); }
.g-line.bad { border-color: rgba(255, 64, 96, 0.55); color: #ffdbe1; }
.g-line.muted { color: #c6c8e6; }
.g-line.flash { animation: gline 0.35s ease-out; }
#game > .guide { pointer-events: none; }
@keyframes gline { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.g-btns { display: flex; gap: 8px; pointer-events: auto; }
.g-btns:empty { display: none; }
.g-btns .btn { padding: 6px 16px; border-radius: 999px; font-size: 0.9rem; }
/* spotlight: the edges of the screen darken while an opponent's card is about to resolve */
.spotlight { position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: 0; transition: opacity 0.35s;
  background: radial-gradient(ellipse at 50% 35%, transparent 25%, rgba(0, 0, 0, 0.55) 70%, rgba(0, 0, 0, 0.8) 100%); }
#game > .spotlight { pointer-events: none; }
#game > .spotlight.open { opacity: 1; pointer-events: auto; cursor: pointer; }
/* Sandy: the CPU opponent's portrait and speech bubble, in the space left of the table */
.sandy { position: absolute; left: 14px; top: calc(var(--hud-h) + 26px); z-index: 6; display: none; pointer-events: none; }
.sandy.show { display: block; }
.sandy-card { position: relative; width: clamp(110px, 13vw, 190px); }
.sandy-art { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; border-radius: 18px;
  background: radial-gradient(circle at 50% 30%, rgba(255, 79, 216, 0.28), rgba(12, 8, 26, 0.9) 70%); border: 1px solid rgba(255, 79, 216, 0.45);
  box-shadow: 0 0 26px rgba(255, 79, 216, 0.25), 0 12px 30px rgba(0, 0, 0, 0.5); }
.sandy-art.pop { animation: sandypop 0.35s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes sandypop { from { transform: scale(0.94) translateY(4px); } to { transform: none; } }
.sandy-name { text-align: center; font-family: var(--display); font-size: clamp(0.8rem, 1.1vw, 1rem); color: #ffd2f5; margin-top: 4px; letter-spacing: 0.04em; }
.sandy-name small { display: block; font-family: var(--mono); font-size: 0.62rem; color: var(--muted); letter-spacing: 0.08em; }
.sandy-bubble { position: absolute; left: calc(100% + 10px); top: 18px; width: max-content; max-width: clamp(160px, 22vw, 300px); padding: 10px 14px; border-radius: 16px 16px 16px 4px;
  background: #fff6fd; color: #2a0f2a; font-weight: 700; font-size: clamp(0.78rem, 1.05vw, 0.95rem); line-height: 1.3; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  opacity: 0; transform: translateX(-6px) scale(0.96); transition: opacity 0.25s, transform 0.25s; }
.sandy-bubble.show { opacity: 1; transform: none; }
#game.with-sandy .opp-hand { left: calc(14px + clamp(110px, 13vw, 190px) + 12px); top: calc(var(--hud-h) + 4px); }
@media (max-height: 520px) {
  .sandy { top: calc(var(--hud-h) + 4px); left: 8px; }
  .sandy-card { width: 82px; }
  .sandy-name small { display: none; }
  .sandy-bubble { top: 6px; font-size: 0.7rem; max-width: 170px; padding: 6px 10px; }
}
/* the auto-skip toggle (unlocks after 10 games) */
.autoskip { position: absolute; right: 14px; bottom: calc(14px + 2 * 46px + 16px); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); font-size: 0.78rem; font-weight: 700; cursor: pointer; display: flex; gap: 6px; align-items: center; }
.autoskip.on { color: #001018; background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 16px rgba(56, 243, 255, 0.5); }
.autoskip.locked { cursor: help; opacity: 0.75; }
@media (max-height: 520px) { .autoskip { bottom: calc(10px + 2 * 36px + 12px); font-size: 0.68rem; padding: 4px 10px; } }
.prompt { position: absolute; top: calc(var(--hud-h) + 22px); left: 50%; transform: translateX(-50%); max-width: min(760px, 70vw); text-align: center; pointer-events: none;
  padding: 8px 18px; border-radius: 12px; background: rgba(5, 3, 12, 0.72); border: 1px solid var(--line); font-weight: 600; font-size: 0.95rem; opacity: 0; transition: opacity 0.2s; }
.prompt.show { opacity: 1; }
.prompt.mine { border-color: rgba(56, 243, 255, 0.6); box-shadow: 0 0 20px rgba(56, 243, 255, 0.25); }

/* hand */
.hand { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); height: calc(var(--card-w) * 1.4 + 14px); width: min(1100px, 92vw); pointer-events: none; }
.dcard { position: absolute; width: var(--card-w); aspect-ratio: 1890/2640; border-radius: calc(var(--card-w) * 0.06); cursor: pointer; pointer-events: auto;
  transform-origin: 50% 120%; transition: transform 0.22s cubic-bezier(.2, .8, .2, 1), filter 0.2s, box-shadow 0.2s; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.55);
  background: #120c24; --mx: 0.5; --my: 0.5; }
.dcard img { width: 100%; height: 100%; border-radius: inherit; display: block; pointer-events: none; }
.dcard .holo { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; mix-blend-mode: color-dodge; opacity: 0;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 0, 140, 0.55) 36%, rgba(255, 220, 0, 0.5) 44%, rgba(0, 255, 160, 0.5) 52%, rgba(0, 160, 255, 0.55) 60%, rgba(170, 0, 255, 0.5) 68%, transparent 82%);
  background-size: 250% 250%; background-position: calc(var(--mx) * 100%) calc(var(--my) * 100%); animation: holo 9s linear infinite; }
.dcard .sheen { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.55) 50%, transparent 60%); background-size: 300% 100%; animation: sheen 3.6s ease-in-out infinite; mix-blend-mode: overlay; }
.dcard .spark { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background-image: radial-gradient(circle, #fff 0 1px, transparent 1.5px), radial-gradient(circle, #fff 0 1px, transparent 1.5px);
  background-size: 23px 31px, 37px 29px; background-position: 0 0, 11px 7px; animation: twinkle 2.8s ease-in-out infinite; mix-blend-mode: screen; }
@keyframes holo { to { background-position: calc(var(--mx) * 100% + 250%) calc(var(--my) * 100%); } }
@keyframes sheen { 0% { background-position: 150% 0; } 60%, 100% { background-position: -50% 0; } }
@keyframes twinkle { 50% { opacity: 0.35; } }
.dcard.r-Uncommon { box-shadow: 0 0 14px 2px rgba(34, 255, 122, 0.55), 0 8px 18px rgba(0, 0, 0, 0.55); }
.dcard.r-Uncommon .sheen { opacity: 0.5; }
.dcard.r-Rare { box-shadow: 0 0 18px 3px rgba(47, 134, 255, 0.7), 0 8px 18px rgba(0, 0, 0, 0.55); }
.dcard.r-Rare .holo { opacity: 0.32; } .dcard.r-Rare .sheen { opacity: 0.55; }
.dcard.r-Epic { box-shadow: 0 0 22px 4px rgba(176, 77, 255, 0.8), 0 8px 18px rgba(0, 0, 0, 0.55); }
.dcard.r-Epic .holo { opacity: 0.5; } .dcard.r-Epic .sheen { opacity: 0.6; } .dcard.r-Epic .spark { opacity: 0.45; }
.dcard.r-Legendary { box-shadow: 0 0 26px 6px rgba(255, 194, 61, 0.9), 0 0 60px rgba(255, 160, 40, 0.35), 0 8px 18px rgba(0, 0, 0, 0.55); outline: 2px solid rgba(255, 220, 140, 0.8); outline-offset: -2px; }
.dcard.r-Legendary .holo { opacity: 0.6; filter: sepia(0.5) saturate(1.6); } .dcard.r-Legendary .sheen { opacity: 0.8; } .dcard.r-Legendary .spark { opacity: 0.8; }
.hand .dcard.playable::after { content: ''; position: absolute; inset: -4px; border-radius: inherit; border: 2px solid var(--cyan); box-shadow: 0 0 14px var(--cyan); animation: glow 1.2s ease-in-out infinite; pointer-events: none; }
@keyframes glow { 50% { opacity: 0.45; } }
.hand .dcard.unplayable { filter: brightness(0.62) saturate(0.7); }
.hand .dcard.selected { filter: brightness(1.12); }
.hand .dcard.selected::after { border-color: var(--gold); box-shadow: 0 0 20px var(--gold); animation: none; }
.hand .dcard .tag { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); font-family: var(--display); font-size: 0.72rem; letter-spacing: 0.12em; color: var(--gold); white-space: nowrap; pointer-events: none;
  text-shadow: 0 0 10px rgba(255, 194, 61, 0.8), 0 1px 3px rgba(0, 0, 0, 0.9); animation: tag-pulse 1.4s ease-in-out infinite; }
@keyframes tag-pulse { 50% { opacity: 0.6; } }

.actions { position: absolute; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.actions .btn { min-width: 132px; }
.actions .btn.end { border-color: rgba(255, 194, 61, 0.7); }

.toasts { position: fixed; left: 50%; top: calc(var(--guide-y, 45%) + 70px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 60; }
.toast { padding: 8px 16px; border-radius: 12px; background: rgba(8, 5, 20, 0.88); border: 1px solid var(--line); font-weight: 700; font-size: 0.95rem; animation: toast 2.8s forwards; text-align: center; max-width: 70vw; }
.toast.bad { border-color: rgba(255, 64, 96, 0.8); box-shadow: 0 0 20px rgba(255, 64, 96, 0.35); }
.toast.good { border-color: rgba(34, 255, 122, 0.7); box-shadow: 0 0 20px rgba(34, 255, 122, 0.3); }
@keyframes toast { 0% { opacity: 0; transform: translateY(10px) scale(0.95); } 8%, 82% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-14px); } }

.log { position: absolute; right: 0; top: var(--hud-h); bottom: 0; width: min(320px, 80vw); background: var(--panel); border-left: 1px solid var(--line); transform: translateX(105%); transition: transform 0.25s; padding: 10px 14px; overflow: auto; z-index: 9; }
.log.open { transform: none; }
.log h4 { margin: 4px 0 8px; font-family: var(--display); font-weight: 400; letter-spacing: 0.08em; }
.log ol { margin: 0; padding-left: 18px; font-size: 0.82rem; color: var(--muted); display: flex; flex-direction: column-reverse; gap: 3px; }
.log li.p0 { color: #bff9ff; } .log li.p1 { color: #ffd0f5; }

.banner { position: absolute; left: 0; right: 0; top: calc(var(--guide-y, 45%) - 62px); text-align: center; pointer-events: none; font-family: var(--display); font-size: clamp(1.05rem, 2.4vw, 1.9rem); opacity: 0; z-index: 7;
  text-shadow: 0 0 30px currentColor; letter-spacing: 0.06em; }
.banner.show { animation: banner 1.5s ease-out forwards; }
.banner.me { color: var(--cyan); } .banner.opp { color: var(--magenta); } .banner.gold { color: var(--gold); } .banner.red { color: var(--red); }
@keyframes banner { 0% { opacity: 0; transform: scale(1.25); letter-spacing: 0.2em; } 15% { opacity: 1; transform: scale(1); letter-spacing: 0.06em; } 75% { opacity: 1; } 100% { opacity: 0; transform: scale(0.96); } }

/* ------------------------------------------------------------ overlays */
.overlay { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 30; background: rgba(3, 2, 8, 0.6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.overlay.open { display: flex; }
#modal, #reaction { z-index: 25; }
.modal-box { width: min(980px, 94vw); max-height: 88vh; display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7); }
.modal-box h3 { margin: 0; font-size: 1.05rem; }
.modal-box .sub { color: var(--muted); font-size: 0.85rem; margin-top: -6px; }
.pick-grid { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; overflow: auto; padding: 8px 4px 14px; }
.pick-grid .dcard { position: relative; --card-w: clamp(78px, 11vw, 140px); }
.pick-grid .dcard:hover { transform: translateY(-4px); }
.pick-grid .dcard.disabled { filter: grayscale(0.85) brightness(0.45); pointer-events: none; }
.pick-grid .dcard.chosen { transform: translateY(-8px); }
.pick-grid .dcard.chosen::after { content: '✓'; position: absolute; inset: -5px; border-radius: inherit; border: 3px solid var(--gold); box-shadow: 0 0 22px var(--gold); display: grid; place-items: start end; padding: 4px 8px; font-weight: 900; color: var(--gold); font-size: 20px; }
/* docked dialog: sits at the bottom so the table stays visible (picking cards or spots on the board) */
#modal.dock { align-items: flex-end; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; pointer-events: none; }
#modal.dock .modal-box { pointer-events: auto; margin-bottom: 10px; max-height: 42vh; width: min(900px, 80vw); }
#modal.dock .pick-grid .dcard { --card-w: clamp(54px, 7vw, 92px); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.choice-list { display: grid; gap: 8px; }

.reaction-box { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 22px; }
.reaction-box h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(1.1rem, 2.6vw, 1.7rem); letter-spacing: 0.04em; text-align: center; color: var(--gold); text-shadow: 0 0 20px rgba(255, 194, 61, 0.5); }
.reaction-row { display: flex; align-items: center; gap: clamp(12px, 3vw, 40px); }
.reaction-row .vs { font-family: var(--display); font-size: 1.6rem; color: var(--red); text-shadow: 0 0 18px var(--red); }
.reaction-row .dcard { position: relative; --card-w: clamp(110px, 16vw, 200px); }
.reaction-opts { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.reaction-opts .dcard { --card-w: clamp(90px, 12vw, 150px); position: relative; }
.reaction-opts .dcard:hover { transform: translateY(-8px) scale(1.04); }
.chain { display: flex; gap: 8px; }
.chain .dcard { position: relative; --card-w: 64px; }
.chain .dcard.cancelled { filter: grayscale(1) brightness(0.5); }

#inspect { z-index: 40; }
.inspect-box { display: flex; gap: 24px; align-items: center; max-width: 94vw; }
.inspect-box .dcard { position: relative; --card-w: min(380px, 34vw, calc(70vh * 0.716)); cursor: default; transform: perspective(900px) rotateY(calc((var(--mx) - 0.5) * 18deg)) rotateX(calc((0.5 - var(--my)) * 18deg)); transition: transform 0.08s; }
.inspect-info { max-width: 460px; max-height: 88vh; overflow: auto; touch-action: pan-y; }
.inspect-info h2 { margin: 0 0 4px; font-family: var(--display); font-weight: 400; }
.inspect-info .type { color: var(--muted); font-family: var(--mono); letter-spacing: 0.08em; margin-bottom: 10px; }
.inspect-info p { line-height: 1.45; }
.rarity-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 0.8rem; cursor: pointer; background: rgba(255, 255, 255, 0.04); }
.chip.on { border-color: var(--cyan); background: rgba(56, 243, 255, 0.12); }
.chip.Uncommon { color: var(--green); } .chip.Rare { color: #78b4ff; } .chip.Epic { color: #d199ff; } .chip.Legendary { color: var(--gold); }

.pass-box, .menu-box, .settings-box, .gameover-box { padding: 24px 28px; display: grid; gap: 12px; text-align: center; min-width: min(380px, 90vw); }
.pass-box h2, .menu-box h2, .settings-box h2 { margin: 0 0 6px; font-family: var(--display); font-weight: 400; letter-spacing: 0.05em; }
.settings-box { text-align: left; }
.gameover-box h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(2.2rem, 7vw, 4.6rem); letter-spacing: 0.04em; }
.gameover-box.win h1 { color: var(--gold); text-shadow: 0 0 40px rgba(255, 194, 61, 0.7); }
.gameover-box.lose h1 { color: var(--red); text-shadow: 0 0 40px rgba(255, 64, 96, 0.6); }
.gameover-box .stats { font-family: var(--mono); color: var(--muted); }
.how-box { width: min(820px, 94vw); max-height: 88vh; overflow: auto; padding: 22px 26px; text-align: left; line-height: 1.5; }
.how-box h2 { font-family: var(--display); font-weight: 400; margin-top: 0; }
.how-box h3 { color: var(--cyan); margin-bottom: 4px; }
.how-box ol, .how-box ul { padding-left: 20px; }

/* ------------------------------------------------------------ library */
#library { z-index: 22; background: radial-gradient(ellipse at 50% 0%, rgba(106, 60, 255, 0.3), rgba(5, 3, 12, 0.97) 60%); overflow: auto; touch-action: pan-y; }
#library.active { display: block; }
.lib-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; background: rgba(5, 3, 12, 0.9); border-bottom: 1px solid var(--line); }
.lib-head h2 { margin: 0; font-family: var(--display); font-weight: 400; }
.lib-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(96px, 12vw, 150px), 1fr)); gap: 16px; padding: 18px; }
.lib-grid .dcard { position: relative; width: 100%; --card-w: 100%; }
.lib-grid .dcard:hover { transform: translateY(-6px) scale(1.03); z-index: 2; }
.lib-grid figure { margin: 0; }
.lib-grid figcaption { font-size: 0.78rem; text-align: center; margin-top: 6px; color: var(--muted); }
.lib-grid figcaption b { color: var(--text); display: block; font-size: 0.85rem; }
.lib-section { grid-column: 1 / -1; font-family: var(--display); color: var(--cyan); letter-spacing: 0.08em; border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-top: 8px; }

/* ------------------------------------------------------------ misc */
#rotate { position: fixed; inset: 0; z-index: 100; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: var(--bg); text-align: center; }
.rotate-icon { font-size: 64px; color: var(--cyan); animation: spin 2s ease-in-out infinite; }
@keyframes spin { 50% { transform: rotate(90deg); } }
@media (orientation: portrait) and (max-width: 820px) { #rotate { display: flex; } }
#loading { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--bg); transition: opacity 0.4s; }
#loading.done { opacity: 0; pointer-events: none; }
#loading .bar { width: 220px; height: 4px; background: rgba(255, 255, 255, 0.08); border-radius: 4px; overflow: hidden; }
#loading .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--magenta)); transition: width 0.2s; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.1); border-top-color: var(--cyan); animation: rot 0.9s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* phones in landscape */
@media (max-height: 520px) {
  :root { --hud-h: 40px; --card-w: clamp(46px, 6vh + 2.4vw, 64px); }
  .hud-top { padding: 4px 8px; }
  .icon-btn { width: 32px; height: 32px; font-size: 15px; }
  .banner { font-size: 1.3rem; }
  .opp-hand { display: none; }
  .steps li { font-size: 0.6rem; padding: 3px 6px; }
  .avatar { width: 28px; height: 28px; font-size: 0.65rem; border-width: 1.5px; }
  .seat-name { font-size: 0.8rem; } .seat-stats { font-size: 0.68rem; gap: 6px; }
  .actions .btn { min-width: 100px; padding: 7px 12px; font-size: 0.85rem; }
  .prompt { font-size: 0.8rem; top: calc(var(--hud-h) + 12px); padding: 5px 12px; }
  .seat-me { bottom: calc(var(--card-w) * 1.05 + 10px); }
  .modal-box { padding: 12px 14px; max-height: 94vh; }
  .pick-grid .dcard { --card-w: clamp(60px, 18vh, 110px); }
  .reaction-row .dcard { --card-w: clamp(80px, 30vh, 150px); }
  .reaction-opts .dcard { --card-w: clamp(70px, 24vh, 120px); }
  .menu .btn.big { padding: 9px 18px; font-size: 0.92rem; }
}
@media (max-width: 900px) { .steps li:not(.now) { display: none; } }
@media (prefers-reduced-motion: reduce) { .dcard .holo, .dcard .sheen, .dcard .spark, .menu-portal { animation: none; } }

/* tutorial coach: Sandy's pose beside a speech panel */
.coach { position: fixed; left: 10px; top: calc(var(--hud-h) + 2px); z-index: 12; display: flex; flex-direction: column; align-items: flex-start; gap: 0; width: min(460px, 37vw); pointer-events: none; }
.coach[hidden] { display: none; }
.coach { --art: clamp(96px, 9vw, 128px); }
.coach-art { width: var(--art); height: auto; flex: none; margin: 0 0 calc(var(--art) * -0.3) 18px; position: relative; z-index: 0; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 18px rgba(255, 79, 216, 0.35)); pointer-events: none; }
.coach-art.pop { animation: coach-bounce 0.45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes coach-bounce { 0% { transform: translateY(10px) scale(0.94); } 100% { transform: none; } }
.coach-body { position: relative; z-index: 1; align-self: stretch; display: grid; gap: 8px; padding: 12px 14px; border-radius: 16px; pointer-events: auto; max-height: calc(100vh - var(--hud-h) - 40px); overflow: auto;
  background: linear-gradient(160deg, rgba(40, 18, 70, 0.97), rgba(12, 8, 26, 0.97)); border: 1px solid rgba(255, 79, 216, 0.55); box-shadow: 0 0 26px rgba(255, 79, 216, 0.28), 0 16px 40px rgba(0, 0, 0, 0.55); }
.coach.hint .coach-body { border-color: rgba(56, 243, 255, 0.6); box-shadow: 0 0 22px rgba(56, 243, 255, 0.25), 0 16px 40px rgba(0, 0, 0, 0.55); }
.coach.in .coach-body { animation: coach-pop 0.3s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes coach-pop { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }
.coach-top { display: flex; align-items: baseline; gap: 10px; }
.coach-name { color: var(--magenta); font-family: var(--display); font-weight: 400; letter-spacing: 0.05em; font-size: 0.9rem; }
.coach-lesson { font-family: var(--mono); color: var(--muted); font-size: 0.72rem; }
.coach-skip { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 0.75rem; text-decoration: underline; cursor: pointer; padding: 0; }
.coach-skip:hover { color: var(--text); }
.coach-text { margin: 0; line-height: 1.4; font-size: 0.9rem; }
.coach-text b { color: var(--gold); }
.coach-cards { display: flex; gap: 6px; flex-wrap: wrap; }
.coach-cards:empty { display: none; }
.coach-cards .dcard { position: relative; --card-w: clamp(44px, 4.4vw, 64px); cursor: default; transition: transform 0.15s; }
.coach-cards .dcard:hover { transform: scale(1.9); z-index: 3; }
.coach-btns { display: flex; justify-content: flex-end; gap: 8px; }
.coach-btns:empty { display: none; }
body:has(#reaction.open, #modal.open) .coach { top: auto; bottom: 10px; z-index: 60; width: min(420px, 38vw); }
body:has(#reaction.open, #modal.open) .coach { --art: 78px; }

/* what Sandy is pointing at */
.tut-focus { outline: 2px solid var(--gold) !important; outline-offset: 3px; box-shadow: 0 0 22px rgba(255, 194, 61, 0.7) !important; animation: tut-glow 1.1s ease-in-out infinite; position: relative; z-index: 11; }
@keyframes tut-glow { 50% { outline-color: rgba(255, 194, 61, 0.35); } }
.steps.tut-all li:not([data-step="Adoption"]) { display: block !important; }

/* lesson title cards */
.tut-cut { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: radial-gradient(ellipse at center, rgba(40, 18, 70, 0.92), rgba(5, 3, 12, 0.97)); opacity: 0; pointer-events: none; transition: opacity 0.35s; cursor: pointer; }
.tut-cut.show { opacity: 1; pointer-events: auto; }
.tut-cut-inner { text-align: center; transform: translateY(10px); transition: transform 0.5s cubic-bezier(.2, 1.2, .4, 1); }
.tut-cut.show .tut-cut-inner { transform: none; }
.tut-cut small { font-family: var(--mono); color: var(--cyan); letter-spacing: 0.3em; text-transform: uppercase; }
.tut-cut h2 { margin: 10px 0 6px; font-family: var(--display); font-weight: 400; font-size: clamp(1.8rem, 5vw, 3.4rem); color: #fff; text-shadow: 0 0 30px rgba(176, 77, 255, 0.7); }
.tut-cut p { margin: 0; color: var(--muted); font-size: 1.05rem; }

@media (max-height: 520px) {
  .coach { width: min(360px, 44vw); top: calc(var(--hud-h) + 4px); }
  .coach { --art: 62px; }
  .coach-art { margin-left: 12px; }
  .coach-body { padding: 6px 9px 7px; gap: 4px; max-height: calc(100vh - var(--hud-h) - 16px); }
  .coach-text { font-size: 0.72rem; line-height: 1.35; }
  .coach-top { gap: 6px; }
  .coach-name, .coach-lesson, .coach-skip { font-size: 0.66rem; }
  .coach-cards .dcard { --card-w: 32px; }
  .coach-btns .btn.small { padding: 4px 10px; font-size: 0.75rem; }
}

/* ------------------------------------------------------------ library: collection and locked prints */
.chip-gap { width: 10px; }
.chip.ver.on { border-color: var(--gold); background: rgba(255, 194, 61, 0.14); }
.lib-progress { grid-column: 1 / -1; color: var(--muted); font-size: 0.88rem; }
.lib-progress b { color: var(--gold); font-family: var(--display); font-weight: 400; font-size: 1.05rem; }
.dcard.locked img { filter: grayscale(1) brightness(0.5) contrast(1.05); }
.dcard.locked .holo, .dcard.locked .sheen, .dcard.locked .spark { opacity: 0 !important; }
.lib-grid .dcard.locked { box-shadow: 0 8px 18px rgba(0, 0, 0, 0.55); outline: none; }
.lib-grid .dcard.locked:hover { filter: brightness(1.25); }
.lock-badge { position: absolute; right: 6%; top: 4%; font-size: clamp(14px, 1.6vw, 20px); filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8)); pointer-events: none; }
.ver-badge { position: absolute; left: 6%; top: 4%; padding: 1px 6px; border-radius: 6px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.05em; pointer-events: none; background: rgba(5, 3, 12, 0.85); border: 1px solid var(--line); }
.ver-badge.og { color: var(--magenta); border-color: rgba(255, 79, 216, 0.6); }
.ver-badge.signature { color: var(--gold); border-color: rgba(255, 194, 61, 0.6); }
.lib-grid figcaption .ver { display: block; font-size: 0.72rem; color: var(--cyan); }
.lib-grid figcaption .ver.og { color: var(--magenta); } .lib-grid figcaption .ver.signature { color: var(--gold); }
.lib-grid figcaption small { display: block; font-size: 0.7rem; color: var(--muted); }
/* how many copies you hold: a badge on the card, and the count per rarity under it */
.own-badge { position: absolute; right: 6%; top: 4%; padding: 1px 7px; border-radius: 99px; font: 700 0.72rem var(--mono); color: var(--cyan); background: rgba(5, 3, 12, 0.85); border: 1px solid rgba(56, 243, 255, 0.55); pointer-events: none; }
.lib-grid figcaption .own-line { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 8px; }
.own-r { white-space: nowrap; }
.own-r.Uncommon { color: var(--green); } .own-r.Rare { color: #78b4ff; } .own-r.Epic { color: #d199ff; } .own-r.Legendary { color: var(--gold); }
.own-summary { margin: 0.4em 0; } .own-summary b { color: var(--cyan); } .own-summary small { color: var(--muted); }
.lib-grid figure.is-locked figcaption b { color: var(--muted); }
.lock-cover { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 4px; text-align: center; border-radius: inherit; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(5, 3, 12, 0.55), rgba(5, 3, 12, 0.15) 70%); }
.lock-cover span { font-size: clamp(30px, 4vw, 52px); filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.8)); }
.lock-cover b { font-size: 0.95rem; text-shadow: 0 2px 6px #000; }
.lock-cover small { color: var(--muted); text-shadow: 0 2px 6px #000; }
.versions { display: grid; gap: 8px; margin: 8px 0 10px; }
.version-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; border: 1px solid transparent; }
.version-row.on { border-color: var(--line); background: rgba(255, 255, 255, 0.03); }
.version-row .ver { flex-basis: 100%; font-weight: 700; font-size: 0.85rem; color: var(--cyan); }
.version-row .ver.og { color: var(--magenta); } .version-row .ver.signature { color: var(--gold); }
.chip.locked { opacity: 0.6; }
.chip.locked.on { opacity: 1; }

.now-playing b { color: var(--gold); margin-right: 10px; font-weight: 700; }

/* ------------------------------------------------------------ the menu's world: the city, the portal, cards drifting out */
#title { z-index: 20; overflow: hidden; background: #05030c; }
.menu-sky { position: absolute; inset: -4%; background: url(../assets/ui/intro/city.webp) center 58% / cover no-repeat; filter: saturate(1.1) brightness(0.62); animation: sky-drift 40s ease-in-out infinite alternate; }
@keyframes sky-drift { to { transform: scale(1.06) translateY(-1%); } }
.menu-portal { position: absolute; left: 50%; top: 27%; width: min(80vh, 62vw); height: auto; transform: translate(-50%, -50%); opacity: 0.55; pointer-events: none; animation: portal-spin 90s linear infinite; filter: drop-shadow(0 0 40px rgba(255, 170, 60, 0.35)); }
@keyframes portal-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.menu-cards { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0.7; overflow: hidden; }
.menu-vignette { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 35%, transparent 30%, rgba(5, 3, 12, 0.55) 70%, rgba(5, 3, 12, 0.92) 100%),
    linear-gradient(180deg, rgba(5, 3, 12, 0.35), transparent 25%, transparent 70%, rgba(5, 3, 12, 0.85)); }
/* scanlines over the whole menu, very faint */
#title::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.18;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 3px); }

/* ------------------------------------------------------------ glass HUD buttons */
.menu { perspective: 1100px; }
.menu .btn {
  --cut: 12px;
  border: 0; border-radius: 0; color: #f4f1ff; letter-spacing: 0.04em;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04) 46%, rgba(255, 255, 255, 0.02) 54%, rgba(140, 110, 255, 0.08)),
    rgba(10, 7, 26, 0.74);
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  box-shadow: inset 0 0 0 1px rgba(200, 210, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 14px 30px rgba(0, 0, 0, 0.45);
  transform: translateZ(0); transition: transform 0.25s cubic-bezier(.2, 1.2, .4, 1), box-shadow 0.25s, background 0.25s;
  overflow: hidden;
}
/* HUD corner ticks */
.menu .btn::before { content: ''; position: absolute; inset: 4px; pointer-events: none;
  background:
    linear-gradient(var(--tick, #38f3ff), var(--tick, #38f3ff)) left top / 14px 1.5px no-repeat,
    linear-gradient(var(--tick, #38f3ff), var(--tick, #38f3ff)) left top / 1.5px 10px no-repeat,
    linear-gradient(var(--tick, #38f3ff), var(--tick, #38f3ff)) right bottom / 14px 1.5px no-repeat,
    linear-gradient(var(--tick, #38f3ff), var(--tick, #38f3ff)) right bottom / 1.5px 10px no-repeat;
  opacity: 0.55; transition: opacity 0.25s; }
/* a light sweep on hover */
.menu .btn::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent); transform: skewX(-18deg); transition: left 0.6s ease; }
.menu .btn:hover { transform: translateZ(40px) translateY(-2px); box-shadow: inset 0 0 0 1px rgba(56, 243, 255, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 0 26px rgba(56, 243, 255, 0.35), 0 18px 36px rgba(0, 0, 0, 0.5); }
.menu .btn:hover::before { opacity: 1; }
.menu .btn:hover::after { left: 130%; }
.menu .btn:active { transform: translateZ(10px) translateY(1px); }
.menu .btn.primary {
  --tick: #ffd27a;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.06) 48%, rgba(255, 255, 255, 0) 52%),
    linear-gradient(90deg, rgba(26, 214, 255, 0.55), rgba(106, 60, 255, 0.55) 60%, rgba(255, 79, 216, 0.45));
  box-shadow: inset 0 0 0 1px rgba(255, 220, 150, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 30px rgba(106, 60, 255, 0.45), 0 14px 30px rgba(0, 0, 0, 0.45);
  animation: primary-breathe 3.2s ease-in-out infinite;
}
@keyframes primary-breathe { 50% { box-shadow: inset 0 0 0 1px rgba(255, 220, 150, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 44px rgba(56, 243, 255, 0.5), 0 14px 30px rgba(0, 0, 0, 0.45); } }
.menu .btn.ghost { background: rgba(10, 7, 26, 0.6); }
.menu .mi { filter: drop-shadow(0 0 6px rgba(56, 243, 255, 0.6)); }
.menu .btn.big small { font-family: var(--mono); letter-spacing: 0.06em; }
/* the menu floats, tilted slightly towards you */
.menu { transform-style: preserve-3d; transform: rotateX(4deg); animation: menu-in 0.8s 0.25s both, menu-float 7s 1.1s ease-in-out infinite; }
@keyframes menu-float { 50% { transform: rotateX(4deg) translateY(-6px); } }
.profile-chip { backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); background: rgba(14, 10, 32, 0.5); box-shadow: inset 0 0 0 1px rgba(200, 210, 255, 0.18), 0 10px 26px rgba(0, 0, 0, 0.45); border: 0; }
.logo-tcg { margin-top: 10px; }
/* TCG-v2: a playtest build, marked so nobody mistakes it for the live game */
.edition-badge {
  display: inline-block; margin-top: 10px; padding: 3px 12px; border-radius: 99px;
  font: 600 0.72rem var(--mono); letter-spacing: 0.22em; text-transform: uppercase;
  color: #1b1203; background: linear-gradient(180deg, #fff1c4, #e8c06a); box-shadow: 0 0 18px rgba(232, 192, 106, 0.45);
}

/* ------------------------------------------------------------ glass panels on the other menu screens */
#setup, #online, #boards { background: #05030c url(../assets/ui/intro/grid.webp) center bottom / cover no-repeat; }
#setup::before, #online::before, #boards::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 20%, rgba(106, 60, 255, 0.25), rgba(5, 3, 12, 0.82) 70%); pointer-events: none; }
.setup-panel, .lobby-panel, .boards-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)), rgba(12, 8, 28, 0.55);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(200, 210, 255, 0.2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 30px 80px rgba(0, 0, 0, 0.6);
}

/* ------------------------------------------------------------ the intro: scroll to descend */
.intro { position: fixed; inset: 0; z-index: 85; overflow: hidden; background: #05030c; opacity: 0; transition: opacity 0.8s; touch-action: none; }
.intro.show { opacity: 1; }
.intro[hidden] { display: none; }
.intro .i-sky { position: absolute; inset: 0; background: url(../assets/ui/intro/city.webp) center 58% / cover no-repeat; transform-origin: 50% 44%; will-change: transform, opacity; }
.intro .i-grid { position: absolute; left: -30%; right: -30%; bottom: -10%; height: 70%; background: url(../assets/ui/intro/grid.webp) center top / cover no-repeat; mix-blend-mode: screen; opacity: 0.55; transform-origin: 50% 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%); mask-image: linear-gradient(180deg, transparent, #000 30%); }
.intro .i-portal, .intro .i-tunnel { position: absolute; left: 50%; top: 44%; height: auto; transform: translate(-50%, -50%); will-change: transform, opacity; pointer-events: none; }
.intro .i-portal { width: min(62vh, 52vw); filter: drop-shadow(0 0 50px rgba(255, 170, 60, 0.45)); }
.intro .i-tunnel { width: max(110vw, 110vh); opacity: 0; mix-blend-mode: normal;
  -webkit-mask-image: radial-gradient(circle, #000 55%, transparent 72%); mask-image: radial-gradient(circle, #000 55%, transparent 72%); }
.intro .i-cards { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; }
/* a card flying out of the vortex */
.vc { position: absolute; border-radius: 6%; backface-visibility: visible; will-change: transform, opacity; pointer-events: none;
  box-shadow: 0 0 22px rgba(255, 190, 80, 0.45), 0 0 2px rgba(255, 230, 180, 0.9); }
.intro .i-logo { position: absolute; left: 50%; top: 17%; width: min(620px, 56vw); transform: translate(-50%, -50%); pointer-events: none; opacity: 0;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 18px rgba(176, 77, 255, 0.85)) drop-shadow(0 12px 30px rgba(0, 0, 0, 0.7)); }
.intro .i-scan { position: absolute; inset: 0; pointer-events: none; opacity: 0.35; background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 3px); mix-blend-mode: overlay; }
.intro .i-flash { position: absolute; inset: 0; background: radial-gradient(circle at 50% 44%, #fff, #ffe2a8 30%, #ff9f2e 60%, rgba(255, 140, 40, 0.6)); opacity: 0; pointer-events: none; }
.i-hud { position: absolute; inset: 14px; pointer-events: none; font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.22em; color: #ffc23d; text-transform: uppercase; text-shadow: 0 0 10px rgba(255, 194, 61, 0.6); }
.i-hud::before, .i-hud::after { content: ''; position: absolute; width: 40px; height: 40px; border: 2px solid rgba(255, 194, 61, 0.7); }
.i-hud::before { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.i-hud::after { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.i-hud .tl { position: absolute; left: 22px; top: 12px; }
.i-hud .tr { position: absolute; right: 22px; top: 12px; color: #38f3ff; text-shadow: 0 0 10px rgba(56, 243, 255, 0.6); }
.hud-btn { position: absolute; pointer-events: auto; cursor: pointer; font: inherit; letter-spacing: 0.22em; text-transform: uppercase; color: #fff; padding: 10px 18px;
  background: rgba(10, 6, 24, 0.55); border: 1px solid rgba(255, 194, 61, 0.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); transition: background 0.2s, box-shadow 0.2s; }
.hud-btn:hover { background: rgba(255, 194, 61, 0.18); box-shadow: 0 0 20px rgba(255, 194, 61, 0.4); }
.i-hud .bl { left: 14px; bottom: 10px; }
.i-hud .br { right: 14px; bottom: 10px; }
.i-hint { position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%); display: grid; justify-items: center; gap: 8px; font-family: var(--mono); letter-spacing: 0.4em; font-size: 0.82rem; color: #ffc23d; text-transform: uppercase; text-shadow: 0 0 10px rgba(255, 194, 61, 0.7); pointer-events: none; }
.i-hint i { width: 22px; height: 34px; border: 2px solid rgba(255, 194, 61, 0.8); border-radius: 12px; position: relative; }
.i-hint i::after { content: ''; position: absolute; left: 50%; top: 6px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: #ffc23d; animation: wheel 1.4s ease-in-out infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 80% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }
@media (max-height: 520px), (max-width: 760px) {
  .i-hud { font-size: 0.62rem; inset: 8px; }
  .hud-btn { padding: 7px 12px; }
  .i-hint { font-size: 0.66rem; bottom: 16%; }
}
@media (prefers-reduced-motion: reduce) { .menu-portal, .menu-sky, .menu, .menu .btn.primary { animation: none; } }

/* the scroll hint reads clearly over the bright floor */
.i-hint span { padding: 6px 14px; background: rgba(5, 3, 12, 0.55); border: 1px solid rgba(255, 194, 61, 0.35); clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }

/* =====================================================================================
   PHONES
   Sideways (short screens): every screen is laid out for ~360-430px of height.
   Upright: the menus, Library, lobby and profile work; only a match asks you to turn sideways.
   ===================================================================================== */
@media (orientation: portrait) and (max-width: 820px) { #rotate { display: none; } body.in-game #rotate { display: flex; } }

@media (max-height: 520px) {
  /* ---------------- title: logo on the left, the glass menu on the right */
  .title-inner { padding: 8px 14px; }
  .title-main { flex-direction: row; align-items: center; justify-content: center; gap: 4vw; width: 100%; }
  .logo-img { width: min(340px, 40vw); }
  .logo-tcg { font-size: 0.58rem; letter-spacing: 0.35em; margin-top: 6px; }
  .menu { width: min(380px, 48vw); gap: 5px; transform: none; animation: menu-in 0.8s 0.25s both; }
  .menu .btn { --cut: 8px; padding: 6px 10px; font-size: 0.8rem; }
  .menu .btn.big { padding: 7px 12px; font-size: 0.88rem; gap: 8px; }
  .menu .btn.big small { font-size: 0.6rem; }
  .menu .mi { font-size: 1rem; }
  .menu-row { gap: 5px; }
  .menu .btn.ghost.small { font-size: 0.66rem; padding: 4px 10px; }
  .menu-portal { left: 27%; top: 50%; width: min(78vh, 46vw); }
  .profile-chip { top: 6px; right: 8px; padding: 3px 10px 3px 3px; gap: 6px; }
  .profile-chip .avatar.sm { width: 26px; height: 26px; }
  .chip-text b { font-size: 0.74rem; } .chip-text small { display: none; }

  /* ---------------- menu screens */
  .setup-panel, .lobby-panel, .boards-panel { padding: 10px 14px; max-height: 96vh; }
  .setup-panel h2, .lobby-panel h2, .boards-panel h2 { font-size: 1.05rem; margin: 0 0 6px; }
  .setup-panel .back, .lobby-panel .back, .boards-panel .back { top: 6px; left: 6px; padding: 5px 10px; font-size: 0.78rem; }
  .vs-side h3 { font-size: 0.66rem; margin-bottom: 4px; }
  .deck-opt { padding: 5px 8px; grid-template-columns: 40px 1fr; gap: 8px; }
  .deck-opt img { width: 40px; }
  .deck-opt b { font-size: 0.82rem; } .deck-opt small { font-size: 0.68rem; }
  .opp-card { padding: 4px 8px; margin-bottom: 5px; }
  .opp-card img { width: 40px; height: 40px; }
  .setup-options { margin: 8px 0; }
  .opt { padding: 5px 10px; font-size: 0.82rem; }
  .btn.big.start { padding: 9px 20px; font-size: 0.92rem; }
  .btn.quick { padding: 10px; font-size: 1.05rem; }
  .lobby-body { gap: 9px; }
  .lobby-notes { font-size: 0.72rem; }
  .board-list li { padding: 5px 10px; }
  .profile-box { padding: 12px 14px; max-height: 96vh; }

  /* ---------------- Library: filters scroll sideways instead of wrapping into three rows */
  .lib-head { padding: 6px 10px; gap: 8px; flex-wrap: nowrap; }
  .lib-head h2 { font-size: 1rem; white-space: nowrap; }
  .lib-head .btn { white-space: nowrap; padding: 5px 10px; font-size: 0.78rem; flex: none; }
  .lib-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; touch-action: pan-x; }
  .lib-filters::-webkit-scrollbar { display: none; }
  .lib-filters .chip { white-space: nowrap; font-size: 0.72rem; padding: 3px 9px; }
  .lib-grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; padding: 10px; }
  .lib-grid figcaption { font-size: 0.66rem; }
  .lib-grid figcaption b { font-size: 0.72rem; }
  .inspect-box { gap: 12px; padding: 0 8px; }
  .inspect-box .dcard { --card-w: min(200px, 36vw, calc(86vh * 0.716)); }
  .inspect-info { max-height: 92vh; font-size: 0.82rem; }
  .inspect-info h2 { font-size: 1.1rem; }
  .version-row { padding: 3px 4px; gap: 4px; }
  .version-row .chip { font-size: 0.66rem; padding: 2px 7px; }

  /* ---------------- the match */
  :root { --hud-h: 38px; --card-w: clamp(46px, 7vh + 1.6vw, 60px); }
  .hand { left: 6px; transform: none; width: calc(100vw - 140px); height: calc(var(--card-w) * 1.4 + 8px); bottom: calc(var(--card-w) * -0.32); }
  .actions { right: 8px; bottom: 8px; gap: 6px; }
  .actions .btn { min-width: 92px; padding: 6px 10px; font-size: 0.8rem; }
  .autoskip { top: calc(var(--hud-h) + 4px); bottom: auto; right: 8px; font-size: 0.6rem; padding: 3px 8px; }
  .seat-me { left: 6px; bottom: calc(var(--card-w) * 1.4 + 8px); }
  .seat-me .seat-stats { display: none; }
  .sandy { left: 6px; }
  .sandy-card { width: 58px; }
  .sandy-name { font-size: 0.66rem; margin-top: 2px; }
  .sandy-bubble { left: calc(100% + 6px); top: 2px; font-size: 0.66rem; max-width: 150px; padding: 5px 9px; }
  .g-line { white-space: normal; max-width: 64vw; text-align: center; font-size: 0.76rem; padding: 4px 12px; line-height: 1.3; background: rgba(5, 3, 12, 0.85); }
  .g-btns .btn { padding: 4px 12px; font-size: 0.76rem; }
  .banner { font-size: 1.1rem; }
  .toast { font-size: 0.76rem; padding: 5px 12px; }
  .turn-timer { font-size: 0.7rem; padding: 2px 9px; }
  .menu-box, .settings-box, .gameover-box, .pass-box { padding: 12px 16px; gap: 7px; min-width: min(320px, 90vw); }
  .menu-box .btn, .settings-box .btn { padding: 7px 12px; font-size: 0.85rem; }
  .settings-box .opt { padding: 4px 10px; }
  .gameover-box h1 { font-size: 2rem; }
  .how-box { padding: 12px 16px; font-size: 0.85rem; }
  .log { font-size: 0.72rem; }
}

/* ---------------- phones upright: the menus stack and fit the width */
@media (orientation: portrait) and (max-width: 600px) {
  .title-inner { padding: 70px 14px 24px; }
  .logo-img { width: 86vw; }
  .menu { width: 90vw; }
  .menu-portal { top: 22%; width: 120vw; }
  .setup-vs, .lobby-row, .locked-decks { grid-template-columns: 1fr; }
  .vs-mid { display: none; }
  .setup-panel, .lobby-panel, .boards-panel, .profile-box { width: 94vw; padding: 14px; }
  .lib-head { flex-wrap: wrap; }
  .lib-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .inspect-box { flex-direction: column; max-height: 94vh; overflow: auto; }
  .inspect-box .dcard { --card-w: min(240px, 60vw); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ------------------------------------------------------------ sound board */
#soundboard { z-index: 46; }
.soundboard-box { width: min(640px, 94vw); max-height: 90vh; overflow: auto; padding: 18px 22px; display: grid; gap: 8px; touch-action: pan-y; }
.soundboard-box h2 { margin: 0; font-family: var(--display); font-weight: 400; }
.soundboard-box h3 { margin: 8px 0 0; font-size: 0.78rem; color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase; }
.sb-row { display: flex; flex-wrap: wrap; gap: 6px; }
.sb-btn.hit { animation: sb-hit 0.5s ease-out; }
@keyframes sb-hit { from { box-shadow: 0 0 0 2px var(--cyan), 0 0 22px rgba(56, 243, 255, 0.6); } }
.soundboard-box.loading .sb-row { opacity: 0.5; }

.toast.tip { border-color: rgba(255, 194, 61, 0.6); color: #fff3d6; box-shadow: 0 0 18px rgba(255, 194, 61, 0.25); }

/* phones sideways: the reaction screen in two columns, so No reaction is always on screen
   (left: what's coming at you; right: your Reactions and the No reaction button) */
@media (max-height: 520px) {
  .reaction-box { display: grid; grid-template-columns: auto auto; grid-template-areas: "title title" "row sub" "row opts" "row btn";
    align-items: center; justify-items: center; column-gap: clamp(16px, 4vw, 40px); row-gap: 6px; padding: 8px 14px; max-height: 100vh; }
  .reaction-box > h3 { grid-area: title; font-size: 1rem; }
  .reaction-box > .reaction-row { grid-area: row; gap: 10px; }
  .reaction-box > .sub { grid-area: sub; font-size: 0.75rem; align-self: end; }
  .reaction-box > .reaction-opts { grid-area: opts; gap: 8px; }
  .reaction-box > .btn { grid-area: btn; align-self: start; padding: 7px 18px; font-size: 0.85rem; }
  .reaction-row .dcard { --card-w: min(30vh, 22vw); }
  .reaction-opts .dcard { --card-w: min(23vh, 15vw); }
  .reaction-row .chain .dcard { --card-w: min(13vh, 9vw); }
  .reaction-row .vs { font-size: 1.1rem; }
}

/* phones: the docked card picker (e.g. choosing a Cipher for Token Burn) is tall enough to show
   whole cards */
@media (max-height: 520px) {
  #modal.dock .modal-box { max-height: 76vh; width: min(760px, 88vw); padding: 8px 12px; gap: 6px; margin-bottom: 6px; }
  #modal.dock .modal-box h3 { font-size: 0.85rem; }
  #modal.dock .modal-box .sub { font-size: 0.7rem; margin-top: -2px; }
  #modal.dock .pick-grid { padding: 6px 4px 8px; gap: 8px; }
  #modal.dock .pick-grid .dcard { --card-w: min(25vh, 13vw); }
}

/* =====================================================================================
   TCG-v2: home hub, deck builder, daily login, match rewards
   Gold (--lux) is kept for things you earn: claims, level, Carats, rewards.
   ===================================================================================== */
:root { --lux: #e8c06a; --lux-hi: #fff1c4; --lux-lo: #8a6418; --num: 'Barlow Condensed', 'Outfit', sans-serif; }
.coin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; flex: none; vertical-align: -2px;
  background: radial-gradient(circle at 35% 30%, #fff6d8, var(--lux) 45%, var(--lux-lo)); box-shadow: 0 0 6px rgba(232, 192, 106, 0.6); }
.bar { display: block; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--purple)); transition: width 0.6s cubic-bezier(.2, 1, .3, 1); }

/* ------------------------------------------------------------ hub: level + Carats (top left) */
.hub-bar { position: absolute; top: 14px; left: 16px; z-index: 2; display: flex; gap: 8px; align-items: center; animation: menu-in 0.7s 0.2s both; }
.hub-level, .hub-carats { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px;
  background: rgba(14, 10, 32, 0.55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px rgba(200, 210, 255, 0.18), 0 10px 26px rgba(0, 0, 0, 0.45); }
.hub-carats { padding-left: 10px; }
.hub-carats b { font: 700 1.05rem var(--num); letter-spacing: 0.02em; }
.lv-gem { width: 34px; height: 34px; display: grid; place-items: center; clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%);
  background: linear-gradient(160deg, var(--lux-hi), var(--lux) 50%, var(--lux-lo)); color: #1b1203; }
.lv-gem b { font: 700 1rem var(--num); margin-top: 4px; }
.lv-text { display: grid; gap: 4px; width: 92px; }
.lv-text small { font: 600 0.6rem var(--mono); letter-spacing: 0.2em; color: var(--muted); }
.lv-text .bar > i { background: linear-gradient(90deg, var(--lux-lo), var(--lux), var(--lux-hi)); }

/* ------------------------------------------------------------ hub: claim pill + profile (top right) */
.hub-tr { position: absolute; top: 14px; right: 16px; z-index: 2; display: flex; gap: 8px; align-items: center; }
.hub-tr .profile-chip { position: static; }
.daily-pill { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px; cursor: pointer; border: 0;
  font: 700 0.85rem var(--font); color: #f4f1ff; background: rgba(14, 10, 32, 0.55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 0 0 1px rgba(200, 210, 255, 0.18), 0 10px 26px rgba(0, 0, 0, 0.45); white-space: nowrap; }
.daily-pill.ready { color: var(--lux-hi); box-shadow: inset 0 0 0 1px rgba(232, 192, 106, 0.75), 0 0 22px rgba(232, 192, 106, 0.35); animation: pill-pulse 2.2s ease-in-out infinite; }
@keyframes pill-pulse { 50% { box-shadow: inset 0 0 0 1px rgba(255, 241, 196, 1), 0 0 34px rgba(232, 192, 106, 0.6); } }
.daily-pill:hover { box-shadow: inset 0 0 0 1px var(--cyan), 0 0 18px rgba(56, 243, 255, 0.35); }

/* the cosmetic PFP frame you've equipped */
.avatar[data-cos-frame="frame:apechain"] { border-color: #8fb4ff !important; box-shadow: 0 0 0 2px #2f6bff, 0 0 16px rgba(47, 107, 255, 0.85) !important; }
.avatar[data-cos-frame="frame:neon"] { border-color: #ff9cf0 !important; box-shadow: 0 0 0 2px #38f3ff, 0 0 16px rgba(255, 79, 216, 0.85) !important; }

/* ------------------------------------------------------------ hub: daily quests (left) */
/* the left column: daily quests, then card packs, as one stack */
.hub-left { position: absolute; left: clamp(12px, 3vw, 48px); top: 50%; z-index: 2; width: clamp(220px, 21vw, 280px);
  display: flex; flex-direction: column; gap: 12px; transform: translateY(-50%); max-height: calc(100% - 150px); }
.hub-quests, .packs-card { padding: 14px; border-radius: 16px; animation: quests-in 0.9s 0.35s cubic-bezier(.2, 1.2, .4, 1) both;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)), rgba(12, 8, 28, 0.6); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(200, 210, 255, 0.18); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 16px 40px rgba(0, 0, 0, 0.5); }
@keyframes quests-in { from { opacity: 0; transform: translateX(-30px); } }
.hub-quests h5 { margin: 0 0 8px; display: flex; justify-content: space-between; gap: 8px; font: 600 0.66rem var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.quest { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; padding: 7px 0; font-size: 0.86rem; }
.quest .bar { grid-column: 1; height: 5px; }
.quest .q-rw { display: flex; gap: 4px; align-items: center; font: 700 0.85rem var(--num); color: var(--lux); }
.quest .q-n { font: 600 0.7rem var(--mono); color: var(--muted); text-align: right; }
.quest.done .q-text { color: var(--green); }
.quest.done .bar > i { background: var(--green); }
.hub-more { margin-top: 6px; width: 100%; padding: 7px; border-radius: 10px; border: 1px solid rgba(232, 192, 106, 0.35); background: rgba(232, 192, 106, 0.08); color: var(--lux-hi); font: 600 0.8rem var(--font); cursor: pointer; }
.hub-more:hover { background: rgba(232, 192, 106, 0.16); }
@media (max-width: 1100px), (max-height: 600px) { .hub-left { display: none; } }

/* ------------------------------------------------------------ card packs on Deck-0 (menu + shop) */
.packs-video { display: block; width: 100%; height: 100%; object-fit: cover; background: #0b0820; }
.packs-media { position: relative; display: block; overflow: hidden; border-radius: 12px; isolation: isolate;
  box-shadow: inset 0 0 0 1px rgba(232, 192, 106, 0.55), 0 0 22px rgba(232, 192, 106, 0.18); }
/* the packs fill the middle ~75% of the video: 1.25× fills the frame and still shows every pack whole */
.packs-video { transform: scale(1.25); }
.packs-media .packs-video { transition: transform 0.6s cubic-bezier(.2, 1, .3, 1); }
/* a slow sweep of light across the packs, like the foil catching it */
.packs-shine { position: absolute; inset: 0; z-index: 1; pointer-events: none; mix-blend-mode: screen; background: linear-gradient(105deg, transparent 35%, rgba(255, 241, 196, 0.28) 48%, transparent 60%) no-repeat; background-size: 250% 100%; animation: packs-shine 5.5s ease-in-out infinite; }
@keyframes packs-shine { 0%, 55% { background-position: 130% 0; } 100% { background-position: -40% 0; } }
.packs-card { display: block; color: inherit; text-decoration: none; animation-delay: 0.5s; }
.packs-card h5 { margin: 0 0 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font: 600 0.66rem var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.packs-price { padding: 2px 8px; border-radius: 99px; letter-spacing: 0.06em; text-transform: none; color: #1b1203; font: 700 0.78rem var(--num); background: linear-gradient(180deg, var(--lux-hi), var(--lux)); }
/* the whole turntable: the video is square, so the frame is too (smaller on short screens, never cropped) */
.packs-card .packs-media { aspect-ratio: 1; width: min(100%, 30vh); margin: 0 auto; }
.packs-card .packs-video { object-fit: contain; }
.packs-over { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding: 8px 8px 8px 12px; border-radius: 10px;
  background: linear-gradient(90deg, rgba(232, 192, 106, 0.16), rgba(232, 192, 106, 0.04)); border: 1px solid rgba(232, 192, 106, 0.4); }
.packs-over b { font: 600 0.9rem var(--font); color: var(--lux-hi); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8); }
.packs-over i { font-style: normal; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: #1b1203; font-weight: 800; background: linear-gradient(180deg, var(--lux-hi), var(--lux)); box-shadow: 0 0 14px rgba(232, 192, 106, 0.6); transition: transform 0.3s; }
.packs-sub { display: block; margin-top: 8px; font-size: 0.78rem; color: var(--muted); }
.packs-card:hover, .packs-card:focus-visible { border-color: rgba(232, 192, 106, 0.6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 26px rgba(232, 192, 106, 0.22); outline: none; }
.packs-card:hover .packs-video, .packs-feature .packs-media:hover .packs-video { transform: scale(1.3); }
.packs-card:hover .packs-over i { transform: translate(2px, -2px); }

/* phones and small windows: a slim banner under the menu buttons */
.menu-packs { display: none; }
@media (max-width: 1100px), (max-height: 600px) { .menu-packs { display: block; } }
.packs-banner { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border-radius: 14px; color: inherit; text-decoration: none;
  background: linear-gradient(90deg, rgba(232, 192, 106, 0.16), rgba(12, 8, 28, 0.6) 60%); border: 1px solid rgba(232, 192, 106, 0.45); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4); }
.packs-thumb { flex: none; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(232, 192, 106, 0.5); }
.packs-text { flex: 1; display: grid; text-align: left; }
.packs-text b { font: 600 0.95rem var(--font); color: var(--lux-hi); }
.packs-text small { color: var(--muted); font-size: 0.78rem; }
.packs-go { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #1b1203; font-weight: 800; background: linear-gradient(180deg, var(--lux-hi), var(--lux)); }
.packs-banner:hover { border-color: var(--lux); }

/* the Shop's feature */
.packs-feature { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: 20px; align-items: center; padding: 18px; border-radius: 18px;
  background: radial-gradient(120% 140% at 0% 0%, rgba(232, 192, 106, 0.18), transparent 55%), linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)), rgba(12, 8, 28, 0.65);
  border: 1px solid rgba(232, 192, 106, 0.45); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45); }
.packs-feature .packs-media { aspect-ratio: 1; }
.packs-k { font: 600 0.72rem var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--lux); }
.packs-feature h3 { margin: 4px 0 8px; font: 400 1.45rem var(--display); }
.packs-feature ul { margin: 0 0 14px; padding-left: 18px; font-size: 0.9rem; display: grid; gap: 4px; }
.packs-cta { text-decoration: none; }
.packs-held { font: 600 0.85rem var(--font); color: var(--cyan); }
.packs-fine { display: block; margin-top: 10px; color: var(--muted); font-size: 0.75rem; }
@media (max-width: 640px) { .packs-feature { grid-template-columns: 1fr; } .packs-feature .packs-media { max-width: 260px; } }
@media (prefers-reduced-motion: reduce) { .packs-shine { animation: none; } }

.menu .new-dot { position: absolute; top: 7px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--magenta); box-shadow: 0 0 8px var(--magenta); }

@media (max-height: 520px) {
  .hub-bar { top: 6px; left: 8px; gap: 5px; }
  .hub-level, .hub-carats { padding: 3px 9px 3px 3px; }
  .hub-carats { padding-left: 7px; }
  .lv-gem { width: 26px; height: 26px; } .lv-gem b { font-size: 0.82rem; }
  .lv-text { width: 64px; } .lv-text small { display: none; }
  .hub-carats b { font-size: 0.9rem; }
  .hub-tr { top: 6px; right: 8px; gap: 5px; }
  .daily-pill { padding: 6px 10px; font-size: 0.74rem; }
}
@media (max-width: 560px) {
  .hub-bar { top: 8px; left: 8px; }
  .lv-text { width: 54px; } .lv-text small { display: none; }
  .hub-tr { top: 52px; right: 8px; }
}

/* ------------------------------------------------------------ setup: choose decks */
.deck-pick { max-height: 46vh; overflow: auto; touch-action: pan-y; padding: 2px; }
.deck-pick .deck-opt { width: 100%; font: inherit; color: inherit; cursor: pointer; }
.deck-pick .deck-opt:disabled { opacity: 0.45; cursor: default; }
.deck-pick .build-link { justify-self: start; }

/* ------------------------------------------------------------ deck builder */
#decks { z-index: 22; display: none; flex-direction: column; background: radial-gradient(ellipse at 50% 0%, rgba(106, 60, 255, 0.3), rgba(5, 3, 12, 0.97) 60%); }
#decks.active { display: flex; }
.db-head { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: rgba(5, 3, 12, 0.9); border-bottom: 1px solid var(--line); flex: none; min-width: 0; }
.db-head h2 { margin: 0; font-family: var(--display); font-weight: 400; white-space: nowrap; }
.db-decks { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; flex: 1; min-width: 0; padding: 2px; touch-action: pan-x; }
.db-deck { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); cursor: pointer; font: 600 0.84rem var(--font); color: var(--text); white-space: nowrap; }
.db-deck small { font: 600 0.7rem var(--mono); color: var(--muted); }
.db-deck.on { border-color: var(--cyan); background: rgba(56, 243, 255, 0.1); box-shadow: 0 0 14px rgba(56, 243, 255, 0.25); }
.db-deck.draft small { color: var(--gold); }
.db-deck .star { color: var(--lux); }
.db-deck.new { border-style: dashed; color: var(--lux-hi); }
.db-deck:disabled { opacity: 0.4; }
.db-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr minmax(290px, 340px); }
.db-pool { min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.db-filters { padding: 10px 16px 0; align-items: center; }
.db-search { flex: 0 1 180px; min-width: 120px; padding: 5px 10px; }
.db-grid { flex: 1; min-height: 0; overflow: auto; touch-action: pan-y; display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(92px, 9vw, 128px), 1fr)); gap: 14px; padding: 14px 16px 24px; align-content: start; }
.db-empty { grid-column: 1 / -1; text-align: center; }
.db-tile { position: relative; margin: 0; cursor: pointer; }
.db-tile .dcard { position: relative; width: 100%; --card-w: 100%; transition: transform 0.15s, filter 0.2s; }
.db-tile:hover .dcard { transform: translateY(-4px); }
.db-tile.full .dcard { filter: brightness(0.55) saturate(0.7); }
.db-tile.has .dcard { box-shadow: 0 0 0 2px var(--cyan), 0 0 16px rgba(56, 243, 255, 0.4); }
.db-tile figcaption { font-size: 0.74rem; text-align: center; margin-top: 5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-count { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; gap: 4px; padding: 3px 6px; border-radius: 99px; background: rgba(5, 3, 12, 0.8); pointer-events: none; }
.db-count i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.45); }
.db-count i.on { background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.db-left { position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%); padding: 1px 7px; border-radius: 99px; font: 700 0.66rem var(--mono); color: var(--cyan); background: rgba(5, 3, 12, 0.85); border: 1px solid rgba(56, 243, 255, 0.5); pointer-events: none; white-space: nowrap; }
.db-left.none { color: var(--muted); border-color: var(--line); }
.db-zoom-btn, .db-minus { position: absolute; top: 4px; width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(5, 3, 12, 0.8); color: #fff; font: 700 0.8rem var(--font); cursor: pointer; display: grid; place-items: center; padding: 0; }
.db-zoom-btn { right: 4px; font-family: Georgia, serif; font-style: italic; }
.db-minus { left: 4px; border-color: rgba(255, 64, 96, 0.7); color: #ff8aa0; font-size: 1rem; }

.db-side { min-height: 0; overflow: auto; touch-action: pan-y; padding: 14px 16px 24px; display: flex; flex-direction: column; gap: 10px; border-left: 1px solid var(--line); background: rgba(8, 5, 20, 0.55); }
.db-name { font: 700 1.05rem var(--font); flex: none; }
h3.db-name { margin: 0; font-family: var(--display); font-weight: 400; }
.db-meter { display: flex; align-items: center; gap: 10px; font: 700 0.95rem var(--num); }
.db-meter .bar { flex: 1; height: 8px; }
.db-status { font-weight: 700; font-size: 0.88rem; color: var(--gold); }
.db-status.ok { color: var(--green); }
.db-shape { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.db-shape span { display: grid; text-align: center; padding: 5px 2px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); font-size: 0.68rem; color: var(--muted); }
.db-shape b { font: 700 1rem var(--num); color: var(--text); }
.db-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.db-notes { margin: 0; padding: 8px 10px 8px 24px; border-radius: 10px; background: rgba(255, 194, 61, 0.07); border: 1px solid rgba(255, 194, 61, 0.25); font-size: 0.78rem; color: #ffd98a; }
.db-notes li { margin: 2px 0; }
.db-code { display: grid; gap: 6px; padding: 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.db-code label { font: 600 0.7rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.db-code-row { display: flex; gap: 6px; }
.db-code-row .text-in { padding: 6px 8px; font-size: 0.78rem; }
.db-list { display: grid; gap: 4px; }
.db-group { display: flex; justify-content: space-between; margin-top: 8px; font: 400 0.85rem var(--display); color: var(--cyan); border-bottom: 1px solid var(--line); padding-bottom: 3px; }
.db-row { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 8px; align-items: center; padding: 3px 4px; border-radius: 8px; }
.db-row:hover { background: rgba(255, 255, 255, 0.04); }
.db-row img { width: 30px; height: 30px; object-fit: cover; object-position: 50% 22%; border-radius: 6px; }
.db-row-name { text-align: left; background: none; border: 0; padding: 0; cursor: pointer; color: inherit; min-width: 0; }
.db-row-name b { display: block; font-size: 0.84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-row-name small { color: var(--muted); font-size: 0.68rem; }
.db-row-n { font: 700 0.95rem var(--num); color: var(--muted); }
.db-row-btns { display: flex; gap: 3px; }
.db-row-btns button { width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); color: var(--text); cursor: pointer; padding: 0; }
.db-row-btns button:disabled { opacity: 0.3; }
.db-tabs { display: none; }
.db-zoom { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; background: rgba(3, 2, 8, 0.7); backdrop-filter: blur(3px); }
.db-zoom[hidden] { display: none; }
.db-zoom-box { display: flex; gap: 20px; padding: 18px; max-width: min(720px, 94vw); max-height: 92vh; overflow: auto; align-items: center; }
.db-zoom-box img { width: min(280px, 38vw); border-radius: 14px; flex: none; }
.db-zoom-box h3 { margin: 0 0 4px; font-family: var(--display); font-weight: 400; font-size: 1.4rem; }
.db-zoom-box .quote { color: var(--gold); font-style: italic; }

@media (max-width: 820px) {
  .db-body { grid-template-columns: 1fr; }
  #decks[data-tab="pool"] .db-side, #decks[data-tab="deck"] .db-pool { display: none; }
  .db-side { border-left: 0; }
  .db-tabs { display: flex; gap: 6px; justify-content: center; padding: 6px; background: rgba(5, 3, 12, 0.92); border-top: 1px solid var(--line); flex: none; }
  .db-tabs .btn { flex: 1; max-width: 200px; }
  #decks[data-tab="pool"] .db-tabs [data-tab="pool"], #decks[data-tab="deck"] .db-tabs [data-tab="deck"] { border-color: var(--cyan); background: rgba(56, 243, 255, 0.14); }
  .db-zoom-box { flex-direction: column; text-align: center; }
  .db-zoom-box img { width: min(200px, 50vw); }
}
@media (max-width: 820px), (max-height: 520px) {
  .db-head { padding: 6px 10px; gap: 8px; }
  .db-head h2 { font-size: 1rem; }
  .db-head .btn { padding: 5px 10px; font-size: 0.8rem; }
  .db-filters { padding: 6px 10px 0; flex-wrap: nowrap; overflow-x: auto; touch-action: pan-x; }
  .db-filters .chip, .db-filters .db-search { flex: none; }
  .db-grid { gap: 10px; padding: 10px; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
}
@media (max-height: 520px) and (orientation: landscape) {
  /* phones held sideways: cards and the deck side by side, both compact */
  .db-body { grid-template-columns: 1fr 240px; }
  .db-side { padding: 8px 10px; gap: 6px; }
  .db-zoom-box img { width: min(180px, 30vw); }
}

/* ------------------------------------------------------------ daily login overlay */
#daily { z-index: 40; }
.daily-box { position: relative; --set: #2f6bff; width: min(860px, 96vw); max-height: 94vh; overflow: auto; touch-action: pan-y; padding: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)), rgba(10, 7, 24, 0.92); border-color: rgba(232, 192, 106, 0.35); }
.daily-x { position: absolute; top: 12px; right: 12px; }
.cal-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; padding-right: 44px; }
.cal-head .k { font: 600 0.7rem var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--set); filter: brightness(1.6); }
.cal-head h2 { margin: 2px 0 4px; font-family: var(--display); font-weight: 400; font-size: 1.6rem; }
.cal-head p { margin: 0; max-width: 520px; color: var(--muted); font-size: 0.85rem; }
.cal-head .day { font: 700 2.4rem/1 var(--num); color: var(--lux); text-align: right; }
.cal-head .day small { display: block; margin-top: 4px; font: 600 0.66rem var(--mono); letter-spacing: 0.08em; color: var(--muted); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; margin: 14px 0 12px; }
.cell { position: relative; min-height: 72px; border-radius: 11px; padding: 6px; display: flex; flex-direction: column; justify-content: space-between; background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(255, 255, 255, 0.07); overflow: hidden; }
.cell .d { font: 600 0.62rem var(--mono); color: #6a6c94; letter-spacing: 0.08em; }
.cell .r { font: 600 0.7rem/1.15 var(--font); color: var(--muted); }
.cell.done { background: rgba(34, 255, 122, 0.05); border-color: rgba(34, 255, 122, 0.2); }
.cell.done .r::before { content: '✓ '; color: var(--green); font-weight: 800; }
.cell.big { background: linear-gradient(160deg, color-mix(in srgb, var(--set) 55%, transparent), rgba(20, 30, 90, 0.5)); border-color: color-mix(in srgb, var(--set) 70%, white 10%); }
.cell.big .r { color: #e6ecff; padding-right: 2px; }
.cell .art { position: absolute; right: 6px; top: 6px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.2); font-size: 15px; }
.cell.today { border-color: var(--lux); box-shadow: 0 0 0 1px var(--lux), 0 0 22px rgba(232, 192, 106, 0.4); background: rgba(232, 192, 106, 0.1); }
.cell .claim { border: 0; cursor: pointer; padding: 5px 0; border-radius: 7px; font: 400 0.72rem var(--display); letter-spacing: 0.06em; color: #1b1203; background: linear-gradient(180deg, var(--lux-hi), var(--lux) 55%, #b78a2c); box-shadow: 0 4px 14px rgba(232, 192, 106, 0.4); }
.cal-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.daily-box .pill { display: inline-flex; gap: 4px; align-items: center; padding: 6px 12px; border-radius: 99px; font-size: 0.8rem; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); }
.daily-box .pill.ok { color: var(--green); border-color: rgba(34, 255, 122, 0.35); }
.daily-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 16px; }
.daily-cols h3 { margin: 0 0 6px; font: 400 1rem var(--display); }
.daily-cols h3 small { font: 500 0.72rem var(--mono); color: var(--muted); }
.cos { display: grid; gap: 6px; }
.cos-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); font-size: 0.86rem; }
.cos-ic { font-size: 1.1rem; text-align: center; }
.cos-row .btn.on { border-color: var(--lux); color: var(--lux-hi); }
@media (max-width: 640px), (max-height: 520px) {
  .daily-box { padding: 12px; }
  .cal { gap: 4px; }
  .cell { min-height: 50px; padding: 4px; border-radius: 8px; }
  .cell .r { font-size: 0.56rem; }
  .cell .d { font-size: 0.5rem; }
  .cell .art { width: 20px; height: 20px; font-size: 11px; right: 3px; top: 3px; }
  .cell .claim { font-size: 0.56rem; }
  .cal-head h2 { font-size: 1.2rem; } .cal-head .day { font-size: 1.8rem; } .cal-head p { font-size: 0.76rem; }
  .daily-cols { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------ rewards on the end screen */
.go-rewards { display: grid; gap: 6px; text-align: left; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(232, 192, 106, 0.3); min-width: min(320px, 80vw); }
.go-xp { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-weight: 700; }
.go-xp b { font: 700 1rem var(--num); color: var(--cyan); }
.go-xp .bar { grid-column: 1 / -1; height: 7px; }
.go-carats { display: flex; gap: 6px; align-items: center; font: 700 1rem var(--num); color: var(--lux); }
.go-carats small { font: 500 0.75rem var(--font); color: var(--muted); }
.go-quest { font-size: 0.84rem; color: var(--muted); }
.go-quest.done { color: var(--green); }
@media (max-height: 520px) { .go-rewards { padding: 8px; gap: 3px; } }

/* ------------------------------------------------------------ cosmetic thumbnails (calendar, cosmetics list) */
.th-frame, .th-coin, .th-die, .th-back, .th-table, .th-vortex, .th-none { --s: 44px; display: inline-grid; place-items: center; flex: none; position: relative; }
.th-frame { width: var(--s); height: var(--s); border-radius: 50%; padding: calc(var(--s) * 0.09); }
.th-frame .pic { width: 100%; height: 100%; border-radius: 50%; background: #120b26 center / cover; }
.th-frame.ape { background: conic-gradient(from 200deg, #e9f2ff, #1b4fe0, #b9d4ff, #0b2a9a, #e9f2ff); box-shadow: 0 0 0 1px #dfeaff, 0 0 14px rgba(60, 160, 255, 0.6); }
.th-frame.neon { background: conic-gradient(var(--cyan), var(--purple), var(--magenta), var(--cyan)); box-shadow: 0 0 14px rgba(255, 79, 216, 0.5); }
.th-frame .badge { position: absolute; bottom: -12%; left: 50%; width: 38%; transform: translateX(-50%); border-radius: 50%; box-shadow: 0 0 0 2px #e9f2ff, 0 2px 6px rgba(0, 0, 0, 0.5); }
.th-coin { width: var(--s); height: var(--s); border-radius: 50%; box-shadow: 0 0 0 2px #e9f2ff, 0 0 14px rgba(60, 160, 255, 0.6); }
.th-vortex { width: var(--s); height: var(--s); border-radius: 50%; background: radial-gradient(circle, #000 28%, var(--purple) 52%, var(--cyan) 70%, transparent 72%); }
.th-die { width: calc(var(--s) * 0.86); height: calc(var(--s) * 0.86); border-radius: 22%; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), inset 0 2px 2px rgba(255, 255, 255, 0.55), inset 0 -3px 4px rgba(0, 0, 0, 0.3); }
.th-die.ape { background: radial-gradient(circle at 30% 25%, #6fa0ff, #1f5cff 45%, #05208c); }
.th-die.ape img { width: 66%; border-radius: 50%; box-shadow: 0 0 0 2px #fff, 0 0 8px rgba(160, 210, 255, 0.8); }
.th-die.neon { background: radial-gradient(circle at 30% 25%, #4a1a63, #2a0b3a 50%, #12051c); box-shadow: 0 0 10px rgba(56, 243, 255, 0.5), inset 0 0 0 1px var(--cyan); grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 14%; }
.th-die.neon i { width: 7px; height: 7px; border-radius: 50%; background: var(--magenta); box-shadow: 0 0 5px var(--magenta); }
.th-die.neon i:nth-child(1) { grid-area: 1 / 1; } .th-die.neon i:nth-child(2) { grid-area: 2 / 2; } .th-die.neon i:nth-child(3) { grid-area: 3 / 3; }
.th-back { width: calc(var(--s) * 0.72); height: var(--s); border-radius: 4px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5), 0 4px 10px rgba(0, 0, 0, 0.5); }
.th-back.neon { background: url(../assets/cards/sm/back.webp) center / cover; filter: hue-rotate(60deg) saturate(1.4); }
.th-table { width: var(--s); height: var(--s); border-radius: 50%; padding: calc(var(--s) * 0.09); }
.th-table span { width: 100%; height: 100%; border-radius: 50%; background: center / cover; }
.th-table.ape { background: conic-gradient(from 200deg, #e9f2ff, #1b4fe0, #b9d4ff, #0b2a9a, #e9f2ff); box-shadow: 0 0 14px rgba(60, 160, 255, 0.6); }
.th-table.neon { background: conic-gradient(var(--cyan), var(--purple), var(--magenta), var(--cyan)); }
.th-table.neon span { background: radial-gradient(circle, #2a0b3a, #07040f); }
/* calendar: the reward art sits in the big tiles' top-right corner */
.cell .art { width: auto; height: auto; display: flex; gap: 4px; align-items: center; background: none; border: 0; right: 6px; top: 6px; }
.cell.big { min-height: 104px; }
.cell.big .r { max-width: none; }
.cos-ic { display: grid; place-items: center; }
.cos-row { grid-template-columns: 40px 1fr auto; }
@media (max-width: 640px), (max-height: 520px) {
  .cell.big { min-height: 58px; }
  .cell .art .th-frame, .cell .art .th-coin, .cell .art .th-table, .cell .art .th-vortex { --s: 22px !important; }
  .cell .art .th-die { --s: 22px !important; } .cell .art .th-back { --s: 24px !important; }
  .cell .art .th-die.neon i { width: 3px; height: 3px; }
  .cell.big .r { max-width: none; }
}

/* the ApeChain frame on your profile chip */
.avatar[data-cos-frame="frame:apechain"] { position: relative; border-color: #dfeaff !important; box-shadow: 0 0 0 3px #1b4fe0, 0 0 0 4px #b9d4ff, 0 0 16px rgba(60, 160, 255, 0.85) !important; overflow: visible; }
.avatar[data-cos-frame="frame:apechain"]::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 13px; height: 13px; transform: translateX(-50%); border-radius: 50%;
  background: url(../assets/partners/apechain/logo-badge.png) center / cover; box-shadow: 0 0 0 1.5px #e9f2ff; }

/* =====================================================================================
   TCG-v2 (2): dock, collection, badges, shop, Academy, item thumbnails
   ===================================================================================== */

/* ------------------------------------------------------------ the dock (title screen) */
.title-foot { display: none; }
.dock { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 3; display: flex; gap: 4px; padding: 5px;
  border-radius: 16px; background: rgba(12, 8, 28, 0.62); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: inset 0 0 0 1px rgba(200, 210, 255, 0.18), 0 14px 34px rgba(0, 0, 0, 0.5); animation: menu-in 0.8s 0.4s both; max-width: calc(100vw - 16px); overflow-x: auto; scrollbar-width: none; }
.dock::-webkit-scrollbar { display: none; }
.dock button { position: relative; display: grid; justify-items: center; gap: 1px; min-width: 66px; padding: 6px 8px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font: 600 0.72rem var(--font); cursor: pointer; flex: none; }
.dock button .i { font-size: 1.15rem; line-height: 1.2; color: var(--text); }
.dock button:hover, .dock button:focus-visible { background: rgba(255, 255, 255, 0.07); color: var(--text); outline: none; }
.dock .dot { position: absolute; top: 5px; right: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--magenta); box-shadow: 0 0 8px var(--magenta); }
@media (max-height: 520px) {
  .dock { bottom: 4px; padding: 3px; }
  .dock button { min-width: 54px; padding: 3px 6px; font-size: 0.6rem; }
  .dock button .i { font-size: 0.95rem; }
  .title-inner { padding-bottom: 46px; }
}
@media (max-width: 560px) { .dock button { min-width: 54px; } }
.hub-carats { cursor: pointer; border: 0; color: inherit; font: inherit; }
.hub-club { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; font: 700 0.8rem var(--font); color: var(--lux-hi);
  background: rgba(232, 192, 106, 0.12); box-shadow: inset 0 0 0 1px rgba(232, 192, 106, 0.55); }

/* ------------------------------------------------------------ shared full screens */
#collection, #shop, #academy { z-index: 22; background: radial-gradient(ellipse at 50% 0%, rgba(106, 60, 255, 0.3), rgba(5, 3, 12, 0.97) 60%); overflow: auto; touch-action: pan-y; }
#collection.active, #shop.active, #academy.active { display: block; }
.col-body, .shop-body, .ac-body { padding: 16px; display: grid; gap: 14px; max-width: 1180px; margin: 0 auto; }
.col-tabs { flex-wrap: nowrap; overflow-x: auto; touch-action: pan-x; scrollbar-width: none; flex: 1; min-width: 0; }
.col-tabs .chip { flex: none; }
.col-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); font-size: 0.9rem; }
.col-summary b { color: var(--text); font: 700 1.2rem var(--num); }
.col-groups { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.chip-tutor { width: 18px; height: 18px; vertical-align: -4px; margin-right: 4px; }

/* badges */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 10px; }
.badge { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.badge .medal { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; font-size: 1.6rem; position: relative;
  background: radial-gradient(circle at 35% 30%, #ffffff55, transparent 40%), conic-gradient(from 210deg, var(--m1), var(--m2), var(--m1), var(--m2), var(--m1));
  box-shadow: 0 0 0 2px var(--m2), 0 6px 14px rgba(0, 0, 0, 0.5); --m1: #3a3355; --m2: #1d1830; }
.badge .medal img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.badge.none .medal { filter: grayscale(1) brightness(0.6); }
.badge.t1 .medal { --m1: #f6c9a0; --m2: #8a4f26; }
.badge.t2 .medal { --m1: #ffffff; --m2: #7e8698; }
.badge.t3 .medal { --m1: #fff1c4; --m2: #a87a22; box-shadow: 0 0 0 2px #e8c06a, 0 0 16px rgba(232, 192, 106, 0.5); }
.badge.t4 .medal { --m1: #d9f6ff; --m2: #4a8fb0; box-shadow: 0 0 0 2px #9fe8ff, 0 0 16px rgba(159, 232, 255, 0.5); }
.badge.t5 .medal { --m1: #e6fbff; --m2: #38f3ff; box-shadow: 0 0 0 2px #38f3ff, 0 0 20px rgba(56, 243, 255, 0.6); }
.badge.t6 .medal { --m1: #ffd6f6; --m2: #ff4fd8; box-shadow: 0 0 0 2px #ff4fd8, 0 0 22px rgba(255, 79, 216, 0.7); }
.badge.club.none { opacity: 0.75; }
.b-text { display: grid; gap: 3px; min-width: 0; }
.b-text b { font-size: 0.98rem; }
.b-text small { color: var(--muted); font-size: 0.78rem; }
.b-text .b-tier { font: 600 0.72rem var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--lux); }
.b-text .bar { height: 5px; }
.b-text .b-val { font: 600 0.7rem var(--mono); }

/* items (collection and shop) */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.item { display: grid; justify-items: center; gap: 6px; padding: 12px 10px; text-align: center; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-top: 2px solid var(--r); }
.item .item-art { height: 84px; display: grid; place-items: center; }
.item b { font-size: 0.86rem; line-height: 1.2; }
.item .rar { font: 600 0.66rem var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--r); }
.item .how { font-size: 0.72rem; color: var(--muted); line-height: 1.3; }
.item .how.ok { color: var(--green); }
.item.locked .item-art { filter: grayscale(1) brightness(0.45) contrast(1.1); }
/* 3D characters in the workshop: their picture, a little dimmed, with a ribbon */
.item.soon .item-art { position: relative; }
.item.soon .item-art > :first-child { filter: saturate(0.7) brightness(0.75); }
.soon-flag { position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); padding: 2px 8px; border-radius: 99px; white-space: nowrap;
  font: 700 0.62rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: #1b1203; background: linear-gradient(180deg, var(--lux-hi), var(--lux)); box-shadow: 0 0 12px rgba(232, 192, 106, 0.5); }
.item.wearing { box-shadow: 0 0 0 1px var(--lux), 0 0 18px rgba(232, 192, 106, 0.25); }
.item .btn.on { border-color: var(--lux); color: var(--lux-hi); }
.item a.btn { text-decoration: none; }

/* ------------------------------------------------------------ thumbnails of every item kind */
.th-frame { background: conic-gradient(from 200deg, var(--fa, #cfd6ff), var(--fb, #5a5f8a), var(--fa, #cfd6ff), var(--fb, #5a5f8a), var(--fa, #cfd6ff)) !important; box-shadow: 0 0 12px color-mix(in srgb, var(--fb, #5a5f8a) 60%, transparent) !important; }
.th-die:not(.ape):not(.neon) { background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--d1) 70%, white), var(--d1) 45%, var(--d2)); box-shadow: 0 0 10px color-mix(in srgb, var(--de) 50%, transparent), inset 0 0 0 1px var(--de); grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 14%; }
.th-die:not(.ape):not(.neon) i { width: calc(var(--s) * 0.13); height: calc(var(--s) * 0.13); border-radius: 50%; background: var(--dp); box-shadow: 0 0 5px var(--dp); }
.th-die:not(.ape):not(.neon) i:nth-child(1) { grid-area: 1 / 1; } .th-die:not(.ape):not(.neon) i:nth-child(2) { grid-area: 2 / 2; } .th-die:not(.ape):not(.neon) i:nth-child(3) { grid-area: 3 / 3; }
.th-back.tint { display: block; background: url(../assets/cards/sm/back.webp) center / cover; position: relative; overflow: hidden; }
.th-back.tint::after { content: ''; position: absolute; inset: 0; background: var(--tint); mix-blend-mode: multiply; opacity: 0.85; }
.th-table { background: conic-gradient(var(--g), #ffffff, var(--g), #0d0920, var(--g)) !important; }
.th-table span { background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--g) 40%, #07040f), #07040f 70%) !important; position: relative; }
.th-table span::after { content: ''; position: absolute; inset: 22%; border-radius: 50%; border: 2px solid var(--g); opacity: 0.7; box-shadow: 0 0 10px var(--g); }
/* a board with its own art: a little landscape of the playmat */
.th-table.art { width: calc(var(--s) * 1.7) !important; height: calc(var(--s) * 0.72) !important; padding: 2px; border-radius: 8px; overflow: hidden;
  background: linear-gradient(135deg, var(--g), #fff1c4, var(--g)) !important; box-shadow: 0 0 14px color-mix(in srgb, var(--g) 50%, transparent); }
.th-table.art img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; display: block; }
.th-token { --s: 44px; width: var(--s); height: var(--s); border-radius: 50%; display: inline-grid; place-items: center; position: relative;
  background: radial-gradient(circle at 40% 35%, #fff, var(--ta) 22%, var(--tb)); box-shadow: 0 0 0 2px #ffffffaa, 0 0 14px var(--ta), 0 4px 10px rgba(0, 0, 0, 0.5); }
.th-token b { font-size: calc(var(--s) * 0.45); }
.th-token .pic { width: 72%; height: 72%; border-radius: 50%; background: center 18% / 160% no-repeat; box-shadow: inset 0 0 0 2px #ffffffaa; }
.th-avatar { --s: 44px; width: var(--s); height: var(--s); border-radius: 50%; display: inline-grid; padding: 3px; background: linear-gradient(160deg, var(--r), #0d0920); box-shadow: 0 0 12px color-mix(in srgb, var(--r) 60%, transparent); }
.th-avatar .pic { border-radius: 50%; background: center 22% / cover no-repeat #120b26; }
.th-sleeve { --s: 44px; width: calc(var(--s) * 0.72); height: var(--s); display: inline-block; position: relative; border-radius: 5px; overflow: hidden; box-shadow: 0 0 0 1px #ffffff80; }
.th-sleeve img { width: 100%; height: 100%; object-fit: cover; }
.th-sleeve::after { content: ''; position: absolute; inset: 0; mix-blend-mode: color-dodge; opacity: 0.7; background: linear-gradient(115deg, transparent 20%, #ff7ad9aa 35%, #ffd36eaa 45%, #7dffb0aa 55%, #6fe9ffaa 65%, transparent 80%); background-size: 250% 250%; animation: holo-slide 3s ease-in-out infinite alternate; }
.th-sleeve.Rare::after { background: linear-gradient(115deg, transparent 25%, #9cc0ffaa 45%, #ffffffaa 52%, transparent 70%); background-size: 250% 250%; }
@keyframes holo-slide { from { background-position: 0 0; } to { background-position: 100% 100%; } }
.th-wall { --s: 44px; width: calc(var(--s) * 0.56); height: var(--s); display: inline-block; border-radius: 6px; background: center / cover; box-shadow: 0 0 0 1px #ffffff60, 0 4px 10px rgba(0, 0, 0, 0.5); }
.th-emote { --s: 44px; width: var(--s); height: var(--s); display: inline-grid; place-items: center; border-radius: 50% 50% 50% 12%; font-size: calc(var(--s) * 0.5); background: rgba(255, 255, 255, 0.92); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45); }
.th-none { --s: 44px; width: var(--s); height: var(--s); display: inline-grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, 0.06); }
.th-frame, .th-table { width: var(--s); height: var(--s); }

/* ------------------------------------------------------------ the shop */
.shop-carats { margin-left: auto; padding: 5px 12px 5px 10px; }
.club-card { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 18px; padding: 18px; border-radius: 18px;
  background: linear-gradient(150deg, rgba(232, 192, 106, 0.16), rgba(155, 107, 255, 0.10) 60%, rgba(255, 255, 255, 0.02)); border: 1px solid rgba(232, 192, 106, 0.45); }
.club-card.active { border-color: var(--green); }
.club-k { font: 600 0.72rem var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--lux); }
.club-card h3 { margin: 4px 0 8px; font: 400 1.35rem var(--display); }
.club-card ul { margin: 0 0 12px; padding-left: 18px; font-size: 0.9rem; display: grid; gap: 4px; }
.club-buy { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.club-until { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: var(--green); font-weight: 700; margin: 0; }
.club-art { position: relative; align-self: center; }
.club-art img { width: 100%; border-radius: 10px; box-shadow: 0 0 30px rgba(232, 192, 106, 0.5); }
.club-art .serial { position: absolute; left: 8px; bottom: 8px; font: 700 0.7rem var(--num); color: #1b1203; background: linear-gradient(180deg, var(--lux-hi), var(--lux)); padding: 1px 6px; border-radius: 4px; }
.shop-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.shop-head h3 { margin: 0; font: 400 1.2rem var(--display); }
.shop-head small { color: var(--muted); }
.bundle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.bundle { position: relative; display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); align-content: start; }
.bundle.limited { border-color: rgba(232, 192, 106, 0.55); background: linear-gradient(160deg, rgba(232, 192, 106, 0.1), rgba(255, 255, 255, 0.02)); }
.bundle .b-flag { position: absolute; top: -9px; right: 12px; font: 600 0.62rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: #1b1203; background: var(--lux); padding: 2px 8px; border-radius: 99px; }
.bundle .b-items { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bundle small { color: var(--muted); font-size: 0.74rem; }
.bundle .btn { justify-self: start; }
.shop-fine { color: var(--muted); font-size: 0.78rem; }
@media (max-width: 640px) { .club-card { grid-template-columns: 1fr; } .club-art { max-width: 150px; } }

/* ------------------------------------------------------------ deck builder additions */
.db-deck.theme small { color: var(--cyan); }
.db-deck.locked { opacity: 0.75; border-style: dashed; }
.db-tile.locked .dcard { filter: grayscale(1) brightness(0.45); }
.db-lock { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); padding: 2px 8px; border-radius: 99px; background: rgba(5, 3, 12, 0.85); font: 600 0.66rem var(--mono); color: var(--lux); pointer-events: none; white-space: nowrap; }
.db-format { display: flex; gap: 8px; align-items: center; }
.db-format small { color: var(--muted); font-size: 0.74rem; }
.fmt { font: 600 0.66rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; }
.fmt.classic { background: rgba(56, 243, 255, 0.12); color: var(--cyan); }
.fmt.open { background: rgba(232, 192, 106, 0.16); color: var(--lux); }
.slot-help { max-width: 460px; }
.slot-help h3 { margin: 0 0 8px; font: 400 1.3rem var(--display); }
.slot-prog { display: flex; gap: 10px; align-items: center; margin: 10px 0; font: 700 0.9rem var(--num); }
.slot-prog .bar { flex: 1; height: 8px; }
.db-zoom-box img.locked { filter: grayscale(1) brightness(0.5); }
.ok-line { color: var(--green); }

/* ------------------------------------------------------------ end screen badges */
.go-badge { display: flex; gap: 8px; align-items: center; font-size: 0.86rem; }
.go-badge .medal { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #fff6dc, var(--lux) 50%, var(--lux-lo)); }
.go-badge small { color: var(--muted); }

/* ------------------------------------------------------------ the Academy */
.ac-decrypt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: center; }
.ac-left { display: grid; gap: 10px; }
.ac-left h3 { margin: 0; font: 400 1.5rem var(--display); }
.ac-stat { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 2px 10px; align-items: center; font-size: 0.9rem; }
.ac-stat span:first-child { color: var(--muted); font: 600 0.72rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.ac-stat b { font: 700 1.1rem var(--num); }
.ac-stat .bar, .ac-stat small { grid-column: 2; }
.ac-bar .bar { height: 10px; }
.ac-bar .bar > i { background: linear-gradient(90deg, var(--lux-lo), var(--lux), var(--lux-hi)); }
.ac-out { color: var(--gold); font-weight: 600; }
.ac-target { position: relative; justify-self: center; width: min(320px, 80vw); aspect-ratio: 1; border-radius: 24px; border: 1px solid rgba(232, 192, 106, 0.45); cursor: pointer; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, rgba(155, 107, 255, 0.35), rgba(5, 3, 12, 0.9) 70%); box-shadow: 0 0 40px rgba(155, 107, 255, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.06); touch-action: manipulation; user-select: none; }
.ac-target > span:first-child { filter: blur(var(--blur)) saturate(var(--sat)); transition: filter 0.25s; transform: scale(1.05); }
.ac-target:active > span:first-child { transform: scale(1.0); }
.ac-scan { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(180deg, rgba(56, 243, 255, 0.08) 0 2px, transparent 2px 5px); mix-blend-mode: screen; animation: scan 3s linear infinite; }
@keyframes scan { to { background-position: 0 50px; } }
.ac-pct { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); font: 700 1.4rem var(--num); color: var(--lux-hi); text-shadow: 0 0 12px rgba(232, 192, 106, 0.7); }
.ac-float { position: absolute; pointer-events: none; font: 700 1.1rem var(--num); color: var(--cyan); text-shadow: 0 0 8px var(--cyan); animation: float-up 0.7s ease-out forwards; }
@keyframes float-up { to { transform: translateY(-50px); opacity: 0; } }
.ac-empty { text-align: center; color: var(--muted); }
.ac-term-pop, .ac-celebrate { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(3, 2, 8, 0.6); backdrop-filter: blur(3px); }
.ac-term { width: min(420px, 92vw); padding: 18px; display: grid; gap: 8px; }
.ac-term h3 { margin: 0; font: 400 1.5rem var(--display); color: var(--cyan); }
.ac-term p { margin: 0; line-height: 1.5; }
.ac-term .btn { justify-self: start; }
.ac-tutor { display: flex; gap: 8px; align-items: center; color: var(--muted); }
.ac-tutor img { width: 34px; height: 34px; }
.ac-new { font: 600 0.7rem var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--lux); }
.ac-cel-box { padding: 22px; display: grid; gap: 10px; justify-items: center; text-align: center; width: min(400px, 92vw); position: relative; z-index: 1; }
.ac-cel-box h2 { margin: 0; font: 400 2rem var(--display); color: var(--lux); text-shadow: 0 0 24px rgba(232, 192, 106, 0.6); }
.confetti { position: absolute; top: -10px; width: 8px; height: 14px; background: hsl(var(--h) 90% 60%); animation: confetti 1.8s ease-in forwards; }
@keyframes confetti { to { transform: translateY(105vh) rotate(720deg); } }
.quiz, .quiz-done { padding: 18px; display: grid; gap: 12px; max-width: 760px; width: 100%; justify-self: center; }
.quiz h3, .quiz-done h3 { margin: 0; font: 400 1.35rem var(--display); }
.quiz-top { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 0.85rem; }
.quiz-top img { width: 30px; height: 30px; }
.quiz-options { display: grid; gap: 8px; }
.quiz-opt { text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--text); font: 500 0.92rem/1.4 var(--font); cursor: pointer; }
.quiz-opt:hover, .quiz-opt:focus-visible { border-color: var(--cyan); background: rgba(56, 243, 255, 0.07); outline: none; }
.quiz-review { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; border-left: 3px solid var(--green); background: rgba(34, 255, 122, 0.05); }
.quiz-review.bad { border-left-color: var(--red); background: rgba(255, 64, 96, 0.06); }
.quiz-review small { color: var(--muted); }
.fine { font-size: 0.75rem; }
.gl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 8px; }
.gl-card { display: grid; grid-template-columns: 30px minmax(0, 1fr); grid-template-rows: auto auto; gap: 0 8px; align-items: center; text-align: left; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--text); cursor: pointer; }
.gl-card img { grid-row: span 2; width: 30px; height: 30px; }
.gl-card b { font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-card small { color: var(--muted); font-size: 0.68rem; }
.gl-card.locked { opacity: 0.45; }
.gl-card.locked img { filter: grayscale(1); }
@media (max-width: 720px) { .ac-decrypt { grid-template-columns: 1fr; } .ac-right { order: -1; } }
@media (max-height: 520px) { .ac-target { width: min(220px, 40vw); } .ac-decrypt { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .ac-right { order: 0; } }
.daily-box .pill.club { color: var(--lux-hi); border-color: rgba(232, 192, 106, 0.45); }
.cell.extra { border-color: rgba(255, 79, 216, 0.35); }

/* ------------------------------------------------------------ character cut-ins (NFT abilities) */
.cutin { position: fixed; inset: 0; z-index: 55; pointer-events: none; overflow: hidden; }
.cutin-band { position: absolute; top: 50%; left: -10%; right: -10%; height: clamp(120px, 28vh, 220px); transform: translateY(-50%) skewY(-6deg);
  display: flex; align-items: center; gap: 4%; padding: 0 14%; overflow: hidden;
  background: linear-gradient(90deg, rgba(5, 3, 12, 0.92), rgba(30, 14, 60, 0.95) 50%, rgba(5, 3, 12, 0.92));
  border-block: 3px solid var(--cut, #38f3ff); box-shadow: 0 0 40px var(--cut, #38f3ff), inset 0 0 60px rgba(0, 0, 0, 0.6);
  animation: cutin-band var(--dur) cubic-bezier(.2, .9, .2, 1) both; }
.cutin.hist { --cut: #ffc23d; }
.cutin.tier2 { --cut: #3d7bff; }
.cutin.tier3 { --cut: #ff4fd8; }
.cutin.theirs .cutin-band { flex-direction: row-reverse; text-align: right; animation-name: cutin-band-r; }
@keyframes cutin-band { 0% { clip-path: inset(0 100% 0 0); } 18% { clip-path: inset(0 0 0 0); } 80% { clip-path: inset(0 0 0 0); opacity: 1; } 100% { clip-path: inset(0 0 0 0); opacity: 0; } }
@keyframes cutin-band-r { 0% { clip-path: inset(0 0 0 100%); } 18% { clip-path: inset(0 0 0 0); } 80% { clip-path: inset(0 0 0 0); opacity: 1; } 100% { clip-path: inset(0 0 0 0); opacity: 0; } }
.cutin-art { flex: none; width: clamp(110px, 22vw, 260px); height: 140%; background: center 18% / cover no-repeat; transform: skewY(6deg) scale(1.1);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  animation: cutin-art var(--dur) ease-out both; filter: drop-shadow(0 0 20px var(--cut)); }
@keyframes cutin-art { from { transform: skewY(6deg) scale(1.35) translateX(-30px); } to { transform: skewY(6deg) scale(1.1) translateX(10px); } }
.cutin-text { display: grid; gap: 2px; transform: skewY(6deg); animation: cutin-text var(--dur) ease-out both; }
@keyframes cutin-text { 0%, 15% { opacity: 0; transform: skewY(6deg) translateX(40px); } 30% { opacity: 1; transform: skewY(6deg) translateX(0); } }
.cutin-k { font: 600 clamp(0.7rem, 1.4vw, 0.95rem) var(--mono); letter-spacing: 0.3em; text-transform: uppercase; color: var(--cut); }
.cutin-text b { font: 400 clamp(1.8rem, 5vw, 3.6rem)/1 var(--display); color: #fff; text-shadow: 0 0 24px var(--cut), 0 4px 0 rgba(0, 0, 0, 0.5); }
.cutin-line { font: 700 clamp(0.95rem, 2.2vw, 1.5rem) var(--font); color: var(--lux-hi); text-shadow: 0 0 12px rgba(232, 192, 106, 0.6); }
.cutin-streaks i { position: absolute; left: -30%; width: 30%; height: 2px; background: linear-gradient(90deg, transparent, var(--cut), #fff); animation: streak calc(var(--dur) * 0.5) ease-in 2 both; }
.cutin.theirs .cutin-streaks i { left: auto; right: -30%; background: linear-gradient(270deg, transparent, var(--cut), #fff); animation-name: streak-r; }
@keyframes streak { to { transform: translateX(450%); } }
@keyframes streak-r { to { transform: translateX(-450%); } }
@media (prefers-reduced-motion: reduce) { .cutin-band, .cutin-art, .cutin-text, .cutin-streaks i { animation-duration: 0.01s !important; } }

/* ------------------------------------------------------------ the loading sequence (replaces the scroll intro) */
.intro .i-load { position: absolute; left: 50%; bottom: 9%; width: min(320px, 60vw); height: 4px; transform: translateX(-50%); border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; transition: opacity 0.4s; }
.intro .i-load i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffc23d, #38f3ff); box-shadow: 0 0 12px rgba(255, 194, 61, 0.7); }
.intro:not(.loading) .i-load { opacity: 0; }

/* ------------------------------------------------------------ Decrypt: shuffle & draw, the album, rigs */
.ac-stat b { font-family: var(--display); font-weight: 400; }
.dc-wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 820px) { .dc-wrap { grid-template-columns: minmax(0, 1fr); } }
.dc-main { display: grid; gap: 10px; min-width: 0; }
.dc-table { position: relative; aspect-ratio: 1 / 0.8; border-radius: 22px; overflow: hidden; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation;
  background: radial-gradient(ellipse at 50% 60%, #241650, #0d0820 70%); border: 1px solid rgba(155, 107, 255, 0.4); box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.7); }
.dc-table:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.dc-felt { position: absolute; inset: 12% 10% 8%; border-radius: 50%; border: 2px solid rgba(56, 243, 255, 0.18); box-shadow: 0 0 40px rgba(56, 243, 255, 0.12) inset; }
.dc-hud { position: absolute; top: 10px; left: 12px; right: 12px; display: flex; justify-content: space-between; gap: 8px; font: 600 12px var(--mono); color: var(--muted); letter-spacing: 0.08em; pointer-events: none; z-index: 2; }
.dc-hud b { color: var(--text); font: 400 clamp(14px, 2.2vw, 18px) var(--display); letter-spacing: 0; }
.dc-deck { position: absolute; left: 50%; top: 52%; width: 16%; aspect-ratio: 1890 / 2640; transform: translate(-50%, -50%); }
.dc-deck > * { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 7%; box-shadow: 0 2px 0 #000; pointer-events: none; }
/* a tinted card back (no art of its own): the standard back washed in its colour, as in the Collection */
.dc-deck .tinted, .dc-fly.tinted { display: block; overflow: hidden; background: url(../assets/cards/sm/back.webp) center / cover; }
.dc-deck .tinted::after, .dc-fly.tinted::after { content: ''; position: absolute; inset: 0; background: var(--tint); mix-blend-mode: multiply; opacity: 0.85; }
.dc-fly { position: absolute; left: 50%; top: 52%; width: 16%; aspect-ratio: 1890 / 2640; border-radius: 7%; pointer-events: none; animation: dc-riffle 0.32s ease-out forwards; }
@keyframes dc-riffle { from { transform: translate(calc(-50% + var(--x)), -50%) rotate(var(--r)); opacity: 1; } to { transform: translate(-50%, -54%) rotate(0); opacity: 0; } }
.dc-hand { position: absolute; bottom: 4%; width: 38%; transition: transform 0.12s; transform-origin: 50% 90%; pointer-events: none; }
.dc-hand svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--hand) 50%, transparent)); }
.dc-hand.l { left: 4%; transform: scaleX(-1); } .dc-hand.r { right: 4%; }
.dc-table.tap .dc-hand.l { transform: scaleX(-1) rotate(-8deg) translate(5%, -3%); }
.dc-table.tap .dc-hand.r { transform: rotate(-8deg) translate(5%, -3%); }
.dc-crest { position: absolute; left: 70%; top: 66%; width: 15%; aspect-ratio: 1; border-radius: 50%; background: center / cover; border: 2px solid var(--hand); box-shadow: 0 0 8px var(--hand); }
.dc-hint { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font: 600 11px var(--mono); letter-spacing: 0.24em; color: var(--gold); pointer-events: none; }
.dc-float { position: absolute; font: 400 20px var(--display); color: var(--cyan); text-shadow: 0 0 10px var(--cyan); pointer-events: none; animation: dc-up 0.8s ease-out forwards; z-index: 2; }
@keyframes dc-up { to { transform: translateY(-60px); opacity: 0; } }
.dc-table.shake { animation: dc-shake 0.45s; }
@keyframes dc-shake { 20% { transform: translate(-6px, 3px); } 40% { transform: translate(5px, -4px); } 60% { transform: translate(-4px, -2px); } 80% { transform: translate(3px, 3px); } }
/* the drawn card: a different reveal for each rarity */
.dc-draw { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 8px; z-index: 3; background: rgba(5, 3, 14, 0.45); cursor: pointer; }
.dc-draw .burst { position: absolute; left: 50%; top: 45%; width: 140%; aspect-ratio: 1; margin: -70% 0 0 -70%; border-radius: 50%; opacity: 0; pointer-events: none; animation: dc-burst 1.1s ease-out forwards; background: radial-gradient(circle, var(--rc) 0%, transparent 60%); }
.dc-draw.common .burst { animation-duration: 0.7s; background: radial-gradient(circle, #ffffff88 0%, transparent 40%); }
.dc-draw.epic .burst { background: conic-gradient(from 0deg, var(--rc), transparent, var(--rc), transparent, var(--rc)); -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 62%); mask-image: radial-gradient(circle, #000 20%, transparent 62%); animation: dc-burst 1.4s ease-out forwards, dc-spin 2s linear infinite; }
.dc-draw.legendary .burst { background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--rc) 70%, transparent) 0 6deg, transparent 6deg 18deg), radial-gradient(circle, var(--rc), transparent 60%); animation: dc-burst 1.8s ease-out forwards, dc-spin 3s linear infinite; }
@keyframes dc-burst { 0% { opacity: 0; transform: scale(0.2); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(1.1); } }
@keyframes dc-spin { to { rotate: 360deg; } }
.dc-draw .card { position: relative; width: min(34%, 190px); aspect-ratio: 1890 / 2640; perspective: 800px; animation: dc-rise 0.8s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes dc-rise { from { transform: translateY(40%) scale(0.4); } to { transform: none; } }
.dc-draw .inner { position: absolute; inset: 0; transform-style: preserve-3d; animation: dc-flip 0.6s 0.3s ease-in-out both; }
.dc-draw.common .inner { animation-delay: 0.1s; }
@keyframes dc-flip { from { transform: rotateY(180deg); } to { transform: rotateY(0); } }
.dc-draw .backf, .dc-draw .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 6%; }
.dc-draw .backf { transform: rotateY(180deg); background: center / cover; }
.dc-draw .face .dcard { position: absolute; inset: 0; width: 100%; height: 100%; --card-w: 100%; cursor: default; }
.dc-draw.legendary .face::after { content: ''; position: absolute; inset: 0; border-radius: inherit; mix-blend-mode: color-dodge; pointer-events: none; background: linear-gradient(115deg, transparent 20%, #ffd36e99 40%, #ffffffaa 50%, #ff7ad999 60%, transparent 80%); background-size: 250% 250%; animation: dc-sheen 1.6s ease-in-out infinite alternate; }
@keyframes dc-sheen { from { background-position: 0 0; } to { background-position: 100% 100%; } }
.dc-draw .cap { position: relative; display: grid; justify-items: center; gap: 2px; text-align: center; animation: dc-cap 0.4s 0.7s both; }
@keyframes dc-cap { from { opacity: 0; transform: translateY(8px); } }
.dc-draw .cap small { font: 600 11px var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--rc); text-shadow: 0 0 8px var(--rc); }
.dc-draw .cap b { font: 400 clamp(14px, 2.4vw, 19px) var(--display); }
.dc-draw .cap em { font: 400 13px var(--display); font-style: normal; color: var(--gold); }
.dc-recent { display: flex; gap: 6px; align-items: center; min-height: 64px; overflow-x: auto; padding: 6px 6px 2px 0; }
.dc-mini { position: relative; flex: none; width: 44px; aspect-ratio: 1890 / 2640; border-radius: 4px; border: 2px solid var(--rc); box-shadow: 0 0 8px color-mix(in srgb, var(--rc) 60%, transparent); }
.dc-mini img { width: 100%; height: 100%; border-radius: 2px; display: block; }
.dc-mini i { position: absolute; top: -6px; right: -6px; font: 600 8px var(--mono); font-style: normal; background: var(--gold); color: #000; padding: 1px 3px; border-radius: 4px; }
.dc-side { display: grid; gap: 12px; min-width: 0; }
.dc-cipher { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px; }
.dc-pic { border-radius: 12px; overflow: hidden; }
.dc-pic > * { filter: blur(var(--blur)) saturate(var(--sat)); transition: filter 0.3s; }
.dc-meter { display: grid; gap: 4px; min-width: 0; }
.dc-meter small:first-child { font: 600 0.7rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.dc-meter b { font: 400 1.05rem var(--display); }
.dc-meter .bar { height: 10px; }
.dc-meter .bar > i { background: linear-gradient(90deg, #9b6bff, var(--cyan), var(--gold)); }
.dc-rig { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 12px; }
.dc-rig > div { display: grid; gap: 2px; min-width: 0; }
.dc-rig small:first-child { font: 600 0.7rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.dc-rig b { font: 400 1.05rem var(--display); }
.rig-standard { border-color: rgba(47, 134, 255, 0.6); } .rig-superior { border-color: rgba(176, 77, 255, 0.7); } .rig-epic { border-color: rgba(255, 194, 61, 0.8); box-shadow: 0 0 18px rgba(255, 194, 61, 0.25); }
.dc-left { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; }
.dc-left > div { display: grid; gap: 2px; }
.fine { font-size: 0.78rem; line-height: 1.45; margin: 0; }
.al-goals { display: grid; gap: 10px; padding: 14px; }
.al-goal { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 10px; align-items: center; }
.al-goal > div { display: grid; }
.al-goal.done b::after { content: ' ✓'; color: var(--green); }
.al-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 92px), 1fr)); gap: 10px; }
.al-card { position: relative; display: grid; gap: 4px; justify-items: center; min-width: 0; }
.al-card img { width: 100%; aspect-ratio: 1890 / 2640; border-radius: 6px; border: 2px solid var(--rc); box-shadow: 0 0 10px color-mix(in srgb, var(--rc) 45%, transparent); }
.al-card.missing img { filter: grayscale(1) brightness(0.22) contrast(1.3); border-color: rgba(255, 255, 255, 0.12); box-shadow: none; }
.al-card i { position: absolute; top: 4px; right: 4px; font: 600 10px var(--mono); font-style: normal; background: rgba(0, 0, 0, 0.75); color: var(--gold); padding: 1px 4px; border-radius: 4px; }
.al-card small { font-size: 0.68rem; color: var(--muted); text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-term-toast { position: fixed; right: 16px; bottom: 96px; z-index: 65; width: min(320px, calc(100vw - 32px)); display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 12px; text-align: left; color: var(--text); cursor: pointer; border-color: rgba(56, 243, 255, 0.5); animation: term-in 0.35s ease-out both; transition: opacity 0.4s, transform 0.4s; }
.ac-term-toast.out { opacity: 0; transform: translateX(30px); }
@keyframes term-in { from { opacity: 0; transform: translateX(40px); } }
.ac-term-toast img { width: 34px; height: 34px; }
.ac-term-toast span { display: grid; gap: 2px; min-width: 0; }
.ac-term-toast small { font: 600 0.66rem var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.ac-term-toast b { font: 400 1rem var(--display); color: var(--cyan); }
.ac-term-toast em { font-style: normal; font-size: 0.8rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.menu .decrypt-btn { border-color: rgba(255, 194, 61, 0.55); background: linear-gradient(180deg, rgba(70, 48, 20, 0.85), rgba(24, 14, 34, 0.9)); }
.menu .decrypt-btn small { color: var(--gold); }

/* ------------------------------------------------------------ hints */
.g-hint { display: flex; gap: 8px; align-items: center; margin-top: 6px; padding: 6px 12px; border-radius: 12px; font-size: 0.86rem; line-height: 1.35; color: #fff4d6;
  background: linear-gradient(90deg, rgba(255, 194, 61, 0.18), rgba(255, 194, 61, 0.06)); border: 1px solid rgba(255, 194, 61, 0.45); pointer-events: none; animation: hint-in 0.3s ease-out both; }
.g-hint[hidden] { display: none; }
.g-hint .bulb { filter: drop-shadow(0 0 6px rgba(255, 194, 61, 0.9)); }
@keyframes hint-in { from { opacity: 0; transform: translateY(-4px); } }
#hand .hinted { box-shadow: 0 0 0 3px #ffc23d, 0 0 26px 6px rgba(255, 194, 61, 0.75) !important; }
.hint-btn { opacity: 0.45; filter: grayscale(0.8); }
.hint-btn.on { opacity: 1; filter: none; box-shadow: 0 0 12px rgba(255, 194, 61, 0.5); }
.hint-btn[hidden] { display: none; }

/* ============================================================ Decrypt 2.0: the chamber */
#academy.active { background: radial-gradient(ellipse 70% 60% at 50% 45%, #1d1048 0%, #0b0620 60%, #05030c 100%); }
#academy::before { content: ''; position: fixed; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(56, 243, 255, 0.022) 0 1px, transparent 1px 4px); }
.dx-body { max-width: 1400px; padding: 10px 16px 18px; }
.dx { position: relative; display: grid; grid-template-columns: 230px minmax(0, 1fr) 340px; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; min-height: calc(100vh - 90px); min-height: calc(100dvh - 90px); }
.dx-top { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 14px; border-radius: 14px; background: rgba(10, 6, 24, 0.9); border: 1px solid rgba(255, 194, 61, 0.4); box-shadow: 0 0 30px rgba(255, 194, 61, 0.08); }
.dx-prize-pics { display: flex; gap: 6px; }
.dx-prize-pics > * { filter: blur(var(--blur, 0)) saturate(var(--sat, 1)); transition: filter 0.4s; }
.dx-prize-pics.big { justify-content: center; gap: 14px; }
/* a board prize: its art, sharper at every 10% (academy.js revealBlur) */
.dx-prize-art { position: relative; width: clamp(150px, 18vw, 240px); aspect-ratio: 4096 / 1730; padding: 0; border: 0; border-radius: 10px; overflow: hidden; cursor: zoom-in;
  background: #0b0912; box-shadow: inset 0 0 0 1px rgba(232, 192, 106, 0.6), 0 0 18px rgba(232, 192, 106, 0.15); }
.dx-prize-art img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.08); filter: blur(var(--blur, 0)) brightness(0.9); transition: filter 0.9s ease-out; }
.dx-prize-art span { position: absolute; right: 5px; bottom: 5px; padding: 1px 7px; border-radius: 99px; font: 700 0.72rem var(--num); color: #1b1203; background: linear-gradient(180deg, var(--lux-hi), var(--lux)); }
.dx-prize-art::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 35%, rgba(255, 241, 196, 0.55) 48%, transparent 60%) no-repeat; background-size: 250% 100%; background-position: 140% 0; mix-blend-mode: screen; }
.dx-prize-art.reveal::after { animation: dx-reveal 1.1s ease-out; }
.dx-prize-art.reveal { animation: dx-reveal-pop 0.6s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes dx-reveal { to { background-position: -40% 0; } }
@keyframes dx-reveal-pop { 40% { transform: scale(1.06); box-shadow: inset 0 0 0 1px var(--lux-hi), 0 0 30px rgba(232, 192, 106, 0.6); } }
.dx-bar.steps { background-image: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), rgba(7, 5, 15, 0.8) calc(10% - 2px) 10%); }
.dx-prize-view .dx-pv-box { width: min(900px, 94vw); padding: 18px; display: grid; gap: 10px; justify-items: center; text-align: center; }
.dx-pv-art { width: 100%; aspect-ratio: 4096 / 1730; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px rgba(232, 192, 106, 0.6); }
.dx-pv-art img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); filter: blur(var(--blur, 0)); }
.dx-pv-box h3 { margin: 0; font: 400 1.4rem var(--display); color: var(--lux-hi); }

/* a board unlocked: rays turning behind it, confetti, the board popping in */
.dx-unlock { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; overflow: hidden; background: rgba(4, 2, 10, 0.78); animation: dx-u-in 0.35s ease-out; }
.dx-unlock.out { opacity: 0; transition: opacity 0.25s; }
@keyframes dx-u-in { from { opacity: 0; } }
.dx-u-glow { position: absolute; left: 50%; top: 44%; width: min(900px, 120vw); aspect-ratio: 900 / 520; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(232, 192, 106, 0.45), rgba(176, 77, 255, 0.18) 60%, transparent); }
.dx-u-rays { position: absolute; left: 50%; top: 44%; width: 1600px; height: 1600px; border-radius: 50%; transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 0deg, rgba(255, 226, 150, 0.2) 0deg 5deg, rgba(255, 226, 150, 0) 5deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 8%, transparent 62%); mask: radial-gradient(circle, #000 8%, transparent 62%);
  animation: dx-rays-in 0.8s ease-out both, dx-rays 40s linear infinite; }
@keyframes dx-rays { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes dx-rays-in { from { opacity: 0; transform: translate(-50%, -50%) scale(0.4); } }
.dx-u-bit { position: absolute; top: 0; border-radius: 2px; animation-name: dx-fall; animation-timing-function: linear; animation-iteration-count: infinite; opacity: 0.9; }
@keyframes dx-fall { from { transform: translateY(-80px) rotate(0); } to { transform: translateY(110vh) rotate(900deg); } }
.dx-u-box { position: relative; z-index: 1; width: min(860px, 94vw); display: grid; justify-items: center; gap: 14px; text-align: center; }
.dx-u-tag { padding: 4px 14px; border-radius: 99px; font: 600 0.8rem var(--mono); letter-spacing: 0.24em; color: #1b1203; background: linear-gradient(180deg, var(--lux-hi), var(--lux)); box-shadow: 0 0 22px rgba(232, 192, 106, 0.7); animation: dx-rise 0.6s ease-out 0.5s both; }
.dx-u-board { position: relative; width: min(760px, 92vw); aspect-ratio: 4096 / 1730; border-radius: 14px; overflow: hidden; perspective: 900px;
  box-shadow: 0 0 0 2px var(--lux), 0 0 70px rgba(232, 192, 106, 0.55), 0 30px 80px rgba(0, 0, 0, 0.7); animation: dx-board-pop 0.9s cubic-bezier(.2, 1.4, .4, 1) 0.15s both; }
.dx-u-board img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dx-u-shine { position: absolute; inset: 0; mix-blend-mode: screen; background: linear-gradient(105deg, transparent 35%, rgba(255, 241, 196, 0.5) 48%, transparent 60%) no-repeat; background-size: 250% 100%; animation: dx-sweep 3.2s ease-in-out 0.9s infinite; }
@keyframes dx-board-pop { 0% { opacity: 0; transform: scale(0.55) rotateX(28deg); } 60% { opacity: 1; transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes dx-sweep { 0%, 40% { background-position: 140% 0; } 100% { background-position: -40% 0; } }
@keyframes dx-rise { from { opacity: 0; transform: translateY(18px); } }
.dx-u-box h2 { margin: 0; font: 400 clamp(2rem, 5vw, 2.9rem) var(--display); color: #fff; text-shadow: 0 0 24px rgba(232, 192, 106, 0.6); animation: dx-rise 0.6s ease-out 0.7s both; }
.dx-u-line { margin: 0; font-size: clamp(1.1rem, 2.4vw, 1.4rem); font-weight: 600; color: var(--lux-hi); animation: dx-rise 0.6s ease-out 0.8s both; }
.dx-u-name { margin: 0; color: var(--muted); animation: dx-rise 0.6s ease-out 0.9s both; }
.dx-u-btns { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; animation: dx-rise 0.6s ease-out 1s both; }
.dx-u-go { font-weight: 800 !important; color: #1b1203 !important; background: linear-gradient(180deg, var(--lux-hi), var(--lux) 60%, #c99a3c) !important; border-color: var(--lux-hi) !important; animation: dx-go 2.4s ease-in-out 2s infinite; }
@keyframes dx-go { 50% { box-shadow: 0 0 0 1px var(--lux-hi), 0 0 40px rgba(232, 192, 106, 0.7); } }
@media (prefers-reduced-motion: reduce) { .dx-u-rays, .dx-u-bit, .dx-u-shine, .dx-u-go, .dx-prize-art.reveal, .dx-prize-art.reveal::after { animation: none; } .dx-u-bit { display: none; } }
.dx-prog { display: grid; gap: 5px; min-width: 0; }
.dx-prog small:first-child { font: 600 0.7rem var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
.dx-bar { height: 12px; border-radius: 8px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.dx-bar i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, #9b6bff, #38f3ff 60%, #ffc23d); box-shadow: 0 0 14px rgba(56, 243, 255, 0.6); transition: width 0.25s; }
.dx-pct { font: 400 clamp(1.4rem, 3vw, 2rem) var(--display); color: #fff; text-shadow: 0 0 16px rgba(56, 243, 255, 0.6); }
.dx-left, .dx-right { display: grid; align-content: start; gap: 10px; min-width: 0; }
.dx-card { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: rgba(12, 8, 30, 0.9); border: 1px solid rgba(155, 107, 255, 0.28); }
.dx-card > small:first-child { font: 600 0.66rem var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.dx-big { font: 400 1.7rem var(--display); color: #fff; line-height: 1.1; font-variant-numeric: tabular-nums; }
.dx-big.gold { color: var(--gold); text-shadow: 0 0 18px rgba(255, 194, 61, 0.45); }
.dx-mid-n { font: 400 1.1rem var(--display); }
.dx-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.dx-chips span { font: 0.64rem var(--mono); padding: 2px 6px; border-radius: 6px; background: rgba(56, 243, 255, 0.1); color: var(--cyan); }
.dx-scramble { font: 400 1.25rem var(--mono); letter-spacing: 0.3em; color: var(--cyan); text-shadow: 0 0 10px rgba(56, 243, 255, 0.6); word-break: break-all; }
.dx-word-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.dx-input { min-width: 0; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); color: var(--text); font: 600 0.9rem var(--mono); text-transform: uppercase; letter-spacing: 0.1em; }
.dx-input:focus { outline: 2px solid var(--cyan); outline-offset: 1px; }
.dx-mid { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 6px; min-width: 0; }
.dx-table { position: relative; min-height: 340px; border-radius: 22px; overflow: hidden; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation; display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 58%, #2a1765, #0d0822 68%); border: 1px solid rgba(155, 107, 255, 0.45); box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.7), 0 0 50px rgba(155, 107, 255, 0.12); }
.dx-table:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.dx-table.tap .dc-hand.l { transform: scaleX(-1) rotate(-8deg) translate(5%, -3%); }
.dx-table.tap .dc-hand.r { transform: rotate(-8deg) translate(5%, -3%); }
.dx-table.shake { animation: dc-shake 0.45s; }
.dx-ring { position: relative; width: min(220px, 46%); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; padding: 7px; margin-bottom: 6%;
  background: conic-gradient(var(--gold) 0 var(--p, 0%), rgba(255, 255, 255, 0.08) var(--p, 0%) 100%); box-shadow: 0 0 34px rgba(255, 194, 61, 0.25); transition: box-shadow 0.3s; }
.dx-ring::before { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: radial-gradient(circle, #1d1048, #0b0620 70%); }
.dx-ring.near { box-shadow: 0 0 70px rgba(255, 194, 61, 0.7); animation: dx-pulse 0.5s ease-in-out infinite alternate; }
.dx-ring.frozen { background: conic-gradient(#7fd8ff 0 var(--p, 0%), rgba(127, 216, 255, 0.12) var(--p, 0%) 100%); filter: saturate(0.5); }
@keyframes dx-pulse { to { transform: scale(1.03); } }
.dx-ring .dc-deck { position: relative; left: auto; top: auto; transform: none; width: 44%; }
.dx-ring .dc-deck > * { position: absolute; }
.dx-ring-lbl { position: absolute; bottom: -28px; left: 50%; transform: translateX(-50%); font: 600 0.68rem var(--mono); letter-spacing: 0.14em; color: var(--gold); white-space: nowrap; }
/* the 3D hands (js/ui/shuffle3d.js) replace the flat gloves and the still deck once they load */
.dx-hands3d { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.dx-table.has3d .dc-hand, .dx-table.has3d .dc-deck { display: none; }
.dx-pauses { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; z-index: 2; pointer-events: none; }
.dx-pause { font: 600 0.66rem var(--mono); padding: 4px 9px; border-radius: 20px; background: rgba(127, 216, 255, 0.14); color: #a8e6ff; border: 1px solid rgba(127, 216, 255, 0.5); }
.dx-pause.good { background: rgba(34, 255, 122, 0.12); color: var(--green); border-color: rgba(34, 255, 122, 0.5); }
.dx-pity { text-align: center; font: 0.68rem var(--mono); letter-spacing: 0.08em; color: var(--muted); }
.dx-right { grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.dx-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.dx-tabs button { font: 600 0.68rem var(--mono); letter-spacing: 0.06em; padding: 8px 4px; border-radius: 9px; border: 1px solid transparent; background: rgba(255, 255, 255, 0.05); color: var(--muted); cursor: pointer; }
.dx-tabs button.on { background: rgba(255, 194, 61, 0.14); color: var(--gold); border-color: rgba(255, 194, 61, 0.4); }
.dx-panel { display: grid; align-content: start; gap: 8px; overflow-y: auto; max-height: calc(100vh - 250px); max-height: calc(100dvh - 250px); padding-right: 4px; min-width: 0; }
.dx-filters { display: flex; flex-wrap: wrap; gap: 4px; }
.dx-filters .chip { font-size: 0.72rem; padding: 4px 9px; }
.dx-item { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 9px; align-items: center; padding: 7px 9px; border-radius: 10px; background: rgba(12, 8, 30, 0.9); border: 1px solid rgba(155, 107, 255, 0.22); }
.dx-item.bear { border-color: rgba(255, 64, 96, 0.35); background: rgba(40, 6, 16, 0.6); }
.dx-item img { width: 44px; border-radius: 4px; border: 2px solid var(--rc); }
.dx-item > div { display: grid; gap: 3px; min-width: 0; }
.dx-item b { font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-kind { font: 600 0.6rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.dx-item small { font-size: 0.7rem; }
.dx-meter { height: 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.dx-meter i { display: block; height: 100%; background: linear-gradient(90deg, #38f3ff, #ffc23d); box-shadow: 0 0 8px rgba(56, 243, 255, 0.6); }
.dx-item.bear .dx-meter i { background: linear-gradient(90deg, #ff4060, #ff8a3d); }
.dx-meter.big { width: min(240px, 70vw); height: 9px; margin-top: 4px; }
.dx-locked { display: grid; gap: 4px; padding: 10px; border-radius: 10px; border: 1px dashed rgba(155, 107, 255, 0.35); font-size: 0.74rem; color: var(--muted); }
.dx-locked small { font: 600 0.64rem var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.dx-term { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 7px 9px; border-radius: 10px; background: rgba(12, 8, 30, 0.9); border: 1px solid rgba(155, 107, 255, 0.22); }
.dx-term img { width: 30px; height: 30px; }
.dx-term > div { display: grid; gap: 2px; min-width: 0; }
.dx-term small { font-size: 0.7rem; }
.dx-term.locked { opacity: 0.55; }
.dx-term-name { all: unset; cursor: pointer; font-weight: 700; font-size: 0.84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-term-name:focus-visible { outline: 2px solid var(--cyan); }
.dx-term .btn, .dx-boost .btn { white-space: nowrap; font-size: 0.72rem; padding: 6px 9px; }
.dx-max { font: 600 0.66rem var(--mono); color: var(--gold); letter-spacing: 0.12em; }
.dx-boost { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: rgba(12, 8, 30, 0.9); border: 1px solid rgba(155, 107, 255, 0.22); }
.dx-boost > div { display: grid; gap: 2px; min-width: 0; }
.dx-boost small { font-size: 0.72rem; }
.dx-h4 { margin: 8px 0 0; font: 400 1rem var(--display); color: var(--gold); }
.dx-bottom { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; padding: 9px 14px; border-radius: 14px; background: rgba(10, 6, 24, 0.9); border: 1px solid rgba(56, 243, 255, 0.3); }
.dx-energy { display: grid; gap: 4px; min-width: 0; }
.dx-energy small { font: 600 0.64rem var(--mono); letter-spacing: 0.14em; color: var(--muted); }
.dx-ebar { height: 13px; border-radius: 8px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.dx-ebar i { display: block; height: 100%; background: repeating-linear-gradient(90deg, #38f3ff 0 10px, #2bc8d4 10px 12px); box-shadow: 0 0 14px #38f3ff; transition: width 0.15s; }
.dx-shield { font: 600 0.7rem var(--mono); color: var(--green); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38vw; }
.dx-auto { display: flex; gap: 6px; align-items: center; font: 0.72rem var(--mono); color: var(--muted); white-space: nowrap; }
.dx-taps { font: 600 0.68rem var(--mono); color: var(--cyan); white-space: nowrap; }
.rig-standard { border-color: rgba(47, 134, 255, 0.55); } .rig-superior { border-color: rgba(176, 77, 255, 0.6); } .rig-epic { border-color: rgba(255, 194, 61, 0.7); }
.loss { color: var(--red); }
/* the reveal: everything else blacks out */
.dx-reveal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; align-content: center; gap: 10px; background: radial-gradient(circle at 50% 45%, rgba(20, 10, 46, 0.97), #020107 70%); cursor: pointer; }
.dx-reveal .burst { position: absolute; left: 50%; top: 42%; width: min(140vw, 1100px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; opacity: 0; pointer-events: none; animation: dx-burst 1.1s ease-out forwards; background: radial-gradient(circle, var(--rc) 0%, transparent 55%); }
.dx-reveal.common .burst { animation-duration: 0.7s; background: radial-gradient(circle, #ffffff66 0%, transparent 35%); }
.dx-reveal.epic .burst { background: conic-gradient(from 0deg, var(--rc), transparent, var(--rc), transparent, var(--rc)); -webkit-mask-image: radial-gradient(circle, #000 15%, transparent 55%); mask-image: radial-gradient(circle, #000 15%, transparent 55%); animation: dx-burst 1.4s ease-out forwards, dx-spin 2s linear infinite; }
.dx-reveal.legendary .burst { background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--rc) 70%, transparent) 0 6deg, transparent 6deg 18deg), radial-gradient(circle, var(--rc), transparent 55%); animation: dx-burst 2s ease-out forwards, dx-spin 3s linear infinite; }
.dx-reveal.bear { background: radial-gradient(circle at 50% 45%, rgba(70, 6, 20, 0.97), #050104 70%); }
.dx-reveal.bear::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 47%, rgba(255, 64, 96, 0.55) 49%, transparent 51%), linear-gradient(60deg, transparent 58%, rgba(255, 64, 96, 0.35) 59%, transparent 60%); animation: dx-crack 0.4s ease-out both; }
@keyframes dx-crack { from { opacity: 0; transform: scale(1.2); } }
@keyframes dx-burst { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.2); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.1); } }
@keyframes dx-spin { to { rotate: 360deg; } }
.dx-reveal.shake { animation: dc-shake 0.5s; }
.dx-reveal .card { position: relative; width: min(230px, 46vw); aspect-ratio: 1890 / 2640; perspective: 900px; animation: dc-rise 0.75s cubic-bezier(.2, 1.3, .4, 1) both; }
.dx-reveal .inner { position: absolute; inset: 0; transform-style: preserve-3d; animation: dc-flip 0.6s 0.25s ease-in-out both; }
.dx-reveal .backf, .dx-reveal .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 6%; }
.dx-reveal .backf { transform: rotateY(180deg); background: center / cover; }
.dx-reveal .face .dcard { position: absolute; inset: 0; width: 100%; height: 100%; --card-w: 100%; cursor: default; box-shadow: 0 0 40px var(--rc); }
.dx-reveal.lvup .face::after { content: ''; position: absolute; inset: 0; border-radius: inherit; mix-blend-mode: color-dodge; pointer-events: none; background: linear-gradient(115deg, transparent 20%, #ffd36ecc 42%, #ffffffdd 50%, #ffd36ecc 58%, transparent 80%); background-size: 260% 260%; animation: dx-shine 1.1s 0.7s ease-in-out both; }
@keyframes dx-shine { from { background-position: 100% 100%; opacity: 1; } to { background-position: 0 0; opacity: 0.2; } }
.dx-reveal.legendary .face::after { content: ''; position: absolute; inset: 0; border-radius: inherit; mix-blend-mode: color-dodge; pointer-events: none; background: linear-gradient(115deg, transparent 20%, #ffd36e99 40%, #ffffffaa 50%, #ff7ad999 60%, transparent 80%); background-size: 250% 250%; animation: dc-sheen 1.6s ease-in-out infinite alternate; }
.dx-reveal .cap { position: relative; display: grid; justify-items: center; gap: 4px; text-align: center; animation: dc-cap 0.4s 0.65s both; }
.dx-reveal .cap small { font: 600 0.72rem var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--rc); text-shadow: 0 0 10px var(--rc); }
.dx-reveal .cap b { font: 400 clamp(1.2rem, 3vw, 1.7rem) var(--display); }
.dx-reveal .cap em { font: 400 1rem var(--display); font-style: normal; color: var(--gold); }
.dx-reveal .cap em.stamp { font-size: 1.25rem; padding: 4px 14px; border: 2px solid var(--gold); border-radius: 8px; box-shadow: 0 0 24px rgba(255, 194, 61, 0.6); animation: dx-stamp 0.45s 1.2s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes dx-stamp { from { transform: scale(2.4) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
.dx-reveal.bear .cap em { color: #ff8fa3; }
.dx-skip { position: absolute; bottom: max(18px, env(safe-area-inset-bottom, 0px)); font: 0.66rem var(--mono); letter-spacing: 0.2em; color: var(--muted); text-transform: uppercase; }
/* bear attack: the shield panel */
.dx-bearpanel { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; background: radial-gradient(circle, rgba(80, 6, 22, 0.88), rgba(4, 1, 6, 0.95)); animation: dx-red 0.3s ease-out both; }
@keyframes dx-red { from { background: rgba(255, 64, 96, 0.8); } }
.dx-bearbox { width: min(520px, calc(100vw - 32px)); padding: 20px; border-radius: 18px; background: rgba(18, 6, 14, 0.96); border: 1px solid rgba(255, 64, 96, 0.6); box-shadow: 0 0 60px rgba(255, 64, 96, 0.35); display: grid; gap: 10px; text-align: center; }
.dx-bearbox > small { font: 600 0.72rem var(--mono); letter-spacing: 0.3em; color: var(--red); }
.dx-bearbox h3 { margin: 0; font: 400 1.5rem var(--display); }
.dx-bearbox p { margin: 0; color: #ffc3cd; }
.dx-shields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 8px; }
.dx-shieldbtn { display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-rows: auto auto; gap: 1px 8px; align-items: center; text-align: left; padding: 8px; border-radius: 10px; border: 1px solid rgba(34, 255, 122, 0.45); background: rgba(34, 255, 122, 0.08); color: var(--text); cursor: pointer; }
.dx-shieldbtn:hover, .dx-shieldbtn:focus-visible { background: rgba(34, 255, 122, 0.18); outline: none; }
.dx-shieldbtn img { grid-row: span 2; width: 40px; border-radius: 4px; }
.dx-shieldbtn b { font-size: 0.82rem; }
.dx-shieldbtn small { font-size: 0.68rem; color: var(--muted); }
.dx-bearfoot { display: flex; justify-content: center; align-items: center; gap: 12px; }
.dx-count { font: 400 1.4rem var(--display); color: var(--red); min-width: 2ch; }
.dx-flash { position: fixed; left: 50%; top: 30%; transform: translateX(-50%); z-index: 90; pointer-events: none; padding: 12px 20px; border-radius: 14px; font: 400 clamp(1rem, 3vw, 1.4rem) var(--display); text-align: center; animation: dx-flash 1.9s ease-out both; max-width: calc(100vw - 32px); }
.dx-flash.bad { background: rgba(60, 4, 16, 0.92); color: #ff8fa3; border: 1px solid var(--red); box-shadow: 0 0 40px rgba(255, 64, 96, 0.5); }
.dx-flash.good { background: rgba(4, 40, 20, 0.92); color: var(--green); border: 1px solid var(--green); box-shadow: 0 0 40px rgba(34, 255, 122, 0.4); }
@keyframes dx-flash { 0% { opacity: 0; transform: translate(-50%, 10px) scale(0.9); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -14px); } }
.dx-quiz .quiz { max-height: calc(100vh - 40px); overflow-y: auto; }
/* phones and narrow windows: one column */
@media (max-width: 980px) {
  .dx { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; min-height: 0; }
  .dx-top { grid-template-columns: auto minmax(0, 1fr); }
  .dx-top .dx-pct { grid-column: 2; justify-self: end; margin-top: -6px; }
  .dx-mid { order: 1; }
  .dx-bottom { order: 2; grid-template-columns: minmax(0, 1fr) auto; }
  .dx-bottom .dx-energy { grid-column: 1 / -1; }
  .dx-left { order: 3; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dx-right { order: 4; }
  .dx-panel { max-height: none; overflow: visible; }
  .dx-table { min-height: 300px; }
  .dx-shield { max-width: 60vw; }
}
@media (max-width: 480px) { .dx-left { grid-template-columns: minmax(0, 1fr); } .dx-prize-pics > *:nth-child(2) { display: none; } }
@media (prefers-reduced-motion: reduce) { .dx-ring.near, .dx-reveal .burst { animation: none; } }

/* ------------------------------------------------------------ the 3D host on the home screen */
.title-host.is3d { width: clamp(240px, 30vw, 460px); height: min(82vh, 820px); height: min(82dvh, 820px); pointer-events: none; }
.title-host.is3d .host-art { display: none; }
.title-host .host3d { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: auto; cursor: pointer; touch-action: manipulation; filter: drop-shadow(0 0 24px rgba(176, 77, 255, 0.35)); }
.title-host.is3d .host-bubble { bottom: auto; top: 6%; right: 52%; z-index: 2; border-radius: 16px 16px 4px 16px; }
.title-host.loading3d .host-art { display: block; opacity: 0.6; }
@media (max-width: 760px) { .title-host.is3d { width: 44vw; height: 70vh; height: 70dvh; } .title-host.is3d .host-bubble { right: 30%; top: 2%; max-width: 180px; font-size: 0.8rem; } }

/* ------------------------------------------------------------ ApeChain set: glass frame ring and first-player button */
.th-frame:has(.ring) { background: none !important; box-shadow: none !important; }
.th-frame .ring { position: absolute; inset: -7%; width: 114%; height: 114%; pointer-events: none; }
.th-frame .ring img { width: 100%; height: 100%; display: block; }
/* glints: a bright sweep that crosses the glass now and then, only where the ring is */
.th-frame .ring.glint::after, .avatar[data-cos-frame="frame:apechain"]::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.95) 48%, rgba(190, 220, 255, 0.7) 52%, transparent 62%) no-repeat;
  background-size: 300% 100%; background-position: 130% 0;
  -webkit-mask: var(--ring) center / contain no-repeat; mask: var(--ring) center / contain no-repeat;
  mix-blend-mode: screen; animation: ring-glint 5.5s ease-in-out infinite;
}
.avatar[data-cos-frame="frame:apechain"]::before { --ring: url(../assets/partners/apechain/frame.png); inset: auto; left: -20%; top: -20%; width: 140%; height: 140%; z-index: 2; border-radius: 0; }
@keyframes ring-glint { 0%, 55% { background-position: 130% 0; } 85%, 100% { background-position: -30% 0; } }
@media (prefers-reduced-motion: reduce) { .th-frame .ring.glint::after, .avatar[data-cos-frame="frame:apechain"]::before { animation: none; opacity: 0; } }
.th-button { --s: 44px; width: var(--s); height: var(--s); border-radius: 50%; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5)); }
.avatar[data-cos-frame="frame:apechain"] { border-color: transparent !important; box-shadow: none !important; }
.avatar[data-cos-frame="frame:apechain"]::after { left: -20%; top: -20%; bottom: auto; width: 140%; height: 140%; transform: none; border-radius: 0; box-shadow: none;
  background: url(../assets/partners/apechain/frame.png) center / contain no-repeat; pointer-events: none; }

/* ------------------------------------------------------------ wallets (read-only link) */
.wallet-card { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); }
.wallet-card.linked { border-color: rgba(47, 107, 255, 0.6); background: rgba(47, 107, 255, 0.08); }
.wallet-addr { font: 600 0.9rem var(--mono); color: #8fb4ff; }
#wallet-pick { z-index: 95; }
.wallet-box { width: min(480px, calc(100vw - 32px)); padding: 20px; display: grid; gap: 12px; }
.wallet-box h2 { margin: 0; font: 400 1.5rem var(--display); }
.wallet-box p { margin: 0; line-height: 1.5; }
.wallet-eyebrow { font: 600 0.7rem var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: #8fb4ff; }
.wallet-list { display: grid; gap: 8px; }
.wallet-opt { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); color: var(--text); cursor: pointer; text-align: left; font: inherit; }
.wallet-opt:hover, .wallet-opt:focus-visible { border-color: #8fb4ff; outline: none; }
.wallet-opt img, .wallet-dot { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; }
.wallet-note { min-height: 1.4em; color: var(--gold); font-size: 0.88rem; }
/* Settings: follow us, legal and contact */
.set-links { display: grid; gap: 8px; padding: 12px 0 4px; border-top: 1px solid var(--line); }
.set-k { font: 600 0.7rem var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.socials { display: flex; flex-wrap: wrap; gap: 8px; }
.socials a { padding: 6px 12px; border-radius: 99px; font-weight: 600; font-size: 0.85rem; color: var(--text, #ece9ff); text-decoration: none; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.socials a:hover { border-color: var(--lux); color: var(--lux-hi); }
.legal-links { font-size: 0.82rem; color: var(--muted); }
.legal-links a, .shop-fine a { color: var(--muted); }
.legal-links a:hover, .shop-fine a:hover { color: var(--cyan); }
/* sharing (js/ui/share.js) */
.share-row { display: flex; justify-content: center; margin: 4px 0 10px; }
.share-btn { display: inline-flex; align-items: center; gap: 8px; }
.share-box { width: min(560px, 94vw); padding: 20px; display: grid; gap: 12px; }
.share-box h2 { margin: 0; font: 400 1.4rem var(--display); }
.share-pic { width: 100%; aspect-ratio: 1200 / 630; border-radius: 12px; box-shadow: 0 0 0 1px rgba(232, 192, 106, 0.5), 0 14px 34px rgba(0, 0, 0, 0.5); }
.share-text { margin: 0; color: var(--muted); }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.share-x { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; background: #0f1419 !important; color: #fff !important; border-color: #3a4450 !important; }
.share-x:hover { background: #1d232a !important; }
.wallet-msg { margin: 0; max-height: 9.5em; overflow: auto; padding: 10px 12px; border-radius: 10px; white-space: pre-wrap; word-break: break-all; font: 0.72rem/1.45 var(--mono); color: #cfe9ff; background: rgba(56, 243, 255, 0.06); border: 1px solid rgba(56, 243, 255, 0.3); }
.wallet-warn { margin: 0; padding: 10px 12px; border-radius: 10px; font-weight: 700; color: #ffd0d8; background: rgba(255, 64, 96, 0.14); border: 1px solid rgba(255, 64, 96, 0.6); }
.wallet-safe { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; font-size: 0.84rem; color: var(--muted); }
.wallet-copy { display: grid; gap: 4px; font-size: 0.8rem; } .wallet-copy code { word-break: break-all; color: #8fb4ff; }

/* the card's story (Deck-0 description) in the Library */
.inspect-info .lore { display: grid; gap: 8px; max-height: 32vh; overflow-y: auto; padding: 10px 12px; border-left: 3px solid var(--gold); border-radius: 0 10px 10px 0; background: rgba(255, 194, 61, 0.06); font-size: 0.9rem; line-height: 1.55; color: #e6e3ff; }
.inspect-info .lore p { margin: 0; }
