/* ===== EINSTEIN v2 – premium visual ===== */

:root {
  --blue: #0b0f1f; --blue2: #151a35; --accent: #1e3a8a;
  --yellow: #FFD700; --yellow2: #ffb800; --orange: #FF8C00;
  --green: #32CD32; --gray: #B0B0B0; --black: #2C2C2C;
  --purple: #9B59B6; --red: #FF6B6B; --cyan: #4ECDC4;
  /* DEFAULT = DARK (единый стиль с sandbox) */
  --bg: #0b0f1f; --bg2: #0f1530; --card: #151a35;
  --text: #e6eaf5; --text-muted: #9aa3b8; --border: #232a48;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.6);
  --shadow-glow: 0 0 24px rgba(255,215,0,.25);
  --radius: 14px;
  --radius-sm: 8px;
  --font-display: 'Unbounded', 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', 'Manrope', -apple-system, system-ui, sans-serif;
}

:root[data-theme="light"] {
  --bg: #f6f7fb; --bg2: #ffffff; --card: #ffffff;
  --text: #1a1f2e; --text-muted: #6b7280; --border: #e5e7eb;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);
}

/* keep old :root[data-theme="dark"] selector as no-op (defaults are already dark) */
:root[data-theme="dark"] {}

* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-feature-settings: 'cv11','ss01','ss03';
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
h1,h2,h3,h4,h5 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== NAV ===== */
nav {
  background: rgba(11,15,31,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
nav .container { display:flex; align-items:center; gap:14px; overflow-x:auto; }
nav a {
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all .2s;
}
nav a:hover, nav a.active {
  color: #fff;
  background: rgba(255,255,255,.08);
}
nav a.active { background: linear-gradient(135deg, rgba(255,215,0,.15), rgba(255,184,0,.08)); color: var(--yellow); }
nav .logo {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  color: var(--yellow);
  letter-spacing: 0.12em;
  text-decoration: none;
  padding-right: 8px;
  border-right: 1px solid rgba(255,255,255,.1);
  margin-right: 4px;
}
nav .theme-toggle {
  margin-left: auto;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .2s;
}
nav .theme-toggle:hover { background: rgba(255,255,255,.15); transform: rotate(15deg); }

/* ===== PROGRESS BAR ===== */
.mission-progress {
  height: 3px;
  background: rgba(255,255,255,.08);
  position: sticky;
  top: 64px;
  z-index: 99;
  overflow: hidden;
}
.mission-progress .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--yellow), var(--orange));
  box-shadow: 0 0 12px rgba(255,215,0,.5);
  transition: width .4s cubic-bezier(.2,.9,.3,1);
}

/* ===== HERO ===== */
.hero {
  position: relative;
  background: linear-gradient(135deg, #0b0f1f 0%, #1e3a8a 50%, #0b0f1f 100%);
  color: #fff;
  padding: 72px 0 60px;
  text-align: center;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(255,215,0,.15), transparent 50%),
              radial-gradient(circle at 80% 70%, rgba(78,205,196,.12), transparent 50%);
  pointer-events: none;
}
#hexCanvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .35; pointer-events: none; }
.hero .container { position: relative; z-index: 2; }
.hero h1 {
  font-size: clamp(28px, 5vw, 52px);
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff, #FFD700, #fff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 8s ease-in-out infinite;
  background-size: 200% auto;
}
.hero h1 span { color: var(--yellow); -webkit-text-fill-color: var(--yellow); }
.hero p { font-size: clamp(14px, 2vw, 18px); opacity: .85; font-weight: 400; }
@keyframes shimmer { 0%,100% { background-position: 0% center; } 50% { background-position: 100% center; } }

/* ===== SECTIONS (alternating dark / light) ===== */
section { padding: 64px 0; position: relative; }
section:nth-child(even) { background: var(--bg2); }
section.dark {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue2) 100%);
  color: #fff;
}
section.dark h2 { color: #fff; border-color: var(--yellow); }
section.dark h3 { color: var(--yellow); }
section.dark p { color: rgba(255,255,255,.8); }
section.dark .card { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.08); color: #fff; }
section.dark .card h4 { color: var(--yellow); }
section.dark .card p { color: rgba(255,255,255,.7); }

h2 {
  font-size: clamp(22px, 3.2vw, 32px);
  color: var(--text);
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--yellow);
  display: inline-block;
}
h3 { font-size: clamp(17px, 2vw, 22px); color: var(--text); margin: 20px 0 10px; }

