/* Learn CTCG - shared styles. Fluid layout, dark Night City look. */
:root {
  --bg: #08080d;
  --panel: #10101a;
  --card: #151520;
  --hi: #1d1d2a;
  --line: #272736;
  --line-hi: #3b3b52;
  --text: #ececf2;
  --dim: #9a9aab;
  --faint: #6b6b7d;
  --yellow: #f5e400;
  --yellow-dim: #b8ab00;
  --cyan: #1de1e1;
  --red: #ff4d5e;
  --green: #45e08a;
  --purple: #b06bff;

  --c-red: #e8465a;
  --c-blue: #3d8bfd;
  --c-green: #3ecf6e;
  --c-yellow: #e8c93a;

  --t-legend: #ffb833;
  --t-unit: #4da6ff;
  --t-gear: #ff9f43;
  --t-program: #b06bff;

  --eddie: #f5e400;

  --page-max: 1600px;
  --gutter: clamp(16px, 3.4vw, 40px);
  --radius: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --head: "Rajdhani", "Segoe UI", sans-serif;
  --body: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --cut: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  color: var(--text); font: 16px/1.6 var(--body); background: transparent;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(29, 225, 225, .08), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(245, 228, 0, .06), transparent 60%),
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 100% 48px,
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 48px 100%;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.15; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; }
strong { color: #fff; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

main { width: 100%; max-width: var(--page-max); margin: 0 auto; padding: 28px var(--gutter) 64px; flex: 1; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8, 8, 13, .82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
/* neon edge under the header: yellow fading into cyan */
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(245, 228, 0, .7) 20%, rgba(29, 225, 225, .55) 80%, transparent);
}
.header-inner {
  max-width: var(--page-max); margin: 0 auto; padding: 10px var(--gutter);
  display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font: 700 1.35rem/1 var(--head); letter-spacing: .05em; white-space: nowrap; text-transform: uppercase; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; flex: none; filter: drop-shadow(0 0 10px rgba(245, 228, 0, .28)); transition: transform .25s var(--ease), filter .25s; }
.brand-mark .bm-chip { fill: var(--yellow); }
.brand-mark .bm-glyph { fill: var(--bg); }
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.06); filter: drop-shadow(0 0 14px rgba(245, 228, 0, .5)); }
.brand b { color: var(--yellow); font-weight: 700; }
.brand.small { font-size: 1rem; gap: 8px; color: var(--dim); }
.brand.small .brand-mark { width: 22px; height: 22px; filter: none; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a {
  color: var(--dim); padding: 6px 10px; border-radius: 6px; font: 600 1rem var(--head); letter-spacing: .03em; white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--hi); text-decoration: none; }
.nav a.active { color: var(--yellow); }
.nav a, .nav-btn { position: relative; }
.nav a.active::after, .nav-btn.active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 1px; height: 2px; background: var(--yellow);
  box-shadow: 0 0 8px rgba(245, 228, 0, .6);
}
.nav-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; cursor: pointer;
  color: var(--dim); padding: 6px 10px; border-radius: 6px; font: 600 1rem var(--head); letter-spacing: .03em; white-space: nowrap;
}
.nav-btn:hover, .nav-btn[aria-expanded="true"] { color: var(--text); background: var(--hi); }
.nav-btn.active { color: var(--yellow); }
.nav-btn i { width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
.nav-btn[aria-expanded="true"] i { transform: translateY(1px) rotate(-135deg); }
.nav-menu {
  position: fixed; z-index: 60; min-width: 240px; padding: 6px; display: grid; gap: 2px;
  background: var(--panel); border: 1px solid var(--line-hi); border-radius: 10px; box-shadow: 0 16px 40px rgba(0,0,0,.55);
}
.nav-menu[hidden] { display: none; }
.nav-menu a { display: block; padding: 8px 10px; border-radius: 7px; color: var(--text); }
.nav-menu a:hover { background: var(--hi); text-decoration: none; }
.nav-menu a b { display: block; font: 700 1rem var(--head); letter-spacing: .03em; }
.nav-menu a small { display: block; color: var(--dim); font-size: .82rem; }
.nav-menu a.active b { color: var(--yellow); }

.wallet {
  display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 8px; border: 1px solid var(--line-hi);
  background: var(--panel); border-radius: 999px; color: var(--text); white-space: nowrap;
}
.wallet:hover { border-color: var(--eddie); text-decoration: none; }
.wallet .amt { font: 700 1.05rem var(--head); color: var(--eddie); min-width: 2ch; }
.wallet .rank { font: 600 .82rem var(--head); color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.wallet.bump { animation: bump .5s var(--ease); }
@keyframes bump { 40% { transform: scale(1.12); border-color: var(--eddie); } }

.eddie-icon { width: 18px; height: 18px; flex: none; display: inline-block; object-fit: contain; transform: scale(1.35); }

@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; gap: 8px 12px; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; margin: 0 -6px; }
  .wallet .rank { display: none; }
  .brand { flex: 1; }
}

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); color: var(--faint); font-size: .85rem; }
.site-footer .inner { max-width: var(--page-max); margin: 0 auto; padding: 22px var(--gutter); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; justify-content: space-between; }

