/* ============================================================================
   OFGEM — styles.css
   Единственный файл стилей. Токены → 5 тем → база → компоненты → адаптив.
   Никаких внешних зависимостей. Картинки не инвертируем фильтрами.
   ========================================================================== */

/* ---------------------------------------------------------------------------
   1. ТОКЕНЫ (по умолчанию = pumpkin)
   ------------------------------------------------------------------------- */
:root,
html[data-theme='pumpkin'] {
  color-scheme: dark;

  --bg:        #100B08;   /* тёплый почти чёрный */
  --bg-2:      #1A110B;
  --panel:     #1D140E;
  --panel-2:   #29190F;
  --ink:       #F7E9D8;
  --muted:     #A98F76;
  --accent:    #FF7A00;
  --accent-2:  #FFB000;
  --accent-3:  #E84200;
  --border:    #4A2C16;
  --shadow:    0 10px 30px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 122, 0, .08);
  --radius:    6px;

  --font-display: 'Permanent Marker', 'Impact', 'Arial Black', cursive, sans-serif;
  --font-body:    'Trebuchet MS', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono:    'Consolas', 'Courier New', monospace;

  /* служебные (дополнительные) токены */
  --grid-line:     rgba(255, 176, 0, .055);
  --scanline:      rgba(0, 0, 0, .22);
  --scanline-tint: rgba(255, 122, 0, .045);
  --hero-art:      '../assets/halloween-pattern.jpg';
  --glow:          0 0 12px rgba(255, 122, 0, .55), 0 0 36px rgba(255, 176, 0, .30);
}

/* ---------------------------------------------------------------------------
   2. ПЯТЬ ТЕМ
   ------------------------------------------------------------------------- */

/* LAVA — тёмно-красный чёрный, красный/оранжевый акцент */
html[data-theme='lava'] {
  color-scheme: dark;
  --bg:        #120707;
  --bg-2:      #1E0A0A;
  --panel:     #240C0C;
  --panel-2:   #341010;
  --ink:       #FFE7DE;
  --muted:     #C48B82;
  --accent:    #FF4D1C;
  --accent-2:  #FF9A2E;
  --accent-3:  #B31212;
  --border:    #5A1A14;
  --shadow:    0 10px 30px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 77, 28, .10);
  --radius:    6px;
  --grid-line:     rgba(255, 77, 28, .06);
  --scanline:      rgba(0, 0, 0, .24);
  --scanline-tint: rgba(255, 30, 0, .05);
  --hero-art:      '../assets/halloween-pattern.jpg';
  --glow:          0 0 12px rgba(255, 77, 28, .6), 0 0 38px rgba(255, 154, 46, .3);
}

/* GLITCH — чёрный #050508, маджента #FF2BD1, циан #35E9FF, CRT */
html[data-theme='glitch'] {
  color-scheme: dark;
  --bg:        #050508;
  --bg-2:      #0B0B14;
  --panel:     #0E0E1A;
  --panel-2:   #15152A;
  --ink:       #EAF9FF;
  --muted:     #8FA3B8;
  --accent:    #FF2BD1;
  --accent-2:  #35E9FF;
  --accent-3:  #7A1CFF;
  --border:    #2A2350;
  --shadow:    0 10px 30px rgba(0, 0, 0, .7), 0 0 0 1px rgba(53, 233, 255, .12);
  --radius:    2px;
  --grid-line:     rgba(53, 233, 255, .06);
  --scanline:      rgba(0, 0, 0, .32);
  --scanline-tint: rgba(53, 233, 255, .05);
  --hero-art:      '../assets/glitch-bg.jpg';
  --glow:          0 0 10px rgba(255, 43, 209, .6), 0 0 28px rgba(53, 233, 255, .35);
}

/* HERB — Minecraft-зелёный #3D7A2A + землистые коричневые */
html[data-theme='herb'] {
  color-scheme: dark;
  --bg:        #141A0E;
  --bg-2:      #1C2513;
  --panel:     #222B18;
  --panel-2:   #2F3B21;
  --ink:       #F2F4DB;
  --muted:     #A7B58C;
  --accent:    #3D7A2A;
  --accent-2:  #7DBE4A;
  --accent-3:  #5A3A1E;
  --border:    #3E5128;
  --shadow:    0 10px 30px rgba(0, 0, 0, .5), 0 0 0 1px rgba(125, 190, 74, .10);
  --radius:    3px;
  --grid-line:     rgba(125, 190, 74, .07);
  --scanline:      rgba(0, 0, 0, .16);
  --scanline-tint: rgba(125, 190, 74, .04);
  --hero-art:      '../assets/halloween-pattern.jpg';
  --glow:          0 0 12px rgba(125, 190, 74, .45), 0 0 30px rgba(61, 122, 42, .35);
}

