/* Basic typography and layout suitable for web and EPUB */

/* Skip-to-content link — visible only on keyboard focus */
.skip-to-content {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 10000;
  background: var(--accent-orange, #ff9f43);
  color: #000;
  padding: 8px 16px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 6px 0;
}
.skip-to-content:focus {
  position: fixed;
  left: 0;
  top: 0;
  width: auto;
  height: auto;
  overflow: visible;
}

:root {
  /* Palette mixing your profile dark + Blender dark UI */
  --bg: #0b0e11;            /* near-black */
  --surface: #12151a;       /* panel background */
  --border: #1e232b;        /* subtle borders */
  --fg: #e6e9ef;            /* text */
  --muted: #a8b0bf;         /* secondary text */
  --accent-blue: #1d9bf0;   /* X blue */
  --accent-orange: #ff9f43; /* Blender orange */

  /* ── Y2K / Motocross / TCG Energy palette ── */
  --dg-blue: #1a6fff;
  --dg-blue-glow: rgba(26,111,255,0.5);
  --dg-blue-dim: rgba(26,111,255,0.15);
  --dg-orange: #ff6a1a;
  --dg-orange-glow: rgba(255,106,26,0.5);
  --dg-orange-dim: rgba(255,106,26,0.15);
  --signal-lime: #8dff1e;
  --signal-yellow: #efff37;
  --signal-ink: #0d1007;
  --dg-chrome: linear-gradient(135deg, #e8e8e8, #888, #e8e8e8);
  --dg-y2k-dark: #0a0e14;
  --dg-y2k-accent: #00e5ff;

  /* Carbon fiber (CSS-only, no external texture files required) */
  --carbon-bg-top: #0b0e11;
  --carbon-bg-bottom: #05070a;
  --carbon-thread-hi: rgba(255,255,255,0.055);
  --carbon-thread-lo: rgba(0,0,0,0.35);
  --carbon-panel-tint: rgba(18,21,26,0.92);
  --carbon-panel-shadow: rgba(0,0,0,0.55);
  --carbon-weave:
    repeating-linear-gradient(45deg, var(--carbon-thread-hi) 0 2px, rgba(0,0,0,0) 2px 6px),
    repeating-linear-gradient(-45deg, var(--carbon-thread-lo) 0 2px, rgba(0,0,0,0) 2px 6px);
  --carbon-grid:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 24px);
  --carbon-panel:
    linear-gradient(180deg, var(--carbon-panel-tint), rgba(11,14,17,0.92));

  /* RetopoFlow-style blue to violet gradients */
  --rf-cyan: #20d0f4;
  --rf-sky: #29b9ff;
  --rf-blue: #1f74ff;
  --rf-indigo: #2a1fa0;
  --rf-violet: #1a0a5d;
  --rf-deep: #0b0328;
  --rf-gradient-main: linear-gradient(180deg, var(--rf-sky) 0%, var(--rf-blue) 28%, var(--rf-indigo) 64%, var(--rf-deep) 100%);
  --rf-gradient-panel: linear-gradient(145deg, rgba(41,185,255,0.2) 0%, rgba(31,116,255,0.14) 32%, rgba(42,31,160,0.22) 70%, rgba(11,3,40,0.75) 100%);
  --rf-gradient-hero: linear-gradient(180deg, #1a8fd4 0%, #1658c4 30%, #133d99 66%, #071d54 100%);
  --rf-gradient-section: linear-gradient(135deg, rgba(44,200,255,0.24) 0%, rgba(36,123,255,0.18) 34%, rgba(43,41,155,0.28) 68%, rgba(21,5,68,0.8) 100%);
  --rf-gradient-subtle: linear-gradient(145deg, rgba(44,200,255,0.12) 0%, rgba(36,123,255,0.1) 40%, rgba(43,41,155,0.16) 72%, rgba(21,5,68,0.58) 100%);

  /* Blender Workspace palette (training cards) */
  --bw-panel:    #303030;
  --bw-surface:  #383838;
  --bw-input:    #1d1d1d;
  --bw-widget:   #545454;
  --bw-outline:  #3d3d3d;
  --bw-out:      #3d3d3d;
  --bw-out-t:    #4a4a4a;
  --bw-muted:    #9a9a9a;
  --bw-text:     #e6e6e6;
  --bw-text-dim: #989898;
  --bw-active:   #ffa028;
  --bw-select:   #ed5700;
  --bw-blue:     #4772b3;
  --bw-green:    #7ac943;
  --bw-red:      #e03030;
  --bw-radius:   6px;
}

.dg-retopo-gradient-bg {
  background: var(--rf-gradient-main);
}

.dg-retopo-gradient-panel {
  background: var(--rf-gradient-panel);
}

.dg-retopo-hero {
  background: var(--rf-gradient-hero);
}

.dg-retopo-section {
  background: var(--rf-gradient-section);
}

.dg-retopo-subtle {
  background: var(--rf-gradient-subtle);
}

/* ── Hero Carousel ── */
.hero-carousel {
  position: relative;
  width: calc(100% + 48px);
  margin-left: -24px;
  margin-bottom: clamp(40px, 7vw, 96px);
  overflow: hidden;
  min-height: 360px;
}
.hero-slides {
  position: relative;
  width: 100%;
  min-height: 360px;
}
.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
  z-index: 0;
}
.hero-slide.active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}
.hero-slide-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-slide-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--carbon-weave);
  background-size: 10px 10px;
  opacity: 0.15;
  pointer-events: none;
}

/* Slide backgrounds */
.hero-slide-gradient {
  background: var(--rf-gradient-hero);
}
.hero-slide-blender {
  background:
    linear-gradient(180deg, rgba(10,14,20,0.4) 0%, rgba(10,14,20,0.7) 100%),
    url('hero-blender.jpg') center/cover no-repeat;
  /* Fallback if no image yet */
  background-color: #1a1e28;
}
.hero-slide-nodes {
  background:
    linear-gradient(180deg, rgba(8,3,28,0.5) 0%, rgba(20,8,50,0.8) 100%),
    url('hero-nodes.jpg') center/cover no-repeat;
  background-color: var(--rf-indigo);
}

/* Overlay stays the same per slide */
.hero-banner-overlay {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 48px 24px;
  max-width: 700px;
}
.hero-banner-overlay h1 {
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  line-height: 1.05;
  margin: 0 0 12px;
  background: linear-gradient(180deg, #ffd59a 0%, #ff9f43 45%, #c76f20 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 8px rgba(255,159,67,0.45)) drop-shadow(0 0 32px rgba(26,111,255,0.3));
}
.hero-banner-overlay p {
  color: rgba(255,255,255,0.88);
  font-size: 1.1rem;
  margin: 0 0 24px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.hero-slide .actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Carousel dots */
.hero-carousel-dots {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 6px;
}
.hero-dot {
  width: 28px;
  height: 6px;
  border: none;
  border-radius: 0;
  background: rgba(255,255,255,0.18);
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, opacity 0.2s;
}
.hero-dot.active {
  background: var(--dg-orange);
}
.hero-dot:hover { background: rgba(255,255,255,0.45); }
.hero-dot.active:hover { background: var(--dg-orange); }

/* Progress bar */
.hero-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.08);
  z-index: 10;
}
.hero-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--dg-orange), var(--dg-blue));
  transition: width 0.3s linear;
}

/* Race stripe divider */
.race-stripe {
  height: 4px;
  margin: 32px auto;
  max-width: 720px;
  background: repeating-linear-gradient(
    90deg,
    var(--dg-orange) 0 20px,
    transparent 20px 28px,
    var(--dg-blue) 28px 48px,
    transparent 48px 56px
  );
  border-radius: 2px;
  opacity: 0.7;
}

/* Buttons — Motocross / Racing / Y2K */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 4px;
  font-family: 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', sans-serif;
  font-weight: 400;
  font-size: 1rem;
  font-style: italic;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease, border-color 0.2s ease;
  cursor: pointer;
  border: none;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.btn:hover { transform: translateY(2px); }
