/* TRUNFO JDM — visual arcade / neon / garagem */
:root {
  --bg: #07050d;
  --bg2: #12091a;
  --panel: #1b1226;
  --panel2: #261833;
  --line: #3d2b4f;
  --text: #f6eefc;
  --muted: #b3a4c4;
  --pink: #ff2d95;
  --cyan: #00f0ff;
  --gold: #ffcc33;
  --green: #3dff9a;
  --danger: #ff4d6a;
  --shadow: 0 12px 40px rgba(0,0,0,.45);
  --radius: 16px;
  --comum: #9aa3ad;
  --raro: #3d7eff;
  --epico: #b44aff;
  --lendario: #ffb020;
  --mitico: #ff4de1;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: "Outfit", system-ui, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255,45,149,.16), transparent 50%),
    radial-gradient(900px 500px at 0% 100%, rgba(0,240,255,.1), transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100dvh;
}
img.pixel { image-rendering: pixelated; image-rendering: crisp-edges; }
button, .btn {
  font-family: inherit;
  cursor: pointer;
  border: 0;
}
button:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }

#app { min-height: 100dvh; position: relative; }
.crt {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 80;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 2px,
    rgba(0,0,0,.08) 2px 3px
  );
  mix-blend-mode: multiply;
  opacity: .35;
}

.screen { max-width: 1080px; margin: 0 auto; padding: 20px 16px 48px; }
.screen-narrow { max-width: 720px; }