/* VOID — глубокий тёмно-синий, циан/фиолетовый */
html[data-theme='void'] {
  color-scheme: dark;
  --bg:        #060A18;
  --bg-2:      #0A1126;
  --panel:     #0D1530;
  --panel-2:   #141E40;
  --ink:       #E4ECFF;
  --muted:     #8C9BC4;
  --accent:    #35E9FF;
  --accent-2:  #9B6CFF;
  --accent-3:  #4C33A8;
  --border:    #243061;
  --shadow:    0 10px 34px rgba(0, 0, 0, .65), 0 0 0 1px rgba(53, 233, 255, .10);
  --radius:    5px;
  --grid-line:     rgba(53, 233, 255, .055);
  --scanline:      rgba(0, 0, 0, .25);
  --scanline-tint: rgba(155, 108, 255, .05);
  --hero-art:      '../assets/glitch-bg.jpg';
  --glow:          0 0 12px rgba(53, 233, 255, .55), 0 0 36px rgba(155, 108, 255, .35);
}

/* ---------------------------------------------------------------------------
   3. БАЗА / RESET
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Жёстко скрываем всё, что помечено hidden (в т.ч. экраны/модалки) */
[hidden] { display: none !important; }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .5em;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: .01em;
}
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.6rem); }
p  { margin: 0 0 1em; }

a {
  color: var(--accent-2);
  text-decoration: none;
  border-radius: 2px;
  transition: color .15s ease;
}
a:hover { color: var(--accent); text-decoration: underline; }

img, svg, canvas, video {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, select, textarea { font: inherit; color: inherit; }

ul, ol { margin: 0 0 1em; padding-left: 1.25rem; }
li { margin: .25em 0; }

code, kbd, pre, samp {
  font-family: var(--font-mono);
  font-size: .92em;
}
code, samp {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: .1em .35em;
  color: var(--accent-2);
}
pre {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  overflow-x: auto;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

::selection { background: var(--accent); color: #0B0705; }

/* Focus可见 — острый акцентный контур, 44px тап-цели ниже */
:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---------------------------------------------------------------------------
   4. УТИЛИТЫ
   ------------------------------------------------------------------------- */
.glow {
  text-shadow: var(--glow);
  filter: drop-shadow(0 0 10px rgba(255, 122, 0, .35));
}
.dim { opacity: .55; }
.locked {
  opacity: .62;
  filter: grayscale(.4);
  cursor: not-allowed !important;
}
.dim *, .locked * { pointer-events: none; }

.pixel-grid {
  background-color: var(--bg);
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: 0 0;
}

/* CRT-сканлайны: включаются на .crt, в glitch — чуть заметнее */
.crt { position: relative; isolation: isolate; }
.crt::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background:
    repeating-linear-gradient(
      0deg,
      var(--scanline) 0px,
      var(--scanline) 1px,
      transparent 1px,
      transparent 3px
    ),
    var(--scanline-tint);
  mix-blend-mode: multiply;
  opacity: .7;
}
html[data-theme='glitch'] .crt::after { opacity: 1; mix-blend-mode: normal; }
html[data-theme='glitch'] .crt::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  background: linear-gradient(90deg, rgba(255,43,209,.06), transparent 30%, transparent 70%, rgba(53,233,255,.06));
}

/* Бегущая строка */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  background: var(--panel-2);
  border-block: 1px solid var(--border);
  padding: .45rem 0;
}
.marquee-track {
  display: inline-flex;
  gap: 2.5rem;
  min-width: max-content;
  animation: marquee-scroll 18s linear infinite;
  font-family: var(--font-mono);
  font-size: .85rem;
  letter-spacing: .08em;
  color: var(--muted);
  text-transform: uppercase;
}
.marquee-track b, .marquee strong { color: var(--accent-2); }
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Раскладки */
.stack { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.grid  { display: grid; gap: 1rem; min-width: 0; }
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: .6rem;
}
.section-head h1, .section-head h2 { margin: 0; }
.section-head::after {
  content: '';
  flex: 1 1 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  order: 3;
}

/* ---------------------------------------------------------------------------
   5. КАРКАС: topbar / nav / app / screen / footer
   ------------------------------------------------------------------------- */
#topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 64px;
  padding: .5rem clamp(.75rem, 3vw, 2rem);
  background: var(--bg-2);
  border-bottom: 2px solid var(--border);
  box-shadow: 0 4px 18px rgba(0,0,0,.4);
}
#topbar::before {
  content: '';
  position: absolute;
  inset: auto 0 -2px 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), transparent 70%);
  opacity: .6;
}

.brand, #topbar .brand {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1;
  color: #fff;
  text-shadow:
    0 1px 0 var(--accent-3),
    0 2px 0 var(--accent-2),
    0 0 16px var(--accent);
  white-space: nowrap;
  flex: 0 0 auto;
}

#nav {
  display: flex;
  align-items: center;
  gap: .15rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
#nav::-webkit-scrollbar { display: none; }

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .4rem .7rem;
  border-radius: var(--radius);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .82rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.nav-link:hover { background: var(--panel-2); color: var(--ink); text-decoration: none; }
.nav-link.active {
  color: #0B0705;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(255,122,0,.35);
  font-weight: 700;
}
html[data-theme='glitch'] .nav-link.active,
html[data-theme='void'] .nav-link.active { color: #050508; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex: 0 0 auto;
}

#ip-text, #server-ip {
  font-family: var(--font-mono);
  color: var(--accent-2);
  word-break: break-all;
}

#route-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--accent-2);
  margin: 0;
}

#app {
  display: block;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.5rem) clamp(.85rem, 3vw, 2rem) 4rem;
  min-height: calc(100vh - 200px);
}

.screen { animation: screen-in .25s ease both; min-width: 0; }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

footer {
  border-top: 2px solid var(--border);
  background: var(--bg-2);
  padding: 1.5rem clamp(.85rem, 3vw, 2rem);
  margin-top: 2rem;
}
footer a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 .4rem; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  max-width: 1440px;
  margin: 0 auto;
}
.footer-links { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
#footer-year { cursor: pointer; font-family: var(--font-mono); color: var(--muted); user-select: none; }
#footer-year:hover { color: var(--accent-2); }

/* ---------------------------------------------------------------------------
   6. КНОПКИ
   ------------------------------------------------------------------------- */
.btn, button.btn, a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 44px;                 /* тап-цель */
  padding: .6rem 1.1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover {
  background: var(--panel);
  border-color: var(--accent);
  color: var(--ink);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
}
.btn:active {
  transform: translateY(1px) scale(.985);
  box-shadow: none;
}
.btn:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; }
.btn[disabled], .btn[aria-disabled='true'] {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent-2);
  color: #140A04;
  text-shadow: 0 1px 0 rgba(255,255,255,.25);
  box-shadow: var(--glow);
}
.btn-primary:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #140A04;
  box-shadow: 0 0 24px var(--accent);
}
html[data-theme='glitch'] .btn-primary,
html[data-theme='void'] .btn-primary { color: #050508; }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--accent-2);
}
.btn-ghost:hover { background: var(--panel-2); color: var(--accent); }

.btn-danger {
  background: transparent;
  border-color: var(--accent-3);
  color: var(--accent);
}
.btn-danger:hover { background: var(--accent-3); color: #fff; border-color: var(--accent); }

.btn-sm { min-height: 44px; padding: .35rem .75rem; font-size: .82rem; }
.btn-block { width: 100%; }

/* Кнопки шапки: минимальная цель 44px, но текст не обрезается */
#btn-theme, #btn-sound, #btn-motion {
  min-width: 44px;
  height: 44px;
  padding: .3rem .65rem;
  font-size: .9rem;
  white-space: nowrap;
  flex: 0 0 auto;
}

/* Иконные кнопки модальных окон — строго квадрат 44px */
#lightbox-close, #auth-close, #secret-modal-close {
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 1.1rem;
  flex: 0 0 auto;
}

/* ---------------------------------------------------------------------------
   7. BADGES / TAGS / STATUS PILLS / TABS
   ------------------------------------------------------------------------- */
