﻿:root {
  --primary-nav-height: 60px;
}

@font-face {
  font-family: 'ChakraPetch';
  src: url('src/fonts/ChakraPetch/ChakraPetch-Regular.otf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'ShareTechMono';
  src: url('src/fonts/ShareTechMono/ShareTechMono.otf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'TagesschriftCyrillic';
  src: url('src/fonts/TagesschriftCyrillic/TagesschriftCyrillic-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Renju';
  src: url('src/fonts/Renju/Renju.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'LeonovSP';
  src: url('src/fonts/LeonovSP/LeonovSP.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.main-header {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bg-video {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100vh;
  object-fit: cover;
  min-width: 100%;
  min-height: 100%;
  z-index: 1;
}

@media (max-width: 768px) {
  .bg-video,
  .main-header {
    display: none !important;
  }
  
  body {
    padding-top: 56px !important;
  }
}

body.nav-mobile-mode .main-header,
body.nav-mobile-mode .bg-video {
  display: none !important;
}

body.nav-mobile-mode {
  background-image: none !important;
  background-color: #111 !important;
}

.header-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
}

.main-title {
  color: #f39819;
  font-family: 'Renju', Arial, sans-serif;
  font-size: 7vw;
  text-shadow: 0 0 30px #000, 0 0 10px #222, 2px 0 6px rgba(255,100,80,0.55), -2px 0 6px rgba(80,180,255,0.45);
  letter-spacing: 0.1em;
  text-align: center;
  margin: 0 0 6vh 0;
  user-select: none;
  align-self: flex-end;
  transform: translateY(-2vh);
  position: relative;
  z-index: 4;
  transition: text-shadow 180ms ease, transform 150ms ease;
  animation: subtle-flicker 3s infinite linear;
}

@keyframes subtle-flicker {
  0%, 100% { text-shadow: 0 0 28px rgba(0,0,0,0.9), 0 0 8px rgba(0,0,0,0.6); opacity: 1; }
  50% { text-shadow: 0 0 38px rgba(0,0,0,0.95), 0 0 12px rgba(0,0,0,0.75); opacity: 0.96; }
}

.header-content::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(0,0,0,0.06) 50%, rgba(0,0,0,0) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  mix-blend-mode: multiply;
  z-index: 3;
  animation: scan 6s linear infinite;
}

@keyframes scan {
  0%, 100% { transform: translateY(0); opacity: 0.9; }
}

@media (max-width: 600px) {
  .main-title { 
    font-size: 12vw; 
    animation: none; 
  }
  .header-content::after { 
    display: none; 
  }
}

.main-title.random-flick {
  color: #fff5dd;
  text-shadow: 0 0 50px rgba(255,230,150,1), 2px 0 15px rgba(255,150,100,0.8), -2px 0 15px rgba(100,200,255,0.5), 0 0 80px rgba(255,210,130,0.6);
  filter: brightness(1.3) contrast(1.1);
  animation: tv-flicker 220ms ease-in-out;
}

.main-title.random-dim {
  color: #cc8800;
  text-shadow: 0 0 12px rgba(200,120,0,0.8), 1px 0 4px rgba(0,0,0,0.7);
  filter: brightness(0.7) contrast(0.9);
  transition: all 200ms ease-out;
}

.main-title.random-glitch {
  animation: tv-glitch 350ms cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

@keyframes tv-flicker {
  0%, 100% { opacity: 1; filter: brightness(1) contrast(1); }
  15% { opacity: 0.8; filter: brightness(1.2) contrast(1.1); }
  30% { opacity: 0.5; filter: brightness(0.6) contrast(0.8); }
  45% { opacity: 0.9; filter: brightness(1.4) contrast(1.2); }
  60% { opacity: 0.7; filter: brightness(0.8) contrast(0.9); }
  75% { opacity: 1; filter: brightness(1.1) contrast(1.05); }
  90% { opacity: 0.85; filter: brightness(0.9) contrast(0.95); }
}

@keyframes tv-glitch {
  0%, 100% {
    transform: translateY(-2vh) translate(0, 0) skew(0deg);
    text-shadow: 0 0 32px rgba(255,192,80,0.9), 2px 0 8px rgba(255,120,80,0.5), -2px 0 8px rgba(80,180,255,0.2);
  }
  10% {
    transform: translateY(-2vh) translate(-2px, 1px) skew(-0.3deg);
    text-shadow: -5px 0 0 rgba(255,0,0,0.8), 5px 0 0 rgba(0,255,255,0.8), 0 0 40px rgba(255,192,80,0.9);
  }
  20% {
    transform: translateY(-2vh) translate(4px, -2px) skew(0.5deg);
    text-shadow: -6px 0 0 rgba(255,0,0,0.9), 6px 0 0 rgba(0,255,255,0.9), 0 0 45px rgba(255,210,130,1);
  }
  50% {
    transform: translateY(-2vh) translate(-3px, 0) skew(-0.4deg);
    text-shadow: -5px 0 0 rgba(255,0,0,0.85), 5px 0 0 rgba(0,255,255,0.85), 0 0 42px rgba(255,192,80,0.9);
  }
}

@media (max-width: 420px) {
  .main-title.random-flick, 
  .main-title.random-dim,
  .main-title.random-glitch { 
    animation: none; 
    filter: none;
    transform: translateY(-2vh);
  }
}

/* Navigation */
.primary-nav {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 9999 !important;
  background: #000 !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6) !important;
  transition: transform 0.3s ease-in-out !important;
}

.primary-nav.nav-hidden {
  transform: translateY(-100%) !important;
}

.primary-nav .nav-link {
  color: #fff !important;
  font-size: 1.1rem !important;
  transition: color 0.3s ease !important;
}

.primary-nav .nav-link:hover,
.primary-nav .nav-link:focus,
.primary-nav .nav-link.active {
  color: #ff8c00 !important;
  text-shadow: 0 0 12px rgba(255,140,0,0.9), 0 0 24px rgba(255,140,0,0.25);
  transform: translateY(-2px);
  background-color: transparent !important;
}

.sidenav-dark {
  background-color: #1a1a1a !important;
  padding-top: 80px !important;
}

.sidenav-dark li > a {
  color: #ffd88c !important;
  font-size: 1.2rem !important;
}

.sidenav-dark li > a:hover {
  background-color: rgba(255, 216, 140, 0.1) !important;
}

.primary-nav .brand-logo {
  cursor: pointer !important;
}

.mobile-brand .brand-short {
  display: none;
}

.mobile-brand .brand-full {
  display: inline;
}

.primary-nav .mobile-brand {
  position: absolute !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  transition: color 0.3s ease !important;
}

.primary-nav .mobile-brand:hover,
.primary-nav .mobile-brand:focus,
.primary-nav .mobile-brand:active {
  color: #ffd88c !important;
  background-color: transparent !important;
  transform: translateX(-50%) !important;
}
body {
  font-family: 'ChakraPetch', Arial, sans-serif;
  margin: 0;
  padding: 0;
  padding-top: 64px; /* Space for fixed Materialize navbar on desktop */
  /* Page background image (covers entire page behind header/video).
     Use a few fallbacks (absolute and relative) because the site may be
     served from different roots (Caddy static vs express static). */
  background-color: #111; /* dark fallback if image not found */
  background-image: url('/src/head/background.webp'), url('src/head/background.webp');
  background-position: center top, center top;
  background-size: cover, cover;
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed;
  color: #e2e2e2;
  font-size: 1.25rem;
}

/* Global link styles - orange theme */
a {
  color: #ffb74d; /* Bright orange for unvisited links */
  text-decoration: none;
  transition: color 0.2s ease;
}

a:visited {
  color: #ff9800; /* Slightly darker orange for visited links */
}

a:hover,
a:focus {
  color: #ffd88c; /* Lighter orange on hover */
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Protective overlay for video-wrapper to make direct saving harder */
.video-wrapper { 
  position: relative; 
  user-select: none; 
  -webkit-user-select: none; 
  -webkit-touch-callout: none;
}

.video-protect-overlay {
  position: absolute;
  inset: 0; /* top:0; right:0; bottom:0; left:0; */
  background: transparent;
  cursor: pointer;
  z-index: 10;
  /* Block all pointer events to the video element below */
  pointer-events: auto;
}
/* When playing, make overlay visually transparent but keep it intercepting all events */
.video-protect-overlay.playing { 
  background: transparent; 
  cursor: default;
}

/* Prevent direct interaction with video element (all events go through overlay) */
#page-main-video { 
  position: relative; 
  z-index: 1; 
  pointer-events: none; /* block all direct clicks/context menu on video */
  user-select: none;
  -webkit-user-select: none;
}

.video-custom-controls { 
  position: absolute; 
  left: 12px; 
  bottom: 12px; 
  z-index: 15; 
  pointer-events: auto; /* allow clicks on controls */
}
.video-custom-controls .vc-play { 
  background: rgba(0,0,0,0.7); 
  color: #fff; 
  border: 1px solid rgba(255,255,255,0.2); 
  padding: 10px 14px; 
  border-radius: 8px; 
  font-size: 18px; 
  cursor: pointer; 
  transition: background 0.2s;
}
.video-custom-controls .vc-play:hover { background: rgba(0,0,0,0.85); }
.video-custom-controls .vc-play.hidden { display: none; }

header {
  background: #444;
  padding: 10px 0;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 2em;
  margin: 0;
  padding: 0;
}

nav a {
  color: #fff !important;
  text-decoration: none !important;
  font-weight: bold;
}

main {
  max-width: 1350px;
  margin: 0 auto; /* remove top margin so nav can sit flush under header */
  padding: 1em; /* keep internal padding */
  /* Slightly translucent main so background image shows through */
  background: rgba(49,49,49,0.6);
  backdrop-filter: blur(4px);
  border-radius: 8px;
}

section {
  margin-bottom: 2em;
}

/* Секции табов: скрываем по умолчанию, показываем активную */
.tab-section { display: none; }
.tab-section.active-tab { display: block; }

/* Сетка скриншотов */
.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 1rem;
}
.screenshot-grid img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.req-image {
  display: block;
  width: 100%; /* span the content width */
  height: auto;
  margin: 0 0 0.8rem 0;
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.45);
}

/* Keep requirement blocks single-column so images appear above headings */
.cover-crop-bottom {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3; /* сохраняем 4:3, можно менять */
  object-fit: cover;
  object-position: center top; /* обрезаем снизу */
  display: block;
  border-radius: 6px;
  margin: 0 0 1rem 0;
}

/* Обрезать нижнюю треть: показываем верхние 2/3 изображения (aspect ratio меняется на 2:1) */
.crop-bottom-third {
  aspect-ratio: 2 / 1; /* ширина : высота = 2:1 — оставляет верхние 2/3 */
  object-position: center top;
}
.screenshot-grid img:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 28px rgba(0,0,0,0.6);
}

.video-wrapper {
  margin-top: 1rem;
  background: #000;
  padding: 8px;
  border-radius: 6px;
}

.video-wrapper video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.accordion-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: #ffd88c;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.accordion-error {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  background: rgba(183, 28, 28, 0.12);
  color: #ffb4a2;
}