/* HUD */
.hud {
  display: flex; align-items: center; gap: 12px;
  max-width: 1080px; margin: 0 auto 16px; padding: 10px 4px;
}
.hud .brand {
  font-family: "Pixelify Sans", sans-serif;
  letter-spacing: .08em;
  color: var(--cyan);
  flex: 1;
  font-size: 22px;
}
.hud .res { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: #1c1328;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  color: var(--gold);
}
.chip.dust { color: #d7b3ff; }
.icon-btn, .ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
}
.ghost { background: #16101f; }
.icon-btn:hover, .ghost:hover { border-color: var(--cyan); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(180deg, #ff4da8, #c2186a);
  color: white;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  letter-spacing: .02em;
  box-shadow: 0 0 0 1px rgba(255,45,149,.3), 0 8px 24px rgba(255,45,149,.25);
}
.btn:hover { filter: brightness(1.08); }
.btn.cyan {
  background: linear-gradient(180deg, #24f3ff, #0898a8);
  color: #041318;
  box-shadow: 0 0 0 1px rgba(0,240,255,.3), 0 8px 24px rgba(0,240,255,.18);
}
.btn.gold {
  background: linear-gradient(180deg, #ffd65a, #e09a00);
  color: #2a1b00;
  box-shadow: 0 8px 24px rgba(255,204,51,.2);
}
.btn.block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* Title */
.title-screen {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 10px; padding: 32px 16px;
}
.eyebrow {
  color: var(--gold);
  letter-spacing: .28em;
  font-size: 12px;
  text-transform: uppercase;
}
.logo {
  font-family: "Press Start 2P", monospace;
  font-size: clamp(28px, 7vw, 56px);
  line-height: 1.35;
  margin: 8px 0;
  background: linear-gradient(180deg, #fff 8%, #00f0ff 42%, #ff2d95 86%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(255,45,149,.35));
}
.tag { color: var(--muted); max-width: 420px; margin: 0 0 18px; }
.jp {
  font-size: 13px; color: rgba(0,240,255,.45); letter-spacing: .4em;
}

/* Letter / intro */
.letter {
  background: #2a1c14;
  color: #f3d9b0;
  border-radius: 8px;
  padding: 28px 24px;
  box-shadow: var(--shadow);
  position: relative;
  transform: rotate(-.4deg);
}
.letter:before {
  content: "";
  position: absolute; inset: 10px;
  border: 1px solid rgba(243,217,176,.18);
  pointer-events: none;
}
.letter h2 { font-family: "Pixelify Sans", sans-serif; margin: 0 0 12px; color: #ffe0b0; }
.letter p { margin: 0 0 12px; line-height: 1.55; }
.letter .sign { text-align: right; font-style: italic; }

/* Garage scene */
.garage-scene {
  position: relative;
  height: 260px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #2a1c22;
  background: linear-gradient(#0a070e 0 58%, #1a120e 58% 100%);
  box-shadow: inset 0 0 80px rgba(0,0,0,.55), var(--shadow);
}
.garage-scene.lit {
  background: linear-gradient(#1a1430 0 58%, #3a2618 58% 100%);
}
.garage-scene.neon {
  box-shadow: inset 0 -40px 80px rgba(255,45,149,.12), 0 0 30px rgba(0,240,255,.08);
}
.gs-ceiling {
  position: absolute; top: 0; left: 0; right: 0; height: 18px;
  background: #0b0810;
}
.gs-bulb {
  position: absolute; top: 16px; width: 22px; height: 10px; border-radius: 0 0 10px 10px;
  background: #2a2410; opacity: .5;
}
.garage-scene.lit .gs-bulb {
  background: #ffe08a;
  box-shadow: 0 18px 40px rgba(255, 220, 120, .35);
  opacity: 1;
}
.gs-neon {
  position: absolute; top: 36px; left: 8%; right: 8%; height: 5px;
  background: linear-gradient(90deg, var(--pink), var(--cyan));
  box-shadow: 0 0 12px var(--pink), 0 0 18px var(--cyan);
  animation: flicker 3.4s infinite;
}
.gs-posters {
  position: absolute; top: 50px; left: 16px; display: flex; gap: 8px;
}
.gs-posters span {
  width: 42px; height: 58px; border: 2px solid #111;
  box-shadow: 0 6px 0 rgba(0,0,0,.3);
}
.gs-lift {
  position: absolute; right: 28px; bottom: 38%;
  width: 90px; height: 78px;
  border: 4px solid #5a6570;
  border-bottom: 0;
  box-shadow: 0 0 0 2px #222;
}
.gs-lift:after {
  content: "";
  position: absolute; left: 10px; right: 10px; top: 18px; height: 16px;
  background: #8a94a0;
}
.gs-box {
  position: absolute; bottom: 18%; left: 18px;
  width: 36px; height: 28px;
  background: linear-gradient(#c62828, #8e0000);
  border: 2px solid #3b0000;
}
.gs-machine {
  position: absolute; bottom: 18%; right: 140px;
  width: 44px; height: 70px;
  background: linear-gradient(#2a1840, #12081c);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 12px rgba(0,240,255,.3);
}
.gs-vitrine {
  position: absolute; top: 56px; right: 24px;
  width: 70px; height: 50px;
  background: rgba(0,240,255,.08);
  border: 2px solid #7a8;
  box-shadow: inset 0 0 12px rgba(0,240,255,.2);
}
.gs-bench {
  position: absolute; bottom: 16%; left: 70px;
  width: 64px; height: 18px;
  background: #5d4037;
  border-top: 4px solid #8d6e63;
}
.gs-floor-line {
  position: absolute; left: 0; right: 0; top: 58%;
  height: 2px; background: rgba(255,255,255,.06);
}
.gs-cars {
  position: absolute; left: 16%; right: 16%; bottom: 10%;
  display: flex; justify-content: center; gap: 10px;
  align-items: flex-end;
}
.gs-cars img { height: 52px; width: auto; filter: drop-shadow(0 8px 0 rgba(0,0,0,.35)); }
.gs-empty {
  position: absolute; left: 0; right: 0; top: 0;
  display: flex; align-items: flex-start; justify-content: center;
  color: var(--muted); text-align: center; padding: 48px 24px 0;
  text-shadow: 0 2px 8px #000;
  pointer-events: none;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: .45; }
  95% { opacity: 1; }
}

.hub-title { margin: 18px 0 6px; font-family: "Pixelify Sans", sans-serif; font-size: 28px; }
.hub-sub { color: var(--muted); margin: 0 0 16px; }
.hub-nav { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px) { .hub-nav { grid-template-columns: repeat(4, 1fr); } }
.hub-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  text-align: left;
  color: inherit;
  min-height: 110px;
  box-shadow: var(--shadow);
}
.hub-card:hover { border-color: var(--cyan); transform: translateY(-2px); }
.hub-card b { display: block; font-size: 18px; margin-bottom: 6px; }
.hub-card span { color: var(--muted); font-size: 13px; }
.pack-alert {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255,204,51,.08);
  border: 1px dashed var(--gold);
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.card {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.card header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; letter-spacing: .12em; font-weight: 700;
  margin-bottom: 6px;
}
.card .art {
  position: relative;
  height: 84px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 80%, rgba(255,255,255,.07), transparent 60%),
              repeating-linear-gradient(90deg, #14101c 0 8px, #100c16 8px 16px);
  border-radius: 8px;
  overflow: hidden;
}
.card .art img { height: 72px; width: auto; max-width: 100%; }
.card h3 { margin: 8px 0 0; font-size: 15px; line-height: 1.25; }
.card .meta { margin: 2px 0 8px; color: var(--muted); font-size: 12px; }
.attrs { display: grid; gap: 4px; }
.attr {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%;
  background: #120c1a;
  color: var(--text);
  border: 1px solid #2c2238;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 13px;
  text-align: left;
}
.attr b { font-variant-numeric: tabular-nums; }
.attr .buffed { color: var(--green); }
.attr:not(:disabled):hover { border-color: var(--cyan); }
.attr.on, .attr.win { border-color: var(--green); background: rgba(61,255,154,.08); }
.attr.lose { border-color: var(--danger); background: rgba(255,77,106,.08); }

.card.rarity-comum { border-color: var(--comum); }
.card.rarity-raro { border-color: var(--raro); box-shadow: 0 0 16px rgba(61,126,255,.18); }
.card.rarity-epico { border-color: var(--epico); box-shadow: 0 0 18px rgba(180,74,255,.22); }
.card.rarity-lendario { border-color: var(--lendario); box-shadow: 0 0 20px rgba(255,176,32,.22); }
.card.rarity-mitico {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    linear-gradient(120deg, #ff4d8d, #7c5cff, #00e5ff, #ffe14d, #ff4d8d) border-box;
  background-size: auto, 300% 300%;
  animation: holoShift 5s linear infinite;
  box-shadow: 0 0 24px rgba(255,77,225,.35);
}
.card.rarity-mitico .art:after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.4) 48%, transparent 66%);
  background-size: 220% 100%;
  animation: shimmer 2.8s ease-in-out infinite;
  mix-blend-mode: screen;
  pointer-events: none;
}
@keyframes holoShift {
  0% { background-position: 0 0, 0% 50%; }
  100% { background-position: 0 0, 100% 50%; }
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.rarity-pill {
  padding: 2px 6px; border-radius: 999px;
}
.rarity-comum .rarity-pill { color: var(--comum); }
.rarity-raro .rarity-pill { color: var(--raro); }
.rarity-epico .rarity-pill { color: var(--epico); }
.rarity-lendario .rarity-pill { color: var(--lendario); }
.rarity-mitico .rarity-pill { color: #fff; }

.card-back {
  min-height: 340px;
  background:
    repeating-linear-gradient(45deg, #1a0e24 0 10px, #14091c 10px 20px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 2px solid var(--pink);
}
.card-back .mark {
  font-family: "Press Start 2P", monospace;
  font-size: 14px; color: var(--cyan); text-align: center; line-height: 1.6;
}
.card.missing { filter: grayscale(.2); opacity: .7; }
.card.missing .art img { filter: brightness(0) opacity(.35); }
.card.picked { outline: 2px solid var(--cyan); transform: translateY(-4px); }
.card.small { padding: 8px; }
.card.small .art { height: 60px; }
.card.small .attrs { display: none; }

/* Battle */
.battle-top {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
}
.battle {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: start;
}
.vs {
  align-self: center;
  font-family: "Press Start 2P", monospace;
  font-size: 16px;
  color: var(--pink);
  text-shadow: 0 0 12px rgba(255,45,149,.6);
  padding-top: 80px;
}
.pile { color: var(--muted); font-size: 13px; }
.combos { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.combo-chip {
  background: rgba(0,240,255,.08);
  border: 1px solid rgba(0,240,255,.25);
  color: var(--cyan);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}
.banner {
  margin: 14px 0;
  padding: 12px 16px;
  border-radius: 12px;
  text-align: center;
  font-weight: 700;
}
.banner.win { background: rgba(61,255,154,.12); color: var(--green); }
.banner.lose { background: rgba(255,77,106,.12); color: var(--danger); }
.banner.tie { background: rgba(255,204,51,.12); color: var(--gold); }
.banner.info { background: rgba(0,240,255,.08); color: var(--cyan); }

@media (max-width: 760px) {
  .battle { grid-template-columns: 1fr; }
  .vs { padding: 4px 0; text-align: center; }
}

/* Shop / lists */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tab {
  background: #16101f; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px;
}
.tab.on { color: #041318; background: var(--cyan); border-color: var(--cyan); }
.shop-list { display: grid; gap: 12px; }
.shop-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
.shop-item img { width: 48px; height: 48px; }
.shop-item h3 { margin: 0 0 4px; font-size: 16px; }
.shop-item p { margin: 0; color: var(--muted); font-size: 13px; }
.emoji-ic {
  width: 48px; height: 48px; display: grid; place-items: center;
  font-size: 28px; background: #120c1a; border-radius: 10px;
}

/* Campaign */
.route { display: grid; gap: 12px; position: relative; }
.route:before {
  content: "";
  position: absolute; left: 27px; top: 20px; bottom: 20px;
  width: 3px; background: linear-gradient(var(--cyan), var(--pink));
  opacity: .4;
}
.stage {
  display: grid; grid-template-columns: 56px 1fr auto;
  gap: 12px; align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  position: relative;
}
.stage .dot {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: #120c1a; border: 2px solid var(--cyan);
  font-weight: 700;
}
.stage.locked { opacity: .5; }
.stage.won { border-color: rgba(61,255,154,.4); }
.stage h3 { margin: 0 0 4px; }
.stage p { margin: 0; color: var(--muted); font-size: 13px; }

/* Deck */
.deck-bar {
  position: sticky; bottom: 0;
  background: rgba(7,5,13,.92);
  backdrop-filter: blur(8px);
  padding: 12px 0;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}

/* Pack open */
.pack-row {
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
}
.pack-card { width: min(220px, 100%); }
.dupe {
  margin-top: 6px; font-size: 12px; color: #d7b3ff;
}
.new-tag { color: var(--green); font-size: 12px; font-weight: 700; }

/* Help / overlay */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.7);
  display: grid; place-items: center;
  padding: 16px;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  max-width: 560px; width: 100%;
  box-shadow: var(--shadow);
}
.modal h2 { margin-top: 0; font-family: "Pixelify Sans", sans-serif; }
.modal li { margin: 0 0 8px; color: var(--muted); }

.toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: 70;
  display: grid; gap: 8px;
}
.toast {
  background: #1c1328;
  border: 1px solid var(--gold);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
}

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.progress-bar {
  height: 8px; background: #120c1a; border-radius: 99px; overflow: hidden; margin: 8px 0 16px;
}
.progress-bar > i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--pink));
}

.ach-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.ach {
  font-size: 12px; padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}
.ach.on { border-color: var(--gold); color: var(--gold); }

.result-hero { text-align: center; padding: 24px 8px; }
.result-hero h1 {
  font-family: "Press Start 2P", monospace;
  font-size: clamp(18px, 5vw, 28px);
  line-height: 1.5;
}
.muted { color: var(--muted); }
.center { text-align: center; }
