/* ============================================
   DOOMSDAY — Shared Components
   ============================================ */

/* ---- A11y: focus-visible (keyboard-only) ---- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--blood-bright, #ef3a3a);
  outline-offset: 2px;
  border-radius: 2px;
}
.nav-burger {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

/* ---- A11y: respect 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;
    scroll-behavior: auto !important;
  }
  .noise-overlay,
  .scanlines,
  .hero-fog-1, .hero-fog-2, .hero-fog-3,
  .hero-particles,
  .glitch {
    display: none !important;
  }
}

/* Last-pass mobile overrides must stay after shared component rules. */
@media (max-width: 768px) {
  .nav-mobile {
    display: flex !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    height: calc(100dvh - var(--nav-height)) !important;
    padding: 14px 24px max(24px, env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  }

  .nav-mobile.open {
    display: flex !important;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .nav-mobile a {
    width: 100% !important;
    min-height: 52px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,.06);
    font-size: clamp(1rem, 4.8vw, 1.32rem) !important;
    letter-spacing: 1.5px !important;
    line-height: 1.15;
    text-align: center;
    overflow-wrap: anywhere;
  }
}

/* ============================================
   MOBILE FUNCTIONAL HARDENING
   ============================================ */
@media (max-width: 768px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .nav {
    z-index: 1500;
  }

  .nav-inner {
    padding: 0 16px;
  }

  .nav-logo {
    min-width: 0;
    font-size: clamp(1.35rem, 8vw, 2rem);
    letter-spacing: clamp(2px, 1vw, 5px);
  }

  .nav-mobile {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    height: calc(100dvh - var(--nav-height));
    padding: 14px 24px max(24px, env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  }

  .nav-mobile.open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .nav-mobile a {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,.06);
    font-size: clamp(1rem, 4.8vw, 1.32rem);
    letter-spacing: 1.5px;
    line-height: 1.15;
    text-align: center;
    overflow-wrap: anywhere;
  }

  .nav-mobile a:last-child {
    margin-bottom: 16px;
  }

  .container,
  .container-wide {
    width: min(100%, 100vw);
    padding-left: 16px;
    padding-right: 16px;
  }

  section {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .section-title {
    font-size: clamp(1.45rem, 8vw, 2.1rem);
    letter-spacing: 1px;
    overflow-wrap: anywhere;
  }

  input,
  select,
  textarea {
    min-height: 44px;
    font-size: 16px;
  }

  button,
  .btn,
  .copy-btn,
  .filter-pill,
  .map-tab,
  .lb-tab {
    min-height: 44px;
  }

  .modal-overlay,
  .case-modal,
  .modal-bg {
    align-items: flex-end !important;
    justify-content: center !important;
    padding: 0 !important;
  }

  .modal,
  .modal-box,
  .case-modal-card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 16px) !important;
    border-radius: 14px 14px 0 0 !important;
    overflow-y: auto !important;
  }

  .modal-btns,
  .modal-actions,
  .case-buy-right {
    flex-direction: column !important;
  }

  .modal-btn,
  .modal-actions button,
  .case-buy-right .btn {
    width: 100%;
    justify-content: center;
  }

  .toast {
    left: 12px !important;
    right: 12px !important;
    top: calc(var(--nav-height) + 10px) !important;
    max-width: none !important;
  }

  .history-section,
  .history-table-wrap,
  .comparison-table-wrap,
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table.history-table,
  table.sessions-table,
  table.comparison-table,
  table.feature-table,
  table.lb-table {
    min-width: 680px;
  }

  .lb-tabs,
  .map-tabs,
  .chat-tabs {
    display: flex;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }

  .lb-tab,
  .map-tab,
  .chat-tabs > * {
    flex: 0 0 auto;
  }

  .map-frame-wrap {
    min-height: min(72vh, 560px) !important;
    aspect-ratio: auto !important;
  }

  .balance-bar {
    top: var(--nav-height) !important;
    z-index: 900 !important;
    padding: 10px 12px !important;
  }

  .balance-inner,
  .balance-left,
  .balance-right,
  .server-select {
    width: 100%;
    align-items: stretch !important;
  }

  .balance-inner {
    gap: 8px !important;
  }

  .balance-left,
  .balance-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  #auth-area,
  #balance-display {
    width: 100%;
  }

  #balance-display {
    flex-wrap: wrap;
    gap: 8px;
  }

  .balance-item {
    flex: 1 1 130px;
  }

  .btn-login {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .server-select {
    gap: 8px !important;
  }

  .server-select select {
    width: 100%;
    min-height: 44px;
  }

  .shop-hero {
    padding: 24px 16px 14px !important;
  }

  .shop-hero h1 {
    font-size: clamp(1.7rem, 10vw, 2.25rem) !important;
    overflow-wrap: anywhere;
  }

  .shop-filters {
    padding: 0 12px !important;
  }

  .filter-row {
    align-items: stretch !important;
  }

  .filter-pills {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-left: -12px;
    margin-right: -12px;
    padding: 0 12px 8px;
  }

  .filter-pill {
    flex: 0 0 auto;
  }

  .shop-search {
    width: 100% !important;
  }

  .shop-grid {
    grid-template-columns: 1fr !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    gap: 12px !important;
  }

  .product-card {
    clip-path: none !important;
    border-radius: 8px !important;
  }

  .product-icon,
  .product-img {
    height: 96px !important;
  }

  .product-actions {
    flex-direction: column !important;
  }

  .btn-buy {
    width: 100%;
    min-height: 44px;
  }

  .topup-methods {
    grid-template-columns: 1fr !important;
  }

  #topup-extra div[style*="display:flex"] {
    flex-wrap: wrap !important;
  }

  #topup-extra div[style*="grid-template-columns"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #promo-input {
    flex: 1 1 180px !important;
    min-width: 0;
  }

  .cases-grid,
  .farm-grid {
    grid-template-columns: 1fr !important;
  }

  .cases-hero-title,
  .farm-title {
    font-size: clamp(1.65rem, 9vw, 2.2rem) !important;
    overflow-wrap: anywhere;
  }

  .cases-hero-info {
    grid-template-columns: 1fr !important;
  }

  .modal-list-head,
  .item-row {
    grid-template-columns: minmax(0, 1fr) 62px 70px !important;
  }

  .item-name,
  .case-card-name,
  .card-name {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .case-buy-bar,
  .case-buy-left,
  .case-buy-server,
  .case-buy-server select {
    width: 100%;
  }

  .farm-wrap {
    margin-top: 70px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .farm-status {
    line-height: 1.7;
  }

  .farm-login-prompt {
    padding: 24px 14px !important;
  }

  .login-section {
    min-height: calc(100dvh - var(--nav-height)) !important;
    align-items: flex-start !important;
    padding: 20px 16px !important;
  }

  .login-card {
    clip-path: none !important;
    padding: 24px 16px !important;
    max-width: 100% !important;
  }

  .login-title {
    font-size: clamp(1.45rem, 8vw, 1.8rem) !important;
  }

  .steam-login-btn {
    width: 100%;
    padding: 14px 12px !important;
    gap: 8px !important;
    font-size: .95rem !important;
    letter-spacing: 1px !important;
    line-height: 1.25;
    white-space: normal;
  }

  .login-features,
  .wallet-grid,
  .server-activity-grid {
    grid-template-columns: 1fr !important;
  }

  .stats-grid,
  .wallet-quick-grid,
  .profile-header-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .profile-header-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
  }

  .profile-steam-id {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 380px) {
  .nav-inner {
    padding: 0 12px;
  }

  .nav-logo {
    font-size: 1.25rem;
    letter-spacing: 2px;
  }

  .nav-burger span {
    width: 24px;
  }

  .product-prices,
  .modal-case-stats {
    grid-template-columns: 1fr !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  #topup-extra div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

/* ---- Navigation ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  border-bottom: 1px solid var(--toxic-green-dim);
}

.nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: repeating-linear-gradient(
    -45deg,
    var(--hazard-yellow) 0, var(--hazard-yellow) 5px,
    transparent 5px, transparent 10px
  );
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--toxic-green);
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 0 0 15px var(--toxic-glow);
  transition: all 0.3s ease;
  position: relative;
}

.nav-logo:hover {
  color: var(--toxic-green-bright);
  text-shadow: 0 0 25px var(--toxic-glow-strong);
  animation: glitch 0.3s ease;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-links a {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  padding-bottom: 4px;
  transition: color var(--transition-normal);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--toxic-green);
  box-shadow: 0 0 8px var(--toxic-glow);
  transition: width var(--transition-normal);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--toxic-green);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Burger */
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 1001;
  padding: 5px;
}

.nav-burger span {
  display: block;
  width: 28px;
  height: 2px;
  background: var(--toxic-green);
  transition: all var(--transition-normal);
}

.nav-burger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-burger.open span:nth-child(2) {
  opacity: 0;
}
.nav-burger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile menu */
.nav-mobile {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 10, 0.97);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  z-index: 999;
}

.nav-mobile.open {
  display: flex;
}

.nav-mobile a {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.nav-mobile a:hover {
  color: var(--toxic-green);
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .nav-burger {
    display: flex;
  }
}

/* ---- Footer ---- */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--toxic-green-dim);
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: repeating-linear-gradient(
    -45deg,
    var(--toxic-green-dim) 0, var(--toxic-green-dim) 5px,
    transparent 5px, transparent 10px
  );
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
  padding: var(--space-xl) 0;
}