/* ---------- common bits ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  padding: 11px 20px; border: 0; background: var(--yellow); color: #000;
  font: 700 1.05rem var(--head); letter-spacing: .05em; text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  transition: filter .15s, transform .15s;
}
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: var(--line-hi); color: var(--faint); cursor: default; filter: none; }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-hi); clip-path: none; border-radius: 6px; }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--cyan); color: var(--cyan); }
.btn.small { padding: 7px 14px; font-size: .92rem; }
.btn.cyan { background: var(--cyan); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line-hi); font: 600 .85rem var(--head); letter-spacing: .04em; color: var(--dim); background: var(--card);
}
.chip.eddie { color: var(--eddie); border-color: rgba(245, 228, 0, .35); }
.chip.done { color: var(--green); border-color: rgba(69, 224, 138, .4); }
.kicker { font: 700 .85rem var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); margin-bottom: 6px; }
.dim { color: var(--dim); }
.center { text-align: center; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }

/* inline game terms */
/* Keyword badges: the official SVGs as-is, sized like the Eddies tracker (1.1em high, natural width). */
.kw { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; white-space: nowrap; margin: 0 1px; line-height: 1; }
.kw img { height: 1.1em; width: auto; max-width: none; flex: none; display: inline-block; }
.kw small { font: 700 .82em var(--head); letter-spacing: .05em; text-transform: uppercase; color: var(--dim); }
.term { border-bottom: 1px dashed var(--cyan); cursor: help; color: inherit; }
.cardref { color: var(--yellow); border-bottom: 1px dotted var(--yellow-dim); cursor: zoom-in; }
.eur { font-weight: 700; color: var(--yellow); white-space: nowrap; }
.tagword { font-weight: 700; letter-spacing: .03em; }

.tip {
  position: fixed; z-index: 200; max-width: 300px; padding: 10px 12px; border-radius: 8px; pointer-events: none;
  background: #0d0d16; border: 1px solid var(--cyan); box-shadow: 0 10px 30px rgba(0,0,0,.6); font-size: .9rem; line-height: 1.45;
}
.tip b { display: block; font-family: var(--head); color: var(--cyan); font-size: 1rem; margin-bottom: 2px; }
.card-pop { position: fixed; z-index: 200; width: 260px; pointer-events: none; border-radius: 12px; overflow: hidden; box-shadow: 0 16px 40px rgba(0,0,0,.7); }

/* ---------- toast ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; background: #0e0e18; border: 1px solid var(--eddie);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: toastIn .35s var(--ease); font-weight: 600;
}
.toast .plus { font: 700 1.15rem var(--head); color: var(--eddie); }
.toast.badge { border-color: var(--cyan); }
.toast.badge .plus { color: var(--cyan); }
.toast.out { opacity: 0; transform: translateY(8px); transition: .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } }

/* ---------- modal ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,.78); display: grid; place-items: center; padding: 16px;
  animation: fade .2s;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(960px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line-hi);
  border-radius: 14px; position: relative;
}
.modal-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-hi); background: var(--card); cursor: pointer; font-size: 1.2rem; z-index: 2; }
.modal-close:hover { border-color: var(--cyan); }

/* card detail (modal + library) */
.card-detail { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 24px; padding: 24px; }
.card-detail .art img { border-radius: 14px; width: 100%; }
.card-detail h2 { margin-bottom: 2px; }
.card-detail .sub { color: var(--dim); font: 600 1.1rem var(--head); margin-bottom: 12px; }
.stat-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.rules-text { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; white-space: pre-line; }
.rules-text .kw { margin-right: 2px; }
.read-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.read-list li { display: grid; grid-template-columns: 110px 1fr; gap: 10px; font-size: .93rem; }
.read-list li b { font-family: var(--head); color: var(--cyan); letter-spacing: .03em; }
[data-card-check] { margin-bottom: 20px; }
.faq-list details { border-top: 1px solid var(--line); padding: 8px 0; }
.faq-list summary { cursor: pointer; font-weight: 600; }
.faq-list p { color: var(--dim); margin: 6px 0 0; }
@media (max-width: 700px) {
  .card-detail { grid-template-columns: 1fr; padding: 18px; }
  .card-detail .art { max-width: 280px; margin: 0 auto; }
  .read-list li { grid-template-columns: 1fr; gap: 0; }
}

/* color + type dots */
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.c-Red { --c: var(--c-red); } .c-Blue { --c: var(--c-blue); } .c-Green { --c: var(--c-green); } .c-Yellow { --c: var(--c-yellow); }
.dot[class*="c-"] { background: var(--c); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .site-footer, .toasts { display: none; }
  body::before { display: none; }
  html, body { background: #fff; color: #000; }
}

/* text-style button (Skip, Show more, Reset all progress) */
.link-btn { background: none; border: 0; padding: 0; color: var(--faint); cursor: pointer; text-decoration: underline; font: inherit; font-size: .9rem; }
.link-btn:hover { color: var(--dim); }