.btn:active { transform: translateY(3px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; filter: none; }
.btn-primary {
  background: linear-gradient(180deg, #ffc46b 0%, #ff8a1a 40%, #e85d00 100%);
  color: #000;
  border: none;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.45),
    inset 0 -2px 0 rgba(0,0,0,0.2),
    0 4px 14px rgba(255,106,26,0.35);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #c45400 0%, #e06800 35%, #ff9a3a 70%, #ffb860 100%);
  box-shadow:
    inset 0 3px 6px rgba(0,0,0,0.5),
    inset 0 1px 2px rgba(0,0,0,0.3),
    inset 0 -1px 0 rgba(255,255,255,0.15),
    0 1px 2px rgba(0,0,0,0.2);
  transform: translateY(2px);
  filter: brightness(0.92) contrast(1.05);
  color: rgba(0,0,0,0.75);
  text-shadow: 0 -1px 0 rgba(255,255,255,0.15);
}
.btn-primary:active {
  background: linear-gradient(180deg, #a84800 0%, #c45a00 40%, #e88030 80%, #f0a050 100%);
  box-shadow:
    inset 0 4px 8px rgba(0,0,0,0.6),
    inset 0 2px 3px rgba(0,0,0,0.3),
    inset 0 -1px 0 rgba(255,255,255,0.1);
  transform: translateY(3px);
  filter: brightness(0.85) contrast(1.08);
}
.btn-secondary {
  background: var(--carbon-panel);
  background-image: var(--carbon-panel), var(--carbon-weave);
  background-size: auto, 14px 14px;
  color: var(--fg);
  border: 1px solid var(--border);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    inset 0 -1px 0 rgba(0,0,0,0.3),
    0 3px 10px rgba(0,0,0,0.35);
}
.btn-secondary:hover {
  background: linear-gradient(180deg, rgba(10,12,16,0.98), rgba(22,26,34,0.98));
  background-image: linear-gradient(180deg, rgba(10,12,16,0.98), rgba(22,26,34,0.98)), var(--carbon-weave);
  background-size: auto, 14px 14px;
  box-shadow:
    inset 0 3px 6px rgba(0,0,0,0.55),
    inset 0 1px 2px rgba(0,0,0,0.3),
    inset 0 -1px 0 rgba(255,255,255,0.04),
    0 1px 2px rgba(0,0,0,0.2);
  transform: translateY(2px);
  filter: brightness(0.88);
  color: rgba(230,233,239,0.7);
  border-color: rgba(255,255,255,0.04);
  text-shadow: 0 -1px 0 rgba(255,255,255,0.05);
}
.btn-secondary:active {
  box-shadow:
    inset 0 4px 8px rgba(0,0,0,0.65),
    inset 0 2px 3px rgba(0,0,0,0.35);
  transform: translateY(3px);
  filter: brightness(0.8);
}
.btn-danger {
  background: linear-gradient(180deg, #ff4444 0%, #cc1100 60%, #880000 100%);
  color: #fff;
  border: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 4px 14px rgba(200,0,0,0.3);
}
.btn-danger:hover {
  box-shadow: 0 6px 24px rgba(200,0,0,0.5);
  transform: translateY(-2px);
}
.btn-sm {
  padding: 8px 18px;
  font-size: 0.8rem;
  letter-spacing: 1px;
  clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
}
.btn-lg {
  padding: 16px 40px;
  font-size: 1.2rem;
  letter-spacing: 2px;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

/* ── Rarity filter pills ── */
.rarity-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 1rem;
}
.rarity-pill {
  appearance: none;
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  background: var(--carbon-panel);
  color: var(--muted);
  font-family: 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', sans-serif;
  font-weight: 400;
  font-style: italic;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.rarity-pill:hover {
  color: var(--fg);
  border-color: var(--dg-orange);
}
.rarity-pill.active {
  background: linear-gradient(180deg, #ffc46b 0%, #ff8a1a 40%, #e85d00 100%);
  border-color: transparent;
  color: #000;
  box-shadow: 0 0 10px rgba(255,106,26,0.3);
}

html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  padding: 15px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.6;
  background: linear-gradient(180deg, var(--carbon-bg-top), var(--carbon-bg-bottom));
  background-image:
    linear-gradient(180deg, var(--carbon-bg-top), var(--carbon-bg-bottom)),
    url('dg-motif.svg');
  background-size: auto, 240px 240px;
  background-repeat: repeat;
  color: var(--fg);
  overflow-x: hidden;
}
header h1 { margin: 0 0 8px; font-size: 2.2rem; font-style: italic; letter-spacing: -0.5px; text-transform: uppercase; color: var(--accent-orange); background-image: linear-gradient(180deg, #ffd59a, #ff9f43 45%, #c76f20 80%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 1px 0 rgba(0,0,0,0.7)); }
header p { color: var(--muted); font-weight: 600; }

/* General link styles */
a { color: var(--accent-orange); text-decoration: none; transition: color .15s ease, text-shadow .15s ease; }
a:hover { color: #ffc066; text-shadow: 0 0 8px rgba(255,159,67,0.4); }
a.btn, a.btn:hover { color: inherit; text-shadow: none; }

.toc { position: relative; border: 1px solid var(--border); padding: 16px; border-radius: 12px;
  background: var(--carbon-panel);
  background-image: var(--carbon-panel), var(--carbon-weave);
  background-size: auto, 16px 16px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.03);
  /* cut-corner look like Blender panels */
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px);
}
.toc::after { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; pointer-events: none; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px); }
.toc h2 { margin-top: 0; font-style: italic; text-transform: uppercase; letter-spacing: 0.5px; }
.toc ol { columns: 2; column-gap: 24px; }
.toc a:not(.study-tool-card):not(.btn) { color: var(--accent-orange); text-decoration: none; padding: 2px 6px; border-radius: 6px; display: inline-block; }
.toc a:not(.study-tool-card):not(.btn):hover { background: rgba(255,159,67,0.12); color: #ffc066; text-decoration: none; }

/* Index gallery (card-based navigation) */
.gallery { margin-bottom: 16px; }

/* ── Study Tools: twin hero cards ── */
.study-tools-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-bottom: 20px;
}
.study-tool-card {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; text-decoration: none;
  padding: 28px 24px 22px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: linear-gradient(170deg, #12151a 0%, #0b0e11 100%);
  background-image: linear-gradient(170deg, #12151a 0%, #0b0e11 100%), var(--carbon-weave);
  background-size: auto, 14px 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: transform .15s ease, box-shadow .15s ease, border-color .2s ease;
  position: relative; overflow: hidden;
}
.study-tool-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% -20%, rgba(255,159,67,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.study-tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.06);
  border-color: var(--accent-orange);
}
.study-tool-icon {
  font-size: 2.6rem; line-height: 1;
  margin-bottom: 10px;
  filter: drop-shadow(0 2px 6px rgba(255,159,67,0.25));
}
.study-tool-card h3 {
  margin: 0 0 8px; font-size: 1.25rem; font-weight: 900;
  font-style: italic; text-transform: uppercase; letter-spacing: 0.3px;
  color: var(--accent-orange);
  background: linear-gradient(180deg, #ffd59a, #ff9f43 50%, #c76f20);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.study-tool-card p {
  margin: 0 0 14px; color: var(--muted); line-height: 1.5; font-size: 0.9rem;
}
.study-tool-card p strong { color: var(--fg); }
.study-tool-cta {
  display: inline-block;
  padding: 8px 22px; border-radius: 999px;
  font-weight: 700; font-size: 0.85rem;
  color: #000; background: var(--accent-orange);
  transition: background .15s ease;
}
.study-tool-card:hover .study-tool-cta { background: #ffc066; }
.study-tool--lab { border-color: rgba(29,155,240,0.3); }
.study-tool--lab::before { background: radial-gradient(ellipse at 50% -20%, rgba(29,155,240,0.08) 0%, transparent 70%); }
.study-tool--lab:hover { border-color: var(--accent-blue); }
.study-tool--cards { border-color: rgba(255,159,67,0.3); }
.study-tool--cards:hover { border-color: var(--accent-orange); }
.study-tool--articles {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  padding: 16px 20px;
  border-color: rgba(255,159,67,0.32);
}
.study-tool--articles .study-tool-icon {
  margin: 0 14px 0 0;
  font-size: 2rem;
  flex-shrink: 0;
}
.study-tool--articles .study-tool-content {
  min-width: 0;
  flex: 1;
}
.study-tool--articles h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
}
.study-tool--articles p {
  margin: 0;
}
.study-tool--articles .study-tool-cta {
  margin-left: 14px;
  flex-shrink: 0;
}

/* Locked state for study tool cards */
.study-tool-card.is-locked {
  pointer-events: auto; cursor: default;
  border-color: rgba(255,255,255,0.08);
  background: linear-gradient(170deg, #0f1216 0%, #0b0e11 100%);
}
.study-tool-card.is-locked::before {
  background: radial-gradient(ellipse at 50% -20%, rgba(255,255,255,0.03) 0%, transparent 70%);
}
.study-tool-card.is-locked:hover {
  transform: none; box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  border-color: rgba(255,255,255,0.12);
}
.study-tool-card.is-locked .study-tool-icon {
  filter: grayscale(1) brightness(0.5);
  opacity: 0.5;
}
.study-tool-card.is-locked h3 {
  background: linear-gradient(180deg, #888, #555);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.study-tool-lock-msg {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin-top: 4px;
}
.study-tool-lock-msg .lock-icon {
  font-size: 1.8rem; opacity: 0.4; line-height: 1;
}
.study-tool-lock-msg .lock-text {
  color: var(--muted); font-size: 0.85rem; line-height: 1.5;
}
.study-tool-lock-msg .lock-cta {
  display: inline-block;
  padding: 8px 22px; border-radius: 999px;
  font-weight: 700; font-size: 0.85rem;
  color: var(--fg); background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  transition: background .15s ease, border-color .15s ease;
  text-decoration: none;
}
.study-tool-lock-msg .lock-cta:hover {
  background: rgba(255,159,67,0.15); border-color: var(--accent-orange); color: var(--accent-orange);
}

@media (max-width: 640px) { .study-tools-row { grid-template-columns: 1fr; } }

.gallery-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.gallery-block h3 { margin: 10px 0 10px; color: var(--fg); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }

.articles-section-card {
  margin-top: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 12px;
  background: rgba(10,13,18,0.4);
  box-shadow: none;
}
.articles-section-card.is-collapsed {
  display: none;
}
@media (max-width: 640px) {
  .study-tool--articles {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .study-tool--articles .study-tool-icon {
    margin: 0;
  }
  .study-tool--articles .study-tool-cta {
    margin-left: 0;
  }
}

.articles-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 4px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 10px;
}

.articles-section-header h3 {
  margin: 0;
  color: var(--accent-orange);
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.35px;
}

.articles-section-header p {
  margin: 0;
  coloor: #4ade80; font-weight: 600; font-size: 1.05rem; margin: 4px 0 8px; }
.stars { letter-spacing: 4px; }

/* ── Responsive: compact on small screens ── */
@media (max-width: 600px) {
  .battle-card { width: 100px; padding: 6px; font-size: 0.7rem; }
  .in-hand { width: 110px; }
  .bcard-art { height: 36px; }
  .pipeline-name { max-width: 50px; }
  .player-bar { font-size: 0.78rem; gap: 6px; }
  .log-panel { width: 260px; }
}

/* ═══════════════════════════════════════════════════
   Battle VFX — Animations & Effects
   ═══════════════════════════════════════════════════ */

/* ── Card play: slide up from hand + fade in ── */
@keyframes vfx-play-card {
  0%   { opacity: 0; transform: translateY(40px) scale(0.85); }
  60%  { opacity: 1; transform: translateY(-6px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.vfx-play { animation: vfx-play-card 0.4s ease-out both; }

/* ── Card draw: slide in from library side ── */
@keyframes vfx-draw {
  0%   { opacity: 0; transform: translateX(-30px) scale(0.9); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
.vfx-draw { animation: vfx-draw 0.35s ease-out both; }

/* ── Attack: lunge forward ── */
@keyframes vfx-attack {
  0%   { transform: translateY(0); }
  35%  { transform: translateY(-18px) scale(1.05); }
  60%  { transform: translateY(-10px); }
  100% { transform: translateY(0) scale(1); }
}
.vfx-attack { animation: vfx-attack 0.45s ease-in-out; }

/* ── Take damage: shake + red flash ── */
@keyframes vfx-damage {
  0%, 100% { transform: translateX(0); filter: brightness(1); }
  15%  { transform: translateX(-6px); filter: brightness(1.8) saturate(2); }
  30%  { transform: translateX(6px); }
  45%  { transform: translateX(-4px); filter: brightness(1.3); }
  60%  { transform: translateX(4px); }
  75%  { transform: translateX(-2px); }
}
.vfx-damage { animation: vfx-damage 0.4s ease-out; }

/* ── Destroy / death: shrink + fade + fall ── */
@keyframes vfx-destroy {
  0%   { opacity: 1; transform: scale(1) translateY(0); filter: brightness(1); }
  30%  { opacity: 1; transform: scale(1.08); filter: brightness(2) saturate(0); }
  100% { opacity: 0; transform: scale(0.3) translateY(30px) rotate(8deg); filter: brightness(0.3); }
}
.vfx-destroy { animation: vfx-destroy 0.55s ease-in both; pointer-events: none; }

/* ── Heal: green glow pulse ── */
@keyframes vfx-heal {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
  50%  { box-shadow: 0 0 18px 6px rgba(74,222,128,0.45); }
}
.vfx-heal { animation: vfx-heal 0.5s ease-in-out; }

/* ── Buff: golden ring pulse ── */
@keyframes vfx-buff {
  0%, 100% { box-shadow: none; }
  50%  { box-shadow: 0 0 14px 4px rgba(251,191,36,0.4); }
}
.vfx-buff { animation: vfx-buff 0.5s ease-in-out; }

/* ── Pipeline tap: brief glow ── */
@keyframes vfx-tap {
  0%   { filter: brightness(1); }
  40%  { filter: brightness(1.8); }
  100% { filter: brightness(1); }
}
.vfx-tap { animation: vfx-tap 0.3s ease-out; }

/* ── LP change: number pulse ── */
@keyframes vfx-lp-change {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.vfx-lp-down strong { animation: vfx-lp-change 0.4s ease-out; color: #f87171; }
.vfx-lp-up strong   { animation: vfx-lp-change 0.4s ease-out; color: #4ade80; }

/* ── LP screen flash (overlays full board briefly) ── */
@keyframes vfx-screen-flash {
  0%   { opacity: 0.35; }
  100% { opacity: 0; }
}
.vfx-screen-flash {
  position: fixed; inset: 0; z-index: 999; pointer-events: none;
  animation: vfx-screen-flash 0.3s ease-out both;
}
.vfx-screen-flash.flash-red  { background: rgba(248,113,113,0.3); }
.vfx-screen-flash.flash-green { background: rgba(74,222,128,0.2); }

/* ── Phase transition: slide label ── */
@keyframes vfx-phase-enter {
  0%   { opacity: 0; transform: translateX(-20px); }
  100% { opacity: 1; transform: translateX(0); }
}
.vfx-phase-enter { animation: vfx-phase-enter 0.25s ease-out; }

/* ── Mulligan fan: stagger each card ── */
.mulligan-hand .battle-card { opacity: 0; animation: vfx-draw 0.3s ease-out both; }
.mulligan-hand .battle-card:nth-child(1) { animation-delay: 0s; }
.mulligan-hand .battle-card:nth-child(2) { animation-delay: 0.06s; }
.mulligan-hand .battle-card:nth-child(3) { animation-delay: 0.12s; }
.mulligan-hand .battle-card:nth-child(4) { animation-delay: 0.18s; }
.mulligan-hand .battle-card:nth-child(5) { animation-delay: 0.24s; }
.mulligan-hand .battle-card:nth-child(6) { animation-delay: 0.3s; }
.mulligan-hand .battle-card:nth-child(7) { animation-delay: 0.36s; }

/* ── Game over overlay entrance ── */
@keyframes vfx-gameover-in {
  0%   { opacity: 0; transform: scale(0.7); }
  70%  { transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}
.gameover-card { animation: vfx-gameover-in 0.5s ease-out; }

/* ── Victory star rain (canvas-free, CSS-only particle burst) ── */
@keyframes vfx-star-float {
  0%   { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(-80px) rotate(180deg); }
}
.vfx-star-particle {
  position: absolute; font-size: 1.2rem; color: #fbbf24; pointer-events: none;
  animation: vfx-star-float 1.2s ease-out both;
}

/* ── Concede red vignette ── */
@keyframes vfx-concede-flash {
  0%   { box-shadow: inset 0 0 60px 30px rgba(248,113,113,0.4); }
  100% { box-shadow: inset 0 0 0 0 rgba(248,113,113,0); }
}
.vfx-concede { animation: vfx-concede-flash 0.6s ease-out; }

/* ── Floating damage numbers ── */
@keyframes vfx-float-number {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-36px) scale(1.3); }
}
.vfx-float-number {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 900; font-size: 1.4rem; pointer-events: none; z-index: 20;
  animation: vfx-float-number 0.7s ease-out both;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
.vfx-float-number.damage-num { color: #f87171; }
.vfx-float-number.heal-num   { color: #4ade80; }

/* ── Summoning sickness shimmer ── */
@keyframes vfx-summon-shimmer {
  0%, 100% { outline-color: rgba(255,255,255,0.15); }
  50%      { outline-color: rgba(255,255,255,0.3); }
}
.board-card-sick { animation: vfx-summon-shimmer 1.5s ease-in-out infinite; }

/* ═══════════════════════════════════════════════════════════
   CAMPAIGN MAP
   ═══════════════════════════════════════════════════════════ */

/* ── Page layout ── */
.campaign-page {
  max-width: 800px; margin: 0 auto; padding: 1rem;
}
.campaign-header {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.5rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.campaign-header h1 { margin: 0; font-size: 1.6rem; }
.campaign-star-total {
  display: flex; align-items: center; gap: 0.25rem;
  font-size: 1.1rem; font-weight: 700;
  background: var(--surface); padding: 0.3rem 0.8rem;
  border-radius: 8px; border: 1px solid var(--border);
}
.star-total-icon { color: #fbbf24; font-size: 1.3rem; }
.star-total-label { color: var(--muted); font-weight: 400; }

/* ── Map container ── */
.campaign-map {
  display: flex; flex-direction: column; align-items: center;
  gap: 0; padding: 1rem 0 2rem;
}

/* ── Node group (node + connector) ── */
.map-node-group {
  display: flex; flex-direction: column; align-items: center;
  width: 100%;
}

/* ── Connector line between nodes ── */
.map-connector {
  width: 3px; height: 32px;
  background: linear-gradient(to bottom, var(--accent-blue), var(--accent-orange));
  border-radius: 2px; opacity: 0.7;
}
.connector-locked {
  background: var(--border); opacity: 0.3;
}

/* ── Map node (stage button) ── */
.map-node {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.15rem 0.6rem;
  align-items: center;
  width: 100%; max-width: 480px;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  color: var(--fg);
  text-align: left;
  position: relative;
}
.map-node:hover:not(:disabled) {
  border-color: var(--accent-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(59,130,246,0.15);
}
.map-node:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

/* Grid placement */
.node-icon {
  grid-row: 1 / 3; grid-column: 1;
  font-size: 1.8rem; line-height: 1;
}
.node-num {
  grid-row: 1; grid-column: 2;
  font-size: 0.75rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600;
}
.node-boss {
  grid-row: 2; grid-column: 2;
  font-size: 1rem; font-weight: 700;
}
.node-tier {
  grid-row: 1; grid-column: 3;
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.1rem 0.4rem; border-radius: 4px;
  justify-self: end;
}
.tier-easy   { background: rgba(74,222,128,0.15); color: #4ade80; }
.tier-medium { background: rgba(251,191,36,0.15); color: #fbbf24; }
.tier-hard   { background: rgba(248,113,113,0.15); color: #f87171; }

.node-stars {
  grid-row: 2; grid-column: 3;
  font-size: 1rem; color: #fbbf24;
  justify-self: end; letter-spacing: 0.1em;
}
.node-lock {
  grid-row: 1 / 3; grid-column: 1 / 4;
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 600; color: var(--muted);
  background: rgba(11,14,17,0.65);
  border-radius: 12px;
}

/* ── Node state variants ── */
.node-locked {
  opacity: 0.5; cursor: not-allowed;
  border-color: transparent;
}
.node-completed {
  border-color: rgba(74,222,128,0.3);
}
.node-current {
  border-color: var(--accent-orange);
  box-shadow: 0 0 12px rgba(249,115,22,0.2);
}
.node-current::before {
  content: '▶';
  position: absolute; left: -1.6rem; top: 50%; transform: translateY(-50%);
  color: var(--accent-orange); font-size: 1rem;
}
.node-selected {
  border-color: var(--accent-blue) !important;
  box-shadow: 0 0 16px rgba(59,130,246,0.25);
}

/* ── Boss detail panel ── */
.boss-detail {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 2px solid var(--accent-blue);
  padding: 1.2rem 1.5rem; z-index: 50;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
  max-height: 45vh; overflow-y: auto;
}
.boss-detail-inner {
  max-width: 600px; margin: 0 auto;
}
.boss-detail-close {
  position: absolute; top: 0.5rem; right: 0.8rem;
  background: none; border: none; color: var(--muted);
  font-size: 1.4rem; cursor: pointer; line-height: 1;
}
.boss-detail-close:hover { color: var(--fg); }

.boss-name {
  margin: 0 0 0.2rem; font-size: 1.3rem;
}
.boss-topic {
  margin: 0 0 0.6rem; color: var(--muted); font-size: 0.9rem;
}
.boss-stats-row {
  display: flex; gap: 1rem; margin-bottom: 0.6rem;
}
.boss-stat {
  display: flex; gap: 0.3rem; align-items: center;
  font-size: 0.85rem; color: var(--muted);
}
.boss-stat strong { color: var(--fg); }
.boss-desc {
  margin: 0 0 0.3rem; font-size: 0.9rem; line-height: 1.5;
}
.boss-mechanic {
  margin: 0 0 0.8rem; font-size: 0.85rem; color: var(--accent-orange);
  font-weight: 600;
}
.boss-unlock-req {
  padding: 0.4rem 0.6rem; background: rgba(248,113,113,0.1);
  border-radius: 6px; margin-bottom: 0.8rem;
  font-size: 0.85rem; color: #f87171;
}
.boss-battle-btn { display: inline-block; text-decoration: none; }

/* ── Boss detail entrance animation ── */
@keyframes boss-detail-slide {
  0%   { transform: translateY(100%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
.boss-detail-enter { animation: boss-detail-slide 0.3s ease-out; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .campaign-header { flex-direction: column; align-items: flex-start; }
  .map-node { max-width: 100%; }
  .node-current::before { display: none; }
  .boss-detail { max-height: 55vh; }
}

/* ═══════════════════════════════════════════════════════════
   MATCH HISTORY + REPLAY
   ═══════════════════════════════════════════════════════════ */

/* ── Page layout ── */
.history-page {
  max-width: 900px; margin: 0 auto; padding: 1rem;
}
.history-header {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.history-header h1 { margin: 0; font-size: 1.6rem; }

/* ── Stats pills ── */
.history-stats {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
}
.stat-pill {
  display: inline-flex; align-items: center; gap: 0.2rem;
  padding: 0.2rem 0.6rem; border-radius: 6px;
  font-size: 0.8rem; font-weight: 700;
  background: var(--surface); border: 1px solid var(--border);
}
.stat-wins    { color: #4ade80; }
.stat-losses  { color: #f87171; }
.stat-draws   { color: #fbbf24; }
.stat-winrate { color: var(--accent-blue); }
.stat-stars   { color: #fbbf24; }

/* ── Filters ── */
.history-filters {
  display: flex; gap: 0.5rem; margin-bottom: 1rem;
}
.history-select {
  padding: 0.35rem 0.6rem; border-radius: 6px;
  background: var(--surface); color: var(--fg);
  border: 1px solid var(--border); font-size: 0.85rem;
}

/* ── Match list ── */
.match-list {
  display: flex; flex-direction: column; gap: 2px;
}
.match-row {
  display: grid;
  grid-template-columns: 70px 1fr 80px 80px 70px 60px 120px auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.match-row:hover, .match-row:focus {
  border-color: var(--accent-blue);
  background: rgba(59,130,246,0.06);
  outline: none;
}

.match-result {
  font-weight: 800; font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.result-win  { color: #4ade80; }
.result-loss { color: #f87171; }
.result-draw { color: #fbbf24; }

.match-opponent { font-weight: 600; font-size: 0.9rem; }
.match-stage    { font-size: 0.8rem; color: var(--muted); }
.match-stars    { color: #fbbf24; letter-spacing: 0.1em; }
.match-turns    { font-size: 0.8rem; color: var(--muted); }
.match-duration { font-size: 0.8rem; color: var(--muted); }
.match-date     { font-size: 0.75rem; color: var(--muted); }
.match-replay-btn {
  font-size: 0.8rem; color: var(--accent-blue); font-weight: 600;
}

/* ── Replay viewer ── */
.replay-viewer {
  max-width: 800px; margin: 0 auto; padding: 1rem;
}
.replay-header {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1rem;
}
.replay-header h2 { margin: 0; font-size: 1.3rem; }

.replay-summary-card {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.8rem 1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 1.5rem;
}
.replay-result {
  font-weight: 800; font-size: 1.1rem; text-transform: uppercase;
}
.replay-stars {
  color: #fbbf24; font-size: 1.1rem; letter-spacing: 0.1em;
}
.replay-info { font-size: 0.85rem; color: var(--muted); }

/* ── Replay controls ── */
.replay-controls {
  display: flex; align-items: center; gap: 0.8rem;
  margin-bottom: 0.8rem;
}
.replay-turn-indicator {
  font-weight: 700; font-size: 0.9rem;
  min-width: 80px; text-align: center;
}

/* ── Replay event log ── */
.replay-log-section h3 {
  margin: 0 0 0.6rem; font-size: 1.1rem;
}
.replay-events {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 60vh; overflow-y: auto;
  padding: 0.5rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
}
.replay-event {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem; color: var(--fg);
  border-radius: 4px;
}
.replay-event:nth-child(odd) { background: rgba(255,255,255,0.02); }
.replay-event-turn {
  background: rgba(59,130,246,0.1) !important;
  font-weight: 700;
  border-left: 3px solid var(--accent-blue);
  padding-left: 0.5rem;
}
.replay-event-end {
  background: rgba(251,191,36,0.1) !important;
  font-weight: 700;
  border-left: 3px solid #fbbf24;
}
.replay-event-combat {
  border-left: 3px solid var(--accent-orange);
  padding-left: 0.5rem;
}

.event-turn-num {
  display: inline-block; min-width: 24px;
  font-size: 0.7rem; color: var(--accent-blue); font-weight: 700;
}
.event-phase {
  display: inline-block; min-width: 60px;
  font-size: 0.7rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.03em;
}
.event-label { font-weight: 600; }
.event-detail { color: var(--muted); font-size: 0.78rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .match-row {
    grid-template-columns: 60px 1fr 70px;
    grid-template-rows: auto auto;
  }
  .match-stage, .match-turns, .match-duration, .match-date {
    grid-column: 2;
    font-size: 0.75rem;
  }
  .match-replay-btn { grid-column: 3; grid-row: 1; }
  .match-stars { grid-column: 3; grid-row: 2; }
  .history-header { flex-direction: column; align-items: flex-start; }
}

/* ═══════════════════════════════════════════════════════════
   LEADERBOARD
   ═══════════════════════════════════════════════════════════ */

/* ── Page layout ── */
.lb-page {
  max-width: 900px; margin: 0 auto; padding: 1rem;
}
.lb-header {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.lb-header h1 { margin: 0; font-size: 1.6rem; }

/* ── Sort tabs ── */
.lb-tabs {
  display: flex; gap: 4px; margin-bottom: 1rem;
  border-bottom: 2px solid var(--border); padding-bottom: 0;
}
.lb-tab {
  padding: 0.55rem 1.2rem; border: none; background: none;
  color: var(--muted);
  font-family: 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', sans-serif;
  font-weight: 400; font-style: italic; font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 1.2px;
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: color 0.15s, border-color 0.15s;
}
.lb-tab:hover { color: var(--fg); }
.lb-tab-active {
  color: var(--accent-blue); border-bottom-color: var(--accent-blue);
}

/* ── Personal stats card ── */
.my-stats-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem; margin-bottom: 1.2rem;
}
.my-stats-title {
  margin: 0 0 0.6rem; font-size: 1.1rem;
}
.my-stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem;
}
.my-stat-box {
  display: flex; flex-direction: column; align-items: center;
  padding: 0.5rem; border-radius: 8px;
  background: rgba(255,255,255,0.03);
}
.my-stat-value { font-size: 1.3rem; font-weight: 800; }
.my-stat-label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.my-stat-box.stat-wins  .my-stat-value { color: #4ade80; }
.my-stat-box.stat-losses .my-stat-value { color: #f87171; }
.my-stat-box.stat-winrate .my-stat-value { color: var(--accent-blue); }
.my-stat-box.stat-stars .my-stat-value { color: #fbbf24; }

/* ── Stage records ── */
.my-stats-bests {
  margin-top: 0.6rem; font-size: 0.85rem;
}
.my-stats-bests summary {
  cursor: pointer; color: var(--accent-blue); font-weight: 600;
}
.bests-grid {
  display: grid; grid-template-columns: 60px 80px 80px;
  gap: 0.2rem 0.8rem; margin-top: 0.4rem;
}
.bests-hdr { font-weight: 700; font-size: 0.75rem; color: var(--muted); text-transform: uppercase; }

/* ── Leaderboard table ── */
.lb-table {
  display: flex; flex-direction: column; gap: 2px;
}
.lb-row {
  display: grid;
  grid-template-columns: 48px 1fr 80px 60px 70px 70px 60px;
  align-items: center; gap: 0.4rem;
  padding: 0.55rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s;
}
.lb-row:hover:not(.lb-row-header) {
  border-color: var(--accent-blue);
}
.lb-row-header {
  background: transparent; border-color: transparent;
  font-size: 0.7rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700;
  padding: 0.3rem 0.8rem;
}

.lb-cell { font-size: 0.85rem; }
.lb-rank { font-weight: 800; text-align: center; }
.lb-name { font-weight: 600; }
.lb-stars { color: #fbbf24; font-weight: 700; }
.lb-wr   { color: var(--accent-blue); }

.lb-profile-link {
  color: var(--fg); text-decoration: none;
}
.lb-profile-link:hover { color: var(--accent-blue); text-decoration: underline; }

/* ── Podium highlighting ── */
.lb-gold   { border-color: rgba(251,191,36,0.4); background: rgba(251,191,36,0.06); }
.lb-gold .lb-rank { color: #fbbf24; font-size: 1.1rem; }
.lb-silver { border-color: rgba(192,192,192,0.3); background: rgba(192,192,192,0.04); }
.lb-silver .lb-rank { color: #c0c0c0; }
.lb-bronze { border-color: rgba(205,127,50,0.3); background: rgba(205,127,50,0.04); }
.lb-bronze .lb-rank { color: #cd7f32; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .lb-row {
    grid-template-columns: 36px 1fr 60px 50px;
  }
  .lb-matches, .lb-wr, .lb-stage { display: none; }
  .lb-header { flex-direction: column; align-items: flex-start; }
  .lb-tabs { overflow-x: auto; }
  .lb-tab { font-size: 0.78rem; padding: 0.4rem 0.7rem; white-space: nowrap; }
}

/* ═════════════════════════════════════════════════
   TCG Shared Navigation
   ═════════════════════════════════════════════════ */

.tcg-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin: 0.75rem 0;
}
.tcg-nav .btn { font-size: 0.78rem; }

/* ═════════════════════════════════════════════════
   Responsive — Campaign Map
   ═════════════════════════════════════════════════ */

@media (max-width: 600px) {
  .campaign-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .campaign-node { padding: 0.6rem; }
  .boss-detail { padding: 1rem; }
  .boss-detail-inner { gap: 0.75rem; }
}

/* ═════════════════════════════════════════════════
   Responsive — Match History
   ═════════════════════════════════════════════════ */

@media (max-width: 600px) {
  .history-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .history-stats { flex-wrap: wrap; }
  .history-filter-bar { flex-direction: column; }
  .replay-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .replay-panels { grid-template-columns: 1fr; }
}

/* ═════════════════════════════════════════════════
   Prefers reduced motion
   ═════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   MOTOCROSS / RACING / CARBON FIBER — Global Treatment
   ═══════════════════════════════════════════════════════════ */

/* ── Carbon fiber texture mixin (reusable) ── */
.carbon-surface {
  background-color: var(--surface);
  background-image:
    var(--carbon-panel),
    var(--carbon-weave),
    var(--carbon-grid);
  background-size: auto, 8px 8px, 24px 24px;
}

/* ── Top nav ── */
.app-nav {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 12px 20px 18px;
  min-height: 64px;
  box-sizing: border-box;
  width: calc(100% + 48px);
  margin-left: -24px;
  background:
    linear-gradient(180deg, rgba(14,17,22,0.97), rgba(8,10,14,0.98)),
    var(--carbon-weave),
    var(--carbon-grid);
  background-size: auto, 8px 8px, 24px 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.5), inset 0 -1px 0 rgba(255,255,255,0.04);
}

.site-nav {
  grid-column: 2;
  justify-self: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 5px 0;
  border: none;
  background: none;
  clip-path: none;
  position: relative;
  z-index: 1;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 26px;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  color: var(--fg);
  font-family: 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', sans-serif;
  font-weight: 400;
  font-size: 0.82rem;
  font-style: italic;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  transition: all 0.15s ease;
  background: linear-gradient(180deg, rgba(20,24,31,0.96), rgba(10,12,16,0.96));
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    inset 0 -1px 0 rgba(0,0,0,0.3),
    0 3px 10px rgba(0,0,0,0.35);
}
.nav-link:hover {
  background: linear-gradient(180deg, rgba(10,12,16,0.98), rgba(22,26,34,0.98));
  box-shadow:
    inset 0 3px 6px rgba(0,0,0,0.55),
    inset 0 1px 2px rgba(0,0,0,0.3),
    inset 0 -1px 0 rgba(255,255,255,0.04),
    0 1px 2px rgba(0,0,0,0.2);
  transform: translateY(2px);
  filter: brightness(0.88);
  color: rgba(230,233,239,0.7);
  border-color: rgba(255,255,255,0.04);
  text-shadow: 0 -1px 0 rgba(255,255,255,0.05);
}
.nav-link:active {
  box-shadow:
    inset 0 4px 8px rgba(0,0,0,0.65),
    inset 0 2px 3px rgba(0,0,0,0.35);
  transform: translateY(3px);
  filter: brightness(0.8);
}
.nav-link[aria-current="page"] {
  color: #fff;
  background: linear-gradient(180deg, rgba(38,47,71,0.96), rgba(18,21,30,0.96));
  border-color: rgba(94,131,213,0.3);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 3px 10px rgba(0,0,0,0.3);
}
.nav-link[aria-current="page"]:hover {
  background: linear-gradient(180deg, rgba(18,21,30,0.98), rgba(30,38,58,0.98));
  box-shadow:
    inset 0 3px 6px rgba(0,0,0,0.5),
    inset 0 1px 2px rgba(0,0,0,0.25),
    inset 0 -1px 0 rgba(255,255,255,0.04);
  transform: translateY(2px);
  filter: brightness(0.88);
  color: rgba(230,233,239,0.8);
}

.app-nav-actions,
#global-account-quick {
  grid-column: 3;
  justify-self: end;
}

#global-account-quick {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  white-space: nowrap;
  min-width: max-content;
  min-height: 34px;
  padding: 6px 26px;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  border: 1px solid rgba(255,159,67,0.42);
  color: #fff;
  font-family: 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', sans-serif;
  font-weight: 400;
  font-size: 0.82rem;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-decoration: none;
  background: linear-gradient(180deg, rgba(18,21,27,0.98), rgba(9,11,15,0.98));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    inset 0 -1px 0 rgba(0,0,0,0.3),
    0 3px 10px rgba(0,0,0,0.35),
    inset 0 0 0 1px rgba(255,159,67,0.12);
  transition: all 0.15s ease;
}
#global-account-quick:hover {
  background: linear-gradient(180deg, rgba(10,12,16,0.98), rgba(22,26,34,0.98));
  border-color: var(--dg-orange);
  box-shadow:
    inset 0 3px 6px rgba(0,0,0,0.55),
    inset 0 1px 2px rgba(0,0,0,0.3),
    inset 0 -1px 0 rgba(255,255,255,0.04),
    0 1px 2px rgba(0,0,0,0.2);
  transform: translateY(2px);
  filter: brightness(0.88);
  color: rgba(255,255,255,0.8);
  text-shadow: 0 -1px 0 rgba(255,255,255,0.05);
}

/* ── Hero banner carbon overlay ── */
.hero-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: var(--carbon-weave);
  background-size: 10px 10px;
  opacity: 0.18;
  pointer-events: none;
}

/* ── Buttons: carbon fiber treatment ── */
.btn {
  position: relative;
  overflow: hidden;
}
.btn::before {
  display: none;
}
.btn-primary {
  border: 1px solid rgba(255,159,67,0.18);
}
.btn-secondary {
  background: linear-gradient(180deg, rgba(20,24,31,1), rgba(10,12,16,1));
  background-image: linear-gradient(180deg, rgba(20,24,31,1), rgba(10,12,16,1));
}

/* ── Feature cards (homepage grid) ── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.feature-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px 20px 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  text-decoration: none;
  overflow: hidden;
  /* Carbon fiber card surface */
  background:
    linear-gradient(170deg, rgba(18,21,26,0.95), rgba(8,10,14,0.98)),
    var(--carbon-weave),
    var(--carbon-grid);
  background-size: auto, 8px 8px, 24px 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.2s ease;
}
.feature-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--dg-orange), var(--dg-blue));
  opacity: 0;
  transition: opacity 0.2s ease;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06);
  border-color: var(--dg-orange);
}
.feature-card:hover::before { opacity: 1; }

.feature-number {
  font-size: 2.4rem;
  font-weight: 900;
  font-style: italic;
  line-height: 1;
  margin-bottom: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.feature-card-body {
  flex: 1;
}
.feature-card-body h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-style: italic;
  text-transform: uppercase;
  color: var(--accent-orange);
}
.feature-card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}
.feature-card-body ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.feature-cta {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,159,67,0.25);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--dg-orange);
  /* Carbon micro-texture */
  background-image: var(--carbon-weave);
  background-size: 5px 5px;
  background-color: rgba(255,106,26,0.06);
  transition: background-color 0.15s, border-color 0.15s;
}
.feature-card:hover .feature-cta {
  background-color: rgba(255,106,26,0.12);
  border-color: var(--dg-orange);
}

/* ── Coming Soon cards ── */
.coming-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.coming-card {
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  /* Carbon fiber surface */
  background:
    linear-gradient(170deg, rgba(18,21,26,0.92), rgba(8,10,14,0.96)),
    var(--carbon-weave);
  background-size: auto, 8px 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.03);
}
.coming-card h3 {
  margin: 0 0 8px;
  font-style: italic;
  text-transform: uppercase;
  font-size: 0.95rem;
  color: var(--accent-orange);
}
.coming-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ── Contact section ── */
.contact-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 28px;
  border: 1px solid rgba(255,159,67,0.18);
  border-radius: 0;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
  background:
    linear-gradient(135deg, rgba(18,21,26,0.96), rgba(10,12,16,0.98)),
    var(--carbon-weave);
  background-size: auto, 10px 10px;
  box-shadow:
    0 4px 20px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.04);
  margin-bottom: 24px;
}

.contact-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.contact-logo {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.contact-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-name {
  font-family: 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', sans-serif;
  font-weight: 400;
  font-style: italic;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--dg-orange);
}

.contact-tagline {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.contact-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(230,233,239,0.75);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.3px;
  transition: color 0.15s;
}

.contact-link:hover {
  color: var(--dg-orange);
}

.contact-divider {
  width: 1px;
  height: 16px;
  background: rgba(255,255,255,0.1);
}

@media (max-width: 600px) {
  .contact-section {
    flex-direction: column;
    text-align: center;
    padding: 18px 16px;
    gap: 16px;
  }
  .contact-brand {
    flex-direction: column;
    gap: 10px;
  }
  .contact-brand-text {
    align-items: center;
  }
  .contact-links {
    flex-direction: column;
    gap: 10px;
  }
  .contact-divider {
    width: 32px;
    height: 1px;
  }
}
.accent-bar {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--dg-orange), var(--dg-blue));
  border-radius: 2px;
  margin-bottom: 14px;
}
.accent-bar-centered {
  margin-left: auto;
  margin-right: auto;
}

/* ── Cart icon in nav ── */
.cart-link {
  color: var(--fg);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
}

/* ── Utility ── */
.mt-12 { margin-top: 12px; }
.muted { color: var(--muted); }
.objectives { color: var(--muted); line-height: 1.6; }

/* ── Responsive nav ── */
@media (max-width: 900px) {
  .app-nav {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 12px 14px;
  }
  .site-nav {
    grid-column: 1;
    justify-self: start;
    min-width: 0;
  }
  .nav-link {
    padding: 6px 12px;
    font-size: 0.76rem;
    letter-spacing: 1.1px;
  }
  .app-nav-actions,
  #global-account-quick {
    grid-column: 2;
    justify-self: end;
  }
  .app-nav-actions {
    gap: 6px;
  }
  #global-account-quick,
  .cart-fab {
    padding: 6px 11px;
    min-height: 32px;
    font-size: 0.74rem;
    letter-spacing: 1px;
  }
}

@media (max-width: 600px) {
  .app-nav {
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 8px 10px 12px;
    min-height: auto;
  }
  .site-nav {
    grid-column: 1;
    justify-self: start;
    padding: 4px 0;
    gap: 4px;
  }
  .nav-link { padding: 6px 10px; font-size: 0.75rem; }
  .app-nav-actions,
  #global-account-quick {
    grid-column: 2;
    justify-self: end;
  }
  .app-nav-actions {
    gap: 6px;
  }
  #global-account-quick,
  .cart-fab {
    padding: 6px 10px;
    font-size: 0.75rem;
    min-height: 32px;
  }
  .feature-grid { grid-template-columns: 1fr; }
  .coming-grid { grid-template-columns: 1fr; }
  .study-tools-row { grid-template-columns: 1fr; }
}

/* ═══ Shop Page ═══ */

/* Subscribe banner */
.subscribe-banner { margin-bottom: 20px; }
.subscribe-card {
  padding: 22px 24px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    linear-gradient(170deg, rgba(18,21,26,0.96), rgba(8,10,14,0.98)),
    var(--carbon-weave);
  background-size: auto, 14px 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.04);
  text-align: center;
}
.subscribe-card h2 { margin: 0 0 8px; font-size: 1.15rem; font-weight: 600; color: var(--fg); }
.subscribe-card p { margin: 0 0 16px; color: var(--muted); font-size: 0.92rem; }
.subscribe-status { margin-top: 8px; font-size: 0.9rem; color: var(--dg-orange); }
.btn--accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 26px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(255,106,26,0.9), rgba(200,60,0,0.95));
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(255,106,26,0.3), inset 0 1px 0 rgba(255,255,255,0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn--accent:hover {
  filter: brightness(1.12);
  box-shadow: 0 6px 20px rgba(255,106,26,0.45);
  transform: translateY(-2px);
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.product-grid .shop-back {
  grid-column: 1 / -1;
  color: var(--accent-orange);
  font-weight: 700;
  margin-bottom: 4px;
}

/* Section banner cards (Articles-style) for category groups */
.shop-section-card {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  text-decoration: none;
  color: var(--fg);
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(170deg, rgba(18,21,26,0.96), rgba(8,10,14,0.98)),
    var(--carbon-weave);
  background-size: auto, 14px 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.2s ease;
}
.shop-section-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 110%, rgba(255,106,26,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.shop-section-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.5);
  border-color: rgba(255,255,255,0.16);
}
.shop-section-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 8px;
}
.shop-section-body {
  flex: 1;
  min-width: 0;
}
.shop-section-body h3 {
  margin: 0;
  font-size: 1.05rem;
  font-style: italic;
  text-transform: uppercase;
  color: var(--accent-orange);
}
.shop-section-body p {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.shop-section-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.shop-section-price {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--fg);
  white-space: nowrap;
}
.shop-section-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex: 0 0 auto;
}
.shop-section-card.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Individual product cards */
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px 18px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  text-decoration: none;
  overflow: hidden;
  background:
    linear-gradient(170deg, rgba(18,21,26,0.95), rgba(8,10,14,0.98)),
    var(--carbon-weave),
    var(--carbon-grid);
  background-size: auto, 8px 8px, 24px 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.2s ease;
  cursor: pointer;
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(0,0,0,0.5);
  border-color: var(--dg-orange);
}
.product-card img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: 12px;
}
.product-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: var(--fg);
}
.product-card h3 a {
  color: inherit;
  text-decoration: none;
}
.product-card > p {
  margin: 0 0 10px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}
.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
}
.badge.flashcards { color: #6ee7ff; border: 1px solid rgba(110,231,255,0.2); }
.badge.addon { color: #ff9f43; border: 1px solid rgba(255,159,67,0.2); }
.badge.book { color: #60a5fa; border: 1px solid rgba(96,165,250,0.2); }
.price {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--fg);
}
.card-sw-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 22px;
  height: 22px;
}
.card-sw-badge svg { width: 100%; height: 100%; }
.buy-options {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.buy-option {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--muted);
  background: rgba(0,0,0,0.3);
}
.buy-option:hover { border-color: var(--dg-orange); color: var(--dg-orange); }
.buy-full { display: none; }
.buy-option:hover .buy-short { display: none; }
.buy-option:hover .buy-full { display: inline; }

/* Coming soon overlay */
.coming-soon { opacity: 1; }
.coming-soon-overlay {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,106,26,0.12);
  border: 1px solid rgba(255,106,26,0.2);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--dg-orange);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.coming-soon-full .coming-soon-overlay {
  display: inline-flex;
}
.coming-soon-message {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}
.is-disabled { pointer-events: none; }

/* Featured card (Training Lab Access Passes hero) */
.featured-section { margin-bottom: 20px; }
.featured-card {
  display: flex;
  gap: 24px;
  padding: 24px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  text-decoration: none;
  color: var(--fg);
  background:
    linear-gradient(170deg, rgba(18,21,26,0.96), rgba(8,10,14,0.98)),
    var(--carbon-weave);
  background-size: auto, 14px 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: transform 0.15s, border-color 0.2s;
}
.featured-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.16);
}
.featured-img-wrap {
  width: 88px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.featured-img-wrap img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 10px;
}
.featured-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.featured-body h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}
.featured-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}
.featured-meta {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}
.featured-unlock {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
}
.featured-unlock strong { color: var(--fg); }

.grid-pair { grid-template-columns: repeat(2, 1fr); }

.shop-controls { margin-bottom: 12px; }

@media (max-width: 640px) {
  .product-grid { grid-template-columns: 1fr; }
  .grid-pair { grid-template-columns: 1fr; }
  .featured-card { flex-direction: column; gap: 16px; padding: 20px; }
  .featured-img-wrap { width: auto; }
  .featured-img-wrap img { width: 56px; height: 56px; }
  .shop-section-card { flex-direction: column; align-items: flex-start; gap: 10px; }
  .shop-section-meta { width: 100%; justify-content: space-between; }
}

/* Page hero header */
.page-hero {
  text-align: center;
  padding: 32px 16px 18px;
}
.page-hero h1 {
  margin: 0 0 8px;
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--fg);
}
.page-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* Shared TCG page layout */
.page-hero {
  width: min(920px, 100%);
  margin: 0 auto clamp(18px, 3vw, 28px);
  padding: clamp(28px, 5vw, 40px) 12px 0;
}

.page-hero p {
  margin: 0 auto;
  max-width: 820px;
  line-height: 1.7;
}

.page-hero .tcg-nav {
  margin-top: 0;
}

.tcg-nav {
  width: min(920px, 100%);
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 1rem auto 0;
}

.tcg-nav .btn {
  flex: 0 1 auto;
  white-space: nowrap;
  justify-content: center;
}

.cards-tabs,
.cards-panel,
.deck-bar,
.builder-panels,
.battle-lobby,
.campaign-shell {
  width: min(960px, 100%);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.cards-tabs {
  margin: 0 auto 18px;
  align-items: stretch;
}

.cards-panel {
  padding: 24px;
}

.cards-state-box,
.pack-card,
.catalog-filters-panel,
.builder-catalog,
.builder-deck,
.lobby-panel,
.deck-bar {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(18,21,26,0.95), rgba(10,12,16,0.98)),
    var(--carbon-weave);
  background-size: auto, 10px 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.3);
}

.cards-state-box {
  display: grid;
  justify-items: start;
  gap: 14px;
  padding: 24px;
}

.cards-state-box--inline {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.cards-state-icon {
  font-size: 1.45rem;
  line-height: 1;
}

.cards-state-box h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.05;
}

.cards-state-box p {
  margin: 0;
}

.cards-state-box .btn {
  margin-top: 4px;
}

.packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.packs-grid > .cards-state-box {
  grid-column: 1 / -1;
}

.pack-card {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 12px;
  padding: 20px;
  min-height: 100%;
}

.pack-card h3,
.pack-card p {
  margin: 0;
}

.pack-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  font-family: 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', sans-serif;
  font-size: 1.1rem;
  font-style: italic;
  letter-spacing: 1px;
}

.pack-icon-locked {
  font-size: 1.2rem;
}

.pack-count {
  color: var(--fg);
  font-weight: 700;
}

.pack-hint {
  font-size: 0.9rem;
  line-height: 1.5;
}

.pack-card .btn {
  width: 100%;
}

.pack-card.pack-locked {
  opacity: 0.86;
}

.collection-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-block {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  text-align: center;
}

.stat-value {
  font-family: 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', sans-serif;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-style: italic;
  letter-spacing: 1px;
  color: var(--fg);
}

.stat-label {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.catalog-layout {
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.catalog-filters-panel,
.catalog-results-panel {
  min-width: 0;
}

.catalog-toolbar {
  display: grid;
  gap: 12px;
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.toolbar-search,
.toolbar-select {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(8,10,14,0.95);
  color: var(--fg);
  font: inherit;
  box-sizing: border-box;
}

.toolbar-search {
  flex: 1 1 240px;
  min-width: 220px;
}

.toolbar-select {
  flex: 0 1 auto;
  min-width: 140px;
}

.toolbar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.toolbar-count {
  color: var(--muted);
  font-size: 0.88rem;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.deck-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 18px 20px;
}

.deck-bar-left,
.deck-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.deck-selector {
  min-width: min(280px, 100%);
}

.deck-count-badge,
.deck-valid-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  font-weight: 800;
}

.deck-valid-indicator.valid {
  color: #d0ffb7;
  border-color: rgba(122,201,67,0.35);
}

.deck-valid-indicator.invalid {
  color: #ffc0c0;
  border-color: rgba(224,48,48,0.35);
}

.builder-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 20px;
  align-items: start;
}

.builder-catalog,
.builder-deck {
  padding: 20px;
}

.builder-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.builder-catalog-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.builder-catalog-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255,159,67,0.35);
  box-shadow: 0 12px 22px rgba(0,0,0,0.28);
}

.builder-catalog-card.catalog-card-maxed {
  opacity: 0.72;
}

.bcc-header,
.bcc-body,
.bcc-stats,
.bcc-deck-info {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.bcc-header {
  align-items: start;
}

.bcc-name {
  font-weight: 800;
  line-height: 1.3;
}

.bcc-type,
.bcc-rarity,
.bcc-in-deck,
.bcc-owned,
.bcc-stats {
  color: var(--muted);
  font-size: 0.84rem;
}

.mana-curve {
  display: grid;
  gap: 10px;
  margin: 16px 0 18px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.mana-curve-bars {
  min-height: 140px;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.mc-bar-wrap {
  min-height: 140px;
  display: flex;
  align-items: end;
}

.mc-bar {
  width: 100%;
  min-height: 12px;
  display: flex;
  align-items: start;
  justify-content: center;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, rgba(255,159,67,0.95), rgba(232,93,0,0.9));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.24);
}

.mc-bar-count {
  padding-top: 6px;
  font-size: 0.76rem;
  font-weight: 800;
  color: #000;
}

.mana-curve-labels {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
}

.mc-label {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.cb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.cb-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
}

.deck-name-heading {
  margin: 0;
}

.deck-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.deck-list-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.dli-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dli-count {
  color: var(--muted);
  font-weight: 700;
}

.dli-remove {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: var(--fg);
  cursor: pointer;
}

.deck-validation {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(224,48,48,0.28);
  background: rgba(224,48,48,0.1);
}

.validation-list {
  margin: 0;
  padding-left: 18px;
  color: #ffc0c0;
}

.battle-lobby {
  display: grid;
  gap: 18px;
  padding-top: clamp(28px, 5vw, 38px);
}

.battle-lobby > h1 {
  margin: 0;
  text-align: center;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 900;
  font-style: italic;
  line-height: 1.05;
}

.battle-lobby > p {
  margin: 0 auto;
  max-width: 760px;
  text-align: center;
}

.lobby-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.lobby-panel {
  padding: 20px;
}

.lobby-heading {
  margin: 0 0 12px;
}

.stage-list,
.lobby-deck-list {
  display: grid;
  gap: 12px;
}

.stage-card,
.deck-card {
  width: 100%;
  display: grid;
  gap: 6px;
  text-align: left;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--fg);
}

.stage-card.selected,
.deck-card.selected {
  border-color: rgba(255,159,67,0.42);
  box-shadow: inset 0 0 0 1px rgba(255,159,67,0.12);
}

.stage-card.stage-locked {
  opacity: 0.6;
}

.stage-num,
.stage-diff,
.stage-stars,
.deck-card-count {
  color: var(--muted);
  font-size: 0.82rem;
}

.stage-name,
.deck-card-name {
  font-weight: 800;
  line-height: 1.3;
}

.deck-card-colors {
  display: flex;
  gap: 6px;
  align-items: center;
}

.lobby-actions {
  display: flex;
  justify-content: center;
}

.lobby-actions .btn-lg {
  min-width: 240px;
}

.battle-overlay .overlay-card {
  width: min(760px, calc(100vw - 32px));
}

@media (max-width: 960px) {
  .catalog-layout,
  .builder-panels,
  .lobby-panels {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .collection-stats {
    grid-template-columns: 1fr;
  }

  .cards-state-box--inline {
    grid-template-columns: 1fr;
  }

  .deck-bar {
    padding: 16px;
  }

  .deck-bar-left,
  .deck-bar-right {
    width: 100%;
  }

  .deck-list-item {
    grid-template-columns: 1fr auto auto;
  }

  .dli-mana {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .page-hero {
    padding-top: 24px;
  }

  .tcg-nav,
  .cards-tabs,
  .cards-panel,
  .deck-bar,
  .builder-panels,
  .battle-lobby,
  .campaign-shell {
    width: 100%;
  }

  .tcg-nav .btn {
    min-width: 0;
    flex: 1 1 140px;
  }

  .cards-panel,
  .builder-catalog,
  .builder-deck,
  .lobby-panel {
    padding: 18px;
  }

  .toolbar-search,
  .toolbar-select {
    width: 100%;
    min-width: 0;
  }
}

/* Account page */
.section-narrow {
  width: min(760px, calc(100vw - 32px));
  margin: 0 auto 28px;
}

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

#page-flash-message {
  margin-top: 8px;
}

/* ── Account hero ── */
.account-hero {
  padding: 40px 16px 16px;
}
.account-hero-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.account-hero-logo {
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(255,106,26,0.3);
}
.account-hero-brand h1 {
  margin: 0;
  padding: 0 4px 2px 0;
  font-family: 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', sans-serif;
  font-size: 1.8rem;
  font-style: italic;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 2px;
  background-image: linear-gradient(180deg, #ffc46b 0%, #ff8a1a 40%, #e85d00 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.7));
  line-height: 1.2;
}

/* ── Auth card (logged-out) ── */
.account-auth-card {
  max-width: 420px;
  margin: 0 auto 24px;
  padding: 28px;
  border: 1px solid #1e232b;
  border-radius: 10px;
  background: linear-gradient(180deg, #0d1017, #080a0e);
  box-shadow: 0 12px 36px rgba(0,0,0,0.4);
}

/* ── Moto tabs ── */
.moto-tabs {
  display: inline-flex;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #222;
  background: #0a0c10;
  margin-bottom: 24px;
}
.moto-tab {
  flex: 1;
  padding: 10px 24px;
  font-family: 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', sans-serif;
  font-size: 0.85rem;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #666;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  border-right: 1px solid #222;
  text-align: center;
}
.moto-tab:last-child { border-right: none; }
.moto-tab:hover { color: #aaa; background: rgba(255,255,255,0.03); }
.moto-tab.active {
  color: #000;
  background: linear-gradient(180deg, #ffc46b 0%, #ff8a1a 40%, #e85d00 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
}

/* ── Moto form inputs ── */
.moto-label {
  display: block;
  font-family: 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', sans-serif;
  font-size: 0.7rem;
  font-weight: 400;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin: 0 0 6px;
}
.moto-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--fg);
  background: #0a0c10;
  border: 1px solid #222;
  border-radius: 4px;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.moto-input:focus {
  border-color: var(--dg-orange);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3), 0 0 0 3px var(--dg-orange-dim);
}
.moto-input::placeholder { color: #444; }

/* ── Moto primary button ── */
.btn-moto-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 36px;
  font-family: 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', sans-serif;
  font-size: 1.1rem;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #000;
  text-decoration: none;
  background: linear-gradient(180deg, #ffc46b 0%, #ff8a1a 40%, #e85d00 100%);
  border: none;
  border-radius: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.4),
    inset 0 -2px 0 rgba(0,0,0,0.2),
    0 4px 16px rgba(255,106,26,0.4);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.btn-moto-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 24px rgba(255,106,26,0.6);
  filter: brightness(1.08);
}
.btn-moto-primary:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}
.btn-moto-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

/* ── Moto danger button + row ── */
.moto-row-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.btn-moto-danger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 10px 24px;
  border: none;
  border-radius: 0;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  background: linear-gradient(180deg, #ff4242 0%, #e10f16 45%, #b5000b 100%);
  color: #fff;
  text-decoration: none;
  font-family: 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', sans-serif;
  font-size: 0.9rem;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 1.7px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.2),
    inset 0 -2px 0 rgba(0,0,0,0.26),
    0 6px 18px rgba(168,0,10,0.38);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-moto-danger:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.24),
    inset 0 -2px 0 rgba(0,0,0,0.28),
    0 10px 22px rgba(168,0,10,0.48);
  filter: brightness(1.06);
}

.btn-moto-danger:active {
  transform: translateY(1px);
  filter: brightness(0.95);
}

.account-policy-box,
.account-danger-zone {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(18,21,26,0.95), rgba(10,12,16,0.98)),
    var(--carbon-weave);
  background-size: auto, 10px 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.3);
  padding: 20px;
}

.account-policy-box h3,
.account-danger-zone h3 {
  margin: 0 0 10px;
  font-family: 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', sans-serif;
  font-size: 0.92rem;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-orange);
}

.account-policy-box p,
.account-danger-zone p {
  margin: 0;
  color: var(--muted);
}

.account-danger-zone .moto-row-grid,
.account-policy-box .moto-row-grid {
  margin-top: 14px;
}

/* ── Moto auth form layout ── */
.moto-auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.moto-auth-form[hidden],
#forgot-panel[hidden] { display: none !important; }

/* ── Benefits strip ── */
.account-benefits-strip {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 460px;
  margin: 0 auto;
}
.account-benefit-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--carbon-panel);
  background-image: var(--carbon-panel), var(--carbon-weave);
  background-size: auto, 14px 14px;
  font-family: 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', sans-serif;
  font-size: 0.75rem;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
}
.benefit-icon { font-size: 1rem; }

/* ── Dashboard head ── */
.account-dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.account-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 50px;
  background: rgba(141,255,30,0.1);
  border: 1px solid rgba(141,255,30,0.25);
  font-family: 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', sans-serif;
  font-size: 0.72rem;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--signal-lime);
}
.account-status-chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal-lime);
  box-shadow: 0 0 6px var(--signal-lime);
}

