/* Cartas — Neo-Print / Studio Vault. Grafite limpo, geometria nítida e coral sinalético. */
:root {
  color-scheme: dark;
  --bg: #0c0e13;
  --felt: #13161f;
  --felt-lit: #181c28;
  --slate: #151923;
  --slate-2: #1c202d;
  --slate-3: #242a3a;
  --line: #232837;
  --line-strong: #32394e;
  --brass-line: #3e455c;
  --accent: #ff4f38;
  --accent-hover: #ff6652;
  --accent-deep: #b52b19;
  --accent-soft: rgba(255, 79, 56, .14);
  --cobalt: #5c92ff;
  --text: #f5f6fa;
  --soft: #c7cbd8;
  --muted: #8a92a8;
  --faint: #585f74;
  --gold: #f5be4f;
  --gold-strong: #ffd97d;
  --gold-deep: #b88424;
  --ink: #140e06;
  --good: #4ade80;
  --warn: #fbbf24;
  --danger: #f87171;
  --c: #c29068; --uc: #c9d3dd; --r: #f2c66f; --sr: #72d2f7; --ssr: #ff5b78; --ur: #e2a9f5;
  --spectrum: linear-gradient(100deg, #7ef0de, #8fb0ff 30%, #e29bff 62%, #ffcf8f);
  --display: 'Space Grotesk', system-ui, -apple-system, 'Noto Sans Symbols 2', 'Noto Sans Tai Le', 'Noto Sans Egyptian Hieroglyphs', 'Segoe UI Symbol', 'Segoe UI Emoji', 'Apple Color Emoji', sans-serif;
  --ui: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', 'Noto Sans Symbols 2', 'Noto Sans Tai Le', 'Noto Sans Egyptian Hieroglyphs', 'Segoe UI Symbol', 'Segoe UI Emoji', 'Apple Color Emoji', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --pad: 36px;
  --radius: 5px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); scrollbar-width: thin; scrollbar-color: #2e3547 transparent; }
html.opening-active { overflow: hidden; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2e3547; border-radius: 2px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); border: 2px solid transparent; background-clip: content-box; }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  font: 14px/1.55 var(--ui);
  overflow-x: hidden;
  background-color: var(--bg);
  background-image: radial-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 24px 24px;
}

h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button, a, input, select { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
svg.ic { fill: currentColor; stroke: none; width: 18px; height: 18px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.skip-link { position: fixed; left: 12px; top: -60px; z-index: 60; background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 4px; font-weight: 700; }
.skip-link:focus { top: 12px; }

/* ---------- Botões ---------- */
.primary, .secondary, .danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .2px;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, transform .12s var(--ease), box-shadow .12s, color .15s;
  white-space: nowrap;
}
.primary {
  background: var(--accent);
  color: #fff;
  border-color: rgba(255, 255, 255, .18);
  box-shadow: 0 3px 0 var(--accent-deep);
}
.primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 0 var(--accent-deep);
}
.primary:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--accent-deep);
}
.secondary {
  background: var(--slate-2);
  border-color: var(--line-strong);
  color: var(--text);
}
.secondary:hover {
  background: var(--slate-3);
  border-color: #4a5370;
}
.danger {
  background: #33161a;
  border-color: #7d3138;
  color: #ffc8c2;
}
.danger:hover { background: #471d23; border-color: #a33f48; }
.secondary:active, .danger:active { transform: translateY(1px); }
.big { min-height: 50px; font-size: 14.5px; width: 100%; }
.small { min-height: 32px; padding: 0 12px; font-size: 12px; border-radius: 3px; }
.ghost { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 4px; color: var(--soft); border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s; }
.ghost:hover { background: var(--slate-2); border-color: var(--line-strong); color: var(--text); }
.link { color: var(--accent-hover); font-weight: 600; white-space: nowrap; }
.link:hover { color: #ff9c8f; }
.coin { display: inline-grid; color: var(--gold); }
.coin svg { width: 16px; height: 16px; }

/* ---------- Moldura de Jogo (HUD Superior) ---------- */
.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.game-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, #12181bf7 0%, #0d1215f0 100%);
  border-bottom: 1px solid var(--line-strong);
  box-shadow: 0 1px 0 #dfb2671a, 0 14px 32px #00000066;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 1320px;
  margin: 0 auto;
  height: 70px;
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
  padding: 4px 6px 4px 2px;
  border-radius: 10px;
}
.brand-crest {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--gold-strong);
  background: radial-gradient(circle at 50% 35%, #dfb26728, #12181b);
  border: 1px solid var(--brass-line);
  box-shadow: 0 0 18px #dfb26722, inset 0 1px 0 #ffffff22;
}
.brand-crest svg { width: 22px; height: 22px; stroke: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: .02em;
  color: var(--text);
}
.brand-sub {
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
}

.game-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: #0a0e10cc;
  border: 1px solid var(--line);
  box-shadow: inset 0 2px 6px #0008;
}
.game-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .2px;
  transition: color .18s, background .18s, border-color .18s, box-shadow .18s;
  border: 1px solid transparent;
}
.game-nav a svg { width: 17px; height: 17px; }
.game-nav a:hover { color: var(--text); background: #ffffff08; }
.game-nav a.active {
  color: var(--gold-strong);
  background: linear-gradient(180deg, #273236 0%, #1a2225 100%);
  border-color: var(--brass-line);
  box-shadow: inset 0 1px 0 #f4d3922e, 0 4px 12px #0006;
}
.game-nav a.active::after {
  content: '';
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold-strong);
  box-shadow: 0 0 10px var(--gold);
}
.nav-meta {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 99px;
  background: #0e1316;
  border: 1px solid var(--line-strong);
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}
.active .nav-meta {
  border-color: var(--brass-line);
  color: var(--gold-strong);
}
.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-strong);
  box-shadow: 0 0 0 3px #dfb26733, 0 0 10px var(--gold);
}