/* Make the whole label clickable and show pointer */
.install-confirm {
  display: inline-flex;
  align-items: center;
  background-color: #332304;
  gap: 0.6rem;
  margin: 1rem 0;
  font-weight: 600;
  font-size: 24px;
  cursor: pointer;
  position: relative;
  padding-left: 32px; /* Место для чекбокса */
  height: auto;
  min-height: 40px; /* гарантируем минимальную кликабельную зону */
}

/* Центруем абсолютный чекбокс по вертикали внутри инлайн-флекса */
.install-confirm input[type="checkbox"] {
  position: absolute;
  opacity: 1;
  left: 6px; /* немного отступа от левой границы */
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  z-index: 1;
  cursor: pointer;
}

/* CSS-only toggle: move input outside label and use sibling selector */
/* Hide native checkbox visually but keep it accessible */
#install-confirm {
  position: absolute;
  left: -9999px; /* offscreen but focusable */
}

/* Draw custom checkbox inside label */
.install-confirm {
  position: relative;
  padding-left: 36px;
}
.install-confirm::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid #ffd88c;
  background: #2a2a2a;
  box-sizing: border-box;
}
/* checked state using :checked + label */
#install-confirm:checked + .install-confirm::before {
  background: linear-gradient(180deg,#ffb74d,#ff9f1a);
  border-color: #ffb74d;
}

/* show install steps when the checkbox is checked (CSS-only) */
#install-steps {
  margin: 0 0 1rem 1.2rem;
  line-height: 1.6;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform-origin: top center;
  transform: translateY(-6px);
  transition: max-height 320ms cubic-bezier(.2,.8,.2,1), opacity 240ms ease, transform 240ms ease;
}

/* when checkbox checked, show the container */
#install-confirm:checked ~ #install-steps {
  opacity: 1;
  transform: translateY(0);
  max-height: 1600px; /* large enough to contain content */
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.contact-list li {
  margin-bottom: 0.5rem;
}

.contact-list a {
  color: #ffb74d;
  text-decoration: underline;
}

.contact-list a:visited {
  color: #ff9800;
}

.contact-list a:hover {
  color: #ffd88c;
}