/* ── Auth tabs ── */
.cards-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.cards-tab {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.08);
  background: var(--carbon-panel);
  color: var(--muted);
  font-family: 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', sans-serif;
  font-weight: 400;
  font-style: italic;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 10px 20px;
  border-radius: 0;
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
  cursor: pointer;
  flex: 1;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, filter 0.15s ease;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    inset 0 -1px 0 rgba(0,0,0,0.3),
    0 3px 10px rgba(0,0,0,0.35);
}

.cards-tab.active {
  background: linear-gradient(180deg, #ffc46b 0%, #ff8a1a 40%, #e85d00 100%);
  border-color: rgba(255,159,67,0.5);
  color: #000;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.45),
    inset 0 -2px 0 rgba(0,0,0,0.2),
    0 0 12px rgba(255,106,26,0.4);
}
.cards-tab.active:hover {
  background: linear-gradient(180deg, #c45400 0%, #e06800 35%, #ff9a3a 70%, #ffb860 100%);
  box-shadow:
    inset 0 3px 6px rgba(0,0,0,0.5),
    inset 0 1px 2px rgba(0,0,0,0.3),
    inset 0 -1px 0 rgba(255,255,255,0.15),
    0 1px 2px rgba(0,0,0,0.2);
  transform: translateY(2px);
  filter: brightness(0.92) contrast(1.05);
  color: rgba(0,0,0,0.75);
}
.cards-tab:hover {
  background: linear-gradient(180deg, rgba(10,12,16,0.98), rgba(22,26,34,0.98));
  box-shadow:
    inset 0 3px 6px rgba(0,0,0,0.55),
    inset 0 1px 2px rgba(0,0,0,0.3),
    inset 0 -1px 0 rgba(255,255,255,0.04),
    0 1px 2px rgba(0,0,0,0.2);
  transform: translateY(2px);
  filter: brightness(0.88);
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.04);
  text-shadow: 0 -1px 0 rgba(255,255,255,0.05);
}
.cards-tab:active {
  box-shadow:
    inset 0 4px 8px rgba(0,0,0,0.65),
    inset 0 2px 3px rgba(0,0,0,0.35);
  transform: translateY(3px);
  filter: brightness(0.8);
}

/* ── Auth / Card form pop-in animation ── */
@keyframes formPopIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.account-form,
.auth-form {
  animation: formPopIn 0.2s ease-out;
}

.account-form,
.cards-panel,
.account-stat-card,
.subscription-info,
.account-quick-links,
.verify-banner-box {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(18,21,26,0.95), rgba(10,12,16,0.98)),
    var(--carbon-weave);
  background-size: auto, 10px 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.3);
}