/* Community column — Discord / Telegram / VK social links */
.footer-col-community .social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin: 4px 0;
  border-radius: 6px;
  border: 1px solid var(--surface);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s ease;
  text-decoration: none;
}
.footer-col-community .social-link svg {
  flex: 0 0 auto;
  transition: transform 0.2s ease;
}
.footer-col-community .social-link:hover {
  color: #fff;
  transform: translateY(-1px);
}
.footer-col-community .social-link.social-discord:hover {
  background: #5865F2;
  border-color: #5865F2;
}
.footer-col-community .social-link.social-telegram:hover {
  background: #229ED9;
  border-color: #229ED9;
}
.footer-col-community .social-link:hover svg {
  transform: scale(1.1);
}

.footer-col h3 {
  font-family: var(--font-heading);
  color: var(--toxic-green);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-md);
}

.footer-col a {
  display: block;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: var(--space-xs) 0;
  transition: color var(--transition-fast);
}

.footer-col a:hover {
  color: var(--toxic-green);
}

.footer-col p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.footer-bottom {
  border-top: 1px solid var(--surface);
  padding: var(--space-md) 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.footer-bottom span {
  color: var(--toxic-green);
}

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
}

/* ---- Military Card ---- */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--toxic-green-dim);
  clip-path: polygon(0 12px, 12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
  padding: var(--space-lg);
  transition: all var(--transition-normal);
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  clip-path: polygon(0 12px, 12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
  background: transparent;
  transition: background var(--transition-normal);
  z-index: -1;
}

.card:hover {
  border-color: var(--toxic-green);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px var(--toxic-glow),
              inset 0 0 30px var(--toxic-glow);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.card-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 14px 32px;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: none;
  clip-path: polygon(0 8px, 8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
  text-align: center;
}

.btn-primary {
  background: var(--toxic-green);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background: var(--toxic-green-bright);
  color: var(--bg-primary);
  box-shadow: 0 0 25px var(--toxic-glow-strong);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--toxic-green);
  border: 2px solid var(--toxic-green);
  clip-path: polygon(0 8px, 8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}

.btn-outline:hover {
  background: var(--toxic-green);
  color: var(--bg-primary);
  box-shadow: 0 0 25px var(--toxic-glow-strong);
  transform: translateY(-2px);
}

.btn-sm {
  font-size: 0.8rem;
  padding: 8px 20px;
  letter-spacing: 1px;
}

/* ---- Badge ---- */
.badge {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 2px;
}

.badge-green {
  background: var(--toxic-green);
  color: var(--bg-primary);
}

.badge-yellow {
  background: var(--hazard-yellow);
  color: var(--bg-primary);
}

.badge-red {
  background: var(--blood-red);
  color: var(--text-primary);
}

.badge-orange {
  background: var(--hazard-orange);
  color: var(--bg-primary);
}

.badge-blue {
  background: var(--steel-blue);
  color: var(--text-primary);
}

/* ---- Status Dot ---- */
.status-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--toxic-green);
}

