/* ==========================================================================
   СОВИНЫЙ АРКАДНЫЙ ЗАЛ — Концепция «Вечерний ретро-лес»
   Стиль: Атмосфера Игротеки, тёплый янтарный свет, CRT-кинескопы среди сосен.
   Шаблон предварительного просмотра (Preview Mockup)
   ========================================================================== */

/* 1. ПЕРЕМЕННЫЕ И ДИЗАЙН-ТОКЕНЫ
   -------------------------------------------------------------------------- */
:root {
  /* Базовая лесная палитра Игротеки */
  --night-deep: #061214;
  --night: #0c1f24;
  --night-card: #10272b;
  --night-card-alt: #0a1b1d;
  --forest-dark: #122b27;
  --forest: #1a4235;
  --forest-light: #2d614e;
  --moss: #6fa35a;
  --moss-glow: rgba(111, 163, 90, 0.3);

  /* Тёплый янтарный огонёк и светлячки */
  --amber: #f4b860;
  --amber-bright: #ffc978;
  --amber-dark: #c98832;
  --amber-glow: rgba(244, 184, 96, 0.35);
  --amber-glow-strong: rgba(244, 184, 96, 0.65);
  --ember: #e8763a;

  /* Ретро-акценты: латунь, дерево, неоновый изумруд */
  --wood-cabinet: #182321;
  --wood-border: #2c423c;
  --brass: #d4a359;
  --crt-phosphor: #7bf2a6;
  --badge-netplay: #2a6652;

  /* Типографика и светлые тона */
  --cream: #fbf1d6;
  --cream-soft: #ebdcc0;
  --text-primary: #fbf1d6;
  --text-secondary: #9cbdb1;
  --text-muted: #6f8f83;

  /* Границы и тени */
  --card-border: rgba(244, 184, 96, 0.16);
  --card-border-hover: rgba(244, 184, 96, 0.75);
  --shadow-card: 0 16px 36px -10px rgba(2, 8, 9, 0.65);
  --shadow-hover: 0 22px 48px -8px rgba(0, 0, 0, 0.75), 0 0 26px rgba(244, 184, 96, 0.28);

  /* Шрифты */
  --font-heading: 'Rubik', system-ui, -apple-system, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, sans-serif;
  --font-mono: 'Consolas', 'Courier New', monospace;

  /* Анимации */
  --transition-normal: 0.25s cubic-bezier(0.2, 0, 0, 1);
}

/* 2. БАЗОВЫЙ СБРОС И ОСНОВА
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--night-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  /* фон body не задаём: иначе он закроет ретро-фон .retro-bg (у того z-index: -1) */
  line-height: 1.6;
}

/* 2а. РЕТРО-ФОН: ступенчатое небо, пиксельные звёзды и луна, два слоя елей, строки кинескопа
   Картинки — bg/*.svg (генерирует bg/gen_bg.py, один ретро-пиксель = 4 px).
   -------------------------------------------------------------------------- */
.retro-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  /* небо полосами, как палитра 16-битных приставок: без плавного градиента */
  background: linear-gradient(180deg,
    #050f11 0 24%, #071517 24% 40%, #091b1c 40% 53%,
    #0c2322 53% 64%, #102b28 64% 74%, #15352f 74% 100%);
}

/* звёзды: тусклый неподвижный слой + два слоя ярких, мерцают медленно и вразнобой;
   к горизонту небо светлее — звёзды тают (маска) */
.retro-bg__stars {
  position: absolute;
  inset: 0 0 22% 0;
  background-repeat: repeat;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 30%, transparent 92%);
          mask-image: linear-gradient(180deg, #000 0%, #000 30%, transparent 92%);
}
.retro-bg__stars--dim { background-image: url("bg/stars-dim.svg"); }
.retro-bg__stars--a {
  background-image: url("bg/stars-bright-a.svg");
  filter: drop-shadow(0 0 6px rgba(255, 226, 168, 0.45));
  animation: retro-twinkle 7s ease-in-out infinite alternate;
}
.retro-bg__stars--b {
  background-image: url("bg/stars-bright-b.svg");
  background-position: 300px 180px;
  filter: drop-shadow(0 0 6px rgba(232, 244, 255, 0.4));
  animation: retro-twinkle 11s ease-in-out -4s infinite alternate;
}

