/* Era — админка и кабинет клиента. Фирменный стиль: тёмный фон, оранжево-фиолетовый неон,
   скошенные кнопки и рамки (как пульт квест-комнаты). Цвета и шрифты — только из переменных ниже. */
:root {
  /* палитра */
  --bg: #09070d; --bg-2: #0e0b14; --surface: #14101b; --surface-2: #1b1624; --surface-3: #251e30;
  --line: #2a2334; --line-2: #3a3147;
  --text: #eee9f6; --muted: #968ea6; --faint: #645b74;
  --orange: #ff8a3d; --orange-2: #ffae70; --orange-soft: rgba(255, 138, 61, .13); --orange-glow: rgba(255, 138, 61, .45);
  --purple: #a65cff; --purple-2: #c9a0ff; --purple-soft: rgba(166, 92, 255, .14); --purple-glow: rgba(166, 92, 255, .5);
  --ok: #4fe0a6; --ok-soft: rgba(79, 224, 166, .12);
  --warn: #ffc65c; --warn-soft: rgba(255, 198, 92, .12);
  --bad: #ff4f7b; --bad-soft: rgba(255, 79, 123, .13);
  /* старые имена — их используют страницы */
  --accent: var(--purple); --accent-2: var(--purple-2); --accent-soft: var(--purple-soft); --accent-text: #fff;
  --g-main: linear-gradient(100deg, var(--orange), var(--purple));
  --g-ok: linear-gradient(135deg, #4fe0a6, #2fc2b0);
  --g-card: linear-gradient(180deg, rgba(22, 17, 30, .88), rgba(14, 11, 20, .9));
  --g-border: linear-gradient(140deg, rgba(166, 92, 255, .32), rgba(255, 255, 255, .04) 45%, rgba(255, 138, 61, .22));
  /* шрифты и форма */
  --f-display: Montserrat, "Segoe UI", system-ui, sans-serif;
  --f-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: ui-monospace, "JetBrains Mono", Consolas, monospace;
  --radius: 14px; --radius-sm: 8px; --skew: -12deg;
  --shadow: 0 14px 40px rgba(0, 0, 0, .45);
  --sidebar: 232px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
html { overflow-y: scroll; scrollbar-gutter: stable; }
body {
  /* тёплое свечение слева, фиолетовое справа — как на пульте */
  background:
    radial-gradient(700px 420px at 50% -8%, rgba(255, 138, 61, .07), transparent 70%),
    linear-gradient(90deg, rgba(255, 112, 36, .10) 0%, rgba(255, 112, 36, .03) 18%, transparent 34%, transparent 64%, rgba(150, 70, 255, .05) 82%, rgba(150, 70, 255, .14) 100%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text); font: 14px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: var(--purple-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-family: var(--f-display); }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.01em; color: #fff; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 13.5px; font-weight: 700; }
p { margin: 8px 0; }
hr { border: 0; height: 1px; margin: 18px 0; background: linear-gradient(90deg, transparent, var(--line-2) 20%, var(--line-2) 80%, transparent); }
::selection { background: rgba(255, 138, 61, .3); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2d2538; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #43384f; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- каркас ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); padding: 22px 14px;
  background: rgba(10, 8, 14, .9); backdrop-filter: blur(12px);
  display: flex; flex-direction: column; gap: 4px; z-index: 20;
}
/* неоновая линия по краю меню: оранжевая сверху, фиолетовая снизу, гаснет к концам */
.sidebar::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 1px; pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--orange) 18%, var(--purple) 78%, transparent);
  box-shadow: 0 0 10px var(--orange-glow);
}
.logo { display: flex; align-items: center; gap: 12px; padding: 2px 10px 22px; color: var(--text); text-decoration: none !important; }
/* «ERA» как на логотипе (docs/brand/era-logo.png): шрифт Jost, буквы своими цветами */
.logo-word { font: 500 30px/1 'Jost', var(--f-display); letter-spacing: .26em; margin-right: -.26em; }
.logo-word .e { color: #ff6a2c; } .logo-word .r { color: #ff8a40; } .logo-word .a { color: #b97cff; }
/* значок рядом — живой эквалайзер без рамки: полоски цветов логотипа, каждая в своём ритме */
.logo-mark { display: grid; place-items: center; flex: 0 0 auto; }
.logo-mark .wave { width: 30px; height: 30px; overflow: visible; filter: drop-shadow(0 0 6px rgba(255, 138, 61, .35)); }
.logo-mark .wave line:nth-child(1) { stroke: #ff6a2c; } .logo-mark .wave line:nth-child(2) { stroke: #ff8a40; }
.logo-mark .wave line:nth-child(3) { stroke: #ea7fa0; } .logo-mark .wave line:nth-child(4) { stroke: #c27cff; }
.logo-mark .wave line:nth-child(5) { stroke: #a66bff; }
.logo-mark .wave.live line { animation: eq 1.6s ease-in-out infinite; }
.logo-mark .wave.live line:nth-child(1) { animation-duration: 1.3s; animation-delay: -.2s; }
.logo-mark .wave.live line:nth-child(2) { animation-duration: 1.7s; animation-delay: -.9s; }
.logo-mark .wave.live line:nth-child(3) { animation-duration: 1.5s; animation-delay: -.4s; }
.logo-mark .wave.live line:nth-child(4) { animation-duration: 1.9s; animation-delay: -1.1s; }
.logo-mark .wave.live line:nth-child(5) { animation-duration: 1.4s; animation-delay: -.6s; }
@keyframes eq { 0%, 100% { transform: scaleY(.4); } 30% { transform: scaleY(1); } 55% { transform: scaleY(.6); } 80% { transform: scaleY(.9); } }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; color: var(--muted);
  font-weight: 500; text-decoration: none; transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255, 255, 255, .03); color: var(--text); }
.nav a.on { border-radius: 0 8px 8px 0; color: var(--orange); background: linear-gradient(90deg, var(--orange-soft), transparent 85%); box-shadow: inset 2px 0 0 var(--orange); font-weight: 600; }
.nav a.on svg { color: var(--orange); filter: drop-shadow(0 0 6px var(--orange-glow)); }
.nav svg { width: 18px; height: 18px; flex: 0 0 18px; }
.sidebar .foot { margin-top: auto; padding: 10px 12px; font-size: 12px; color: var(--faint); }
.page { margin-left: var(--sidebar); padding: 30px 32px 60px; }
/* на широком экране — по центру справа от меню, ширина содержимого до 1360 px */
@media (min-width: 1650px) { .page { padding-left: calc((100vw - var(--sidebar) - 1360px) / 2); padding-right: calc((100vw - var(--sidebar) - 1360px) / 2); } }
.page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
/* под заголовком страницы — неоновая линия */
.page-head::after {
  content: ""; flex: 0 0 100%; height: 1px; margin-top: 4px;
  background: linear-gradient(90deg, var(--orange), rgba(166, 92, 255, .8) 40%, rgba(166, 92, 255, 0) 85%);
  box-shadow: 0 0 8px rgba(255, 138, 61, .35);
}
.page-head .grow { flex: 1; min-width: 200px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--orange-2); }

@media (max-width: 860px) {
  .sidebar { position: sticky; top: 0; inset: auto; width: auto; height: auto; flex-direction: row; align-items: center;
             padding: 8px 12px; overflow-x: auto; }
  .sidebar::after { top: auto; left: 0; bottom: 0; width: auto; height: 1px;
                    background: linear-gradient(90deg, var(--orange), var(--purple) 70%, transparent); }
  .logo { padding: 0 8px 0 0; }
  .logo > span:last-child, .sidebar .foot { display: none; }
  .nav { display: flex; gap: 2px; }
  .nav a { padding: 8px 10px; white-space: nowrap; }
  .nav a.on { border-radius: 0; background: transparent; box-shadow: inset 0 -2px 0 var(--orange); }
  .sidebar { scrollbar-width: none; }
  .sidebar::-webkit-scrollbar { display: none; }
  .page { margin-left: 0; padding: 20px 16px 50px; }
  /* меню не помещается — лишние пункты под «три полоски» (navfit.js); открытый пункт виден всегда */
  .sidebar.nav-fit { overflow: visible; }
  .sidebar.nav-fit .nav { flex: 1 1 auto; min-width: 0; overflow: hidden; }
  .nav a.nav-out { display: none; }
  .nav-more { flex: 0 0 40px; width: 40px; height: 40px; padding: 0; margin-left: 6px; --b: var(--line-2); --c: var(--muted); }
  .nav-more svg { width: 20px; height: 20px; }
  .nav-more.on { --b: rgba(255, 138, 61, .6); --f: var(--orange-soft); --c: var(--orange); }
  .nav-drop { position: absolute; top: calc(100% + 6px); right: 10px; z-index: 40; min-width: 220px; max-width: calc(100vw - 20px);
    padding: 6px; display: flex; flex-direction: column; gap: 2px; border-radius: 12px; border: 1px solid rgba(166, 92, 255, .4);
    background: linear-gradient(180deg, #1a1522, #110d17); box-shadow: 0 16px 40px rgba(0, 0, 0, .55), 0 0 24px rgba(166, 92, 255, .14);
    animation: nav-drop .14s ease-out; }
  .nav-drop a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 8px; color: var(--muted);
    font-weight: 500; text-decoration: none; white-space: nowrap; }
  .nav-drop a:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
  .nav-drop a svg { width: 18px; height: 18px; flex: 0 0 18px; }
  .nav-drop-foot { margin-top: 4px; padding: 10px 12px 6px; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); }
  .nav-drop-foot .who { color: var(--text); font-weight: 600; }
}
@keyframes nav-drop { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- блоки ---------- */
.card {
  background: var(--g-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; box-shadow: 0 12px 36px rgba(0, 0, 0, .3);
}
/* заголовок блока — как подпись на пульте: капс, разрядка */
.card > h2:first-child, .card-head h2, .card > h3:first-child, .card-head h3 {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: #cfc7dc;
}
.card > h2:first-child, .card-head { margin-bottom: 14px; }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-head h2 { flex: 1; }
.card.danger-zone { border-color: rgba(255, 79, 123, .35); }
.hint { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
@media (max-width: 900px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 160px; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 10px; }

/* ---------- формы ---------- */
.field { display: block; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.field > small { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.4; }
input, select, textarea, button { font: inherit; color: var(--text); }
/* автозаполнение браузера (сохранённый логин) красит поля в голубой — оставляем наш тёмный фон и светлый текст */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-2) inset; box-shadow: 0 0 0 1000px var(--bg-2) inset;
  -webkit-text-fill-color: var(--text); caret-color: var(--text); transition: background-color 9999s ease-out 0s; }
input:autofill { background: var(--bg-2); color: var(--text); }
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background-color: rgba(8, 6, 12, .75); outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--orange) !important; box-shadow: 0 0 0 3px var(--orange-soft), 0 0 14px rgba(255, 138, 61, .18); }
input::placeholder, textarea::placeholder { color: var(--faint); }
select { appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ff8a3d' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
select option { background: var(--surface); }
textarea { min-height: 110px; resize: vertical; }
textarea.code { font-family: var(--f-mono); font-size: 12px; line-height: 1.45; }
input[type=file] { color: var(--muted); font-size: 13px; }
input[type=file]::file-selector-button { margin-right: 10px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text); cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--orange); }
input[type=checkbox] { accent-color: var(--orange); width: 16px; height: 16px; vertical-align: -3px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text); }