.status-online::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--toxic-green);
  animation: pulse-glow 2s ease-in-out infinite;
}

/* ---- Difficulty Bars ---- */
.difficulty-bars {
  display: flex;
  gap: 4px;
  align-items: flex-end;
}

.difficulty-bars .bar {
  width: 8px;
  height: 12px;
  background: var(--surface);
  transition: background var(--transition-fast);
}

.difficulty-bars .bar.filled-1 { background: var(--toxic-green); height: 8px; }
.difficulty-bars .bar.filled-2 { background: var(--toxic-green); height: 12px; }
.difficulty-bars .bar.filled-3 { background: var(--hazard-yellow); height: 16px; }
.difficulty-bars .bar.filled-4 { background: var(--hazard-orange); height: 20px; }
.difficulty-bars .bar.filled-5 { background: var(--blood-red); height: 24px; }

/* ---- Divider ---- */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--toxic-green-dim), transparent);
  margin: var(--space-lg) 0;
}

/* ---- Icon Circle ---- */
.icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--toxic-green-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
  transition: all var(--transition-normal);
  background: rgba(57, 255, 20, 0.05);
}

.card:hover .icon-circle {
  border-color: var(--toxic-green);
  box-shadow: 0 0 20px var(--toxic-glow);
  background: rgba(57, 255, 20, 0.1);
}