@keyframes retro-twinkle {
  0% { opacity: 1; }
  100% { opacity: 0.45; }
}

.retro-bg__moon {
  position: absolute;
  top: clamp(84px, 13vh, 150px);
  right: clamp(20px, 9vw, 180px);
  width: 64px;
  height: 64px;
  background: url("bg/moon.svg") no-repeat;
  filter: drop-shadow(0 0 14px rgba(251, 231, 181, 0.4));
}
/* лунный ореол — мягкое пятно света на небе */
.retro-bg__moon::before {
  content: "";
  position: absolute;
  inset: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 231, 181, 0.14) 0%, rgba(251, 231, 181, 0.05) 35%, transparent 70%);
  z-index: -1;
}

/* дымка между дальним и ближним лесом — даёт глубину */
.retro-bg__mist {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 60px;
  height: 200px;
  background: linear-gradient(180deg, transparent 0%, rgba(140, 190, 170, 0.07) 55%, rgba(140, 190, 170, 0.11) 80%, transparent 100%);
}

.retro-bg__forest {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background-repeat: repeat-x;
  background-position: left bottom;
}
.retro-bg__forest--far {
  height: 160px;
  background-image: url("bg/forest-far.svg");
  background-position: 96px bottom;
  bottom: 24px;
}
.retro-bg__forest--near {
  height: 200px;
  background-image: url("bg/forest-near.svg");
}

/* строки кинескопа и затемнение по краям — поверх фона, но под содержимым */
.retro-bg__scan {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0 2px, transparent 2px 4px),
    radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

@media (max-width: 640px) {
  .retro-bg__moon { width: 40px; height: 40px; background-size: 40px 40px; top: 68px; right: 8px; }
  .retro-bg__forest--far { height: 120px; background-size: auto 120px; bottom: 16px; }
  .retro-bg__forest--near { height: 150px; background-size: auto 150px; }
}

@media (prefers-reduced-motion: reduce) {
  .retro-bg__stars, .firefly { animation: none; }
}

img, svg {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* 3. ВЕРХНЯЯ ПАНЕЛЬ (TOPBAR) — без кнопки доната!
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px clamp(16px, 4vw, 36px);
  background: rgba(6, 18, 20, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-brand-icon {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 0 8px var(--amber-glow));
}

.topbar-brand-text {
  display: flex;
  flex-direction: column;
}

.topbar-brand-text b {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--cream);
  letter-spacing: 0.02em;
}

.topbar-brand-text small {
  font-size: 0.75rem;
  color: var(--amber);
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(16, 39, 43, 0.6);
  border: 1px solid rgba(244, 184, 96, 0.12);
  transition: all var(--transition-normal);
  cursor: pointer;
}

.topbar-link:hover {
  color: var(--cream);
  border-color: var(--amber);
  background: rgba(26, 66, 53, 0.7);
  box-shadow: 0 0 14px var(--amber-glow);
}

.topbar-link--back {
  color: var(--amber-bright);
}

/* 4. HERO СВЕТЛЯЧКИ И ЗВЁЗДЫ
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(32px, 5vw, 64px) 20px 32px;
  background: transparent;          /* под hero виден общий ретро-фон */
  border-bottom: 1px solid var(--card-border);
  overflow: hidden;
}

.sky-backdrop {
  display: none;                    /* звёзды теперь пиксельные — в .retro-bg */
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
  background-image: 
    radial-gradient(1px 1px at 20px 30px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 150px 80px, #ffdf9e, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 280px 140px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 450px 60px, #f4b860, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 620px 190px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 800px 50px, #ffc978, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 980px 120px, #ffffff, rgba(0,0,0,0));
  background-repeat: repeat;
  background-size: 1000px 300px;
}

.fireflies-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.firefly {
  position: absolute;
  width: 4px;
  height: 4px;
  left: var(--x);
  top: var(--y);
  border-radius: 0;                 /* пиксельный светлячок: квадрат с квадратным ореолом */
  background: var(--amber-bright);
  box-shadow: 0 0 0 4px rgba(244, 184, 96, 0.22), 0 0 12px 2px rgba(244, 184, 96, 0.35);
  animation: firefly-glow var(--dur) steps(5) infinite alternate var(--delay),
             firefly-float calc(var(--dur) * 1.4) steps(12) infinite alternate var(--delay);
}

@keyframes firefly-glow {
  0% { opacity: 0.2; }
  50% { opacity: 1; }
  100% { opacity: 0.3; }
}

@keyframes firefly-float {
  0% { translate: 0 0; }
  100% { translate: var(--drift-x) var(--drift-y); }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(26, 66, 53, 0.7);
  border: 1px solid var(--amber);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--amber-bright);
  box-shadow: 0 0 16px var(--amber-glow);
  margin-bottom: 16px;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber-bright);
  animation: pulse-dot 1.8s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(0.85); opacity: 0.7; }
  50% { transform: scale(1.25); opacity: 1; }
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  color: var(--cream);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 35px var(--amber-glow);
  margin-bottom: 12px;
  text-align: center;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 650px;
  text-align: center;
  margin-bottom: 32px;
}