.badge, .tag {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-height: 28px;
  padding: .15rem .55rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--panel-2);
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-size: .75rem;
  line-height: 1.2;
  white-space: nowrap;
}
.badge {
  border-left: 3px solid var(--accent);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.tag { border-radius: 999px; background: transparent; color: var(--muted); }
#profile-badges { display: flex; flex-wrap: wrap; gap: .4rem; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 32px;
  padding: .25rem .7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--muted);
}
.status-pill::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  flex: 0 0 auto;
}
.status-pill.online, .status-pill[data-status='online'], .status-pill.ok { color: #7DBE4A; }
.status-pill.offline, .status-pill[data-status='offline'] { color: #B31212; }
.status-pill.demo, .status-pill[data-status='demo'] { color: var(--accent-2); }
#home-status, #server-status { font-family: var(--font-mono); }

.tabs, [role='tablist'] {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1rem;
}
.tab, [role='tab'] {
  min-height: 44px;
  padding: .5rem 1rem;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .85rem;
  cursor: pointer;
}
.tab:hover, [role='tab']:hover { color: var(--ink); background: var(--panel); }
.tab.active, [role='tab'][aria-selected='true'] {
  color: var(--accent-2);
  background: var(--panel-2);
  border-color: var(--border);
  box-shadow: inset 0 2px 0 var(--accent);
}

/* ---------------------------------------------------------------------------
   8. ПАНЕЛИ / КАРТОЧКИ
   ------------------------------------------------------------------------- */
.panel, .card {
  position: relative;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1rem, 2.5vw, 1.6rem);
}
.panel::before, .card::before {
  content: '';
  position: absolute;
  left: -1px; top: 12px; bottom: 12px;
  width: 3px;
  background: var(--accent);
  opacity: .8;
}
.card {
  background: var(--panel-2);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(0,0,0,.45), 0 0 0 1px var(--accent);
}
.panel h2, .panel h3, .card h2, .card h3 { color: var(--ink); }
.panel p:last-child, .card p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------------------
   9. ФОРМЫ
   ------------------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  min-width: 0;
  margin-bottom: .9rem;
}
.field label, label.field > span {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input, .field select, .field textarea,
input[type='text'], input[type='email'], input[type='password'],
input[type='number'], input[type='url'], input[type='file'],
select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: .55rem .75rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }
.field input:focus, .field select:focus, .field textarea:focus,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,122,0,.18);
  outline: none;
}
input[type='file'] { padding: .4rem; cursor: pointer; }
input[type='range'] { padding: 0; min-height: 44px; accent-color: var(--accent); }
input[type='checkbox'], input[type='radio'] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: flex-end;
  min-width: 0;
}
.form-row > .field { flex: 1 1 220px; margin-bottom: 0; }
form { min-width: 0; }

.form-error, .error, #auth-error {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: .85rem;
  min-height: 1.2em;
}
.form-hint, .hint, #auth-hint { color: var(--muted); font-size: .82rem; }

/* ---------------------------------------------------------------------------
   10. HERO (только главная)
   ------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: clamp(1.5rem, 5vw, 4rem);
  background-color: var(--panel);
  background-image:
    linear-gradient(120deg, color-mix(in srgb, var(--bg) 88%, transparent), color-mix(in srgb, var(--bg) 55%, transparent)),
    url('../assets/halloween-pattern.jpg');
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow);
}
html[data-theme='glitch'] .hero,
html[data-theme='void'] .hero {
  background-image:
    linear-gradient(120deg, color-mix(in srgb, var(--bg) 85%, transparent), color-mix(in srgb, var(--bg) 50%, transparent)),
    url('../assets/glitch-bg.jpg');
}
.hero-art {
  background-color: var(--bg-2);
  background-image:
    linear-gradient(0deg, var(--bg) 0%, transparent 55%),
    url('../assets/halloween-pattern.jpg');
  background-size: cover;
  background-position: center bottom;
  min-height: 220px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
html[data-theme='glitch'] .hero-art,
html[data-theme='void'] .hero-art {
  background-image:
    linear-gradient(0deg, var(--bg) 0%, transparent 55%),
    url('../assets/glitch-bg.jpg');
}
.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr);
  gap: clamp(1rem, 4vw, 3rem);
  align-items: center;
}

/* Гигантский горящий brush-леттеринг */
.hero-title, .hero h1, #screen-home .hero-title {
  margin: 0 0 .35em;
  font-family: var(--font-display);
  font-size: clamp(3rem, 11vw, 8.5rem);
  line-height: .86;
  letter-spacing: -.02em;
  color: #FFFFFF;
  text-shadow:
    0 1px 0 #FFF,
    0 2px 0 var(--accent-2),
    0 4px 0 var(--accent-3),
    0 6px 2px rgba(0,0,0,.6),
    0 0 18px var(--accent),
    0 0 44px var(--accent-2);
  overflow-wrap: anywhere;
}
.hero-sub {
  max-width: 46ch;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.25rem;
}
.hero-cta .btn { min-width: 150px; }
#btn-play { font-size: 1.15rem; padding-inline: 1.6rem; }