/* ---- Copy Button ---- */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--toxic-green-dim);
  color: var(--toxic-green);
  font-family: var(--font-body);
  font-size: 1.2rem;
  padding: 12px 24px;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.copy-btn:hover {
  border-color: var(--toxic-green);
  box-shadow: 0 0 15px var(--toxic-glow);
}

.copy-btn .copied {
  color: var(--hazard-yellow);
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.copy-btn.show-copied .copied {
  opacity: 1;
}

/* ============================================
   REDESIGN v2 (2026-04-17) — additional mixins
   Apply via classes; existing components untouched.
   ============================================ */

/* ---- Notched panel (срезанные углы как лента патронов) ---- */
.notched {
  --notch: 10px;
  clip-path: polygon(
    var(--notch) 0,
    calc(100% - var(--notch)) 0,
    100% var(--notch),
    100% calc(100% - var(--notch)),
    calc(100% - var(--notch)) 100%,
    var(--notch) 100%,
    0 calc(100% - var(--notch)),
    0 var(--notch)
  );
}
.notched-sm { --notch: 6px; }
.notched-lg { --notch: 16px; }

/* ---- Rivets (4 заклёпки по углам через ::before+::after с box-shadow) ---- */
.rivets {
  position: relative;
}
.rivets::before, .rivets::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--metal-hi);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 1px 2px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  z-index: 2;
}
.rivets::before { top: 8px;    left: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 1px 2px rgba(0, 0, 0, 0.7),
    /* top-right rivet */
    calc(100% - 800%) 0 0 0 var(--metal-hi);
}
.rivets::after  { bottom: 8px; left: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 1px 2px rgba(0, 0, 0, 0.7);
}
/* Use .rivets-4 for full 4-corner rivets via background-image trick */
.rivets-4 {
  background-image:
    radial-gradient(circle at 8px 8px,                                 var(--metal-hi) 0 3px, transparent 3.5px),
    radial-gradient(circle at calc(100% - 8px) 8px,                    var(--metal-hi) 0 3px, transparent 3.5px),
    radial-gradient(circle at 8px calc(100% - 8px),                    var(--metal-hi) 0 3px, transparent 3.5px),
    radial-gradient(circle at calc(100% - 8px) calc(100% - 8px),       var(--metal-hi) 0 3px, transparent 3.5px);
  background-repeat: no-repeat;
}