/* переключатель */
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { display: none; }
.switch i { position: relative; width: 40px; height: 22px; flex: 0 0 40px; border-radius: 22px; background: var(--bg-2); border: 1px solid var(--line-2); transition: .2s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch input:checked + i { border-color: var(--orange); background: var(--orange-soft); box-shadow: 0 0 12px rgba(255, 138, 61, .3); }
.switch input:checked + i::after { left: 20px; background: var(--orange); box-shadow: 0 0 8px var(--orange); }
.switch b { font-weight: 600; font-size: 13px; }
.switch small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }

/* ---------- кнопки: скошенная неоновая рамка, как на пульте ----------
   Рамка — это ::before под текстом (скошена только она, текст прямой). Цвет задают переменные:
   --b рамка, --f заливка, --g свечение, --c текст. */
button, .btn {
  --b: var(--line-2); --f: rgba(255, 255, 255, .025); --g: none; --c: var(--text);
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 18px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--c); cursor: pointer;
  font: 700 11.5px/1.45 var(--f-display); letter-spacing: .08em; text-transform: uppercase;
  white-space: nowrap; text-decoration: none; transition: color .15s, transform .05s, opacity .15s;
}
button::before, .btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  border-radius: var(--radius-sm); transform: skewX(var(--skew));
  border: 1px solid var(--b); background: var(--f); box-shadow: var(--g);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