/* ===== CARDS ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin: 20px 0;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: transform .25s cubic-bezier(.2,.9,.3,1), box-shadow .25s, border-color .25s;
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; width: 4px; height: 100%;
  background: linear-gradient(180deg, var(--yellow), var(--orange));
  opacity: .85;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--yellow);
}
.card h4 { color: var(--text); margin-bottom: 8px; font-size: 15px; font-weight: 700; }
.card p { font-size: 13.5px; color: var(--text-muted); }

/* Mission card links */
a.card { text-decoration: none; display: block; }
a.card h4 { font-size: 15px; }

/* ===== TABLE ===== */
.comp-table { width:100%; border-collapse: collapse; margin: 20px 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.comp-table th { background: var(--blue); color:#fff; padding: 12px 16px; text-align:left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.comp-table td { padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; background: var(--card); color: var(--text); }
.comp-table tr:hover td { background: color-mix(in srgb, var(--yellow) 6%, var(--card)); }
.color-dot { width: 20px; height: 20px; border-radius: 50%; display: inline-block; vertical-align: middle; margin-right: 8px; border: 2px solid rgba(0,0,0,.1); box-shadow: 0 0 6px rgba(0,0,0,.1); }

/* ===== DETAIL CARDS ===== */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.detail-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  gap: 14px;
  align-items: center;
  transition: all .25s cubic-bezier(.2,.9,.3,1);
}
.detail-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: var(--shadow-md);
  border-color: var(--yellow);
}
.hex-viz { width: 100px; height: 92px; flex-shrink: 0; filter: drop-shadow(0 2px 4px rgba(0,0,0,.08)); }
.detail-info { flex: 1; min-width: 0; }
.detail-info .name { font-weight: 700; font-size: 14px; color: var(--text); font-family: var(--font-display); }
.detail-info .type-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.detail-magnets { display: flex; gap: 3px; margin-top: 6px; flex-wrap: wrap; }
.role-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.role-tag { font-size: 11px; padding: 3px 9px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent); font-weight: 500; }

