/*
 * meancity_noir.css — Neo-Noir Visual Theme
 * MeanCity | Palette: Deep Graphite × Neon Crimson × Cold Steel
 *
 * Palette:
 *   Deep Graphite (bg):  #1a1a1a  #2d2d2d  #3a3a3a
 *   Neon Crimson (accent): #dc143c  #ff0040  #8b0000
 *   Cold Steel (text):   #c0c0c0  #e8e8e8  #f5f5f5
 */

/* ── 0. FONTS ────────────────────────────────────────────────────────────── */

/* Roboto Mono (local fallback chain) */
body {
  font-family: 'JetBrains Mono', 'Roboto Mono', 'Courier New', monospace;
}

/* ── 1. BASE ─────────────────────────────────────────────────────────────── */

html {
  scrollbar-color: #2d2d2d #0d0d0d;
  scrollbar-width: thin;
}

body {
  background: linear-gradient(180deg, #1a1a1a 0%, #2d2d2d 100%);
  background-attachment: fixed;
  color: #e8e8e8;
  min-height: 100vh;
}

::selection {
  background: rgba(220, 20, 60, 0.35);
  color: #f5f5f5;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0d0d0d; }
::-webkit-scrollbar-thumb { background: #2d2d2d; border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: #dc143c; }

/* ── 2. NAVIGATION ───────────────────────────────────────────────────────── */

nav, .navbar, .global-nav {
  background: rgba(18, 18, 18, 0.97);
  border-bottom: 2px solid #dc143c !important;
  backdrop-filter: blur(4px);
}

.global-nav a {
  color: #888 !important;
  text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.global-nav a:hover {
  color: #dc143c !important;
  text-shadow: 0 0 8px rgba(220, 20, 60, 0.5);
}

.nav-brand {
  color: #666 !important;
  letter-spacing: 2px;
}

.nav-brand:hover {
  color: #dc143c !important;
}

/* ── 3. BUTTONS ──────────────────────────────────────────────────────────── */

/* Primary action button (crimson) */
.btn-noir, .btn-primary-noir, .btn-danger, .action-button {
  background: linear-gradient(135deg, #dc143c 0%, #8b0000 100%);
  border: 1px solid #ff0040;
  color: #f5f5f5 !important;
  font-family: inherit;
  font-size: 0.82rem;
  letter-spacing: 2px;
  padding: 10px 22px;
  cursor: pointer;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 0 10px rgba(220, 20, 60, 0.3);
  transition: box-shadow 0.3s ease, transform 0.2s ease, background 0.2s ease;
}

.btn-noir:hover, .btn-primary-noir:hover, .btn-danger:hover, .action-button:hover {
  box-shadow: 0 0 22px rgba(255, 0, 64, 0.65);
  transform: translateY(-2px);
  background: linear-gradient(135deg, #ff0040 0%, #dc143c 100%);
}

.btn-noir:active { transform: translateY(0); }

/* Secondary (steel/ghost) */
.btn-secondary-noir, .btn-steel {
  background: transparent;
  border: 1px solid #3a3a3a;
  color: #c0c0c0;
  font-family: inherit;
  font-size: 0.8rem;
  letter-spacing: 1px;
  padding: 10px 20px;
  cursor: pointer;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
  transition: border-color 0.2s, color 0.2s;
}

.btn-secondary-noir:hover, .btn-steel:hover {
  border-color: #c0c0c0;
  color: #f5f5f5;
}

/* ── 4. CARDS & PANELS ───────────────────────────────────────────────────── */

.card, .panel, .role-card, .mc-card {
  background: rgba(45, 45, 45, 0.9);
  border: 1px solid #3a3a3a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover, .mc-card:hover {
  border-color: rgba(220, 20, 60, 0.4);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

.card-header, .mc-card-header {
  background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%);
  border-bottom: 2px solid #dc143c;
  color: #c0c0c0;
  padding: 12px 16px;
  font-size: 0.88rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ── 5. PLAYER CARDS ─────────────────────────────────────────────────────── */

.player-card {
  background: #2d2d2d;
  border: 2px solid #3a3a3a;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
  position: relative;
}

.player-card:hover {
  border-color: #dc143c;
  box-shadow: 0 0 15px rgba(220, 20, 60, 0.4);
  transform: scale(1.03);
}

.player-card.selected {
  border-color: #ff0040;
  box-shadow: 0 0 22px rgba(255, 0, 64, 0.65);
  background: rgba(220, 20, 60, 0.08);
}

.player-card.dead {
  opacity: 0.35;
  filter: grayscale(100%);
  pointer-events: none;
}

.player-card.exiled {
  opacity: 0.5;
  border-style: dashed;
}

/* ── 6. PHASE INDICATORS ─────────────────────────────────────────────────── */

.phase-night {
  background: linear-gradient(135deg, #1a1a1a 0%, #080808 100%);
  border: 2px solid #dc143c;
  color: #ff0040;
  padding: 8px 16px;
  font-size: 0.88rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.phase-day {
  background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
  border: 2px solid #c0c0c0;
  color: #e8e8e8;
  padding: 8px 16px;
  font-size: 0.88rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ── 7. TABLES & LOGS ────────────────────────────────────────────────────── */

table {
  background: rgba(26, 26, 26, 0.97);
  color: #e8e8e8;
  border-collapse: collapse;
  width: 100%;
}

thead {
  background: #2d2d2d;
  border-bottom: 2px solid #dc143c;
}

th {
  color: #c0c0c0;
  font-size: 0.84rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 10px 12px;
  font-weight: normal;
}

td {
  padding: 9px 12px;
  font-size: 0.92rem;
  border-bottom: 1px solid #1e1e1e;
}

tr:hover td {
  background: rgba(220, 20, 60, 0.07);
}

/* ── 8. FORMS & INPUTS ───────────────────────────────────────────────────── */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
select,
textarea {
  background: #2d2d2d !important;
  border: 1px solid #3a3a3a !important;
  color: #e8e8e8 !important;
  font-family: inherit;
  padding: 10px 12px;
  border-radius: 0;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #dc143c !important;
  box-shadow: 0 0 6px rgba(220, 20, 60, 0.25) !important;
}

input::placeholder,
textarea::placeholder {
  color: #555;
}

select option {
  background: #2d2d2d;
  color: #e8e8e8;
}

label {
  color: #888;
  font-size: 0.88rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}

.form-group {
  margin-bottom: 1.4rem;
}

/* ── 9. ICONS & SYMBOLS ──────────────────────────────────────────────────── */

.icon-death, .icon-kill, .mc-kill {
  color: #dc143c;
  text-shadow: 0 0 6px rgba(220, 20, 60, 0.5);
}

.icon-protect, .icon-sheriff, .mc-protect {
  color: #c0c0c0;
  text-shadow: 0 0 6px rgba(192, 192, 192, 0.3);
}

.icon-heal, .mc-heal {
  color: #00cc44;
  text-shadow: 0 0 6px rgba(0, 204, 68, 0.3);
}

.icon-warn, .mc-warn {
  color: #cc6600;
}

/* ── 10. DEPTH LAYERS ────────────────────────────────────────────────────── */

.layer-1 { z-index: 1; }
.layer-2 { z-index: 10;  box-shadow: 0 2px 6px rgba(0,0,0,0.35); }
.layer-3 { z-index: 100; box-shadow: 0 4px 12px rgba(0,0,0,0.55); }
.layer-4 { z-index: 999; box-shadow: 0 8px 24px rgba(0,0,0,0.7); }

/* ── 11. ANIMATIONS ──────────────────────────────────────────────────────── */

@keyframes pulse-crimson {
  0%, 100% { box-shadow: 0 0 6px rgba(220, 20, 60, 0.3); }
  50%       { box-shadow: 0 0 22px rgba(255, 0, 64, 0.65); }
}

@keyframes flicker {
  0%, 95%, 100% { opacity: 1; }
  96%, 98%      { opacity: 0.85; }
  97%           { opacity: 0.7; }
}

@keyframes noir-scan {
  0%   { background-position: 0 0; }
  100% { background-position: 0 100vh; }
}

.alert-danger,
.notification-kill,
.pulse-danger {
  animation: pulse-crimson 2.2s infinite;
}

.neon-crimson {
  color: #dc143c;
  text-shadow: 0 0 8px rgba(220, 20, 60, 0.7), 0 0 16px rgba(255, 0, 64, 0.3);
}

.flicker { animation: flicker 8s infinite; }

/* ── 12. TYPOGRAPHY ──────────────────────────────────────────────────────── */

h1, h2, h3, h4 {
  color: #e8e8e8;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; color: #c0c0c0; letter-spacing: 3px; }
h3 { font-size: 0.9rem;  color: #888;    letter-spacing: 2px; }

.accent-text, .crimson { color: #dc143c; font-weight: bold; }
.steel-text  { color: #c0c0c0; }
.dim-text    { color: #555; }
.meta-text   { color: #888; font-size: 0.82rem; }
.mono        { font-family: 'JetBrains Mono', 'Roboto Mono', monospace; }

a { color: #888; text-decoration: none; transition: color 0.2s; }
a:hover { color: #dc143c; }

/* ── 13. ALERTS & NOTICES ────────────────────────────────────────────────── */

.mc-alert {
  padding: 12px 16px;
  font-size: 0.92rem;
  border-left: 3px solid #dc143c;
  background: rgba(220, 20, 60, 0.06);
  color: #c0c0c0;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.mc-alert.beta {
  border-left-color: #886600;
  background: rgba(136, 102, 0, 0.08);
}

.mc-alert.info {
  border-left-color: #0066aa;
  background: rgba(0, 102, 170, 0.06);
}

.mc-alert.success {
  border-left-color: #00cc44;
  background: rgba(0, 204, 68, 0.06);
}

/* ── 14. BETA NOTICE BANNER ──────────────────────────────────────────────── */

.beta-notice {
  background: rgba(100, 80, 0, 0.12);
  border-top: 1px solid #1a1500;
  border-bottom: 1px solid #1a1500;
  padding: 10px 16px;
  font-size: 0.86rem;
  color: #6b5a00;
  letter-spacing: 1px;
  text-align: center;
  line-height: 1.8;
}

.beta-notice strong { color: #997a00; }
.beta-notice a { color: #775500; text-decoration: underline; }
.beta-notice a:hover { color: #bb8800; }

/* ── 15. FACTION COLORS ──────────────────────────────────────────────────── */

.faction-korennoj  { color: #0066cc; }
.faction-prestupnik { color: #cc2222; }
.faction-otstupnik  { color: #886600; }
.faction-legenda    { color: #6622aa; }

/* ── 16. GAME LOG ENTRIES ────────────────────────────────────────────────── */

.log-kill    { color: #dc143c; }
.log-protect { color: #4488cc; }
.log-info    { color: #555; }
.log-system  { color: #8b0000; font-style: italic; }
.log-win     { color: #00cc44; font-weight: bold; }

/* ── 17. STATUS TAGS ─────────────────────────────────────────────────────── */

.tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.92rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 1px solid;
}

.tag-alive  { color: #00cc44; border-color: #004400; background: rgba(0,204,68,0.05); }
.tag-dead   { color: #555;    border-color: #777; background: transparent; }
.tag-exiled { color: #886600; border-color: #443300; background: rgba(136,102,0,0.05); }
.tag-night  { color: #dc143c; border-color: #4a0010; background: rgba(220,20,60,0.05); }
.tag-day    { color: #c0c0c0; border-color: #888; background: rgba(192,192,192,0.04); }

/* ── 18. DIVIDERS ────────────────────────────────────────────────────────── */

.mc-divider {
  border: none;
  border-top: 1px solid #1e1e1e;
  margin: 1.5rem 0;
}

.mc-divider-crimson {
  border: none;
  border-top: 1px solid rgba(220, 20, 60, 0.3);
  margin: 1.5rem 0;
}

/* ── 19. RESPONSIVE HELPERS ──────────────────────────────────────────────── */

@media (max-width: 480px) {
  h1 { font-size: 1.2rem; }
  h2 { font-size: 0.95rem; }
  .mc-hide-mobile  { display: none !important; }
  .mc-full-mobile  { width: 100% !important; }
  .mc-stack-mobile { flex-direction: column !important; }
}


/* === SKYLINE HIDDEN === */
.skyline-wrap { display: none !important; }


/* ========================================
   MOBILE IMPROVEMENTS (auto-fix)
   ======================================== */

/* Larger tap targets */
a, button { min-height: 44px; min-width: 44px; }
.btn-primary, .btn-ghost, .tb-btn { 
  min-height: 48px; 
  padding: 14px 24px;
  font-size: 0.9rem !important;
}

/* Nav links bigger on mobile */
@media (max-width: 768px) {
  .nav-links a {
    font-size: 0.85rem !important;
    padding: 10px 12px !important;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .nav-brand { font-size: 1rem !important; }
  .hero-title { font-size: clamp(1.6rem, 7vw, 3rem) !important; }
  .hero-sub { font-size: 0.9rem !important; color: #777 !important; }
  .feat-name { font-size: 0.85rem !important; }
  .feat-desc { font-size: 0.8rem !important; }
  .stat-num { font-size: 1.8rem !important; }
  .stat-lbl { font-size: 0.72rem !important; color: #777 !important; }
  .sec-title { font-size: 1.2rem !important; }
  .sec-label { font-size: 0.7rem !important; }
  .fac-name { font-size: 0.85rem !important; }
  .fac-flavor { font-size: 0.8rem !important; }
  .cycle-list { font-size: 0.8rem !important; }
  .footer-cta-title { font-size: 1rem !important; }
}

/* Better contrast for dark elements */
.feat-card { background: #070707; }
.hero-sub { color: #888 !important; }
.proof-big { color: #888; }
.hero-badges { color: #444 !important; }
.feat-desc { color: #999 !important; }
.fac-flavor { color: #888 !important; }

/* Hero video fix - ensure content overlaps video */
.hero {
  position: relative !important;
}
.hero > .video-bg {
  position: absolute !important;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0 !important;
}
.hero-grid-bg, .hero-vignette { z-index: 1 !important; }
.hero-content { 
  position: relative !important;
  z-index: 2 !important; 
}


/* ========================================
   TESTER FIXES v4 - March 2026
   ======================================== */

/* 1. HERO: текст поверх видео */
.hero {
  position: relative !important;
  overflow: hidden !important;
  min-height: 88vh !important;
}
.hero > .video-bg {
  position: absolute !important;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0 !important;
  pointer-events: none;
}
.hero-grid-bg, .hero-vignette {
  position: absolute !important;
  inset: 0;
  z-index: 1 !important;
  pointer-events: none;
}
.hero-content {
  position: relative !important;
  z-index: 10 !important;
}

/* 2. MARCK SCRIPT для hero title */
.hero-title {
  font-family: 'Marck Script', cursive !important;
  font-size: clamp(2.2rem, 8vw, 4rem) !important;
  color: #f0f0f0 !important;
  text-shadow: 2px 2px 12px rgba(220, 20, 60, 0.6), 0 0 30px rgba(180, 0, 20, 0.3) !important;
  line-height: 1.25 !important;
}
.hero-title .accent {
  color: #ff2222 !important;
  text-shadow: 2px 2px 15px rgba(255, 0, 0, 0.8), 0 0 40px rgba(220, 20, 60, 0.5) !important;
}
.hero-title .accent2 {
  color: #dc143c !important;
  text-shadow: 2px 2px 12px rgba(220, 20, 60, 0.7) !important;
}

/* 3. КОНТРАСТ - улучшаем читаемость */
.hero-sub {
  color: #aaa !important;
  font-size: clamp(0.85rem, 2.5vw, 1rem) !important;
}
.hero-eyebrow {
  color: #dc143c !important;
  opacity: 1 !important;
  font-size: 0.68rem !important;
}
.feat-desc { color: #777 !important; }
.fac-flavor { color: #666 !important; }
.cycle-list { color: #666 !important; }
.stat-lbl { color: #555 !important; }
.stat-num { color: #ccc !important; }
.sec-title { color: #888 !important; }
.proof-big { color: #777 !important; }
.hero-badges { color: #333 !important; }
.feat-name { color: #ccc !important; }
.fac-name { color: #bbb !important; }
.footer-cta-title { color: #777 !important; }
.footer-cta-sub { color: #444 !important; }

/* 4. МОБИЛЬНЫЕ - размеры шрифтов */
@media (max-width: 768px) {
  .hero-title {
    font-size: clamp(1.8rem, 9vw, 3rem) !important;
    line-height: 1.2 !important;
  }
  .hero-sub {
    font-size: 0.88rem !important;
    color: #999 !important;
  }
  .btn-primary, .btn-ghost {
    font-size: 0.85rem !important;
    padding: 13px 22px !important;
    min-height: 46px !important;
    display: inline-flex !important;
    align-items: center !important;
  }
  .nav-brand { font-size: 0.85rem !important; }
  .nav a, nav a {
    font-size: 0.82rem !important;
    padding: 8px 10px !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
  }
  .feat-name { font-size: 0.9rem !important; }
  .feat-desc { font-size: 0.82rem !important; }
  .fac-name { font-size: 0.85rem !important; }
  .fac-flavor { font-size: 0.8rem !important; }
  .sec-title { font-size: 1.1rem !important; }
  .cycle-head { font-size: 0.72rem !important; }
  .cycle-list { font-size: 0.78rem !important; }
  .stat-num { font-size: 1.6rem !important; }
  .stat-lbl { font-size: 0.65rem !important; }
  .tb-text { font-size: 0.8rem !important; }
  .proof-big { font-size: 1rem !important; }
  .footer-cta-title { font-size: 1rem !important; }
  .footer-links a { font-size: 0.7rem !important; }
  .hero-badges { font-size: 0.65rem !important; }
}

@media (max-width: 480px) {
  .hero {
    padding: 40px 16px 30px !important;
  }
  .hero-title {
    font-size: clamp(1.6rem, 10vw, 2.5rem) !important;
  }
  .hero-cta {
    gap: 8px !important;
  }
  .hero-cta a {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
  }
  .stats-bar {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .feat-grid, .factions-grid {
    grid-template-columns: 1fr !important;
  }
}


/* === VIDEO BG FIX === */
.video-bg {
  position: absolute !important;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  z-index: 0 !important;
  pointer-events: none;
}
.hero-vignette {
  position: absolute !important;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.7) 100%);
  z-index: 1 !important;
  pointer-events: none;
}
.hero-grid-bg {
  position: absolute !important;
  inset: 0;
  z-index: 2 !important;
  pointer-events: none;
}
.hero-content {
  position: relative !important;
  z-index: 3 !important;
  max-width: 660px;
}

/* === CONTRAST FIX === */
.hero-sub { color: #d0d0d0 !important; font-size: 1.05rem !important; }
.hero-eyebrow, .hero-eyebrow * { color: #ff6080 !important; }
.feat-card { background: #0d0d0d !important; border: 1px solid #2a2020 !important; }
.feat-card h3, .feat-card p { color: #e0e0e0 !important; }
.proof-big { color: #c0c0c0 !important; }
.hero-badges { color: #bbb !important; }
.section-lead { color: #c0c0c0 !important; }
body { color: #ddd !important; }
p { color: #c8c8c8 !important; }
.text-muted { color: #aaa !important; }

/* === MOBILE FIX === */
@media (max-width: 768px) {
  .hero-title { font-size: clamp(2rem, 9vw, 3.5rem) !important; line-height: 1.2 !important; }
  .hero-sub { font-size: 1rem !important; }
  .hero-eyebrow { font-size: 0.75rem !important; }
  .hero { padding: 64px 16px 32px !important; min-height: 92vh !important; }
  .hero-content { max-width: 100% !important; padding: 0 8px !important; }
  
  /* Навигация: крупнее, легче тапать */
  .nav-link { font-size: 1rem !important; padding: 12px 16px !important; min-height: 44px !important; display: flex !important; align-items: center !important; }
  .navbar-nav .nav-link { font-size: 0.95rem !important; }
  .dropdown-item { font-size: 0.95rem !important; padding: 12px 16px !important; min-height: 44px !important; }
  
  /* Кнопки: крупнее на мобильных */
  .btn-noir, .btn-primary-noir, .btn-danger, .action-button,
  .btn-primary, .btn-ghost, .btn-secondary-noir, .btn-steel {
    font-size: 1rem !important;
    padding: 13px 24px !important;
    min-height: 48px !important;
  }
  
  /* Заголовки секций */
  h2.section-title, .section-title { font-size: clamp(1.4rem, 6vw, 2rem) !important; }
  h3 { font-size: clamp(1.1rem, 5vw, 1.4rem) !important; }
  
  /* Карточки */
  .feat-card { padding: 20px 16px !important; }
  
  /* Общий текст */
  body { font-size: 15px !important; }
  p, li { font-size: 0.95rem !important; line-height: 1.6 !important; }
}

@media (max-width: 480px) {
  .hero-title { font-size: clamp(1.8rem, 10vw, 2.6rem) !important; }
  .hero-cta { flex-direction: column !important; align-items: stretch !important; }
  .hero-cta a { text-align: center !important; width: 100% !important; }
}


/* ── MOBILE NAV / HAMBURGER ─────────────────────────────────── */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin-left: auto;
  flex-shrink: 0;
  z-index: 1001;
}
.nav-burger span {
  display: block;
  width: 100%;
  height: 2px;
  background: #888;
  transition: all 0.25s ease;
}
.nav-burger.open span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.nav-burger.open span:nth-child(2) {
  opacity: 0;
}
.nav-burger.open span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Language switcher - always visible small pill */
.lang-switcher {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}
.lang-switcher button {
  min-height: 32px;
  min-width: 44px;
  padding: 4px 8px;
  font-size: 0.65rem;
}

@media (max-width: 768px) {
  .nav-burger {
    display: flex;
  }
  .nav-links {
    display: none;
    position: fixed;
    top: 40px;
    left: 0;
    right: 0;
    background: #050505;
    border-bottom: 1px solid #1a1a1a;
    flex-direction: column;
    padding: 12px 0 16px;
    z-index: 1000;
    gap: 0;
    flex-wrap: nowrap;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a {
    padding: 13px 24px;
    font-size: 0.8rem;
    border-bottom: 1px solid #0d0d0d;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .nav-links a:last-child {
    border-bottom: none;
  }
  /* Sign in / Sign up as CTA buttons in mobile menu */
  .nav-links a[href*="signin"], .nav-links a[href*="login"],
  .nav-links a[href*="signup"], .nav-links a[href*="register"] {
    color: #dc143c;
  }
  /* Keep lang switcher and logo visible */
  .global-nav {
    flex-wrap: nowrap;
    gap: 8px;
  }
  .global-nav .nav-logo {
    font-size: 0.7rem;
    letter-spacing: 2px;
  }
}

/* ── IMPROVED TOUCH TARGETS FOR LANG BUTTONS ─────────────────── */
.lang-btn {
  min-height: 44px !important;
  min-width: 44px !important;
  padding: 8px 12px !important;
  font-size: 0.72rem !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── MOBILE HERO IMPROVEMENTS ────────────────────────────────── */
@media (max-width: 480px) {
  .hero {
    min-height: 92vh;
    padding: 72px 16px 32px;
  }
  .hero-title {
    font-size: clamp(1.6rem, 7vw, 2.2rem);
    margin-bottom: 16px;
  }
  .hero-sub {
    font-size: 0.78rem;
    color: #555;
    line-height: 1.8;
    margin-bottom: 28px;
  }
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 28px;
  }
  .btn-primary, .btn-ghost {
    padding: 16px 20px;
    font-size: 0.8rem;
    text-align: center;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  /* Stats bar 2-column on mobile */
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-num {
    font-size: 1.2rem;
  }
  .stat-lbl {
    font-size: 0.58rem;
  }
  /* Features single column */
  .feat-grid {
    grid-template-columns: 1fr;
    margin: 0 8px;
  }
  .factions-grid {
    grid-template-columns: 1fr;
    margin: 0 8px;
  }
  /* Tutorial banner full width */
  .tutorial-banner {
    margin: 0 8px 32px;
    flex-direction: column;
    gap: 12px;
  }
  .tb-btn {
    align-self: flex-start;
    min-height: 44px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
  }
  /* Section padding reduce */
  .section {
    padding: 0 0 40px;
  }
  .sec-title {
    font-size: 0.95rem;
    padding: 0 12px;
  }
  /* Cycle row - stack vertically */
  .cycle-row {
    flex-direction: column;
    margin: 0 8px;
  }
  .cycle-night {
    border-left: 1px solid #200000;
    border-top: none;
  }
  /* Screenshots horizontal scroll */
  .screenshots {
    padding: 0 8px 40px;
  }
  /* Footer CTA */
  .footer-cta {
    padding: 32px 16px 24px;
  }
  .footer-links {
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }
  .footer-links a {
    font-size: 0.68rem;
    min-height: 36px;
    display: flex;
    align-items: center;
  }
  /* Proof section */
  .proof-big {
    font-size: clamp(0.9rem, 4vw, 1.2rem);
  }
  /* PWA install */
  .pwa-install-btn {
    min-height: 44px;
    padding: 12px 24px;
  }
  /* Skyline hide on very small */
  .skyline-wrap {
    display: none;
  }
  /* Hero badges bigger */
  .hero-badges {
    font-size: 0.62rem;
    color: #333;
  }
  /* Announcement bar wrap nicely */
  .announce-bar {
    font-size: 0.62rem;
    padding: 8px 12px;
    text-align: center;
  }
}

/* ── PREVENT HORIZONTAL OVERFLOW ─────────────────────────────── */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}
*, *::before, *::after {
  box-sizing: border-box;
}
img, video {
  max-width: 100%;
}

/* ═══════════════════════════════════════════════════
   MOBILE-FIRST COMPREHENSIVE FIX — max-width: 768px
   ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Cycle section: день/ночь — в одну колонку */
  .cycle-row { flex-direction: column !important; }
  .cycle-half { width: 100% !important; min-height: 220px !important; }
  .cycle-sep { display: none !important; }

  /* Фазы раунда — в одну колонку */
  .phase-row { flex-direction: column !important; }
  .phase-card { width: 100% !important; min-height: 200px !important; }

  /* Фракции — 2 колонки на мобильном */
  .factions-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }

  /* Фичи — 1 колонка */
  .feat-grid { grid-template-columns: 1fr !important; }

  /* Роли — 2 колонки */
  .roles-grid { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }

  /* Статс бар — в два ряда */
  .stats-bar { flex-wrap: wrap !important; gap: 12px !important; }
  .stat-item { flex: 1 1 45% !important; }

  /* CTA кнопки — в колонку */
  .cta-row, .hero-cta { flex-direction: column !important; align-items: stretch !important; width: 100% !important; }
  .cta-row a, .hero-cta a { width: 100% !important; text-align: center !important; min-height: 48px !important; }

  /* Онбординг шаги — в колонку */
  .onboard-steps { flex-direction: column !important; }
  .onboard-step { width: 100% !important; }

  /* Общие секции — меньше padding */
  .section, section { padding: 40px 16px !important; }

  /* Кнопки — минимум 48px для touch */
  .btn-primary, .btn-ghost, .btn-noir, .action-button { min-height: 48px !important; font-size: 0.95rem !important; }

  /* Заголовки секций */
  .sec-title { font-size: 1.4rem !important; }
  .sec-label { font-size: 0.7rem !important; }

  /* Видео фон в карточках — фикс высоты */
  .cycle-half .video-bg { object-fit: cover; }
}

/* ═══════════════════════════════════════
   SMALL MOBILE — max-width: 480px
   ═══════════════════════════════════════ */
@media (max-width: 480px) {
  /* Фракции и роли — 1 колонка на очень маленьких */
  .factions-grid { grid-template-columns: 1fr !important; }
  .roles-grid { grid-template-columns: 1fr 1fr !important; }

  /* Статистика — каждый на всю ширину */
  .stat-item { flex: 1 1 100% !important; }

  /* Заголовки */
  .sec-title { font-size: 1.2rem !important; }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE OPTIMISATION v2 — точные классы по аудиту
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* ── НАВИГАЦИЯ ─────────────────────────────────────── */
  .global-nav { padding: 0 12px; gap: 6px; flex-wrap: nowrap; }
  .nav-links { display: none !important; }
  .nav-logo { font-size: 0.75rem !important; letter-spacing: 2px; }

  /* ── HERO ──────────────────────────────────────────── */
  .hero { min-height: 88vh !important; padding: 64px 16px 32px !important; }
  .hero-title { font-size: clamp(1.6rem, 8vw, 2.4rem) !important; line-height: 1.2 !important; }
  .hero-sub { font-size: 0.95rem !important; }
  .hero-cta { flex-direction: column !important; align-items: stretch !important; gap: 10px !important; width: 100% !important; }
  .hero-cta a, .hero-cta button { width: 100% !important; text-align: center !important; min-height: 52px !important; font-size: 1rem !important; }

  /* ── ANNOUNCE BAR ──────────────────────────────────── */
  .announce-bar { font-size: 0.68rem !important; padding: 8px 12px !important; text-align: center; }

  /* ── СТАТИСТИКА (4 col → 2×2) ─────────────────────── */
  .stats-bar { grid-template-columns: 1fr 1fr !important; gap: 12px 8px !important; padding: 24px 16px !important; }
  .stat-item { text-align: center; }

  /* ── ФИЧИ (1 col) ──────────────────────────────────── */
  .feat-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
  .feat-card { padding: 20px 16px !important; }

  /* ── ЦИКЛ ДЕНЬ/НОЧЬ (side-by-side → stack) ─────────── */
  .cycle-row { flex-direction: column !important; gap: 0 !important; }
  .cycle-half { width: 100% !important; min-height: 240px !important; }
  .cycle-sep { display: none !important; }

  /* ── ФАЗЫ РАУНДА (2 col grid → 1 col) ─────────────── */
  .phases-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
  .phase-card { min-height: 200px !important; }

  /* ── ФРАКЦИИ (2 col → 1 col) ───────────────────────── */
  .factions-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
  .faction-card { min-height: 180px !important; }

  /* ── CINEMATIC STRIP (4 col → 2 col) ──────────────── */
  .cinematic-strip { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }

  /* ── СЕКЦИИ — padding ──────────────────────────────── */
  .section { padding: 40px 16px !important; }
  .sec-title { font-size: 1.3rem !important; line-height: 1.3 !important; }
  .sec-label { font-size: 0.65rem !important; letter-spacing: 2px; }

  /* ── CTA блоки ─────────────────────────────────────── */
  .cta-row { flex-direction: column !important; align-items: stretch !important; gap: 10px !important; }
  .cta-row a, .cta-row button { width: 100% !important; text-align: center !important; min-height: 52px !important; }

  /* ── КНОПКИ — touch targets ────────────────────────── */
  .btn-primary, .btn-ghost, .btn-noir, .btn-danger,
  .action-button, .btn-secondary-noir, .btn-steel { min-height: 48px !important; }

  /* ── ОНБОРДИНГ ─────────────────────────────────────── */
  .onboard-steps { flex-direction: column !important; gap: 16px !important; }
  .onboard-step { width: 100% !important; }

  /* ── ФУТЕР ──────────────────────────────────────────── */
  .footer-inner { flex-direction: column !important; gap: 20px !important; text-align: center; }
  .footer-links { flex-wrap: wrap !important; justify-content: center !important; gap: 12px !important; }
  .footer-links a { font-size: 0.7rem !important; min-height: 36px !important; display: flex; align-items: center; }

  /* ── PROOF / SOCIAL PROOF ──────────────────────────── */
  .proof-section { padding: 20px 16px !important; }
  .proof-big { font-size: clamp(0.85rem, 4vw, 1.1rem) !important; }
}

/* ═══════════════════════════════════════════════════════════════
   SMALL MOBILE — 480px и меньше
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
  /* Cinematic: 2 → 1 колонка */
  .cinematic-strip { grid-template-columns: 1fr !important; }

  /* Stats: убедимся в 2 колонках */
  .stats-bar { grid-template-columns: 1fr 1fr !important; }

  /* Hero title ещё меньше */
  .hero-title { font-size: clamp(1.4rem, 9vw, 2rem) !important; }

  /* Убираем лишние декоративные элементы */
  .skyline-wrap { display: none !important; }
  .hero-grid-bg { opacity: 0.3 !important; }

  /* Секции — минимальный padding */
  .section { padding: 32px 12px !important; }
  .sec-title { font-size: 1.15rem !important; }
}