/* ---- Hazard borders top/bottom ---- */
.has-hazard-top, .has-hazard-bot { position: relative; }
.has-hazard-top::before, .has-hazard-bot::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 3px;
  background: repeating-linear-gradient(
    -45deg,
    var(--hazard-yellow) 0, var(--hazard-yellow) 6px,
    #000 6px, #000 12px
  );
  pointer-events: none;
}
.has-hazard-top::before { top: 0; }
.has-hazard-bot::after  { bottom: 0; }
.has-hazard-top.thicker::before, .has-hazard-bot.thicker::after { height: 5px; }

/* ---- Distressed (усиленный шум, локальный, не fixed как .noise-overlay) ---- */
.distressed {
  position: relative;
}
.distressed::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 9 -3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 120px 120px;
  z-index: 1;
}

/* ---- Glitch text effect (RGB shift via duplicate layers) ---- */
.glitch {
  position: relative;
  display: inline-block;
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  pointer-events: none;
  opacity: 0.6;
  mix-blend-mode: screen;
}
.glitch::before {
  color: #00e5ff;
  transform: translate(-2px, 0);
  animation: glitch-shift-x 2.5s infinite steps(1);
}
.glitch::after {
  color: #ff003c;
  transform: translate(2px, 0);
  animation: glitch-shift-y 2.5s infinite steps(1);
}

/* ---- Text utilities (redesign-v2) ---- */
.text-shadow-blood { text-shadow: var(--sh-text-stencil); }
.text-stencil       { font-family: var(--font-display); letter-spacing: 3px; }
.text-bone          { color: var(--bone); }
.text-bone-dim      { color: var(--bone-dim); }
.text-blood         { color: var(--blood); }
.text-blood-bright  { color: var(--blood-bright); }
.text-hazard        { color: var(--hazard-yellow); }
.text-rust          { color: var(--rust); }
.text-mono          { font-family: var(--font-body); }

/* ---- Section title in stencil terminal style: ☠ // TITLE // ☠ ---- */
.sec-title-grim {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 2rem);
  letter-spacing: 4px;
  text-align: center;
  color: var(--blood);
  text-shadow: var(--sh-blood-soft);
  margin-bottom: var(--space-xl);
  position: relative;
}
.sec-title-grim::before, .sec-title-grim::after {
  content: '☠';
  margin: 0 18px;
  color: var(--blood-bright);
  font-size: 0.85em;
  vertical-align: 0.05em;
  text-shadow: 0 0 12px var(--blood-glow-strong);
}

/* ---- HUD panel (как в лаунчере) ---- */
.hud-panel {
  --notch: 10px;
  background: linear-gradient(180deg, var(--bg-tertiary), var(--metal-deep));
  border: 1px solid var(--metal);
  position: relative;
  padding: 22px 22px 18px;
  clip-path: polygon(
    var(--notch) 0, calc(100% - var(--notch)) 0,
    100% var(--notch), 100% calc(100% - var(--notch)),
    calc(100% - var(--notch)) 100%, var(--notch) 100%,
    0 calc(100% - var(--notch)), 0 var(--notch)
  );
  background-image:
    radial-gradient(circle at 10px 10px,                              var(--metal-hi) 0 3px, transparent 3.5px),
    radial-gradient(circle at calc(100% - 10px) 10px,                 var(--metal-hi) 0 3px, transparent 3.5px),
    radial-gradient(circle at 10px calc(100% - 10px),                 var(--metal-hi) 0 3px, transparent 3.5px),
    radial-gradient(circle at calc(100% - 10px) calc(100% - 10px),    var(--metal-hi) 0 3px, transparent 3.5px),
    linear-gradient(180deg, var(--bg-tertiary), var(--metal-deep));
  background-repeat: no-repeat;
}
.hud-panel-head {
  background: var(--hazard-dark);
  color: var(--hazard-yellow);
  font-family: var(--font-heading);
  font-size: 12px;
  letter-spacing: 2px;
  padding: 4px 10px;
  margin: -10px -10px 12px;
  border-left: 3px solid var(--hazard-yellow);
}
.hud-row {
  display: flex; justify-content: space-between;
  font-family: var(--font-body);
  font-size: 12px;
  padding: 3px 0;
  border-bottom: 1px dashed rgba(168, 152, 128, 0.10);
  color: var(--bone-dim);
}
.hud-row:last-child { border-bottom: none; }
.hud-row b { color: var(--bone); font-weight: normal; }