/* Yandex consent banner styles */
.ym-consent-banner{
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: rgba(10,10,10,0.95);
  color: #fff;
  padding: 1rem;
  z-index: 10000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  box-sizing: border-box;
}
.ym-consent-banner__text{ flex: 1 1 60%; min-width:220px; padding-right:1rem; }
.ym-consent-banner__text h4{ margin:0 0 0.4rem 0; }
.ym-consent-banner__text p{ margin:0 0 0.4rem 0; }
.ym-consent-banner__text p:last-of-type{ margin-bottom:0; }
.ym-consent-banner__text strong{ font-weight:600; }
.ym-consent-banner__actions{ flex:0 0 220px; display:flex; justify-content:flex-end; gap:0.5rem; }
.ym-btn{ padding:0.6rem 0.9rem; border-radius:6px; cursor:pointer; }
.ym-btn--primary{ background:transparent; color:#fff; border:none; }
.ym-btn--ghost{ background:transparent; color:#fff; border:1px solid rgba(255,255,255,0.12); }
.ym-consent-link{ color:#ffd88c; margin-left:0.5rem; text-decoration:underline; display:inline-block; margin-top:0.4rem; }

@media (max-width:600px){
  .ym-consent-banner{ padding:0.8rem; }
  .ym-consent-banner__actions{ flex:1 1 100%; justify-content:flex-start; margin-top:0.5rem; }
}

/* Accessibility: reduce motion for animations */
@media (prefers-reduced-motion: reduce) {
  .main-title { animation: none !important; }
  .header-content::after { animation: none !important; }
  .carousel-dot::before { transition: none !important; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Стили для новостей */
.news-list { display: grid; gap: 14px; margin-top: 1rem; }
.news-item { display: flex; gap: 12px; background: #272727; padding: 12px; border-radius: 8px; align-items: center; }
.news-item img { width: 140px; height: 84px; object-fit: cover; border-radius: 6px; }
.news-body h4 { margin: 0 0 6px 0; color: #ffb74d; }
.news-body p { margin: 0 0 8px 0; color: #e6e6e6; }
.news-body time { color: #bdbdbd; font-size: 0.9rem; }

/* Сетка по 3 изображения, 16:9 и адаптив */
.three-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 1rem 0;
}
.img-16-9 {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-radius: 6px;
}

/* Standardized list for "Модификации" sections across accordion blocks */
.mods-list {
  list-style: disc;
  margin: 0.5rem 0 1rem 1.2rem;
  padding: 0;
  columns: 2;
  column-gap: 1.2rem;
}
.mods-list li {
  margin: 0 0 0.35rem 0;
  break-inside: avoid;
}

/* Custom block specific styles */
.video-caption {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: #ffdca8;
  text-align: center;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 0.8rem 0 1rem 0;
}
.gallery-grid .grid-item img { width: 100%; height: 140px; object-fit: cover; border-radius: 6px; }

.full-width-image {
  margin-top: 0.8rem;
}

.full-width-image img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  object-fit: cover;
}

@media (max-width: 900px) {
  .three-grid { grid-template-columns: repeat(2, 1fr); }
  /* allow nav to use padding and keep items visible on narrower screens */
  .primary-nav ul { max-width: calc(100% - 2rem); padding: 0 1rem; }
}

@media (max-width: 768px) {
  .three-grid { grid-template-columns: 1fr; }
  
  /* Disable TV effects on mobile */
  .tv-effects { display: none !important; }
}

@media (max-width: 560px) {
  .three-grid { grid-template-columns: 1fr; }
}

/* Headings use LeonovSP font with golden underline */
h2, h3 {
  color: #ffb300;
  border-bottom: 1px solid #ffb300;
  padding-bottom: 0.2em;
  font-family: 'LeonovSP', 'Renju', Arial, sans-serif;
  /* Ensure headings are scrolled into view below the fixed nav */
  scroll-margin-top: calc(var(--primary-nav-height) + 12px);
  /* Remove visible focus outline from headings */
  outline: none;
}

/* But keep focus-visible for keyboard navigation accessibility */
h2:focus-visible, h3:focus-visible {
  outline: 2px solid rgba(255,183,0,0.5);
  outline-offset: 4px;
}

button {
  background: #ffb300;
  color: #222;
  border: none;
  padding: 0.5em 1.2em;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 1em;
}

/* Custom scrollbars: dark, rounded, no arrows */
/* WebKit browsers (Chrome, Edge, Safari) */
::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}
::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.25);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.6);
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.03); /* subtle separation */
}
/* remove default arrows in older WebKit/EdgeHTML (if any) */
::-webkit-scrollbar-button { display: none; height: 0; width: 0; }

/* Firefox */
html {
  /* track color, thumb color */
  scrollbar-color: #ff8a00 auto;
  scrollbar-width: thin;
}

/* Small enhancement: a lightweight shadow for the thumb on hover */
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.75); }

button:hover {
  background: #ffa000;
}

.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  background: #222;
  padding: 2em;
  border-radius: 8px;
  text-align: center;
}

/* Disclaimer modal specific tweaks */
.modal-content.disclaimer { max-width: 1200px; max-height: 70vh; overflow: auto; text-align: left; }
.modal-content.disclaimer .disclaimer-text p { margin-bottom: 0.6rem; }

/* Background image for disclaimer modal (decorative). Uses a pseudo-element as overlay so text stays readable */
/* Unified background for the whole disclaimer modal: decorative image + overlay via pseudo-elements */
.modal-content.disclaimer {
  position: relative;
  background-color: rgba(20,20,20,0.9); /* fallback */
  /* keep scrollable area for long disclaimers */
  max-width: 1200px;
  max-height: 70vh;
  overflow: auto;
  text-align: left;
}

/* Background image layer */
/* Move background to the scrollable content so it covers the full disclaimer text height */
.modal-content.disclaimer::before,
.modal-content.disclaimer::after {
  /* clear previous decorations (kept for compatibility) */
  content: none;
}

/* Apply background to the inner scrollable content so it covers everything and scrolls with it */
.modal-content.disclaimer .disclaimer-text {
  position: relative;
  z-index: 2; /* content above background/overlay */
}
.modal-content.disclaimer .disclaimer-text::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('src/disclaimer/background.svg');
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  z-index: 0; /* behind content */
}
.modal-content.disclaimer .disclaimer-text::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(10,10,10,0.45), rgba(10,10,10,0.75));
  z-index: 1; /* between background and content */
  pointer-events: none;
}

/* Ensure all textual elements are above overlay and readable */
.modal-content.disclaimer .disclaimer-text,
.modal-content.disclaimer .disclaimer-text p,
.modal-content.disclaimer .disclaimer-text li,
.modal-content.disclaimer .disclaimer-text dd,
.modal-content.disclaimer .disclaimer-text dt {
  color: #e6e6e6;
  position: relative;
  z-index: 2;
}

/* Prevent text selection inside disclaimer modal (basic protection) */
.modal-content.disclaimer .disclaimer-text,
.modal-content.disclaimer .disclaimer-text * {
  -webkit-user-select: none; /* Chrome/Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* IE10+ */
  user-select: none;
}

/* Style h4 headings inside disclaimer modal: orange, bold, uppercase, highlighted */
.modal-content.disclaimer h4 {
  color: #ff8c00; /* orange */
  font-weight: 800;
  text-transform: uppercase;
  margin: 0 0 0.6rem 0;
  padding: 0.35rem 0.6rem;
  background: rgba(255,140,0,0.06); /* subtle highlight */
  border-left: 4px solid rgba(255,140,0,0.18);
  letter-spacing: 0.06em;
  font-family: 'LeonovSP', 'Renju', Arial, sans-serif;
  position: relative;
  z-index: 3; /* make sure headings sit above background and overlay */
}