button:hover, .btn:hover { --b: rgba(166, 92, 255, .7); --f: var(--purple-soft); --g: 0 0 16px rgba(166, 92, 255, .28); text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
button:disabled, button:disabled:hover { --b: var(--line); --f: transparent; --g: none; --c: var(--faint); cursor: default; transform: none; }
/* главное действие — оранжевый неон */
.primary { --b: var(--orange); --f: linear-gradient(180deg, rgba(255, 138, 61, .2), rgba(255, 138, 61, .07)); --c: #fff;
           --g: 0 0 18px rgba(255, 138, 61, .35), inset 0 0 12px rgba(255, 138, 61, .15); }
.primary:hover { --b: var(--orange-2); --f: linear-gradient(180deg, rgba(255, 138, 61, .32), rgba(255, 138, 61, .12));
                 --g: 0 0 26px rgba(255, 138, 61, .55), inset 0 0 14px rgba(255, 138, 61, .2); }
/* идёт сейчас (игра запущена) — фиолетовый неон */
.success { --b: var(--purple); --f: linear-gradient(180deg, rgba(166, 92, 255, .24), rgba(166, 92, 255, .08)); --c: #fff;
           --g: 0 0 18px rgba(166, 92, 255, .4), inset 0 0 12px rgba(166, 92, 255, .18); }
.success:hover { --b: var(--purple-2); --g: 0 0 26px rgba(166, 92, 255, .6), inset 0 0 14px rgba(166, 92, 255, .22); }
.danger { --b: rgba(255, 79, 123, .55); --f: var(--bad-soft); --c: #ff8aa6; }
.danger:hover { --b: var(--bad); --f: rgba(255, 79, 123, .2); --g: 0 0 16px rgba(255, 79, 123, .3); }
.ghost { --b: transparent; --f: transparent; --c: var(--muted); }
.ghost:hover { --b: transparent; --f: rgba(255, 255, 255, .04); --g: none; --c: var(--text); }
.sm { padding: 6px 12px; font-size: 10.5px; }
.lg { padding: 12px 24px; font-size: 13px; }
.icon-btn { padding: 7px; width: 34px; height: 34px; }

/* ---------- метки — капс, как «FINISHED / ACTIVE» на пульте ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 6px;
        font: 700 10.5px/1.5 var(--f-display); letter-spacing: .08em; text-transform: uppercase;
        background: rgba(255, 255, 255, .03); color: var(--muted); border: 1px solid var(--line-2); white-space: nowrap; }
.pill.ok { color: var(--ok); border-color: rgba(79, 224, 166, .35); background: var(--ok-soft); }
.pill.warn { color: var(--orange-2); border-color: rgba(255, 138, 61, .45); background: var(--orange-soft); }
.pill.bad { color: #ff8aa6; border-color: rgba(255, 79, 123, .45); background: var(--bad-soft); }
.pill.accent { color: var(--purple-2); border-color: rgba(166, 92, 255, .5); background: var(--purple-soft); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; flex: 0 0 8px; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px rgba(79, 224, 166, .7); }
.dot.live { background: var(--ok); animation: pulse 1.8s infinite; }
.dot.warn { background: var(--orange); box-shadow: 0 0 8px var(--orange-glow); } .dot.bad { background: var(--bad); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(79, 224, 166, .55); } 70% { box-shadow: 0 0 0 8px rgba(79, 224, 166, 0); } 100% { box-shadow: 0 0 0 0 rgba(79, 224, 166, 0); } }
kbd, code { font-family: var(--f-mono); font-size: 12px; background: var(--surface-3); padding: 1px 6px; border-radius: 5px; }

/* ---------- вкладки — как «Game | System»: активная оранжевая с подсветкой снизу ---------- */
.tabs { display: flex; gap: 2px; width: fit-content; max-width: 100%; overflow-x: auto; margin-bottom: 20px;
        border-bottom: 1px solid var(--line); }
.tabs button { --c: var(--muted); padding: 10px 16px 11px; border-radius: 0; }
.tabs button::before { display: none; }
.tabs button:hover { --c: var(--text); }
.tabs button.on { --c: var(--orange); box-shadow: inset 0 -2px 0 var(--orange), 0 8px 14px -10px var(--orange); }
/* нажатие не сдвигает вкладку и рамка фокуса — внутри: иначе у полосы вкладок появлялась прокрутка */
.tabs { overflow-y: hidden; scrollbar-width: thin; }
.tabs button:active { transform: none; }
.tabs button:focus-visible { outline-offset: -2px; }

/* ---------- таблицы ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font: 700 10.5px/1.4 var(--f-display); text-transform: uppercase; letter-spacing: .1em; color: var(--faint);
     padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: rgba(255, 138, 61, .04); }
tr.detail td { background: var(--bg-2); }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { position: relative; overflow: hidden; background: var(--g-card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.kpi::before { content: ""; position: absolute; left: 14px; right: 14px; top: 0; height: 1px; pointer-events: none;
               background: linear-gradient(90deg, transparent, var(--kc, var(--orange)), transparent); box-shadow: 0 0 10px var(--kc, var(--orange)); }
.kpi:nth-child(even) { --kc: var(--purple); }
.kpi span { font-size: 10.5px; font-weight: 700; font-family: var(--f-display); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.kpi b { display: block; font: 800 24px/1.25 var(--f-display); margin-top: 4px; color: #fff; }

/* ---------- карточки комнат ---------- */
.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.room-card { position: relative; display: flex; flex-direction: column; background: var(--g-card); border: 1px solid var(--line);
             border-radius: 16px; overflow: hidden; transition: transform .18s, border-color .18s, box-shadow .18s; }
.room-card:hover { transform: translateY(-2px); border-color: rgba(166, 92, 255, .55); box-shadow: var(--shadow), 0 0 30px rgba(166, 92, 255, .16); }
/* идёт игра — оранжевая подсветка, как активная загадка на пульте */
.room-card.live { border-color: var(--orange); box-shadow: 0 0 26px rgba(255, 138, 61, .22), inset 0 0 18px rgba(255, 138, 61, .06); }
.cover { position: relative; height: 150px; background: var(--surface-2) center / cover no-repeat; cursor: pointer; }
.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9, 7, 13, 0) 30%, rgba(9, 7, 13, .6) 65%, rgba(14, 11, 20, .97)); }
.cover .initial { position: absolute; inset: 0; display: grid; place-items: center; font: 800 54px/1 var(--f-display); color: rgba(255, 255, 255, .9);
                  text-shadow: 0 0 30px rgba(255, 138, 61, .35); }