/* ---- Drip edge (кровавые капли по нижнему краю) ---- */
.drip-edge {
  position: relative;
}
.drip-edge::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: -10px;
  height: 12px;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='12' viewBox='0 0 240 12'%3E%3Cg fill='%23c41e1e'%3E%3Cellipse cx='14' cy='2' rx='3' ry='5'/%3E%3Cellipse cx='44' cy='2' rx='2.5' ry='9'/%3E%3Cellipse cx='78' cy='2' rx='3.5' ry='4'/%3E%3Cellipse cx='112' cy='2' rx='2' ry='8'/%3E%3Cellipse cx='148' cy='2' rx='3' ry='6'/%3E%3Cellipse cx='184' cy='2' rx='2.5' ry='10'/%3E%3Cellipse cx='220' cy='2' rx='3' ry='5'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 240px 12px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
}
.drip-edge.drip-dark::after { filter: drop-shadow(0 1px 1px rgba(0,0,0,0.8)) brightness(0.7); }

/* ---- CTA blood button (как в launcher.html .lnch-cta) ---- */
.btn-blood {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 30px;
  background: linear-gradient(135deg, var(--blood-dim), var(--blood-red));
  color: var(--bone);
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  border: 2px solid var(--blood);
  position: relative;
  text-decoration: none;
  overflow: hidden;
  transition: filter .15s, transform .15s, box-shadow .25s;
  box-shadow: 0 6px 20px var(--blood-glow-strong), inset 0 0 0 1px rgba(255,255,255,0.05);
  text-shadow: 0 2px 0 #000;
}
.btn-blood::before, .btn-blood::after {
  content: '';
  position: absolute; left: 0; right: 0; height: 3px;
  background: repeating-linear-gradient(-45deg,
    var(--hazard-yellow) 0, var(--hazard-yellow) 6px,
    #000 6px, #000 12px);
}
.btn-blood::before { top: 0; }
.btn-blood::after  { bottom: 0; }
.btn-blood:hover {
  filter: brightness(1.15) saturate(1.15);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px var(--blood-glow-strong), inset 0 0 0 1px rgba(255,255,255,0.15);
  color: #fff;
}
.btn-blood:active { transform: translateY(1px); }

/* ---- Skull motif inline (Unicode fallback if no SVG) ---- */
.skull-icon {
  display: inline-block;
  color: var(--blood-bright);
  text-shadow: 0 0 10px var(--blood-glow-strong);
  font-family: 'Segoe UI Symbol', 'Apple Color Emoji', sans-serif;
  vertical-align: -0.05em;
}

/* ---- Hide-on-mobile / show-on-mobile utilities ---- */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
  .show-mobile { display: none !important; }
}

/* ============================================
   REDESIGN v2 — NAV / FOOTER overrides
   (специфичность та же — идут позже = выигрывают)
   ============================================ */

/* Усиленный nav: ржавая нижняя граница + plus череп в логотипе */
.nav {
  background: rgba(8, 4, 4, 0.92);
  border-bottom: 1px solid var(--metal);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}