.install-consent { margin: 0.6rem 0; color: #e6e6e6; }
.install-consent input { margin-right: 0.5rem; }

/* Footnote style used for small disclaimer lines */
.footnote {
  margin-top: 0.6rem;
  color: #cfcfcf;
  font-size: 0.85rem;
  opacity: 0.9;
}
.footnote a { 
  color: #ffb74d; 
  text-decoration: underline; 
}

.footnote a:visited {
  color: #ff9800;
}

.footnote a:hover {
  color: #ffd88c;
}

.footnote small { font-size: 0.85rem; color: inherit; }

/* ============================================================================
   SweetAlert2 Custom Styles
   ============================================================================ */

/* Fix SweetAlert2 on mobile devices */
.swal2-container {
  z-index: 999999 !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 10px !important;
  overflow-y: auto !important;
}

.swal2-popup {
  background: rgba(20, 20, 25, 0.98) !important;
  color: #f5efe6 !important;
  border-radius: 12px !important;
  padding: 20px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7) !important;
  max-width: 1050px !important;
  width: 90% !important;
  margin: auto !important;
  font-family: 'ChakraPetch', sans-serif !important;
  opacity: 1 !important;
}

.disclaimer-popup.swal2-popup {
  background: rgba(18, 18, 24, 0.98) !important;
  border: 1px solid rgba(255, 216, 140, 0.18) !important;
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.75) !important;
}

.swal2-title {
  color: #ffd88c !important;
  font-size: 1.5rem !important;
  margin-bottom: 15px !important;
}

.swal2-html-container {
  color: #f5efe6 !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
  max-height: 60vh !important;
  overflow-y: auto !important;
  text-align: left !important;
}

.swal2-confirm, .swal2-cancel {
  font-family: 'ChakraPetch', sans-serif !important;
  font-weight: 600 !important;
  padding: 12px 24px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  min-width: 120px !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* Default SweetAlert2 button colors */
.swal2-confirm {
  background: linear-gradient(180deg, #ffd88c, #ffb74d) !important;
  color: #1b1200 !important;
  border: none !important;
}

.swal2-cancel {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffd88c !important;
  border: 1px solid rgba(255, 200, 90, 0.3) !important;
}

/* Disclaimer modal specific button styles */
.disclaimer-accept-btn.swal2-confirm {
  background: #000 !important;
  color: #fff !important;
  border: none !important;
}

.disclaimer-accept-btn.swal2-confirm:not([disabled]):not([aria-disabled="true"]):hover {
  background: #222 !important;
}

.disclaimer-accept-btn.swal2-confirm[disabled],
.disclaimer-accept-btn.swal2-confirm[aria-disabled="true"] {
  background: #000 !important;
  opacity: 0.6 !important;
  cursor: not-allowed !important;
}

.disclaimer-cancel-btn.swal2-cancel {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.disclaimer-cancel-btn.swal2-cancel:hover {
  background: rgba(255, 255, 255, 0.2) !important;
}

.swal2-actions {
  margin-top: 20px !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}

.swal2-backdrop-show {
  background: rgba(0, 0, 0, 0.85) !important;
}

html.disclaimer-modal-open,
body.disclaimer-modal-open {
  overflow: hidden !important;
  touch-action: none !important;
  height: 100vh;
}

.disclaimer-container.swal2-container {
  align-items: center !important;
  justify-content: center !important;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom)) 18px !important;
  z-index: 12000 !important;
}

.disclaimer-container-open {
  pointer-events: auto !important;
}

/* Template-driven disclaimer content inside SweetAlert */
.swal2-html-container .disclaimer-text {
  position: relative;
  padding: 0 0.2rem 0.8rem 0.2rem;
  margin: 0;
  color: #f5efe6;
}

.swal2-html-container .disclaimer-text::before,
.swal2-html-container .disclaimer-text::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.swal2-html-container .disclaimer-text::before {
  background-image: url('src/disclaimer/background.svg');
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  opacity: 0.42;
}

.swal2-html-container .disclaimer-text::after {
  background: linear-gradient(180deg, rgba(10,10,10,0.55), rgba(10,10,10,0.82));
}

.swal2-html-container .disclaimer-text > * {
  position: relative;
  z-index: 1;
}

.swal2-html-container .disclaimer-text h4 {
  color: #ffb24d;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1rem 0 0.45rem 0;
  padding: 0.35rem 0.5rem;
  background: rgba(255, 140, 0, 0.12);
  border-left: 4px solid rgba(255, 140, 0, 0.24);
}

.swal2-html-container .disclaimer-text dl,
.swal2-html-container .disclaimer-text ul {
  margin-left: 0.4rem;
  padding-left: 1.2rem;
}

.swal2-html-container .disclaimer-text p,
.swal2-html-container .disclaimer-text li,
.swal2-html-container .disclaimer-text dd,
.swal2-html-container .disclaimer-text dt {
  color: #f3ede0;
}

.swal2-html-container .disclaimer-text dt {
  font-weight: 700;
  margin-top: 0.45rem;
}

.swal2-html-container .disclaimer-text a {
  color: #ffb74d;
  text-decoration: underline;
}

.swal2-html-container .disclaimer-text a:visited {
  color: #ff9800;
}

.swal2-html-container .disclaimer-text a:hover {
  color: #ffd88c;
}

.swal2-html-container .disclaimer-actions {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-top: 1.2rem;
}

.swal2-html-container .disclaimer-consent {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
  color: #ffd88c;
}

.swal2-html-container .disclaimer-consent label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.95rem;
  cursor: pointer;
  pointer-events: auto;
}

.swal2-html-container .disclaimer-consent input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  border-radius: 4px;
  cursor: pointer;
  background-color: #2a2a2a !important;
  border: 2px solid #ffd88c !important;
  appearance: none !important;
  position: relative;
  flex-shrink: 0;
  display: inline-block !important;
  opacity: 1 !important;
  visibility: visible !important;
  margin: 0 !important;
  vertical-align: middle;
}

/* Checkmark for checked state */
.swal2-html-container .disclaimer-consent input[type="checkbox"]:checked {
  background-color: #ffb74d !important;
  border-color: #ffb74d !important;
}

.swal2-html-container .disclaimer-consent input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #1b1200;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
}

/* Focus state for accessibility */
.swal2-html-container .disclaimer-consent input[type="checkbox"]:focus {
  outline: 2px solid rgba(255, 216, 140, 0.5);
  outline-offset: 2px;
}

/* Hover state */
.swal2-html-container .disclaimer-consent input[type="checkbox"]:hover {
  border-color: #ffd88c;
  box-shadow: 0 0 8px rgba(255, 216, 140, 0.3);
}

.swal2-confirm[disabled],
.swal2-confirm[aria-disabled="true"] {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
}

/* Disclaimer accept button should stay black even when disabled */
.disclaimer-accept-btn.swal2-confirm[disabled],
.disclaimer-accept-btn.swal2-confirm[aria-disabled="true"] {
  filter: none !important;
}