.hud-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-label { display: none; }
.demo-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  background: #101619;
  border-radius: 99px;
  padding: 4px 10px;
  cursor: help;
  white-space: nowrap;
}
.wallet {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--brass-line);
  border-radius: 99px;
  background: linear-gradient(180deg, #282317 0%, #181611 100%);
  box-shadow: inset 0 1px 0 #f4d39229, 0 4px 12px #0006;
  transition: transform .18s var(--ease), border-color .18s, box-shadow .18s;
}
.wallet:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
  box-shadow: inset 0 1px 0 #f4d39240, 0 6px 16px #dfb26728;
}
.wallet b { font-weight: 700; color: var(--gold-strong); font-variant-numeric: tabular-nums; }
.bump { animation: bump .45s var(--ease); }
@keyframes bump { 30% { transform: scale(1.08); } 55% { transform: scale(.97) translateX(-2px); } 75% { transform: translateX(2px); } }

/* ---------- Conteúdo Principal ---------- */
main {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px var(--pad) 48px;
  outline: 0;
  flex: 1;
  animation: page-in .28s var(--ease);
}
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Rodapé ---------- */
.app-footer {
  border-top: 1px solid var(--line);
  background: #0a0d10cc;
  padding: 18px var(--pad);
  color: var(--faint);
  font-size: 12px;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 24px;
}
.footer-roadmap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.soon-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
}
.soon-items {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}
.soon-items > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.soon-items svg { width: 14px; height: 14px; opacity: .75; }
.soon-note { color: var(--faint); }
.footer-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}
.app-footer button {
  color: var(--soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 32px;
}
.app-footer button:hover { color: var(--gold-strong); }

/* ---------- Cabeçalhos & Elementos Comuns ---------- */
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 18px; }
h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 3.2vw, 38px);
  line-height: 1.05;
  letter-spacing: -.03em;
  color: var(--text);
}
h2 { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.15; letter-spacing: -.025em; }
h3 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.lede { color: var(--soft); margin-top: 6px; max-width: 62ch; font-size: 14px; }
.muted { color: var(--muted); }
.kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--accent-hover); font-weight: 700; }
.note { color: var(--faint); font-size: 12px; margin-top: 26px; max-width: 70ch; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 16px; }
.section-head span { font-size: 12px; color: var(--muted); }

.next-step {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 10px 14px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 3px;
  background: var(--felt);
  color: var(--soft);
  font-size: 13px;
}
.next-step b { color: var(--text); font-weight: 700; }
.next-step.done { border-left-color: var(--good); color: var(--good); }