/* Маскот — тыква в костюме */
#mascot-pumpkin {
  width: min(100%, 320px);
  aspect-ratio: 1;
  object-fit: contain;
  cursor: pointer;
  filter: drop-shadow(0 14px 26px rgba(0,0,0,.6)) drop-shadow(0 0 22px rgba(255,122,0,.28));
  transition: transform .2s ease;
  margin-inline: auto;
}
#mascot-pumpkin:hover { transform: rotate(-4deg) scale(1.04); }
#mascot-pumpkin:active { transform: scale(.96); }
html[data-theme='herb'] #mascot-pumpkin { filter: drop-shadow(0 12px 22px rgba(0,0,0,.6)); }
/* НИКАКОГО filter: invert — картинки остаются как есть */

.event-timer, #event-timer {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .8rem;
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  background: var(--panel-2);
  font-family: var(--font-mono);
  color: var(--accent-2);
}

/* ---------------------------------------------------------------------------
   11. ГЛАВНАЯ / СЕРВЕР / НОВОСТИ / ПРАВИЛА
   ------------------------------------------------------------------------- */
#news-teaser { display: grid; gap: .8rem; }
#news-teaser .card { border-left: 3px solid var(--accent); }
#news-list { display: grid; gap: 1rem; min-width: 0; }
.news-item, .news-card {
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--panel);
  min-width: 0;
  overflow-wrap: anywhere;
}
.news-item time, .news-date { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); }
#secret-word-hint { cursor: help; text-decoration: underline dotted var(--muted); }

#server-features { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
#server-features li {
  list-style: none;
  padding: .7rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  margin: 0;
}
#server-features li::before { content: '▸ '; color: var(--accent); font-weight: 700; }
#server-map {
  min-height: 260px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px),
    var(--bg-2);
  background-size: 32px 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
#server-faq details, details.faq {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: .75rem 1rem;
  margin-bottom: .5rem;
}
#server-faq summary, details summary {
  cursor: pointer;
  min-height: 32px;
  color: var(--accent-2);
  font-weight: 700;
}
#server-port, #server-version { font-family: var(--font-mono); color: var(--accent-2); }
#rules-list { counter-reset: rule; display: grid; gap: .6rem; min-width: 0; }
#rules-list li {
  list-style: none;
  counter-increment: rule;
  padding: .7rem 1rem .7rem 3rem;
  position: relative;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-3);
  border-radius: var(--radius);
  background: var(--panel);
  overflow-wrap: anywhere;
}
#rules-list li::before {
  content: counter(rule, decimal-leading-zero);
  position: absolute;
  left: .8rem;
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 700;
}
#rules-accepted { color: #7DBE4A; font-family: var(--font-mono); }
#btn-accept-rules { margin-top: 1rem; }

/* ---------------------------------------------------------------------------
   12. МАСТЕРСКАЯ СКИНОВ + КУБ
   ------------------------------------------------------------------------- */
#skin-preview {
  perspective: 900px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-2);
  overflow: hidden;
}
#skin-preview-canvas, #skin-preview img {
  max-width: 100%;
  image-rendering: pixelated;
  border: 1px solid var(--border);
}
#skin-name { font-family: var(--font-mono); color: var(--accent-2); }
#skin-status, #skin-api-status { font-family: var(--font-mono); font-size: .82rem; color: var(--muted); }
#skin-preset-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.skin-preset {
  min-height: 44px;
  padding: .35rem .7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: .8rem;
}
.skin-preset:hover, .skin-preset.active { border-color: var(--accent); color: var(--accent-2); }