.account-form,
.cards-panel,
.subscription-info,
.account-quick-links {
  padding: 20px;
}

.account-form {
  display: grid;
  gap: 14px;
}

.account-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-family: 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', sans-serif;
  font-weight: 400;
  font-style: italic;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.account-form input,
.account-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 4px;
  border: 1px solid #222;
  background: #0a0c10;
  color: var(--fg);
  font: inherit;
  font-size: 0.95rem;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.account-form input:focus,
.account-form textarea:focus {
  outline: none;
  border-color: var(--dg-orange);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3), 0 0 0 3px var(--dg-orange-dim);
}

.account-form input::placeholder,
.account-form textarea::placeholder {
  color: #444;
}

.label-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.label-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--dg-orange);
}

.auth-inline-link {
  background: none;
  border: 0;
  color: var(--dg-orange);
  font: inherit;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}

.auth-inline-link:hover {
  text-decoration: underline;
}

.auth-error,
.save-ok,
.verify-banner-box {
  padding: 12px 14px;
}

.auth-error {
  color: #ffc0c0;
  border-color: rgba(224,48,48,0.38);
  background: rgba(224,48,48,0.12);
}

.save-ok {
  color: #d0ffb7;
  border-color: rgba(122,201,67,0.35);
  background: rgba(122,201,67,0.12);
  border-radius: 12px;
}