/* Mobile specific fixes */
@media (max-width: 640px) {
  .swal2-popup {
    width: 95% !important;
    padding: 15px !important;
    max-height: 90vh !important;
  }
  
  .swal2-title {
    font-size: 1.2rem !important;
  }
  
  .swal2-html-container {
    font-size: 13px !important;
    max-height: 50vh !important;
  }
  
  .swal2-confirm, .swal2-cancel {
    padding: 10px 20px !important;
    font-size: 13px !important;
    min-width: 100px !important;
  }
  
  .swal2-actions {
    flex-direction: column-reverse !important;
    width: 100% !important;
  }
  
  .swal2-actions button {
    width: 100% !important;
    margin: 5px 0 !important;
  }

  .disclaimer-container.swal2-container {
    align-items: center !important;
    justify-content: center !important;
    padding-top: calc(16px + env(safe-area-inset-top)) !important;
  }

  .swal2-html-container .disclaimer-consent {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .swal2-html-container .disclaimer-consent label {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ============================================================================
   Accordion
   ============================================================================ */

/* Accordion (composition) styles */
.accordion { margin-top: 1rem; }
.accordion-item { background: transparent; border-radius: 8px; margin: 0.6rem 0; overflow: hidden; }
.accordion-header {
  display: flex; align-items: center; justify-content: flex-start; gap: 0.6rem;
  padding: 0.8rem 1rem; cursor: pointer; user-select: none;
}
.accordion-header .title { font-weight: 700; color: #ffd88c; }
.accordion-header .toggle { display: none; }
.accordion-content { padding: 0 1rem 1rem 1rem; display: none; }
.accordion-item.open .accordion-content { display: block; }
.accordion-item.open .accordion-header { background: linear-gradient(0deg, rgba(255,140,0,0.03), transparent); }

/* Fullscreen image viewer */
.viewer { position: fixed; inset: 0; background: rgba(0,0,0,0.95); display: none; align-items: center; justify-content: center; z-index: 12000; }
.viewer.open { display: flex; }
.viewer img { max-width: 96%; max-height: 92%; border-radius: 6px; }
.viewer .close { position: absolute; top: 18px; right: 18px; background: rgba(255,255,255,0.06); color:#ffd88c; border-radius: 6px; width:40px; height:40px; display:flex; align-items:center; justify-content:center; }

/* small screens: reduce paddings for accordion items */
@media (max-width: 560px) {
  .accordion-header { padding: 0.6rem 0.6rem; }
  .accordion-content { padding: 0 0.6rem 0.8rem; }
  .carousel-btn { width: 36px; height: 36px; }
}

/* Carousel progress dots */
.carousel-dots { display:flex; gap:10px; justify-content:center; margin-top:10px; z-index: 210; }
/* Retro 60s style dots: use a small circular pseudo-element for crisp visuals
   while keeping the button itself a larger hit target for accessibility. */
.carousel-dot {
  /* Keep a comfortable tappable area while the visible dot is smaller */
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  position: relative;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 160ms ease;
}
.carousel-dot::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2b2b2b;
  border: 2px solid rgba(255,210,120,0.08);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.25);
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  display: block;
}
.carousel-dot.active::before {
  background: linear-gradient(180deg, #ffd88c, #ffb74d);
  transform: scale(1.22);
  box-shadow: 0 2px 8px rgba(0,0,0,0.36);
  border-color: rgba(255,200,90,0.95);
}

/* keyboard focus visible ring */
.carousel-dot:focus {
  outline: none;
}
.carousel-dot:focus::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 8px;
  box-shadow: 0 0 0 3px rgba(255,208,120,0.16);
}

/* Slightly smaller tappable area on very small screens */
@media (max-width: 420px) {
  .carousel-dot { width: 24px; height: 24px; }
  .carousel-dot::before { width: 10px; height: 10px; }
}

/* Hide dots for blueprint carousels (many images, dots not needed) */
.swiper-carousel[data-src*="blueprints"] .swiper-pagination { 
  display: none !important; 
}

/* Reusable video window styles */
.video-window { width: 100%; max-width: 100%; margin: 0 auto 12px; background: #000; color: #fff; border-radius: 6px; overflow: hidden; min-height: 100px; }
.video-window .video-controls { display: flex; gap: 8px; padding: 8px; background: rgba(0,0,0,0.6); align-items: center; }
.video-window .video-source { background: rgba(255,255,255,0.04); color: #ffd88c; border: 1px solid rgba(255,255,255,0.04); padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.video-window .video-source.active { background: linear-gradient(180deg,#2b2b2b,#1f1f1f); box-shadow: 0 2px 6px rgba(0,0,0,0.4); }
.video-window .video-holder { width: 100%; background: #000; position: relative; /* for fallback */ }
/* Use modern aspect-ratio when available, with a padding-top fallback for older browsers */
.video-window .video-holder::before { content: ''; display: block; padding-top: 56.25%; }
.video-window iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; display: block; }
.video-window iframe[style] { position: absolute; }
@supports (aspect-ratio: 16/9) {
  .video-window .video-holder::before { display: none; }
  .video-window .video-holder { padding-top: 0; }
  .video-window iframe { position: static; aspect-ratio: 16/9; height: auto; }
}

.video-backup { padding: 8px; background: rgba(0,0,0,0.6); text-align: right; }
.video-backup a { 
  color: #ffb74d; 
  text-decoration: underline; 
}

.video-backup a:visited {
  color: #ff9800;
}

.video-backup a:hover {
  color: #ffd88c;
}

/* Fallback placeholder for video windows when iframe embedding fails */
.video-placeholder {
  padding: 12px;
  background: rgba(0,0,0,0.6);
  text-align: center;
}
.video-placeholder a {
  color: #ffb74d;
  text-decoration: underline;
  margin: 0 6px;
}
.video-placeholder a:hover { color: #ffd88c; }

/* Spoiler summary styling: fallout terminal ribbon */
.terminal-box {
  font-family: 'ShareTechMono', 'ChakraPetch', 'Consolas', monospace;
  color: #39ff14;
  font-weight: 700;
  font-size: 1.30rem;
  letter-spacing: 0.02em;
  text-shadow: 0 0 2px #39ff14, 0 0 8px #0a2e0a;
  background: #091508;
  border-radius: 0;
  box-shadow: 0 0 10px #39ff14;
  padding: 0.7rem 1.4rem;
  margin: 0.8rem 0;
  transition: filter 160ms ease;
  min-width: 0;
  overflow: hidden;
}

.spoiler-summary {
  display: block;
  width: 100%;
  position: relative;
  isolation: isolate;
  text-align: left;
  cursor: pointer;
  background: none;
  box-shadow: none;
  font-size: 2.0rem;
  color: #39ff14;
  text-shadow: 0 0 4px #39ff14, 0 0 12px #0a2e0a;
}

.spoiler-summary::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 24" preserveAspectRatio="none"><polygon points="0,0 98.492,0 100,12 98.492,24 0,24" fill="%23091508"/></svg>');
  background-repeat: no-repeat;
  background-size: 90% 100%;
  background-position: left;
}

.spoiler-summary:hover, .spoiler-summary:focus {
  filter: brightness(1.15) drop-shadow(0 0 6px #39ff14);
}

details.spoiler-block[open] .spoiler-summary {
  filter: brightness(1.22) drop-shadow(0 0 10px #39ff14);
}
/* Container and content spacing extracted from inline styles */
.spoiler-block {
  margin: 0.8rem 0;
}
.spoiler-content {
  padding: 0.8rem 0;
}

/* FAQ fallout terminal style */
.faq-answer {
  font-family: 'ShareTechMono', 'ChakraPetch', 'Consolas', monospace;
  color: #39ff14;
  font-weight: 1;
  font-size: 1.30rem;
  letter-spacing: 0.02em;
  text-shadow: 0 0 2px #39ff14, 0 0 8px #0a2e0a;
  background: #091508;
  border-radius: 10px;
  box-shadow: 0 0 10px #39ff14;
  padding: 0.7rem 1.4rem;
  margin: 0.8rem 0;
  transition: filter 160ms ease;
  min-width: 0;
  overflow: hidden;
}

details.spoiler-block > .spoiler-content {
  position: relative; /* establish positioning context for pseudo-elements */
  z-index: 2; /* keep content above background/border layers */
  background: transparent; /* actual panel background is drawn by ::before */
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 12px 16px; /* inner spacing so content doesn't touch the frame */
  color: rgba(57,255,20,0.85);
}

/* wider background (10px on all sides) behind the content */
details.spoiler-block > .spoiler-content::before {
  content: '';
  position: absolute;
  inset: -10px; /* extend 10px beyond each edge */
  z-index: 0;
  pointer-events: none;
  background: #0a2e0a; /* dark green panel */
  border-radius: 10px; /* match visual style */
  box-shadow: inset 0 6px 18px rgba(0,0,0,0.55); /* subtle inner depth */
}

/* neon-green perimeter with glow */
details.spoiler-block > .spoiler-content::after {
  content: '';
  position: absolute;
  inset: -14px; /* push border further out so it doesn't touch the panel */
  z-index: 1;
  pointer-events: none;
  border-radius: 12px; /* slightly larger to follow larger inset */
  border: 2px solid #39ff14; /* bright green outline */
  /* softer inner glow and larger outer halo to suggest separation */
  box-shadow: 0 0 8px 2px rgba(57,255,20,0.85), 0 0 36px 14px rgba(57,255,20,0.18);
}

/* Ensure content inside the panel sits above the pseudo-elements (outline/glow) */
/* Ensure all content inside the panel sits above the pseudo-elements (outline/glow) */
details.spoiler-block > .spoiler-content > * {
  position: relative;
  z-index: 3;
}

/* subtle pulsing glow animation for the outline */
@keyframes spoiler-glow-pulse {
  0% { box-shadow: 0 0 6px 1px rgba(57,255,20,0.6), 0 0 18px 6px rgba(57,255,20,0.12); }
  50% { box-shadow: 0 0 14px 4px rgba(57,255,20,0.95), 0 0 36px 14px rgba(57,255,20,0.28); }
  100% { box-shadow: 0 0 6px 1px rgba(57,255,20,0.6), 0 0 18px 6px rgba(57,255,20,0.12); }
}

/* play animation on hover and when details is open */
details.spoiler-block > .spoiler-content::after {
  transition: box-shadow 220ms ease;
}
details.spoiler-block > .spoiler-content:hover::after,
details.spoiler-block[open] > .spoiler-content::after {
  animation: spoiler-glow-pulse 1.6s ease-in-out infinite;
}

/* Page main wrapper previously inline-styled in privacy.html */
.content-main {
  max-width: 900px;
  margin: 2rem auto;
  padding: 1rem;
}

.btn--revoke-consent {
  padding: 0.6rem 0.9rem;
  background: #6a4c93;
  color: #fff;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}
/* Remove native disclosure marker so text sits flush to the ribbon */
details.spoiler-block > summary::-webkit-details-marker,
details.spoiler-block > summary::marker {
  display: none;
}

/* Custom chevron marker: points right by default, down when open */
.spoiler-summary::after {
  content: '▸';
  display: inline-block;
  margin-left: 0.6rem;
  transition: transform 180ms ease;
  transform-origin: center;
  color: #39ff14;
  filter: drop-shadow(0 0 2px #0a2e0a);
}
details.spoiler-block[open] .spoiler-summary::after {
  transform: rotate(90deg);
}

/* Orange-yellow accordion header in Fallout terminal style */
div.accordeon-header {
  display: block;
  width: 100%;
  position: relative;
  isolation: isolate;
  font-family: 'ShareTechMono', 'ChakraPetch', 'Consolas', monospace;
  color: #1b1200; /* dark text on yellow */
  font-weight: 700;
  font-size: 1.30rem;
  letter-spacing: 0.02em;
  padding: 0.6rem 1.6rem;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
  background: none;
  transition: filter 160ms ease;
  min-width: 0;
  box-shadow: none;
  overflow: hidden;
}

div.accordeon-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* orange-yellow ribbon, left flat, right pointed */
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 24" preserveAspectRatio="none"><polygon points="0,0 98.492,0 100,12 98.492,24 0,24" fill="%23a35500"/></svg>');
  background-repeat: no-repeat;
  background-size: 90% 100%;
  background-position: left top;
}

div.accordeon-header::after {
  content: '▸';
  display: inline-block;
  margin-left: 0.6rem;
  transition: transform 180ms ease;
  transform-origin: center;
  color: #ffd88c; /* bright yellow chevron */
}

div.accordeon-header.open::after {
  transform: rotate(90deg);
}

div.accordeon-header:hover,
div.accordeon-header:focus {
  filter: brightness(1.08) drop-shadow(0 0 6px #ffb74d);
}

/* Apply the same orange-yellow ribbon style to the real accordion header used in markup */
.accordion-header {
  display: block;
  width: 100%;
  position: relative;
  isolation: isolate;
  font-family: 'ShareTechMono', 'ChakraPetch', 'Consolas', monospace;
  color: #1b1200; /* dark text on yellow */
  font-weight: 700;
  font-size: 1.30rem;
  letter-spacing: 0.02em;
  padding: 0.6rem 1.6rem;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
  background: none;
  transition: filter 160ms ease;
  min-width: 0;
  box-shadow: none;
  overflow: hidden;
}

.accordion-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 24" preserveAspectRatio="none"><polygon points="0,0 98.492,0 100,12 98.492,24 0,24" fill="%23a35500"/></svg>');
  background-repeat: no-repeat;
  background-size: 99% 100%;
  background-position: left top;
}

.accordion-header .title {
  font-weight: 700; color: #ffd88c; position: relative; display: inline-block;
}

.accordion-header .title::after {
  content: '◂';
  display: inline-block;
  margin-left: 0.4rem;
  transition: transform 180ms ease;
  transform-origin: center;
  color: #ffd88c;
  vertical-align: middle;
}

/* Hide CSS chevron if inline .js-chevron already exists (added by script) */
.accordion-header .title:has(.js-chevron)::after {
  display: none;
}

/* rotate chevron to point down when item is open */
.accordion-item.open .accordion-header .title::after {
  transform: rotate(-90deg);
}

.accordion-header:hover,
.accordion-header:focus {
  filter: brightness(1.08) drop-shadow(0 0 6px #ffb74d);
}

/* Consent banner - improved contrast and single-action layout */
.ym-consent-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 18px;
  z-index: 999999;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(10,10,12,0.98);
  color: #fff;
  box-shadow: 0 8px 32px rgba(0,0,0,0.65);
  max-width: 1470px;
  margin: 0 auto;
  pointer-events: auto;
  touch-action: auto;
}

.ym-consent-banner__text h4 { 
  margin: 0 0 6px 0; 
  font-size: 1.05rem; 
  color: #ffd88c; 
}

.ym-consent-banner__text p { 
  margin: 0 0 6px 0; 
  color: #f5efe6; 
  line-height: 1.34; 
}

.ym-consent-banner__actions { 
  display: flex; 
  gap: 10px; 
  align-items: center; 
}

.ym-btn { 
  padding: 8px 12px; 
  border-radius: 8px; 
  border: none; 
  cursor: pointer; 
  font-weight: 600; 
}

.ym-btn--primary { 
  background: linear-gradient(180deg, #ffd88c, #ffb74d); 
  color: #1b1200; 
  box-shadow: 0 2px 6px rgba(0,0,0,0.35); 
}

.ym-btn--ghost { 
  background: transparent; 
  color: #ffd88c; 
  border: 1px solid rgba(255,200,90,0.12);
}

@media (max-width: 640px) {
  .ym-consent-banner { left: 8px; right: 8px; padding: 10px; }
  .ym-consent-banner__text p { font-size: 13px; }
}

/* ============================================================================
   Swiper Carousel Styles
   ============================================================================ */

/* Swiper Carousel */
.swiper-carousel,
.swiper.swiper-carousel {
  position: relative;
  margin: 20px 0;
  width: 100%;
  height: auto !important; /* Override Swiper's fixed height */
  overflow: visible !important; /* Allow overlay elements to show */
  isolation: isolate; /* Prevent parent stacking contexts from swallowing overlays */
}

.swiper-wrapper {
  overflow: visible !important; /* Keep overlay elements within view */
  height: auto !important; /* Override Swiper's fixed height */
}

.swiper-slide {
  position: relative;
  width: 100% !important;
  max-width: 100%;
  height: auto !important; /* Override Swiper's fixed height */
  overflow: visible !important;
  display: block !important; /* Back to block to let image define height */
}

.swiper-slide-inner {
  position: relative;
  display: block;
  width: 100%;
}

.swiper-slide img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
  cursor: pointer;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

/* Special handling for specific images - no width constraint */
.swiper-slide img[src*="hc4.webp"],
.swiper-slide img[src*="background.webp"] {
  max-width: none;
  width: auto;
  margin: 0 auto;
}

.swiper-caption {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: rgba(8,8,10,0.52);
  color: #ffd88c;
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 5;
}

.swiper-button-prev {
  left: 10px !important;
}

.swiper-button-next {
  right: 10px !important;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
  background: rgba(255, 183, 77, 0.9);
  border-color: #ff8c00;
  transform: scale(1.1);
}

.swiper-button-next:after,
.swiper-button-prev:after {
  content: '';
  font-size: 0;
  display: none;
}

/* Custom arrow icons using borders */
.swiper-button-next:before,
.swiper-button-prev:before {
  content: '';
  display: block;
  width: 12px;
  height: 12px;
  border-top: 3px solid #ffd88c;
  border-right: 3px solid #ffd88c;
  position: absolute;
  top: 50%;
  left: 50%;
}

.swiper-button-prev:before {
  transform: translate(-35%, -50%) rotate(-135deg);
}

.swiper-button-next:before {
  transform: translate(-65%, -50%) rotate(45deg);
}

.swiper-button-next:hover:before,
.swiper-button-prev:hover:before {
  border-color: #000;
}

/* Swiper pagination */
.swiper-pagination {
  position: relative !important;
  margin-top: 15px !important;
  bottom: auto !important;
}

.swiper-pagination-bullet {
  background: #ffd88c !important;
  opacity: 0.4 !important;
  width: 14px;
  height: 14px;
  transition: all 0.3s ease;
}

.swiper-pagination-bullet:hover {
  opacity: 0.7 !important;
  transform: scale(1.2);
}

.swiper-pagination-bullet-active {
  opacity: 1 !important;
  background: #ffb74d !important;
  box-shadow: 0 0 8px rgba(255, 183, 77, 0.6);
  transform: scale(1.3);
}

@media (max-width: 560px) {
  .swiper-button-next,
  .swiper-button-prev {
    width: 36px;
    height: 36px;
  }
  
  .swiper-caption {
    font-size: 12px;
    padding: 8px 10px;
    max-width: min(88%, calc(100% - 16px));
    margin: 0 0 8px 8px;
  }
}

/* ============================================
   SCREENSHOTS GALLERY STYLES
   ============================================ */

/* Gallery controls panel */
.gallery-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  margin: 2rem 0;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(255, 216, 140, 0.2);
}

.control-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.control-group label {
  color: #ffd88c;
  font-size: 0.95rem;
  white-space: nowrap;
  margin: 0;
}

.control-group select {
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 216, 140, 0.3);
  border-radius: 4px;
  color: #ffd88c;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.control-group select:hover,
.control-group select:focus {
  border-color: #ffd88c;
  background: rgba(0, 0, 0, 0.7);
  outline: none;
}

.control-group select option {
  background: #1a1a1a;
  color: #ffd88c;
}

.gallery-stats {
  color: #ffd88c;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Screenshots gallery grid */
.screenshots-gallery {
  position: relative;
  min-height: 400px;
}

.gallery-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: #ffd88c;
  gap: 1.5rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0;
}

/* Individual gallery item */
.gallery-item {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid transparent;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
}

/* Hover effects */
.gallery-item:hover {
  border-color: #ffd88c;
  box-shadow: 0 8px 30px rgba(255, 216, 140, 0.3);
  transform: translateY(-5px);
}

.gallery-item:hover img {
  transform: scale(1.1);
}

/* Overlay on hover */
.gallery-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0) 50%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.gallery-item:hover::after {
  opacity: 1;
}

/* Image number indicator */
.gallery-item-number {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: #ffd88c;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: 'ShareTechMono', monospace;
  z-index: 2;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.gallery-item:hover .gallery-item-number {
  opacity: 1;
  transform: translateY(0);
}

/* Thumbnail indicator badge */
.gallery-item-thumb-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-family: 'ShareTechMono', monospace;
  font-weight: bold;
  z-index: 2;
  opacity: 0.9;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.gallery-item:hover .gallery-item-thumb-badge {
  opacity: 1;
}

/* Load more button container */
.load-more-container {
  display: flex;
  justify-content: center;
  padding: 3rem 0;
}

#load-more-btn {
  background: linear-gradient(135deg, rgba(255, 216, 140, 0.2), rgba(255, 216, 140, 0.1));
  border: 2px solid #ffd88c;
  color: #ffd88c;
  padding: 1rem 3rem;
  font-size: 1.1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  /* center text horizontally and vertically */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#load-more-btn:hover {
  background: linear-gradient(135deg, rgba(255, 216, 140, 0.3), rgba(255, 216, 140, 0.2));
  box-shadow: 0 5px 20px rgba(255, 216, 140, 0.4);
  transform: translateY(-2px);
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.2rem;
  }
}

@media (max-width: 768px) {
  .gallery-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .control-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .control-group label {
    font-size: 0.9rem;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
  }
  
  .gallery-item {
    border-radius: 6px;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .gallery-controls {
    padding: 1rem;
  }
}

/* PhotoSwipe custom styling to match theme */
.pswp {
  --pswp-bg: rgba(0, 0, 0, 0.95);
  --pswp-placeholder-bg: rgba(0, 0, 0, 0.5);
  --pswp-icon-color: #ffd88c;
  --pswp-icon-color-secondary: #fff;
  z-index: 9999;
}

.pswp__button {
  background-color: rgba(255, 216, 140, 0.15) !important;
  color: #ffd88c !important;
  width: 50px !important;
  height: 50px !important;
  cursor: pointer !important;
}

.pswp__button:hover {
  background-color: rgba(255, 216, 140, 0.3) !important;
}

.pswp__button--close {
  background-color: rgba(255, 100, 100, 0.2) !important;
}

.pswp__button--close:hover {
  background-color: rgba(255, 100, 100, 0.4) !important;
}

.pswp__counter {
  color: #ffd88c !important;
  font-family: 'ShareTechMono', monospace !important;
  font-size: 16px !important;
}

.pswp__icn {
  fill: #ffd88c !important;
}

/* Make UI more visible */
.pswp__top-bar {
  background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 100%) !important;
}

.pswp__error-msg {
  color: #ffd88c;
  text-align: center;
  padding: 2rem;
  font-family: 'ShareTechMono', monospace;
}

/* Improve touch targets on mobile */
@media (max-width: 768px) {
  .pswp__button {
    width: 60px !important;
    height: 60px !important;
  }
  
  .pswp {
    --pswp-icon-stroke-width: 3;
  }
}

.news-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.news-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
  align-items: start;
}

.news-control {
  width: 100%;
  color: #ddd;
}

.news-control label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.news-search-wrapper {
  position: relative;
}

.news-search-wrapper input[type="search"] {
  width: 100%;
  padding: 0.65rem 2.6rem 0.65rem 0.85rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.55);
  color: #f0f0f0;
  font-size: 1rem;
  line-height: 1.5;
  box-sizing: border-box;
  height: auto;
  min-height: calc(1.5em + 1.3rem + 2px);
}

.news-search-wrapper input[type="search"]:focus {
  outline: none;
  border-color: rgba(255, 216, 140, 0.65);
  box-shadow: 0 0 0 2px rgba(255, 216, 140, 0.15);
}

.news-search-clear {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #bbb;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: none;
}

.news-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.news-stats {
  font-size: 0.95rem;
  color: #bbb;
}

.news-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0.35rem 0.75rem;
  color: #ffd88c;
  transition: background 0.2s ease, transform 0.2s ease;
}

.news-refresh-btn .material-icons {
  font-size: 1.1rem;
}

.news-refresh-btn:hover,
.news-refresh-btn:focus {
  background: rgba(255, 216, 140, 0.12);
  transform: translateY(-1px);
}

.news-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.news-card {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.news-card:focus {
  outline: 2px solid rgba(255, 216, 140, 0.8);
  outline-offset: 4px;
}

@media (hover: hover) {
  .news-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.35);
  }
}

.news-card-media {
  position: relative;
  width: 100%;
  padding-top: 56%;
  background-position: top center;
  background-size: cover;
  background-repeat: no-repeat;
}

.news-card-body {
  flex: 0 0 auto;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.news-card-title {
  margin: 0;
  font-family: 'ShareTechMono', monospace;
  font-size: 1.2rem;
  line-height: 1.35;
  color: #ffd88c;
}

.news-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
  color: #aaa;
}

.news-card-summary {
  margin: 0;
  color: #ddd;
  font-size: 0.95rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.news-pagination .btn-flat {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 0.3rem 0.9rem;
  color: #ddd;
}

.news-pagination .btn-flat:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.news-page-indicator {
  font-size: 0.95rem;
  color: #bbb;
}

.news-empty-state,
.news-loading,
.news-error {
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
  color: #bbb;
}

.news-error p {
  margin-bottom: 1rem;
}

.news-spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  border: 3px solid rgba(255, 216, 140, 0.25);
  border-top-color: #ffd88c;
  animation: news-spin 0.9s linear infinite;
}

@keyframes news-spin {
  to { transform: rotate(360deg); }
}

.news-modal {
  color: #ddd;
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.news-modal .news-modal-meta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #bbb;
}

.news-modal-hero {
  margin-bottom: 1.2rem;
}

.news-modal-hero img,
.news-modal-content img {
  width: 100%;
  border-radius: 10px;
}

.news-modal-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 1rem;
  line-height: 1.6;
}

.news-modal-image img {
  border-radius: 10px;
}

.news-modal-video {
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 1rem;
}

.news-modal-video img {
  border-radius: 6px;
  margin-bottom: 0.6rem;
}

.news-modal-actions {
  margin-top: 1.2rem;
  text-align: center;
}

.news-modal-actions .btn-flat,
.news-modal-link {
  color: #ffd88c;
}

@media (max-width: 600px) {
  .news-controls {
    grid-template-columns: 1fr;
  }

  .news-card {
    min-height: 0;
  }

  .news-card-media {
    padding-top: 60%;
  }
}

.news-control select,
.news-control input[type="search"] {
  width: 100%;
  display: block;
}

.news-control select.browser-default {
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.55);
  color: #f0f0f0;
  font-size: 1rem;
  line-height: 1.5;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
  height: auto;
  min-height: calc(1.5em + 1.3rem + 2px);
}

