/* tcg.css — shared styles for the whole /tcg lane (The Cold Forge).
   Inherits minkforge.dev site tokens; adds a gold "forge" sub-brand.
   Every /tcg page links ONLY this stylesheet + its own inline page CSS. */

:root {
  /* site tokens (kept in sync with site/index.html) */
  --bg: #14110e; --panel: #1e1a16; --panel-2: #26201b; --line: #332a22;
  --ink: #e8e2d8; --muted: #8a7f72; --dim: #5c5348;
  --ember: #ff7a2f; --ember-soft: #ffb27a; --good: #6fbf73;
  /* TCG sub-brand: forged gold */
  --gold: #c99a3f; --gold-soft: #e6c67a;
  /* rarity accents (match card_forge.py RARITY_COLORS) */
  --r-common: #9b9b9b; --r-uncommon: #6ebe8c; --r-rare: #78a0e6; --r-mythic: #eba03c;
  --r: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(120% 80% at 50% -10%, #241a12 0%, var(--bg) 55%) fixed,
    var(--bg);
  color: var(--ink);
  font: 15px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--ember-soft); text-decoration: none; }
a:hover { color: var(--ember); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; }

/* visible keyboard focus on this dark bg (site convention) */
a:focus-visible, button:focus-visible, .card:focus-visible,
.thumb:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--ember); outline-offset: 3px; border-radius: 8px;
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
      transition-duration: .01ms !important; }
}

/* ---------- shared /tcg nav ---------- */
.tcg-nav {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  background: linear-gradient(#1a150f, #14110e);
  position: sticky; top: 0; z-index: 20;
}
.tcg-nav .logo {
  font: bold 18px Georgia; color: var(--gold); letter-spacing: 2px;
  margin-right: 14px; text-shadow: 0 0 20px rgba(201,154,63,.35);
}
.tcg-nav a {
  color: var(--muted); padding: 8px 14px; border-radius: 9px; font-weight: 600;
  min-height: 40px; display: inline-flex; align-items: center;
}
.tcg-nav a:hover { color: var(--ink); background: var(--panel); }
.tcg-nav a.on { color: var(--gold); background: var(--panel-2); }
.tcg-nav .spacer { flex: 1; }

/* ---------- buttons ---------- */
.btn {
  background: linear-gradient(#2a2218, #1a140e); color: var(--gold);
  border: 2px solid var(--gold); border-radius: 12px; padding: 12px 28px;
  font: bold 17px Georgia; cursor: pointer; min-height: 44px;
}
.btn:hover { background: #3a2e1c; box-shadow: 0 0 24px rgba(201,154,63,.35); }
.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn.ghost {
  background: none; border: 1px solid var(--line); color: var(--muted);
  font: 14px Georgia; padding: 9px 16px; min-height: 40px;
}
.btn.ghost:hover { color: var(--ink); background: var(--panel); box-shadow: none; }
.btn.ember { color: var(--ember-soft); border-color: var(--ember); }

/* ---------- card primitive (thumb by default; full art in lightbox) ---------- */
.card {
  position: relative; aspect-ratio: 822 / 1122; border-radius: 10px;
  overflow: hidden; background: var(--panel); border: 2px solid transparent;
  cursor: pointer; display: block; width: 100%;
}
.card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card.common { border-color: var(--r-common); }
.card.uncommon { border-color: var(--r-uncommon); }
.card.rare { border-color: var(--r-rare); }
.card.mythic { border-color: var(--r-mythic); box-shadow: 0 0 22px rgba(235,160,60,.4); }
.card .cnt {
  position: absolute; bottom: 6px; right: 6px; background: #000a; color: var(--gold);
  font: bold 12px Georgia; padding: 1px 7px; border-radius: 8px;
}
.card .tag {
  position: absolute; top: 6px; left: 6px; font: bold 11px Georgia;
  padding: 2px 7px; border-radius: 6px; z-index: 3;
}
.card .tag.new { background: var(--gold); color: #14100a; }
.card .tag.dupe { background: #3a3226; color: #9a8a6a; }

/* intrinsic-grid responsiveness (site convention) */
.card-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

/* silhouette for unowned binder slots */
.card.unowned img { filter: brightness(.08) saturate(0); opacity: .75; }
.card.unowned::after {
  content: "?"; position: absolute; inset: 0; display: grid; place-items: center;
  color: #3a3226; font: bold 40px Georgia;
}

/* ---------- lightbox (data-attr + IIFE pattern, site convention) ---------- */
.lb-backdrop {
  position: fixed; inset: 0; background: #000c; z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.lb-backdrop.open { display: flex; }
.lb-backdrop img { max-width: min(92vw, 520px); max-height: 92vh; border-radius: 14px;
  box-shadow: 0 20px 80px #000; }

/* ---------- 3D tilt (featured cards; disabled under reduced-motion) ---------- */
.tilt { transform-style: preserve-3d; transition: transform .15s ease-out; }

/* ---------- screen shake (fx.js adds .shake) ---------- */
.shake { animation: tcg-shake .5s; }
@keyframes tcg-shake {
  0%, 100% { transform: none; }
  20% { transform: translate(-8px, 4px) rotate(-.4deg); }
  40% { transform: translate(7px, -5px) rotate(.4deg); }
  60% { transform: translate(-5px, 3px); }
  80% { transform: translate(4px, -2px); }
}

/* ---------- rarity halos (pack flip + featured) ---------- */
.halo-mythic { box-shadow: 0 0 44px #eba03c, 0 0 90px rgba(235,160,60,.5); }
.halo-rare { box-shadow: 0 0 30px #78a0e6; }
.halo-uncommon { box-shadow: 0 0 18px #6ebe8c; }

/* ---------- misc ---------- */
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.gold { color: var(--gold); }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin: 20px 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 20px; font: 12px Georgia;
  border: 1px solid var(--line); color: var(--muted); }