.verify-banner-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-color: rgba(255,159,67,0.32);
  background: rgba(255,159,67,0.12);
  margin-bottom: 20px;
  padding: 0;
}

.auth-hint {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.account-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.account-stat-card {
  padding: 18px;
  text-align: center;
  background: var(--carbon-panel);
  background-image: var(--carbon-panel), var(--carbon-weave);
  background-size: auto, 14px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.account-stat-num {
  display: block;
  font-family: 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  color: var(--dg-orange);
}

.account-stat-lbl {
  display: block;
  margin-top: 6px;
  font-family: 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', sans-serif;
  font-size: 0.68rem;
  font-style: italic;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

.account-quick-links-bar {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}
.account-quick-links-bar .nav-link {
  flex: 1 1 0;
  text-align: center;
  white-space: nowrap;
}

.account-cta-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  gap: 14px;
}

.account-quick-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 0;
}

.account-quick-links .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.subscription-info h3 {
  margin: 0 0 8px;
  font-family: 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', sans-serif;
  font-style: italic;
  color: var(--accent-orange);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.92rem;
}

.subscription-info p {
  margin: 0;
}

.account-subscription-actions {
  margin-top: 12px;
}

.subscription-badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,106,26,0.14);
  border: 1px solid rgba(255,159,67,0.32);
  color: var(--dg-orange);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.76rem;
}