.news-control select.browser-default:hover {
  border-color: rgba(255, 216, 140, 0.35);
}

.news-control select.browser-default:focus {
  outline: none;
  border-color: rgba(255, 216, 140, 0.65);
  box-shadow: 0 0 0 2px rgba(255, 216, 140, 0.15);
}

.news-control select.browser-default option {
  background: #1a1a1a;
  color: #f0f0f0;
}

/* Gameplay tables */
.gameplay-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.6rem 0;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  overflow: hidden;
}

.gameplay-table thead tr {
  background: rgba(255, 255, 255, 0.05);
}

.gameplay-table th {
  padding: 0.6rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffd88c;
}

.gameplay-table th.center {
  text-align: center;
}

.gameplay-table td {
  padding: 0.5rem 0.6rem;
}

.gameplay-table td.center {
  text-align: center;
}

.gameplay-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.gameplay-table .duration-header {
  padding: 0.4rem 0.6rem;
  background: rgba(255, 200, 120, 0.08);
  font-weight: 600;
  color: #ffb74d;
}

/* Section headers */
.section-header {
  color: #ffd88c;
  margin: 0.8rem 0 0.4rem 0;
}

.content-list {
  margin: 0 0 1rem 1.2rem;
}

.note-text {
  margin-top: 0.8rem;
  font-size: 0.92rem;
  color: #ccc;
}

/* Faction list */
.faction-names {
  margin: 0.4rem 0 1rem 1.2rem;
}

/* Disclaimer styles */
.disclaimer-text {
  text-align: left;
  max-height: 60vh;
  overflow-y: auto;
  padding: 0 15px;
}

.disclaimer-text ul {
  margin: 10px 0;
  padding-left: 25px;
}

.disclaimer-consent-note {
  margin: 10px 0;
  font-size: 14px;
  color: #666;
}

.disclaimer-actions {
  text-align: center;
  margin-top: 1rem;
}

.disclaimer-consent {
  margin-bottom: 0.8rem;
}

.centered-content {
  text-align: center;
  margin-top: 0.6rem;
}

/* Hardcore block images */
.hardcore-img {
  max-width: 100%;
  border-radius: 6px;
}

.hardcore-img-small {
  max-width: 25%;
  border-radius: 6px;
}

/* Mobile navigation brand */
.nav-mobile-trigger.mobile-brand {
  font-family: 'LeonovSP', sans-serif;
  color: #ffd88c;
  font-size: 1.5rem;
  display: none;
}