.cube-scene, .skin-cube-wrap {
  perspective: 900px;
  width: 100%;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 6 граней, CSS 3D */
.skin-cube {
  --cube-size: 150px;
  --cube-half: calc(var(--cube-size) / 2);
  position: relative;
  width: var(--cube-size);
  height: var(--cube-size);
  flex: 0 0 auto;
  transform-style: preserve-3d;
  transform: rotateX(-22deg) rotateY(32deg);
  animation: cube-spin 16s linear infinite;
}
@keyframes cube-spin {
  from { transform: rotateX(-22deg) rotateY(0deg); }
  to   { transform: rotateX(-22deg) rotateY(360deg); }
}
.skin-cube > * {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid var(--border);
  background-color: var(--panel-2);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  backface-visibility: visible;
  box-shadow: inset 0 0 24px rgba(0,0,0,.35);
}
/* fallback по порядку детей */
.skin-cube > :nth-child(1) { transform: translateZ(var(--cube-half)); }
.skin-cube > :nth-child(2) { transform: rotateY(180deg) translateZ(var(--cube-half)); }
.skin-cube > :nth-child(3) { transform: rotateY(90deg)  translateZ(var(--cube-half)); }
.skin-cube > :nth-child(4) { transform: rotateY(-90deg) translateZ(var(--cube-half)); }
.skin-cube > :nth-child(5) { transform: rotateX(90deg)  translateZ(var(--cube-half)); }
.skin-cube > :nth-child(6) { transform: rotateX(-90deg) translateZ(var(--cube-half)); }
/* явные классы граней (имеют приоритет) */
.skin-cube .front  { transform: translateZ(var(--cube-half)); }
.skin-cube .back   { transform: rotateY(180deg) translateZ(var(--cube-half)); }
.skin-cube .right  { transform: rotateY(90deg)  translateZ(var(--cube-half)); }
.skin-cube .left   { transform: rotateY(-90deg) translateZ(var(--cube-half)); }
.skin-cube .top    { transform: rotateX(90deg)  translateZ(var(--cube-half)); }
.skin-cube .bottom { transform: rotateX(-90deg) translateZ(var(--cube-half)); }
html[data-theme='herb'] .skin-cube > * { border-color: #5A3A1E; }

/* ---------------------------------------------------------------------------
   13. ГАЛЕРЕЯ + ЛАЙТБОКС
   ------------------------------------------------------------------------- */
#gallery-filter { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
#gallery-filter button, [data-filter] {
  min-height: 44px;
  padding: .4rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .82rem;
  cursor: pointer;
}
#gallery-filter button:hover, [data-filter]:hover { color: var(--ink); border-color: var(--accent); }
[data-filter].active, #gallery-filter .active {
  background: var(--accent);
  color: #140A04;
  border-color: var(--accent-2);
}
html[data-theme='glitch'] [data-filter].active,
html[data-theme='void'] [data-filter].active { color: #050508; }
#gallery-count { font-family: var(--font-mono); color: var(--muted); }
#gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: .9rem;
  min-width: 0;
}
.gallery-item {
  position: relative;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  cursor: pointer;
  aspect-ratio: 4 / 3;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.gallery-item:hover, .gallery-item:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), 0 10px 24px rgba(0,0,0,.45);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: auto;
}
.gallery-item figcaption, .gallery-item .caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: .35rem .6rem;
  background: linear-gradient(0deg, rgba(0,0,0,.85), transparent);
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--ink);
}

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(0,0,0,.9);
}
#lightbox.open { display: flex; }
#lightbox-img {
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 0 40px rgba(0,0,0,.8), 0 0 24px var(--accent);
}
#lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

/* ---------------------------------------------------------------------------
   14. КОНТАКТЫ
   ------------------------------------------------------------------------- */
#social-twitch, #social-vk, #social-youtube {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 44px;
  padding: .45rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-size: .85rem;
}
#social-twitch:hover, #social-vk:hover, #social-youtube:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
#contact-log, #daily-status, #roulette-result, #skin-status {
  min-height: 1.4em;
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------------------
   15. ПРОФИЛЬ / ЭКОНОМИКА / КВЕСТЫ / АЧИВКИ
   ------------------------------------------------------------------------- */
#profile-user { display: grid; gap: 1rem; min-width: 0; }
.profile-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}
#profile-avatar {
  width: 96px;
  height: 96px;
  flex: 0 0 auto;
  object-fit: cover;
  image-rendering: pixelated;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--panel-2);
}
#profile-name { font-family: var(--font-display); color: var(--ink); margin: 0; }
#profile-rank { color: var(--accent-2); font-family: var(--font-mono); font-size: .85rem; }
#profile-level, #profile-coins, #profile-xp, #profile-joined, #profile-skin-name {
  font-family: var(--font-mono);
  color: var(--accent-2);
}
.xp-wrap { min-width: 0; }
#profile-xp-bar {
  width: 0%;
  height: 14px;
  max-width: 100%;
  background: linear-gradient(90deg, var(--accent-3), var(--accent), var(--accent-2));
  border: 1px solid var(--border);
  border-radius: 2px;
  transition: width .35s ease;
  box-shadow: 0 0 12px var(--accent);
}
.xp-track {
  height: 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.economy-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
#clicker-btn {
  min-width: 120px;
  font-family: var(--font-display);
  font-size: 1.1rem;
}
#clicker-btn:active { transform: scale(.94); }