.subscription-inline-note {
  margin-left: 8px;
}

.cards-tabs {
  margin-bottom: 16px;
}

.cards-panel[hidden],
.auth-error[hidden],
.save-ok[hidden],
#verify-banner[hidden],
.verify-banner-box[hidden],
#page-flash-message[hidden] {
  display: none !important;
}

.account-divider {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

.mt-20 { margin-top: 20px; }

@media (max-width: 600px) {
  .account-auth-card { padding: 20px 16px 24px; }
  .account-benefits-strip { flex-direction: column; align-items: stretch; }
  .account-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .account-cta-row { grid-template-columns: 1fr; }
  .account-quick-links { gap: 8px; flex-wrap: wrap; }
  .account-quick-links .btn { flex: 1 1 auto; text-align: center; }
  .account-quick-links-bar { flex-wrap: wrap; }
  .account-quick-links-bar .nav-link { flex: 1 1 auto; }
  .btn-moto-danger { width: 100%; }
}

/* Cart widget */
.cart-fab-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.app-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.cart-fab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  white-space: nowrap;
  gap: 0;
  min-width: 46px;
  min-height: 34px;
  padding: 6px 14px;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  border: 1px solid rgba(255,159,67,0.42);
  background: linear-gradient(180deg, rgba(18,21,27,0.98), rgba(9,11,15,0.98));
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    inset 0 -1px 0 rgba(0,0,0,0.3),
    0 3px 10px rgba(0,0,0,0.35),
    inset 0 0 0 1px rgba(255,159,67,0.12);
  transition: all 0.15s ease;
  cursor: pointer;
}