/* Письмо Совы */
.owl-letter {
  max-width: 780px;
  width: 100%;
  background: linear-gradient(145deg, rgba(16, 39, 43, 0.85), rgba(10, 27, 29, 0.95));
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--amber);
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(8px);
  margin-bottom: 24px;
}

.owl-letter blockquote {
  font-size: 0.9375rem;
  color: var(--cream-soft);
  line-height: 1.65;
}

.owl-letter figcaption {
  margin-top: 12px;
  font-size: 0.8125rem;
  color: var(--amber);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* 5. КАТАЛОГ КОНСОЛЕЙ И ФИЛЬТРЫ
   -------------------------------------------------------------------------- */
.container {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 20px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--cream);
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 24px;
  background: var(--amber);
  border-radius: 3px;
  box-shadow: 0 0 10px var(--amber);
}

.console-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.console-tab {
  padding: 8px 18px;
  border-radius: 10px;
  background: var(--night-card);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.console-tab:hover, .console-tab.active {
  background: var(--forest);
  border-color: var(--amber);
  color: var(--cream);
  box-shadow: 0 0 12px var(--amber-glow);
}

/* Карточки игр */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.game-card {
  background: var(--night-card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  position: relative;
}

.game-card:hover {
  transform: translateY(-6px);
  border-color: var(--card-border-hover);
  box-shadow: var(--shadow-hover);
}

.game-card-art {
  height: 160px;
  background: linear-gradient(135deg, #091a1d, #14352d);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.game-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  background: rgba(6, 18, 20, 0.85);
  border: 1px solid var(--amber);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--amber-bright);
}

.game-card-netplay {
  position: absolute;
  bottom: 10px;
  left: 10px;
  padding: 3px 8px;
  background: rgba(42, 102, 82, 0.9);
  border: 1px solid rgba(123, 242, 166, 0.4);
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--crt-phosphor);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.game-card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.game-card-system {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.game-card-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 6px;
}

.game-card-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  flex-grow: 1;
}

.game-card-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(180deg, var(--amber) 0%, var(--amber-dark) 100%);
  color: #1a1505;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.875rem;
  transition: all var(--transition-normal);
}

.game-card-btn:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 16px var(--amber-glow-strong);
}

/* Карточка "Открыть свой ROM" */
.rom-dropzone-card {
  background: linear-gradient(135deg, rgba(18, 43, 39, 0.7), rgba(10, 27, 29, 0.85));
  border: 2px dashed rgba(244, 184, 96, 0.4);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  margin-bottom: 48px;
  transition: all var(--transition-normal);
  cursor: pointer;
}

.rom-dropzone-card:hover {
  border-color: var(--amber-bright);
  background: linear-gradient(135deg, rgba(26, 66, 53, 0.8), rgba(16, 39, 43, 0.95));
  box-shadow: 0 0 24px var(--amber-glow);
}

.rom-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--amber);
}

.rom-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 8px;
}

.rom-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 16px;
}

.rom-disclaimer {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Инструкция к сетевой игре */
.netplay-guide {
  background: var(--night-card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 48px;
}

.guide-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.guide-step {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--forest);
  border: 1px solid var(--amber);
  color: var(--amber-bright);
  font-family: var(--font-heading);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--cream);
}