#quest-list, #achievement-list {
  display: grid;
  gap: .6rem;
  min-width: 0;
  list-style: none;
  padding: 0;
  margin: 0;
}
.quest, .achievement {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
  min-width: 0;
  padding: .7rem .9rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--panel);
}
.achievement { border-left-color: var(--accent-2); }
.quest .quest-info, .achievement .achievement-info { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.quest .quest-title, .achievement strong { color: var(--ink); }
.quest.done, .achievement.done, .quest.completed, .achievement.unlocked {
  border-left-color: #7DBE4A;
  background: color-mix(in srgb, var(--panel) 80%, #7DBE4A);
}
.quest.done .quest-title::after, .achievement.done strong::after { content: ' ✓'; color: #7DBE4A; }
#referral-code {
  font-family: var(--font-mono);
  color: var(--accent-2);
  background: var(--bg-2);
  border: 1px dashed var(--border);
  padding: .4rem .7rem;
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}
#guestbook-list { display: grid; gap: .6rem; min-width: 0; }
.guestbook-entry {
  padding: .7rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  overflow-wrap: anywhere;
}
.guestbook-entry strong { color: var(--accent-2); font-family: var(--font-mono); }
#delete-account { margin-top: 1.5rem; }

/* ---------------------------------------------------------------------------
   16. МОДАЛКИ / BACKDROP / TOASTS / CONFETTI / TWEAKS
   ------------------------------------------------------------------------- */
#modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  background: rgba(0,0,0,.72);
  backdrop-filter: none;           /* без glassmorphism */
}
#modal-backdrop.open,
body:has(.modal.open) #modal-backdrop { display: block; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}
.modal.open { display: flex; }
.modal-dialog, .modal > .panel, .modal > .card {
  position: relative;
  width: min(100%, 520px);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0,0,0,.8), 0 0 28px var(--accent);
  padding: clamp(1.1rem, 3vw, 2rem);
}
#auth-title { color: var(--ink); margin-bottom: 1rem; }
#auth-close, #secret-modal-close { position: absolute; top: .6rem; right: .6rem; }
#auth-switch { background: none; border: 0; color: var(--accent-2); cursor: pointer; text-decoration: underline; min-height: 44px; }
#secret-code-input { font-family: var(--font-mono); letter-spacing: .2em; text-transform: uppercase; }

#toast-host {
  position: fixed;
  z-index: 300;
  right: clamp(.75rem, 2vw, 1.5rem);
  bottom: clamp(.75rem, 2vw, 1.5rem);
  display: flex;
  flex-direction: column;
  gap: .5rem;
  width: min(360px, calc(100vw - 1.5rem));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 0;
  padding: .7rem .9rem;
  border: 1px solid var(--accent);
  border-left: 4px solid var(--accent-2);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(0,0,0,.6);
  font-size: .9rem;
  overflow-wrap: anywhere;
  animation: toast-in .22s ease both;
}
.toast.error { border-left-color: #E84200; }
.toast.ok, .toast.success { border-left-color: #7DBE4A; }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: none; }
}

#confetti-host {
  position: fixed;
  inset: 0;
  z-index: 250;
  pointer-events: none;
  overflow: hidden;
}
.confetti {
  position: absolute;
  top: -8vh;
  font-size: clamp(1rem, 3vw, 2rem);
  user-select: none;
  animation: confetti-fall var(--fall, 3s) linear forwards;
  left: var(--x, 50%);
}
@keyframes confetti-fall {
  to { transform: translate3d(var(--drift, 0), 112vh, 0) rotate(var(--spin, 720deg)); opacity: .1; }
}

#tweaks-toggle { position: relative; }
#tweaks-panel {
  position: fixed;
  z-index: 80;
  right: clamp(.75rem, 2vw, 1.5rem);
  bottom: 5rem;
  width: min(280px, calc(100vw - 1.5rem));
  padding: 1rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
#tweaks-panel[hidden] { display: none !important; }
#sound-volume { width: 100%; }

/* Попап тем */
#theme-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: clamp(.75rem, 3vw, 2rem);
  z-index: 70;
  width: min(240px, calc(100vw - 1.5rem));
  padding: .5rem;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 16px 40px rgba(0,0,0,.7), 0 0 18px var(--accent);
  display: grid;
  gap: .3rem;
}
#btn-theme { position: relative; }
#theme-menu button, #theme-menu [data-theme] {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 44px;
  width: 100%;
  padding: .4rem .7rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: .85rem;
  text-align: left;
  cursor: pointer;
}
#theme-menu button::before, #theme-menu [data-theme]::before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--accent);
  flex: 0 0 auto;
}
#theme-menu [data-theme='lava']::before   { background: #FF4D1C; }
#theme-menu [data-theme='glitch']::before { background: linear-gradient(135deg, #FF2BD1 50%, #35E9FF 50%); }
#theme-menu [data-theme='herb']::before   { background: #3D7A2A; }
#theme-menu [data-theme='void']::before   { background: #9B6CFF; }
#theme-menu button:hover, #theme-menu [data-theme].active {
  background: var(--panel-2);
  border-color: var(--accent);
  color: var(--accent-2);
}
/* поддержка открытия по классу, если JS не ставит hidden */
#theme-menu.open, #theme-menu:not([hidden]).is-open { display: grid; }