.cover .top { position: absolute; z-index: 1; top: 12px; left: 12px; right: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.cover .top .pill { background: rgba(9, 7, 13, .78); backdrop-filter: blur(6px); }
.cover .title { position: absolute; z-index: 1; left: 16px; right: 16px; bottom: 12px; }
.cover .title h2 { font-size: 19px; font-weight: 800; color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
.cover .title div { font-size: 12.5px; color: rgba(238, 233, 246, .75); }
.room-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fact { background: rgba(8, 6, 12, .6); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.fact span { display: block; font-size: 10px; font-weight: 700; font-family: var(--f-display); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.fact b { font: 700 15px/1.4 var(--f-display); color: #fff; }
.boxes { display: flex; flex-wrap: wrap; gap: 6px; }
.box-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 99px; background: rgba(8, 6, 12, .6);
            border: 1px solid var(--line); font-size: 12.5px; }
.room-actions { display: flex; gap: 10px; margin-top: auto; padding: 0 4px; }
.room-actions > * { flex: 1; min-width: 0; padding-left: 10px; padding-right: 10px; }
.add-card { display: grid; place-items: center; min-height: 300px; border: 1.5px dashed rgba(255, 138, 61, .35); border-radius: 16px; color: var(--muted);
            cursor: pointer; background: rgba(255, 138, 61, .03); transition: .15s; text-align: center; }
.add-card::before { display: none; }
.add-card:hover { border-color: var(--orange); color: var(--text); background: var(--orange-soft); box-shadow: 0 0 24px rgba(255, 138, 61, .15); }
.add-card .plus { font: 300 46px/1 var(--f-display); margin-bottom: 6px; color: var(--orange); text-shadow: 0 0 14px var(--orange-glow); }
@media (max-width: 860px) { .add-card { min-height: 110px; } }

/* ---------- коробки ---------- */
.devs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.dev { background: var(--g-card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.dev.online { border-color: rgba(79, 224, 166, .3); }
.dev.sel { border-color: var(--orange); box-shadow: 0 0 24px rgba(255, 138, 61, .2); }
.dev-head { display: flex; gap: 12px; align-items: center; }
.dev-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; flex: 0 0 44px;
            background: var(--bg-2); border: 1px solid var(--line-2); }
.dev.online .dev-icon { border-color: rgba(79, 224, 166, .5); box-shadow: 0 0 14px rgba(79, 224, 166, .2); }
.dev-name { flex: 1; min-width: 0; }
.dev-name input { background: transparent !important; border-color: transparent !important; padding: 2px 6px !important; margin-left: -6px; font-weight: 700; font-size: 15px; }
.dev-name input:hover { border-color: var(--line-2) !important; }
.dev-name input:focus { background: var(--bg-2) !important; }
.dev-check { display: flex; align-items: center; cursor: pointer; padding: 4px; margin-left: -4px; }
.dev-check input { width: 18px; height: 18px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.kv span { color: var(--muted); }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; vertical-align: -1px; margin-right: 4px; }
.bars i { width: 3px; background: var(--line-2); border-radius: 1px; }
.bars i.on { background: var(--ok); }

/* ---------- игра ---------- */
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .game-layout { grid-template-columns: minmax(0, 1fr); } }
/* панель состояния игры — скошенная неоновая рамка, как табло таймера */
.card.status-bar {
  position: relative; isolation: isolate; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 18px 34px; margin-left: 10px; margin-right: 10px; background: transparent; border: 0; box-shadow: none;
}
.card.status-bar::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: 18px; transform: skewX(-8deg);
  border: 1.5px solid rgba(166, 92, 255, .55); background: linear-gradient(180deg, rgba(20, 15, 28, .92), rgba(11, 8, 16, .94));
  box-shadow: 0 0 22px rgba(166, 92, 255, .2), inset 0 0 24px rgba(166, 92, 255, .06);
}
.card.status-bar.live::before {
  border-color: var(--orange);
  box-shadow: 0 0 26px rgba(255, 138, 61, .38), 0 0 60px rgba(255, 138, 61, .1), inset 0 0 26px rgba(255, 138, 61, .08);
}
.status-bar .state { display: flex; align-items: center; gap: 10px; font: 800 17px/1.3 var(--f-display); letter-spacing: .02em; }
.status-bar .state .dot { width: 10px; height: 10px; flex-basis: 10px; }
.status-bar.live .state { color: #fff; }
@media (max-width: 600px) {
  .card.status-bar { margin-left: 0; margin-right: 0; padding: 16px 18px; }
  .card.status-bar::before { transform: none; }
}
.chat-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
#chat { height: calc(100vh - 380px); min-height: 340px; overflow-y: auto; padding: 18px 20px; scroll-behavior: smooth; }
.empty { text-align: center; color: var(--muted); padding: 50px 20px; }
.empty .big { font-size: 38px; margin-bottom: 8px; }
.msg-row { display: flex; gap: 10px; margin: 12px 0; align-items: flex-end; }
.msg-row.user { flex-direction: row-reverse; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; flex: 0 0 30px;
          background: var(--surface-3); border: 1px solid var(--line-2); }
.msg-row.bot .avatar { border: 1.5px solid transparent; background: linear-gradient(var(--bg-2), var(--bg-2)) padding-box, var(--g-main) border-box;
                       box-shadow: 0 0 12px rgba(255, 138, 61, .3); }
.msg-row.op .avatar { background: var(--warn-soft); border-color: rgba(255, 198, 92, .4); }
.bubble { max-width: min(78%, 680px); padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; }
/* игроки — фиолетовый, персонаж — тёмный с тёплой кромкой */
.msg-row.user .bubble { background: linear-gradient(135deg, rgba(166, 92, 255, .26), rgba(120, 60, 220, .14)); border: 1px solid rgba(166, 92, 255, .5);
                        border-bottom-right-radius: 4px; color: #fff; box-shadow: 0 0 18px rgba(166, 92, 255, .12); }
.msg-row.bot .bubble { background: linear-gradient(160deg, #1a1522, #120e19); border: 1px solid var(--line-2); border-left-color: rgba(255, 138, 61, .55);
                       border-bottom-left-radius: 4px; }
.msg-row.op .bubble { background: var(--warn-soft); border: 1px solid rgba(255, 198, 92, .3); border-bottom-left-radius: 4px; }
.bubble .who { font: 700 10.5px/1.4 var(--f-display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.msg-row.user .bubble .who, .msg-row.user .bubble .tech, .msg-row.user .bubble .muted { color: rgba(255, 255, 255, .7); }
.meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; white-space: normal; }
.meta .pill { font-size: 9.5px; padding: 2px 7px; }
.tech { font-size: 11px; color: var(--faint); margin-top: 5px; white-space: normal; }
body:not(.show-tech) .tech { display: none; }
.typing span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); margin: 0 2px; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; background: var(--purple); }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.composer { border-top: 1px solid var(--line); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: rgba(8, 6, 12, .6); }
.composer .row { align-items: center; }
/* ступени подсказок: 1 — мягкая, 2 — средняя, 3 — ответ */
.lv1 { color: var(--purple-2); } .lv2 { color: var(--orange); } .lv3 { color: var(--bad); }
.puzzles { display: flex; flex-direction: column; gap: 4px; }
.pz { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; border: 1px solid transparent; }
.pz:hover { background: rgba(255, 255, 255, .03); border-color: var(--line); }
.pz-room { display: flex; justify-content: space-between; align-items: center; margin: 14px 4px 4px; font: 700 10.5px/1.4 var(--f-display);
           text-transform: uppercase; letter-spacing: .14em; color: var(--orange-2); }
.pz-room:first-child { margin-top: 2px; }
.pz-room span:last-child { color: var(--faint); }
.pz .mk { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex: 0 0 22px; font-size: 12px;
          background: var(--bg-2); border: 1px solid var(--line-2); color: var(--faint); }
/* пройдена — фиолетовый, как FINISHED на пульте */
.pz.done .mk { background: var(--purple-soft); border-color: var(--purple); color: #fff; box-shadow: 0 0 10px rgba(166, 92, 255, .45); }
.pz.done .nm { color: var(--muted); }
.pz.locked { opacity: .5; }
.pz .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pz .lvl { display: flex; gap: 3px; }
.pz .lvl i { width: 6px; height: 14px; border-radius: 2px; background: var(--surface-3); transform: skewX(var(--skew)); }
.pz .lvl i.l1 { background: var(--purple-2); } .pz .lvl i.l2 { background: var(--orange); box-shadow: 0 0 6px var(--orange-glow); }
.pz .lvl i.l3 { background: var(--bad); box-shadow: 0 0 6px rgba(255, 79, 123, .5); }
.progress { height: 8px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; margin: 6px 0 14px; }
.progress i { display: block; height: 100%; border-radius: 6px; transition: width .4s;
              background: linear-gradient(90deg, var(--orange), var(--purple)); box-shadow: 0 0 12px rgba(166, 92, 255, .6); }
.alert { background: var(--bad-soft); border: 1px solid rgba(255, 79, 123, .35); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: 13px; }

/* ---------- голоса ---------- */
.voice-row { display: grid; grid-template-columns: 110px minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 10px; align-items: center;
             padding: 12px 0; border-bottom: 1px solid var(--line); }
.voice-row:last-child { border-bottom: 0; }
@media (max-width: 1100px) { .voice-row { grid-template-columns: 1fr 1fr; } }
.lang-tag { display: flex; flex-direction: column; }
.lang-tag b { font-size: 14px; }
.lang-tag small { color: var(--faint); font-size: 11.5px; }

/* ---------- тосты и диалоги ---------- */
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--surface-2); border: 1px solid var(--line-2); border-left: 2px solid var(--purple); border-radius: 10px; padding: 11px 16px;
         box-shadow: var(--shadow); animation: slidein .2s ease-out; max-width: 360px; }
.toast.ok { border-left-color: var(--ok); } .toast.bad { border-left-color: var(--bad); border-color: rgba(255, 79, 123, .45); }
@keyframes slidein { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
dialog { background: linear-gradient(180deg, #1a1522, #110d17); color: var(--text); border: 1px solid rgba(166, 92, 255, .4); border-radius: 16px;
         padding: 22px; width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow), 0 0 40px rgba(166, 92, 255, .15); }
dialog::backdrop { background: rgba(4, 3, 7, .7); backdrop-filter: blur(3px); }
dialog h2 { margin-bottom: 8px; font-size: 17px; }
dialog .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.save-bar { position: sticky; bottom: 16px; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-top: 6px;
            background: rgba(20, 15, 28, .95); backdrop-filter: blur(10px); border: 1px solid var(--orange); border-radius: 14px;
            box-shadow: var(--shadow), 0 0 22px rgba(255, 138, 61, .2); }
.save-bar[hidden] { display: none; }
details > summary { cursor: pointer; color: var(--muted); font-size: 13px; list-style: none; user-select: none; }
details > summary:hover { color: var(--text); }
details > summary::before { content: "▸ "; color: var(--orange); }
details[open] > summary::before { content: "▾ "; }
.drop { border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 22px; text-align: center; color: var(--muted); transition: .15s; }
.drop.over { border-color: var(--orange); background: var(--orange-soft); }

/* ---------- значок Era — звуковые полоски ---------- */
.wave { width: 20px; height: 20px; color: #fff; display: block; }
.wave line { transform-box: fill-box; transform-origin: center; }
.wave line:nth-child(1), .wave line:nth-child(2) { stroke: var(--orange); }
.wave line:nth-child(4), .wave line:nth-child(5) { stroke: var(--purple-2); }
.wave.live line { animation: talk 1.1s ease-in-out infinite; }
.wave.live line:nth-child(2) { animation-delay: -.25s; }
.wave.live line:nth-child(3) { animation-delay: -.5s; }
.wave.live line:nth-child(4) { animation-delay: -.15s; }
.wave.live line:nth-child(5) { animation-delay: -.4s; }
@keyframes talk { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.45); } }
.avatar .wave { width: 15px; height: 15px; }
.dev-icon .wave { width: 22px; height: 22px; color: var(--muted); }
.dev-icon .wave line { stroke: currentColor; }
.dev.online .dev-icon .wave { color: var(--ok); }

@media (prefers-reduced-motion: reduce) {
  .wave.live line, .dot.live, .typing span { animation: none; }
  .room-card, .room-card:hover { transition: none; transform: none; }
}

/* описания под «?» (common.js helpify) */
.help-btn { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; min-height: 0;
  margin: 0 0 0 6px; padding: 0; border-radius: 50%; border: 1px solid var(--line-2); background: transparent;
  color: var(--muted); font-size: 11px; font-weight: 700; line-height: 1; vertical-align: 1px; cursor: pointer;
  text-transform: none; letter-spacing: 0; box-shadow: none; }
.help-btn:hover { color: var(--orange); border-color: var(--orange); background: transparent; }
.help-pop { position: fixed; z-index: 1000; max-width: min(340px, calc(100vw - 16px)); padding: 10px 12px;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text);
  font-size: 12.5px; font-weight: 400; line-height: 1.45; box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
  text-transform: none; letter-spacing: 0; }
.help-pop a { color: var(--accent-2); }

/* временные изменения площадки (hint_rules.temp_*) */
.tmp-card.has { border-color: rgba(255, 138, 61, .55); box-shadow: 0 0 0 1px rgba(255, 138, 61, .18) inset; }
.tmp-list { display: grid; gap: 8px; margin: 4px 0 12px; }
.tmp-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 12px;
  border: 1px solid rgba(255, 138, 61, .35); border-radius: 10px; background: var(--orange-soft); }
.tmp-item p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.tmp-item small { display: block; margin-top: 4px; color: var(--muted); }
.tmp-item .by-client { color: var(--purple-2); font-weight: 600; }
.tmp-add textarea { width: 100%; min-height: 64px; resize: vertical; }
.tmp-add .row { margin-top: 8px; align-items: center; flex-wrap: wrap; gap: 8px; }
.tmp-head { cursor: pointer; user-select: none; margin-bottom: 0; }
.tmp-head h2 { margin-right: auto; }
.tmp-head .tmp-chev { color: var(--muted); font-size: 18px; line-height: 1; transition: transform .2s; margin-left: 10px; }
.tmp-card.open .tmp-head .tmp-chev { transform: rotate(180deg); }
.tmp-card.open .tmp-head { margin-bottom: 12px; }
.tmp-head:focus-visible { outline: 2px solid var(--orange-2); outline-offset: 4px; border-radius: 6px; }
.msg-min { font-size: 11px; color: var(--faint); margin-top: 4px; }
.msg-row.user .bubble .msg-min { color: rgba(255, 255, 255, .6); text-align: right; }
.bridge-said { color: var(--muted); font-style: italic; }
.typing-inline { display: inline-flex; gap: 4px; vertical-align: middle; margin-left: 4px; }
.typing-inline span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: typing-blink 1.2s infinite ease-in-out; }
.typing-inline span:nth-child(2) { animation-delay: .2s; } .typing-inline span:nth-child(3) { animation-delay: .4s; }
@keyframes typing-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