.step-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* 6. АРКАДНЫЙ ЭКРАН И ДИЗАЙН ЭМУЛЯТОРА (PLAY.HTML)
   -------------------------------------------------------------------------- */
.arcade-viewport {
  max-width: 960px;
  margin: 24px auto 40px;
  width: 100%;
}

/* Деревянно-латунный ретро-кабинет */
.arcade-cabinet {
  background: radial-gradient(circle at 50% 30%, #1e332e 0%, #0d1e1c 100%);
  border: 8px solid #142824;
  border-radius: 24px;
  box-shadow: 
    0 0 0 2px rgba(244, 184, 96, 0.25),
    0 24px 60px -10px rgba(0, 0, 0, 0.9),
    inset 0 2px 10px rgba(255, 255, 255, 0.1);
  padding: 20px;
  position: relative;
}

/* Верхняя латунная планка автомата */
.cabinet-marquee {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px 16px;
  border-bottom: 2px solid rgba(244, 184, 96, 0.15);
  margin-bottom: 16px;
}

.marquee-badge {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  color: var(--amber-bright);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.led-power {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber-bright);
  box-shadow: 0 0 10px 2px var(--amber);
  animation: pulse-dot 2s infinite ease-in-out;
}

.crt-frame {
  position: relative;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: inset 0 0 35px rgba(0, 0, 0, 0.95);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Эффект сканлайнов (CRT Scanlines) */
.crt-scanlines::after {
  content: " ";
  display: block;
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.28) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 10;
}

/* Свечение кинескопа */
.crt-glow {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 80px rgba(111, 163, 90, 0.15);
  pointer-events: none;
  z-index: 11;
}

/* Симуляция игры внутри мокапа */
.mockup-game-canvas {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #0e2923 0%, #051113 100%);
  color: var(--cream);
  text-align: center;
  padding: 20px;
}

.mockup-game-art {
  font-size: 3rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 16px var(--amber));
}

/* Кастомный оверлей тулбара */
.cabinet-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar-group {
  display: flex;
  gap: 8px;
}

.cabinet-btn {
  padding: 8px 14px;
  background: rgba(16, 39, 43, 0.8);
  border: 1px solid var(--card-border);
  color: var(--cream-soft);
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-normal);
}

.cabinet-btn:hover {
  background: var(--forest);
  border-color: var(--amber);
  color: var(--cream);
  box-shadow: 0 0 12px var(--amber-glow);
}

.cabinet-btn--active {
  background: var(--forest);
  border-color: var(--amber-bright);
  color: var(--amber-bright);
}

/* Панель сетевой комнаты */
.netplay-panel-card {
  margin-top: 24px;
  background: var(--night-card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.netplay-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--moss);
  box-shadow: 0 0 10px var(--moss);
}

.room-invite-code {
  font-family: var(--font-mono);
  background: #051113;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  color: var(--amber-bright);
  font-size: 0.875rem;
}

/* 7. ФУТЕР
   -------------------------------------------------------------------------- */
.footer {
  margin-top: auto;
  padding: 32px 20px;
  background: rgba(4, 13, 14, 0.82);
  border-top: 1px solid var(--card-border);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer a {
  color: var(--amber);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer a:hover {
  color: var(--amber-bright);
}

.footer-credits {
  margin-top: 8px;
}

/* 8. АДАПТИВНОСТЬ ДЛЯ ТЕЛЕФОНОВ (375px)
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .topbar {
    padding: 10px 14px;
    gap: 10px;
  }

  /* шапка влезает в 375 px: название в одну строку с многоточием, подзаголовок скрыт,
     у ссылок, кроме «назад», остаются только значки */
  .topbar-brand { min-width: 0; gap: 8px; }
  .topbar-brand-text { min-width: 0; }
  .topbar-brand-text b {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar-brand-text small { display: none; }
  .topbar-links { gap: 6px; flex-shrink: 0; }
  .topbar-link { padding: 7px 10px; }
  .topbar-link:not(.topbar-link--back) span:not([class]) { display: none; }   /* текст прячем, значки и индикатор оставляем */
  
  .hero-title {
    font-size: 1.85rem;
  }
  
  .cabinet-marquee {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .cabinet-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .toolbar-group {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .netplay-panel-card {
    flex-direction: column;
    align-items: stretch;
  }
}