/* ---------------------------------------------------------------------------
   17. АДАПТИВ: 1100 / 760 / 560 (без горизонтального скролла)
   ------------------------------------------------------------------------- */

/* ≥1100 — базовая сетка уже рассчитана на широкий экран */
@media (min-width: 1100px) {
  .grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #news-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; }
}

@media (max-width: 1100px) {
  #app { padding-inline: clamp(.85rem, 2.5vw, 1.5rem); }
  .hero-inner { grid-template-columns: minmax(0, 1fr) minmax(180px, .7fr); }
  .hero-title { font-size: clamp(2.8rem, 9vw, 6rem); }
}

@media (max-width: 760px) {
  #topbar {
    flex-wrap: wrap;
    gap: .4rem .75rem;
    padding-block: .45rem;
  }
  #topbar .brand { font-size: 1.5rem; }
  #nav {
    order: 3;
    flex: 1 0 100%;
    width: 100%;
    padding-bottom: .15rem;
  }
  .topbar-actions { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
  #route-title { font-size: 1rem; }
  .hero-inner { grid-template-columns: minmax(0, 1fr); text-align: left; }
  #mascot-pumpkin { width: min(70%, 260px); }
  .hero-title { font-size: clamp(2.6rem, 13vw, 5rem); }
  #gallery-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }
  .form-row > .field { flex-basis: 100%; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  #app { padding: 1rem .8rem 3rem; }
  h1 { font-size: 1.9rem; }
  h2 { font-size: 1.5rem; }
  #topbar { min-height: 0; padding-inline: .7rem; }
  #topbar .brand { font-size: 1.3rem; }
  .nav-link { font-size: .72rem; padding-inline: .55rem; }
  .topbar-actions { gap: .25rem; }
  #ip-text { font-size: .8rem; }
  .hero { padding: 1.1rem; }
  .hero-title { font-size: clamp(2.2rem, 14vw, 3.6rem); text-shadow: 0 1px 0 #FFF, 0 2px 0 var(--accent-2), 0 3px 0 var(--accent-3), 0 0 14px var(--accent); }
  .hero-cta .btn { flex: 1 1 140px; min-width: 0; padding-inline: .6rem; }
  #mascot-pumpkin { width: min(80%, 220px); }
  .panel, .card { padding: .9rem; }
  .section-head { gap: .35rem; }
  #gallery-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: .6rem; }
  .gallery-item { aspect-ratio: 1; }
  .skin-cube { --cube-size: 120px; --cube-half: 60px; }
  #skin-preview, .cube-scene, .skin-cube-wrap { min-height: 180px; }
  #profile-avatar { width: 72px; height: 72px; }
  .economy-actions .btn { flex: 1 1 130px; min-width: 0; padding-inline: .5rem; }
  .modal-dialog, .modal > .panel, .modal > .card { padding: 1rem; max-height: calc(100vh - 1.2rem); }
  #toast-host { right: .5rem; bottom: .5rem; width: calc(100vw - 1rem); }
  #theme-menu { right: .5rem; }
  .status-pill, .badge, .tag { white-space: normal; }
}

/* ---------------------------------------------------------------------------
   18. ДВИЖЕНИЕ / prefers-reduced-motion
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .skin-cube { transform: rotateX(-22deg) rotateY(32deg) !important; }
  .marquee-track { animation: none !important; transform: none !important; }
  .confetti { display: none !important; }
}

/* Переключатель движения из JS (body класс) — тот же эффект без media query */
body.no-motion *, body.no-motion *::before, body.no-motion *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
}
body.no-motion .confetti { display: none !important; }
body.no-motion .marquee-track { animation: none !important; }

/* Плотность из tweaks */
body.dense #app { padding-top: .75rem; }
body.dense .panel, body.dense .card { padding: .7rem; }
body.dense .stack { gap: .6rem; }
body.dense .grid { gap: .6rem; }

/* ========================================================================== */