.nav::before {
  background: repeating-linear-gradient(
    -45deg,
    var(--hazard-yellow) 0, var(--hazard-yellow) 6px,
    #000 6px, #000 12px
  );
  height: 4px;
  opacity: 0.9;
}

.nav-logo {
  color: var(--bone);
  text-shadow: var(--sh-text-stencil);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.nav-logo::before {
  content: '\2620';                          /* ☠ — Segoe UI Symbol */
  font-family: 'Segoe UI Symbol', sans-serif;
  color: var(--blood-bright);
  text-shadow: 0 0 10px var(--blood-glow-strong);
  font-size: 1.6rem;
  line-height: 1;
}
.nav-logo:hover {
  color: var(--blood-bright);
  text-shadow: 0 0 24px var(--blood-glow-strong), 0 4px 0 #000;
}

/* nav-links: bone-color текст, hazard-yellow на hover, blood underline */
.nav-links a {
  color: var(--bone-dim);
  font-family: var(--font-heading);
}
.nav-links a:hover { color: var(--hazard-yellow); }
.nav-links a.active { color: var(--blood-bright); }
.nav-links a::after {
  background: var(--blood);
  box-shadow: 0 0 8px var(--blood-glow-strong);
}
/* Маленький череп-маркер над активной ссылкой */
.nav-links a.active::before {
  content: '\2620';
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Segoe UI Symbol', sans-serif;
  font-size: 10px;
  color: var(--blood-bright);
  text-shadow: 0 0 6px var(--blood-glow-strong);
  pointer-events: none;
}

.nav-burger span { background: var(--bone); }

/* === FOOTER overrides === */
.footer {
  background: linear-gradient(180deg, var(--bg-secondary), var(--bg-primary));
  border-top: 1px solid var(--metal);
}
.footer::before {
  background: repeating-linear-gradient(
    -45deg,
    var(--hazard-yellow) 0, var(--hazard-yellow) 6px,
    #000 6px, #000 12px
  );
  height: 3px;
  opacity: 0.85;
}
.footer-col h3 {
  color: var(--blood);
  text-shadow: 0 0 10px var(--blood-glow);
  border-left: 3px solid var(--blood);
  padding-left: 10px;
}
.footer-col h3::before {
  content: '\25B8 ';                         /* ▸ */
  color: var(--hazard-yellow);
  margin-right: 4px;
}
.footer-col a:hover { color: var(--hazard-yellow); }

.footer-bottom {
  border-top: 1px solid var(--metal);
  letter-spacing: 2px;
  font-family: var(--font-body);
  position: relative;
}
.footer-bottom::before {
  content: '\2620';
  display: block;
  font-family: 'Segoe UI Symbol', sans-serif;
  color: var(--blood-bright);
  font-size: 22px;
  margin-bottom: 8px;
  text-shadow: 0 0 14px var(--blood-glow-strong);
}
.footer-bottom span {
  color: var(--blood-bright);
  font-family: var(--font-display);
  letter-spacing: 4px;
}

/* ============================================
   GLOBAL A11Y: focus-visible + reduced-motion
   ============================================ */
*:focus-visible {
  outline: 2px solid var(--blood-bright);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .noise-overlay::before,
  .scanlines::after,
  .hero-fog-1, .hero-fog-2, .hero-fog-3,
  .glitch {
    display: none !important;
  }
}

/* Last-pass mobile overrides must stay after shared component rules. */
@media (max-width: 768px) {
  .nav-mobile {
    display: flex !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    height: calc(100dvh - var(--nav-height)) !important;
    padding: 14px 24px max(24px, env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  }

  .nav-mobile.open {
    display: flex !important;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .nav-mobile a {
    width: 100% !important;
    min-height: 52px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,.06);
    font-size: clamp(1rem, 4.8vw, 1.32rem) !important;
    letter-spacing: 1.5px !important;
    line-height: 1.15;
    text-align: center;
    overflow-wrap: anywhere;
  }
}