.mag { width: 26px; height: 24px; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color:#fff; }
.mag.n { background: linear-gradient(135deg, var(--red), #ff4d4d); box-shadow: 0 2px 6px rgba(255,107,107,.35); }
.mag.s { background: linear-gradient(135deg, var(--cyan), #2ebbaf); box-shadow: 0 2px 6px rgba(78,205,196,.35); }
.mag.none { background: var(--border); color: var(--text-muted); box-shadow: none; }

/* ===== HEX BOARD ===== */
/* Размеры гекса: 68px = 60px viewBox + 8px padding (4px с каждой стороны)
   60px = ширина SVG viewBox для boardHexSvg (hex-render.js)
   52px = высота SVG viewBox + 8px padding */
.hex-board { position: relative; margin: 24px auto; filter: drop-shadow(0 4px 16px rgba(0,0,0,.08)); }
.hex-cell {
  position: absolute;
  width: 68px;  /* 60px viewBox + 8px padding */
  height: 60px; /* 52px viewBox + 8px padding */
  display: flex; align-items: center; justify-content: center;
  cursor: default;
  transition: transform .2s cubic-bezier(.2,.9,.3,1), filter .2s;
}
.hex-cell:hover { transform: scale(1.12); z-index: 10; filter: brightness(1.08) drop-shadow(0 4px 12px rgba(255,215,0,.35)); }
.hex-cell svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.hex-cell .hex-content { position: relative; z-index: 2; text-align: center; line-height: 1.2; }
.hex-cell .hex-symbol { font-size: 20px; display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,.2)); }
.hex-cell .hex-label { font-size: 8px; color: #2a2a2a; font-weight: 600; }
.hex-cell .hex-id { position: absolute; top: 3px; left: 50%; transform: translateX(-50%); font-size: 7px; font-weight: 700; color: rgba(0,0,0,.55); z-index: 5; pointer-events: none; white-space: nowrap; }
.hex-cell.empty .hex-content { color: #ccc; font-size: 9px; }

.hex-source polygon { fill: #FFF3B0; stroke: #b8860b; stroke-width: 2; }
.hex-processing polygon { fill: #FFD8A8; stroke: #cc7000; stroke-width: 2; }
.hex-consumer polygon { fill: #B8F0B8; stroke: #228b22; stroke-width: 2; }
.hex-pipe polygon { fill: #EAECEF; stroke: #8a8f99; stroke-width: 2; }
.hex-obstacle polygon { fill: #4a4f5e; stroke: #2a2f3e; stroke-width: 2; }
.hex-obstacle .hex-content { color: #fff; }
.hex-special polygon { fill: #E8D5F5; stroke: #7b2d8e; stroke-width: 2; }
.hex-empty polygon { fill: color-mix(in srgb, var(--border) 70%, transparent); stroke: var(--border); stroke-width: 1; }

/* ===== CUSTOM ICONS (replace emoji) ===== */
.ico {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.2em;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.ico.filled { fill: currentColor; stroke: none; }

/* ===== MAGNET PULSE ANIMATION ===== */
@keyframes pulseN {
  0%, 100% { opacity: .85; stroke-width: 2; }
  50% { opacity: 1; stroke-width: 2.6; }
}
@keyframes pulseS {
  0%, 100% { opacity: .85; stroke-width: 2; }
  50% { opacity: 1; stroke-width: 2.6; }
}
.hex-cell svg line[stroke="#FF6B6B"] { animation: pulseN 2.4s ease-in-out infinite; }
.hex-cell svg line[stroke="#4ECDC4"] { animation: pulseS 2.4s ease-in-out infinite .8s; }

/* Larger viz magnets pulse too */
.hex-viz line[stroke="#FF6B6B"] { animation: pulseN 2.8s ease-in-out infinite; transform-origin: center; }
.hex-viz line[stroke="#4ECDC4"] { animation: pulseS 2.8s ease-in-out infinite 1s; transform-origin: center; }

/* ===== TOOLTIP ===== */
.hex-tooltip {
  position: fixed;
  background: rgba(11,15,31,.96);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-family: var(--font-body);
  pointer-events: none;
  z-index: 500;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .15s, transform .15s;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,215,0,.3);
  max-width: 240px;
  backdrop-filter: blur(8px);
}
.hex-tooltip.show { opacity: 1; transform: translateY(0); }
.hex-tooltip .tt-name { font-family: var(--font-display); font-weight: 700; color: var(--yellow); font-size: 13px; margin-bottom: 4px; }
.hex-tooltip .tt-line { font-size: 11px; opacity: .85; }
.hex-tooltip .tt-mag { display: inline-block; padding: 1px 6px; border-radius: 4px; font-weight: 700; font-size: 10px; margin: 0 2px; }
.hex-tooltip .tt-mag.n { background: var(--red); color: #fff; }
.hex-tooltip .tt-mag.s { background: var(--cyan); color: #fff; }

/* ===== MISSION META ===== */
.mission-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 20px 0; }
.meta-card {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  transition: transform .25s, box-shadow .25s;
  position: relative;
  overflow: hidden;
}
.meta-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.meta-card h5 { font-family: var(--font-display); font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); margin-bottom: 6px; font-weight: 700; }
.meta-card p { font-size: 13.5px; color: var(--text); }
.meta-goal { background: linear-gradient(135deg, #1b3a20, #0f2015); border-color: #2e6b35; }
.meta-lesson { background: linear-gradient(135deg, #0f1e3a, #081326); border-color: #1e3a8a; }
.meta-setup { background: linear-gradient(135deg, #3a2a0f, #201708); border-color: #8a5a1e; }
.meta-reward { background: linear-gradient(135deg, #3a0f2a, #20081a); border-color: #8a1e5a; }
.meta-card p { color: var(--text); }
.meta-card h5 { color: var(--text-muted); }

:root[data-theme="light"] .meta-goal { background: linear-gradient(135deg, #e8f5e9, #f1f8e9); border-color: #a5d6a7; }
:root[data-theme="light"] .meta-lesson { background: linear-gradient(135deg, #e3f2fd, #e8eaf6); border-color: #90caf9; }
:root[data-theme="light"] .meta-setup { background: linear-gradient(135deg, #fff3e0, #fff8e1); border-color: #ffcc80; }
:root[data-theme="light"] .meta-reward { background: linear-gradient(135deg, #fce4ec, #f8bbd0); border-color: #f48fb1; }

/* ===== STEP / MAGNET CHECK / VICTORY ===== */
.victory-text {
  background: linear-gradient(135deg, #0f2015, #1b3a20);
  border: 2px solid #2e6b35;
  color: #d4f5d4;
  border-radius: var(--radius);
  padding: 16px 20px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 12.5px;
  white-space: pre-line;
  margin: 16px 0;
  box-shadow: var(--shadow-sm);
}
:root[data-theme="light"] .victory-text {
  background: linear-gradient(135deg, #f1f8e9, #dcedc8);
  border-color: #aed581;
  color: #1a1f2e;
}

/* ===== CHECKLIST ===== */
.checklist { list-style: none; margin: 16px 0; background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.checklist li { padding: 12px 18px; border-bottom: 1px solid var(--border); font-size: 13.5px; display: flex; align-items: center; gap: 10px; color: var(--text); transition: background .15s; }
.checklist li:last-child { border-bottom: none; }
.checklist li:hover { background: color-mix(in srgb, var(--yellow) 5%, transparent); }
.check-box { width: 22px; height: 22px; border: 2px solid var(--border); border-radius: 6px; flex-shrink: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .2s; font-size: 13px; background: var(--bg); }
.check-box.checked { background: linear-gradient(135deg, var(--green), #2db82d); border-color: var(--green); color:#fff; transform: scale(1.05); }
.coins-badge { margin-left: auto; background: linear-gradient(135deg, var(--yellow), var(--yellow2)); color: #333; padding: 2px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; box-shadow: 0 2px 4px rgba(255,215,0,.35); }

/* ===== LEGEND / FILTERS ===== */
.legend { display: flex; gap: 18px; margin: 14px 0; padding: 12px 18px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); flex-wrap: wrap; border: 1px solid var(--border); }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0; }
.filter-btn { padding: 6px 14px; border-radius: 18px; border: 2px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; font-size: 12px; font-weight: 600; transition: all .2s; font-family: var(--font-body); }
.filter-btn:hover { border-color: var(--yellow); transform: translateY(-1px); }
.filter-btn.active { background: var(--blue); color:#fff; border-color: var(--blue); box-shadow: var(--shadow-md); }

/* ===== INVESTOR ===== */
.investor-block {
  background: linear-gradient(135deg, #0b0f1f 0%, #1e3a8a 50%, #0b0f1f 100%);
  color:#fff;
  border-radius: var(--radius);
  padding: 34px;
  margin: 20px 0;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.investor-block::before {
  content:''; position:absolute; inset:0;
  background: radial-gradient(circle at 20% 30%, rgba(255,215,0,.12), transparent 50%);
  pointer-events:none;
}
.investor-block > * { position: relative; }
.investor-block h3 { color: var(--yellow); font-size: 22px; margin-bottom: 8px; }
.investor-block p { opacity: .9; margin: 8px 0; font-size: 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 16px; margin-top: 20px; }
.stat { text-align: center; padding: 18px 12px; background: rgba(255,255,255,.06); border-radius: 12px; border: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(4px); transition: transform .25s; }
.stat:hover { transform: translateY(-3px); background: rgba(255,255,255,.09); }
.stat .num { font-family: var(--font-display); font-size: 30px; font-weight: 800; color: var(--yellow); }
.stat .label { font-size: 11px; opacity: .7; margin-top: 3px; text-transform: uppercase; letter-spacing: 0.8px; }

/* ===== BACK / NAV LINKS ===== */
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--yellow); text-decoration: none; font-size: 14px; font-weight: 600; margin-bottom: 12px; transition: transform .2s; }
.back-link:hover { color: var(--yellow2); transform: translateX(-3px); }
.mission-nav { display: flex; justify-content: space-between; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.mission-nav a { color: var(--yellow); text-decoration: none; font-weight: 700; font-family: var(--font-display); transition: transform .2s; }
.mission-nav a:hover { transform: translateX(3px); color: var(--yellow2); }

:root[data-theme="light"] .mission-nav a, :root[data-theme="light"] .back-link { color: var(--accent); }

/* ===== SCROLL REVEAL ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s cubic-bezier(.2,.9,.3,1), transform .7s cubic-bezier(.2,.9,.3,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .hex-cell svg line, .hex-viz line { animation: none !important; }
}

/* ===== MISSION STEPS ===== */
.step {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 14px 0;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  transition: transform .2s, box-shadow .2s;
}
.step:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.step h4 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}
.step p { font-size: 14px; color: var(--text-muted); margin: 0; line-height: 1.6; }
.step .try-wrong {
  background: color-mix(in srgb, var(--orange) 10%, var(--card));
  border: 1px solid color-mix(in srgb, var(--orange) 35%, transparent);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text);
}
.step .try-wrong b { color: var(--orange); }

/* ===== MAGNET CHECK ===== */
.magnet-check {
  background: color-mix(in srgb, var(--green) 12%, var(--card));
  border: 1px solid color-mix(in srgb, var(--green) 35%, transparent);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 18px 0;
  font-size: 13px;
  color: var(--text);
}
.magnet-check h4 {
  font-family: var(--font-display);
  color: var(--green);
  margin: 0 0 10px;
  font-size: 14px;
}
.magnet-check .row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 5px 0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--text-muted);
}
.magnet-check .ok { color: var(--green); font-weight: 700; }
.magnet-check .fail { color: var(--red); font-weight: 700; }

/* ===== PIECES LIST ===== */
.pieces-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.piece-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text);
  transition: all .2s;
}
.piece-tag:hover { border-color: var(--yellow); transform: translateY(-1px); }
.piece-tag .pid { font-family: var(--font-display); font-weight: 700; color: var(--yellow); }

footer { background: var(--blue); color: rgba(255,255,255,.5); text-align: center; padding: 24px 16px; font-size: 12px; font-family: var(--font-body); }
footer a { color: var(--yellow); text-decoration: none; }

@media print { nav, .theme-toggle, .mission-progress { display: none; } }

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  /* Breakpoint для планшетов и мобильных */
  .container { padding: 0 14px; }
  nav { padding: 10px 0; }
  nav .container { gap:8px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  nav .container::-webkit-scrollbar { display: none; }
  nav a { font-size: 12px; padding: 5px 9px; }
  nav .logo { font-size: 14px; flex-shrink: 0; padding-right: 6px; }
  nav .theme-toggle { width: 32px; height: 32px; font-size: 14px; }
  .hero { padding: 44px 0 36px; }
  section { padding: 44px 0; }
  .comp-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .card-grid { grid-template-columns: 1fr; gap: 12px; }
  .card { padding: 16px; }
  .detail-grid { grid-template-columns: 1fr; gap: 10px; }
  .detail-card { padding: 12px; }
  .hex-viz { width: 90px; height: 83px; }
  .mission-meta { grid-template-columns: 1fr; gap: 10px; }
  /* Scale down hex board on mobile: 0.78 = fits 7-col board on ~360px screens */
  .hex-board { transform: scale(0.78); transform-origin: top center; margin: 20px auto !important; }
  .filter-btn { padding: 5px 12px; font-size: 11px; }
  .investor-block { padding: 22px; }
  .stat-grid { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .stat .num { font-size: 24px; }
  .legend { gap: 12px; padding: 10px 14px; }
  .victory-text { font-size: 11.5px; padding: 12px; }
  .mission-nav { font-size: 13px; }
}