/* ---------- Raridades ---------- */
.rar {
  display: inline-block;
  min-width: 28px;
  padding: 2px 6px;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  text-align: center;
  color: var(--rarity);
  background: color-mix(in srgb, var(--rarity) 14%, #090b10);
  border: 1px solid color-mix(in srgb, var(--rarity) 40%, transparent);
  vertical-align: 1px;
}
.rar-ur { color: #140d1b; background: var(--spectrum); border-color: transparent; }

/* ---------- Coleção (Vitrine / Álbum) ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  padding: 10px 12px;
  border-radius: 5px 5px 0 0;
  background: var(--felt);
  border: 1px solid var(--line);
}
.search {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1 1 240px;
  min-width: 200px;
  min-height: 36px;
  padding: 0 10px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  transition: border-color .15s, box-shadow .15s;
}
.search svg { width: 15px; height: 15px; color: var(--muted); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 13.5px; padding: 6px 0; }
.search input::placeholder { color: var(--faint); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

.chips {
  display: flex;
  gap: 2px 6px;
  flex-wrap: wrap;
  padding: 0 12px;
  background: #10131b;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 5px 5px;
}
.chip {
  min-height: 38px;
  padding: 0 10px;
  border-radius: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  transition: color .15s, border-color .15s, background .15s;
}
.chip b { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--faint); margin-left: 4px; font-variant-numeric: tabular-nums; }
.chip:hover { color: var(--text); background: rgba(255, 255, 255, .03); }
.chip.active { background: rgba(255, 79, 56, .08); border-bottom-color: var(--accent); color: #fff; }
.chip.active b { color: var(--accent-hover); }

.selects { display: flex; gap: 6px; flex-wrap: wrap; flex: 0 1 auto; max-width: 100%; }
@media (max-width: 1200px) {
  .selects { width: 100%; }
  .selects select { flex: 1 1 0; min-width: 130px; }
}
select {
  min-height: 36px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%238a92a8' stroke-width='1.8' stroke-linecap='square'%3E%3Cpath d='m2.5 4.5 3.5 3.5 3.5-3.5'/%3E%3C/svg%3E") no-repeat right 9px center / 10px;
  color: var(--soft);
  font-size: 12.5px;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  max-width: 100%;
  transition: border-color .15s;
}
select::-ms-expand { display: none; }
select::picker-icon { display: none; }
select option, select optgroup { background: #13161f; color: var(--text); }
select:hover { border-color: #4a5370; color: #fff; }

.work {
  padding: 4px 0 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.work + .work { margin-top: 34px; }
.work-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 0 12px 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.work-head::before {
  content: '';
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 12px;
  width: 3px;
  background: var(--accent);
}
.work-head::after { display: none; }
.work-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; min-width: 0; }
.work-title h2 { font-size: 23px; color: var(--text); }
.work-title span { font-family: var(--mono); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.work-head.complete .work-title span { color: var(--good); font-weight: 600; }
.work-progress { display: flex; align-items: center; margin-left: auto; height: 3px; border-radius: 0; background: var(--line); overflow: hidden; }
.work-progress i { display: block; width: var(--progress, 0%); height: 100%; border-radius: 0; background: var(--accent); transition: width .4s var(--ease); }
.work-pct { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--soft); font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(174px, 1fr)); gap: 26px 20px; }

.tile { display: block; width: 100%; text-align: left; border-radius: 4px; }
.tile-art {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  transition: transform .22s var(--ease);
}
.tile-art::before {
  content: '';
  position: absolute;
  inset: 10% 8% 6%;
  background: var(--rarity);
  filter: blur(22px);
  opacity: 0;
  transition: opacity .25s;
  border-radius: 18%;
}
.tile-art img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px #000a);
  transition: filter .25s;
}
.tile:hover .tile-art, .tile:focus-visible .tile-art { transform: translateY(-6px); }
.tile:hover .tile-art::before, .tile:focus-visible .tile-art::before { opacity: .34; }
.tile:active .tile-art { transform: translateY(-2px) scale(.985); }

.tile.locked .tile-art { background: transparent; border: 0; box-shadow: none; }
.tile.locked .tile-art img { filter: grayscale(.72) brightness(.5) contrast(1.06); opacity: .86; }
.tile.locked:hover .tile-art img { filter: grayscale(.25) brightness(.78) contrast(1.04); opacity: 1; }
.tile.locked:hover .tile-art::before { opacity: .22; }
.tile.locked .tile-name { color: var(--soft); }

.tile-count, .tile-new, .tile-deck, .tile-lock { position: absolute; z-index: 2; font-size: 11px; font-weight: 700; }
.tile-count {
  right: 6%;
  top: 5%;
  padding: 2px 7px;
  border-radius: 2px;
  background: #0c0e13eb;
  border: 1px solid #3c445c;
  color: var(--gold-strong);
  font-family: var(--mono);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 10px #000a;
}
.tile-new {
  left: 6%;
  top: 5%;
  padding: 2px 7px;
  border-radius: 2px;
  background: var(--accent);
  color: #fff;
  letter-spacing: .5px;
  box-shadow: 0 3px 10px rgba(255,79,56,.45);
}
.tile-deck {
  left: 6%;
  bottom: 6%;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  background: #0c0e13eb;
  border: 1px solid var(--accent);
  color: #fff;
  box-shadow: 0 4px 10px #000a;
}
.tile-deck svg { width: 13px; height: 13px; }
.tile-lock {
  left: auto;
  top: auto;
  right: 6%;
  bottom: 5.5%;
  transform: none;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 2px;
  background: rgba(12, 14, 19, .9);
  border: 1px solid #353c50;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .2px;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0,0,0,.6);
}
.tile-lock svg { width: 11px; height: 11px; color: var(--muted); }
.tile-meta { display: block; padding: 10px 2px 0; }
.tile-name { display: block; font-family: var(--display); font-weight: 700; font-size: 14px; line-height: 1.25; color: var(--text); letter-spacing: -.015em; }
.tile-sub { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }

.empty {
  text-align: center;
  padding: 56px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: #0d131688;
  color: var(--muted);
}
.empty-mark { display: block; font-size: 34px; color: var(--gold); opacity: .75; line-height: 1; margin-bottom: 12px; }
.empty h3 { font-family: var(--display); font-weight: 600; font-size: 22px; color: var(--text); margin-bottom: 6px; }
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* ---------- Pacotes (Altar de Abertura) ---------- */
.pack-area { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(310px, .82fr); gap: 24px; align-items: stretch; }
.pack-stage {
  position: relative;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background:
    radial-gradient(ellipse 65% 58% at 50% 45%, #1c2233 0%, #11141c 62%, #0c0e13 100%);
  box-shadow: inset 0 0 64px rgba(0,0,0,.65);
  overflow: hidden;
}
.pack-pedestal {
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  border: 1px solid #dfb26728;
  box-shadow: 0 0 0 22px #dfb26709, inset 0 0 0 18px #0b0e1166;
  pointer-events: none;
}
.pack-pedestal::before {
  content: '';
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  border: 1px dashed #dfb26733;
}
.motion-note { font-size: 12px; color: var(--muted); text-align: center; padding: 0 16px; margin-top: -8px; z-index: 1; }
.motion-note .link { text-decoration: underline; text-underline-offset: 3px; }
.pack-hint { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--gold-strong); z-index: 1; }

.pack-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--felt);
}
.pack-panel .muted { max-width: 44ch; }
.pack-facts { width: 100%; display: grid; gap: 0; margin: 8px 0 auto; }
.pack-facts div { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.pack-facts dt { color: var(--muted); white-space: nowrap; }
.pack-facts dd { display: flex; align-items: center; gap: 6px; text-align: right; flex-wrap: wrap; justify-content: flex-end; font-weight: 600; }
.pack-facts small { color: var(--faint); font-size: 12px; font-weight: 500; }
.pack-panel .big { margin-top: 12px; }
.price { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; background: #1a130833; font-variant-numeric: tabular-nums; }
.price .coin { color: var(--ink); }

.notice {
  width: 100%;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid #8a6432;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #2b2113 0%, #1c160e 100%);
}
.notice strong { color: var(--warn); }
.notice p { color: var(--soft); font-size: 13px; margin-top: 6px; }

.odds, .fx-preview {
  margin-top: 22px;
  padding: 22px 24px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--felt);
}
.odds-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 40px; }
.odds-list li { display: grid; grid-template-columns: 136px 1fr 44px; align-items: center; gap: 12px; }
.odds-name { color: var(--soft); white-space: nowrap; font-weight: 500; }
.odds-bar { height: 6px; border-radius: 3px; background: #0a0e10; border: 1px solid var(--line); overflow: hidden; }
.odds-bar i { display: block; height: 100%; width: var(--w); min-width: 4px; border-radius: 3px; background: var(--rarity); }
.odds-list li:last-child .odds-bar i { background: var(--spectrum); }
.odds-list strong { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }

.fx-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.fx-btn {
  min-height: 40px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--rarity) 36%, transparent);
  background: color-mix(in srgb, var(--rarity) 9%, #0d1215);
  color: var(--soft);
  font-size: 13px;
  font-weight: 600;
  transition: background .18s, transform .18s var(--ease), border-color .18s;
}
.fx-btn b { color: var(--rarity); margin-right: 4px; }
.fx-btn:hover { background: color-mix(in srgb, var(--rarity) 18%, #0d1215); transform: translateY(-1px); border-color: var(--rarity); }
.fx-btn.current { border-color: var(--rarity); background: color-mix(in srgb, var(--rarity) 20%, #0d1215); color: var(--text); }
.fx-buttons.compact .fx-btn { min-height: 34px; padding: 0 10px; }
.fx-buttons.compact .fx-btn b { margin: 0; }

/* ---------- Deque (Tabuleiro de Formação) ---------- */
.deck-count {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 12px;
  background: #0d1316;
  border: 1px solid var(--line-strong);
  font-family: var(--display);
  color: var(--muted);
  white-space: nowrap;
}
.deck-count b { font-size: 34px; font-weight: 700; color: var(--text); line-height: 1; }
.deck-count span { font-size: 16px; }
.deck-count.full { border-color: var(--brass-line); background: #211b11; }
.deck-count.full b { color: var(--gold-strong); }

.swap-banner {
  position: sticky;
  top: 80px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  background: linear-gradient(90deg, #2d2314f5 0%, #1c1710f5 100%);
  color: var(--gold-strong);
  box-shadow: 0 12px 28px #000b;
  animation: page-in .25s var(--ease);
}
.swap-banner span { flex: 1; }
.swap-banner b { color: #fff; }

.slots {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  max-width: 1020px;
  padding: 24px 22px;
  margin-bottom: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background:
    radial-gradient(ellipse 75% 85% at 50% 50%, #191e2b 0%, #11141c 75%, #0c0e13 100%);
  box-shadow: inset 0 0 40px rgba(0,0,0,.6);
}
.slot { position: relative; aspect-ratio: 2 / 3; min-width: 0; }
.slot.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px dashed #3e4d54;
  border-radius: 12px;
  background: #0a0f1188;
  box-shadow: inset 0 4px 18px #0009;
  color: var(--faint);
  transition: border-color .18s, color .18s, background .18s, transform .18s var(--ease);
}
.slot-num {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--muted);
  opacity: .55;
}
.slot-plus { font-size: 26px; line-height: 1; font-weight: 300; }
.slot.empty small { font-size: 11px; font-weight: 600; }
.slot.empty:hover { border-color: var(--gold); color: var(--gold-strong); background: #dfb26712; transform: translateY(-2px); }
.slot.empty:hover .slot-num { color: var(--gold); opacity: .9; }

.slot-card { display: block; width: 100%; height: 100%; border-radius: 12px; transition: transform .25s var(--ease); animation: slot-in .35s var(--ease); }
@keyframes slot-in { from { opacity: 0; transform: translateY(10px) scale(.94); } }
.slot-card img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 12px 16px #000a); }
.slot-card:hover { transform: translateY(-5px); }
.slot-remove {
  position: absolute;
  right: -7px;
  top: -7px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #12181bf0;
  border: 1px solid var(--line-strong);
  color: var(--soft);
  box-shadow: 0 4px 10px #000a;
  transition: background .18s, color .18s, transform .18s, border-color .18s;
}
.slot-remove::after { content: ''; position: absolute; inset: -8px; }
.slot-remove svg { width: 14px; height: 14px; }
.slot-remove:hover { background: #5a2826; border-color: #a8524d; color: #ffd4cf; transform: scale(1.08); }
.slot.target .slot-card { animation: target-pulse 1.4s ease-in-out infinite; }
.slot.target .slot-card img { filter: drop-shadow(0 0 12px var(--gold)) brightness(.82); }
@keyframes target-pulse { 50% { transform: translateY(-4px); } }
.slot-swap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 99px;
  background: linear-gradient(180deg, #f4d392, #d4a152);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 6px 16px #000c;
}
.slot-swap svg { width: 14px; height: 14px; }

.pool-grid { grid-template-columns: repeat(auto-fill, minmax(154px, 1fr)); gap: 24px 18px; }
.pool-item { min-width: 0; display: flex; flex-direction: column; }
.pool-card { position: relative; display: block; width: 100%; aspect-ratio: 2 / 3; border-radius: 12px; transition: transform .25s var(--ease); }
.pool-card img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 14px #0009); transition: filter .25s; }
.pool-card:hover { transform: translateY(-5px); }
.pool-item.in-deck .pool-card img { filter: drop-shadow(0 8px 12px #0007) brightness(.52) saturate(.75); }
.pool-item.pending .pool-card img { filter: drop-shadow(0 0 14px var(--gold)); }
.pool-check {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #0c1214e6;
  border: 1.5px solid var(--good);
  color: var(--good);
  box-shadow: 0 6px 16px #000b;
}
.pool-action {
  margin-top: 10px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--brass-line);
  background: #dfb26714;
  color: var(--gold-strong);
  font-size: 13px;
  font-weight: 700;
  transition: background .18s, border-color .18s;
}
.pool-action:hover { background: #dfb26729; border-color: var(--gold); }
.pool-action.on { border-color: #8fd1a659; background: #8fd1a614; color: var(--good); }
.pool-action.on:hover { background: #8fd1a626; }
.pool-action svg { width: 14px; height: 14px; }
.pool-item .tile-meta { flex: 1; }

/* ---------- Diálogos (Mesa de Inspeção) ---------- */
dialog { color: var(--text); }
dialog.modal {
  background: #13161f;
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--accent);
  border-radius: 6px;
  padding: 26px;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  box-shadow: 0 36px 100px rgba(0,0,0,.85);
  overflow: auto;
}
dialog.modal[open] { animation: modal-in .26s var(--ease); }
dialog.modal::backdrop { background: #050709e0; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fade-in .2s; }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  z-index: 2;
  transition: background .18s, color .18s;
}
.dialog-close:hover { background: #ffffff14; color: var(--text); }

.card-dialog { width: 790px; }
.detail { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 34px; align-items: center; }
.detail-art { position: relative; aspect-ratio: 2 / 3; perspective: 900px; }
.detail-art::before { content: ''; position: absolute; inset: 12% 10%; background: var(--rarity); filter: blur(48px); opacity: .34; }
.detail-art img { position: relative; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 20px 26px #000b); transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s var(--ease); }
.detail-art.tilting img { transition: transform .08s linear; }
.glare { position: absolute; inset: 0; opacity: 0; transition: opacity .3s; pointer-events: none; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), #ffffff52, transparent 42%); -webkit-mask: var(--mask) center / 100% 100% no-repeat; mask: var(--mask) center / 100% 100% no-repeat; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); mix-blend-mode: soft-light; }
.detail-art.tilting .glare { opacity: 1; }
.detail.locked .detail-art img { filter: grayscale(1) brightness(.36); }
.detail.locked .detail-art::before { opacity: .08; }
.detail-rarity { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--soft); font-weight: 600; }
.detail-info h2 { font-size: 30px; margin: 10px 0 4px; }
.detail-work { color: var(--gold-strong); font-size: 13px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; margin-bottom: 12px; }
.detail-facts { margin-top: 20px; border-top: 1px solid var(--line); }
.detail-facts div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.detail-facts dt { color: var(--muted); }
.detail-facts dd { font-weight: 600; }
.detail-actions { margin-top: 20px; display: flex; }
.detail-actions > * { flex: 1; }
.dialog-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; color: var(--faint); font-size: 12px; }

.confirm-dialog { width: 440px; }
.confirm-dialog h2 { margin-bottom: 10px; }
.confirm-dialog p { color: var(--soft); }
.dialog-actions { display: flex; gap: 10px; margin-top: 24px; }
.dialog-actions > * { flex: 1; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 40;
  max-width: min(90vw, 460px);
  padding: 12px 20px;
  border-radius: 10px;
  background: rgba(18, 20, 27, .96);
  border: 1px solid var(--line-strong);
  box-shadow: 0 16px 40px #000c;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 14px);
  transition: opacity .22s, transform .22s var(--ease);
  pointer-events: none;
}
#toast.visible { opacity: 1; transform: translate(-50%, 0); }
#toast.good { border-color: #8fd1a673; color: #d8f5e1; }
#toast.warn { border-color: #ebb66a80; color: #ffe5b8; }

/* ---------- Telas médias & paisagem ---------- */
@media (max-width: 980px) {
  :root { --pad: 24px; }
  .header-inner { grid-template-columns: auto 1fr auto; height: 64px; gap: 12px; }
  .brand-sub { display: none; }
  .game-nav { justify-self: center; }
  .game-nav a { padding: 0 12px; }
  .odds-list { gap: 12px 24px; }
}

@media (max-width: 840px) {
  .pack-area { grid-template-columns: 1fr; }
  .pack-stage { min-height: 400px; }
  .odds-list { grid-template-columns: 1fr; }
  .selects { margin-left: 0; width: 100%; }
  .selects select { flex: 1 1 0; min-width: 0; }
}

@media (max-height: 520px) and (min-width: 641px) {
  :root { --pad: 22px; }
  .header-inner { height: 54px; }
  .brand-crest { width: 30px; height: 30px; }
  .brand-name { font-size: 17px; }
  .brand-sub { display: none; }
  .game-nav a { min-height: 34px; padding: 0 12px; font-size: 12px; }
  main { padding-top: 20px; padding-bottom: 28px; }
  .pack-area { grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr); }
  .pack-stage { min-height: 310px; }
  .pack-pedestal { width: 240px; height: 240px; }
  .detail { grid-template-columns: minmax(0, 180px) minmax(0, 1fr); gap: 22px; }
  dialog.modal { padding: 18px 22px; }
  .detail-info h2 { font-size: 22px; margin-top: 6px; }
  .detail-work { margin-bottom: 6px; }
  .detail-facts { margin-top: 10px; }
  .detail-facts div { padding: 6px 0; }
  .detail-actions { margin-top: 12px; }
  .dialog-nav { margin-top: 8px; }
  .swap-banner { top: 62px; }
}

/* ---------- Celular: dock tátil inferior ---------- */
@media (max-width: 640px) {
  :root { --pad: 16px; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .game-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: linear-gradient(180deg, #12181bfa 0%, #0d1215f7 100%);
  }
  .header-inner {
    height: 56px;
    padding-left: max(var(--pad), env(safe-area-inset-left));
    padding-right: max(var(--pad), env(safe-area-inset-right));
    grid-template-columns: auto 1fr;
  }
  .brand-sub { display: none; }
  .brand-name { font-size: 17px; letter-spacing: 1.5px; }
  .brand-crest { width: 32px; height: 32px; }

  .game-nav {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    z-index: 30;
    height: calc(68px + env(safe-area-inset-bottom));
    padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
    border-radius: 0;
    border: 0;
    border-top: 1px solid var(--brass-line);
    background: linear-gradient(180deg, #131a1df5 0%, #0b0f12fa 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 -10px 30px #000b;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .game-nav a {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-height: 0;
    height: 100%;
    padding: 4px 2px;
    font-size: 11px;
    border-radius: 10px;
  }
  .game-nav a.active::after {
    top: -5px;
    bottom: auto;
    left: 26%;
    right: 26%;
  }
  .nav-meta { display: none; }
  .nav-dot { position: absolute; top: 7px; right: calc(50% - 18px); }

  main { padding-top: 20px; padding-bottom: 28px; }
  .page-head { margin-bottom: 16px; align-items: start; }
  .lede { font-size: 13px; }
  .next-step { padding: 12px 14px; font-size: 13px; }
  .toolbar { padding: 10px 12px; gap: 10px; margin-bottom: 20px; }
  .search { max-width: none; flex-basis: 100%; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -2px; padding: 2px; scrollbar-width: none; width: calc(100% + 4px); }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex-shrink: 0; }
  .selects { gap: 6px; }
  .selects select { flex: 1 1 45%; font-size: 12px; padding-left: 10px; padding-right: 24px; background-position: right 8px center; white-space: nowrap; }

  .work { padding: 4px 0 8px; border-radius: 0; }
  .work-head { flex-wrap: wrap; gap: 10px 14px; margin-bottom: 18px; }
  .work-title { flex: 1 1 100%; justify-content: space-between; }
  .work-progress { margin-left: 0; flex: 1; }
  .work-progress i { flex: 1; width: auto; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 18px 12px; }
  .tile-name { font-size: 13px; }

  .pack-stage { min-height: 360px; }
  .pack-pedestal { width: 250px; height: 250px; }
  .pack-panel, .odds, .fx-preview { padding: 20px 16px; border-radius: 16px; }
  .odds-list li { grid-template-columns: 118px 1fr 40px; gap: 10px; }
  .fx-btn { flex: 1 1 30%; padding: 0 8px; }
  .fx-buttons.compact .fx-btn { flex: 0 0 auto; }

  .deck-count { padding: 6px 12px; }
  .deck-count b { font-size: 26px; }
  .slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 16px 10px; margin-bottom: 28px; }
  .slot { width: calc((100% - 24px) / 3); max-width: 126px; }
  .swap-banner { top: 64px; font-size: 13px; }
  .pool-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 18px 12px; }

  .app-footer { font-size: 11px; padding: 16px var(--pad); }
  #toast { bottom: calc(80px + env(safe-area-inset-bottom)); }

  /* Detalhes viram uma folha inferior */
  dialog.card-dialog {
    width: 100vw;
    max-width: 100vw;
    margin: auto 0 0;
    border-radius: 20px 20px 0 0;
    border-width: 1px 0 0;
    padding: 20px 18px calc(16px + env(safe-area-inset-bottom));
    max-height: 92dvh;
  }
  dialog.card-dialog[open] { animation: sheet-in .3s var(--ease); }
  @keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
  .detail { grid-template-columns: 1fr; gap: 16px; }
  .detail-art { width: min(48vw, 27dvh); margin: 0 auto; }
  .detail-info { text-align: center; }
  .detail-rarity { justify-content: center; }
  .detail-info h2 { font-size: 24px; }
  .detail-facts { text-align: left; margin-top: 14px; }
  .dialog-nav span { visibility: hidden; }
  .dialog-nav { margin-top: 10px; }
  .dialog-actions { flex-direction: column-reverse; }
}

@media (max-width: 640px) and (orientation: landscape) {
  dialog.card-dialog { max-height: 100dvh; }
  .detail { grid-template-columns: 150px 1fr; align-items: center; }
  .detail-art { width: 150px; }
  .detail-info { text-align: left; }
  .detail-rarity { justify-content: flex-start; }
}

@media (max-width: 360px) {
  .demo-tag { display: none; }
  .grid, .pool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (hover: none) {
  .tile:hover .tile-art, .slot-card:hover, .pool-card:hover { transform: none; }
  .tile:hover .tile-art::before { opacity: 0; }
}

/* Movimento reduzido: definido pelo sistema ou pela escolha no rodapé (classe aplicada por gacha.js). */
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

/* Evita flash de Visitante/estado deslogado antes da sessão online terminar de hidratar. */
html[data-online-boot="1"] #mode-pill,
html[data-online-boot="1"] #save-status {
  opacity: .55;
  pointer-events: none;
}
.boot-loading-panel {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 28px 20px;
}
.boot-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent, #e4a957);
  box-shadow: 0 0 14px var(--accent, #e4a957);
  animation: bootPulse 1.1s ease-in-out infinite;
}
@keyframes bootPulse {
  0%, 100% { opacity: .35; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1.15); }
}