.cart-fab svg {
  width: 18px;
  height: 18px;
  opacity: 0.9;
}

.cart-fab:hover {
  background: linear-gradient(180deg, rgba(10,12,16,0.98), rgba(22,26,34,0.98));
  border-color: var(--dg-orange);
  box-shadow:
    inset 0 3px 6px rgba(0,0,0,0.55),
    inset 0 1px 2px rgba(0,0,0,0.3),
    inset 0 -1px 0 rgba(255,255,255,0.04),
    0 1px 2px rgba(0,0,0,0.2);
  transform: translateY(2px);
  filter: brightness(0.88);
  color: rgba(255,255,255,0.8);
}

.cart-fab.is-open {
  color: #fff;
  background: linear-gradient(180deg, rgba(10,12,16,0.98), rgba(22,26,34,0.98));
  border-color: var(--dg-orange);
}

.cart-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--dg-orange);
  color: #000;
  border: 1px solid rgba(11,14,17,0.92);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  font-size: 0.5rem;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}
.cart-badge[hidden] {
  display: none !important;
}

.cart-overlay[hidden] {
  display: none !important;
}

.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(3px);
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 160;
  width: min(420px, 100vw);
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  background:
    linear-gradient(180deg, rgba(18,21,26,0.98), rgba(8,10,14,0.99)),
    var(--carbon-weave);
  background-size: auto, 10px 10px;
  border-left: 1px solid rgba(255,255,255,0.08);
  box-shadow: -16px 0 40px rgba(0,0,0,0.45);
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-drawer-header,
.cart-drawer-footer {
  padding: 18px;
}

.cart-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.cart-drawer-title {
  font-weight: 900;
  font-size: 1.1rem;
  text-transform: uppercase;
  color: var(--dg-orange);
}

.cart-drawer-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
}

.cart-close {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--fg);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  font-size: 1.3rem;
  cursor: pointer;
}

.cart-drawer-body {
  padding: 18px;
  overflow: auto;
}

.cart-items {
  display: grid;
  gap: 12px;
}

.cart-empty {
  padding: 20px;
  border-radius: 14px;
  border: 1px dashed rgba(255,255,255,0.15);
  color: var(--muted);
  text-align: center;
}

.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
}

.cart-item-img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
}

.cart-item-img.placeholder {
  background: linear-gradient(135deg, rgba(255,106,26,0.16), rgba(26,111,255,0.16));
}

.cart-item-title {
  font-weight: 800;
  color: var(--fg);
}

.cart-item-variant {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.cart-item-meta {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cart-item-price {
  font-weight: 800;
  color: var(--dg-orange);
}

.cart-qty input {
  width: 68px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(8,10,14,0.95);
  color: var(--fg);
}

.cart-remove {
  border: 0;
  background: none;
  color: #ff9a9a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.cart-drawer-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  display: grid;
  gap: 14px;
}

.cart-drawer-footer > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.cart-drawer-footer strong {
  color: var(--fg);
}

.cart-actions {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr;
  gap: 10px;
}

.cart-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  text-align: center;
  font-size: 0.88rem;
  padding: 5px 7px;
}

@media (max-width: 760px) {
  .account-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-cta-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .section-narrow {
    width: min(100vw - 20px, 100%);
  }

  .account-stats-grid {
    grid-template-columns: 1fr;
  }

  .account-subscription-actions .btn,
  .actions .btn {
    width: 100%;
    text-align: center;
  }

  .account-quick-links {
    gap: 8px;
  }

  .account-quick-links .btn {
    flex: 1 1 0;
    min-width: 0;
  }

  .account-quick-links-bar {
    flex-direction: column;
  }

  .cart-item {
    grid-template-columns: 1fr;
  }
}

/* Free-decks popup */
.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}
.popup-card {
  position: relative;
  max-width: 420px;
  width: 90%;
  padding: 22px 20px 18px;
  border-radius: 14px;
  border: 2px solid rgba(255,159,67,0.3);
  background:
    linear-gradient(170deg, rgba(18,21,26,0.98), rgba(8,10,14,0.99)),
    var(--carbon-weave);
  background-size: auto, 14px 14px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.6);
  text-align: center;
}
.popup-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}
.popup-close:hover { color: var(--fg); }
.popup-icon { font-size: 2.2rem; margin-bottom: 6px; }
.popup-card h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  color: var(--accent-orange);
}
.popup-body {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.popup-body strong { color: var(--fg); }
.popup-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════
   DIVIDERS
   ═══════════════════════════════════════════════════ */

.divider-center-glow {
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--dg-orange) 40%,
    var(--dg-orange) 60%,
    transparent 100%
  );
  box-shadow: 0 0 12px var(--dg-orange-glow), 0 0 4px var(--dg-orange-glow);
}

.divider-fade-dash {
  height: 0;
  border: none;
  border-top: 2px dashed var(--dg-orange);
  opacity: 0.45;
  mask-image: linear-gradient(90deg, transparent 0%, white 15%, white 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, white 15%, white 85%, transparent 100%);
}

/* ═══════════════════════════════════════════════════
   SITE FOOTER
   ═══════════════════════════════════════════════════ */

.site-footer {
  margin-top: clamp(56px, 8vw, 104px);
  min-height: clamp(120px, 16vw, 180px);
  padding: 8px 24px 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  text-align: center;
}

.site-footer .divider-center-glow {
  margin: 0 auto auto;
  max-width: 680px;
}

.site-footer .divider-fade-dash {
  margin: 0 auto;
  max-width: 460px;
}

.site-footer p {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0 auto;
  line-height: 1.55;
  letter-spacing: 0.02em;
}

@media (max-width: 600px) {
  .hero-carousel {
    margin-bottom: 30px;
  }

  .site-footer {
    min-height: 108px;
    padding: 8px 16px 14px;
    gap: 8px;
  }

  .site-footer .divider-center-glow {
    max-width: 92%;
  }

  .site-footer .divider-fade-dash {
    max-width: 78%;
  }
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.site-footer a:hover {
  color: var(--dg-orange);
}

/* Copilot UI fixes */
.page-hero .tcg-nav {
  margin-top: 0;
}

.tcg-nav {
  width: min(100%, 1080px);
  display: flex;
  flex-wrap: nowrap !important;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 1rem auto 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tcg-nav::-webkit-scrollbar {
  display: none;
}

.tcg-nav .btn {
  flex: 0 0 auto;
  white-space: nowrap;
  justify-content: center;
}

.cart-fab {
  min-width: 46px;
  min-height: 34px;
  padding: 6px 14px;
}

.cart-fab svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 900px) {
  .cart-fab {
    min-width: 42px;
    min-height: 32px;
    padding: 6px 12px;
  }

  .cart-fab svg {
    width: 17px;
    height: 17px;
  }
}

@media (max-width: 700px) {
  .cart-fab {
    min-width: 40px;
    min-height: 32px;
    padding: 6px 11px;
  }

  .cart-fab svg {
    width: 16px;
    height: 16px;
  }
}
