/* ============================================================
   Элизиум — дизайн-система v0.1
   База: тёплый почти-чёрный + пергаментный текст + золото.
   Акценты залов: свеча / кровь / неон.
   ============================================================ */

:root {
  --bg: #0C0A09;
  --bg-2: #16130F;
  --card: #211C15;
  --line: #3A3125;
  --text: #EAE0CC;
  --muted: #9C8F7A;
  --gold: #C9A45C;
  --gold-dim: rgba(201, 164, 92, .35);
  --fire: #E08D3C;      /* каминный зал */
  --blood: #A61B2E;     /* комната ужасов / детективное бюро */
  --neon: #3FE0B0;      /* космическая станция */
  --radius: 14px;
  --font-display: "Cormorant Unicase", "Georgia", serif;
  --font-body: "Golos Text", "Segoe UI", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Зерно поверх всего — статичное, дешёвое */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; display: block; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: .02em;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

.section { padding: 72px 0; }
.section:nth-of-type(even) { background: var(--bg-2); }

.section-title {
  font-size: clamp(30px, 4.5vw, 44px);
  margin-bottom: 12px;
}
.section-sub { color: var(--muted); max-width: 640px; margin-bottom: 36px; }

/* ---------- Шапка ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 10, 9, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  max-width: 1120px;
  margin: 0 auto;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text);
}
.logo:hover { text-decoration: none; color: var(--gold); }
.logo img { height: 34px; width: auto; }

.nav { display: flex; gap: 22px; align-items: center; }
.nav a { color: var(--muted); font-size: 15px; }
.nav a:hover { color: var(--gold); text-decoration: none; }

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: var(--radius);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-weight: 600;
  font-size: 15px;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.btn:hover {
  background: var(--gold);
  color: var(--bg);
  text-decoration: none;
  transform: translateY(-2px);
}
.btn--solid { background: var(--gold); color: var(--bg); }
.btn--solid:hover { background: #D9B876; }
/* Кнопка в меню: перебиваем .nav a и .nav a:hover, иначе там светлый текст на золоте */
.nav a.btn--solid, .nav a.btn--solid:hover { color: var(--bg); }
.btn--ghost { border-color: var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--gold); background: transparent; color: var(--gold); }

.nav-toggle { display: none; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("../img/hero-facade-night.jpg") center / cover no-repeat;
}
.hero__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(12,10,9,.82) 0%, rgba(12,10,9,.62) 46%, rgba(12,10,9,.18) 100%),
    radial-gradient(ellipse at 30% 40%, rgba(224, 141, 60, .10), transparent 55%),
    linear-gradient(180deg, rgba(12,10,9,.25) 0%, rgba(12,10,9,.10) 45%, var(--bg) 100%);
}
.hero__fog {
  position: absolute;
  inset: -20% -50%;
  z-index: -1;
  opacity: .35;
  background: radial-gradient(ellipse at 50% 60%, rgba(234, 224, 204, .14), transparent 60%);
  animation: fog 26s ease-in-out infinite alternate;
}
@keyframes fog {
  from { transform: translateX(-4%); }
  to   { transform: translateX(4%); }
}
@media (prefers-reduced-motion: reduce) {
  .hero__fog { animation: none; }
}

.hero__content { max-width: 720px; padding: 120px 20px 90px; }
.hero__kicker {
  color: var(--gold);
  font-size: 14px;
  letter-spacing: .25em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(40px, 7vw, 76px);
  margin-bottom: 20px;
}
.hero h1 em { font-style: normal; color: var(--gold); }
.hero__lead {
  font-size: 19px;
  color: var(--muted);
  max-width: 560px;
  margin-bottom: 34px;
}
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Карточки игр ---------- */

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}
.game-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .25s ease, border-color .25s ease;
}
.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-dim);
}
.game-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--accent, var(--gold));
  opacity: 0;
  transition: opacity .25s ease;
}
.game-card:hover::before { opacity: 1; }

.game-card__head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.game-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  flex: none;
}
.game-card__title { font-size: 21px; }
.game-card__tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.tag--newbie { color: var(--fire); border-color: rgba(224,141,60,.4); }
.tag--18 { color: var(--blood); border-color: rgba(166,27,46,.5); }
.game-card__desc {
  color: var(--muted);
  font-size: 15px;
  flex: 1;
}
.game-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.game-card__price { font-size: 20px; color: var(--gold); font-weight: 600; }
.game-card__price small { color: var(--muted); font-weight: 400; font-size: 13px; }

/* ---------- Залы ---------- */

.halls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}
.hall {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  background: linear-gradient(180deg, var(--card), var(--bg-2));
}
.hall__icon { font-size: 30px; margin-bottom: 12px; }
.hall__photo { width: 100%; height: 150px; object-fit: cover; border-radius: 12px; margin-bottom: 14px; display: block; }
.hall h3 { font-size: 22px; margin-bottom: 8px; }
.hall--fire h3 { color: var(--fire); }
.hall--blood h3 { color: var(--blood); }
.hall--neon h3 { color: var(--neon); }
.hall--gold h3 { color: var(--gold); }
.hall p { color: var(--muted); font-size: 15px; }

/* ---------- Расписание ---------- */

.sched-list { display: flex; flex-direction: column; gap: 12px; }
.sched-item {
  display: grid;
  grid-template-columns: 92px 44px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.sched-item__date { text-align: center; }
.sched-item__day {
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--gold);
  line-height: 1;
}
.sched-item__month { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.sched-item__what { min-width: 0; }
.sched-item__system { font-weight: 600; font-size: 17px; }
.sched-item__meta { color: var(--muted); font-size: 14px; }
.sched-item__meta b { color: var(--text); font-weight: 500; }
.seats {
  display: inline-block;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.seats--open { color: var(--neon); border-color: rgba(63,224,176,.4); }
.seats--full { color: var(--muted); }
.sched-note { color: var(--muted); font-size: 14px; margin-top: 18px; }
.sched-error { color: var(--muted); font-style: italic; }

/* Иконки систем и залов (SVG инлайном, красятся в цвет) */
.sicon {
  width: 38px;
  height: 38px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sicon svg { width: 100%; height: 100%; }
.sicon--fire { color: var(--fire); }
.sicon--blood { color: var(--blood); }
.sicon--neon { color: var(--neon); }
.sicon--gold { color: var(--gold); }

.sched-item .sicon { align-self: center; }

/* Иконки залов на главной — через CSS mask, красятся в цвет зала */
.hall__icon-svg {
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  background-color: currentColor;
  -webkit-mask: var(--icon) no-repeat center / contain;
  mask: var(--icon) no-repeat center / contain;
}
.hall--fire .hall__icon-svg { color: var(--fire); --icon: url("../img/icons/fire.svg?v=3"); }
.hall--blood .hall__icon-svg { color: var(--blood); --icon: url("../img/icons/detective.svg?v=3"); }
.hall--neon .hall__icon-svg { color: var(--neon); --icon: url("../img/icons/rocket.svg?v=3"); }
.hall--gold .hall__icon-svg { color: var(--gold); --icon: url("../img/icons/tea.svg?v=3"); }

/* ---------- Атмосфера / фото ---------- */

.split {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 40px;
  align-items: center;
}
.split img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
}

.checklist { list-style: none; display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; }
.checklist li { padding-left: 28px; position: relative; color: var(--muted); font-size: 15px; line-height: 1.55; }
.checklist li::before {
  content: "✦";
  position: absolute;
  left: 0;
  top: .18em;
  color: var(--gold);
  font-size: 12px;
}
.checklist b { color: var(--text); font-weight: 500; }

/* ---------- Page hero (внутренние страницы) ---------- */
.page-hero {
  padding: 88px 0 44px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 80% 0%, rgba(201, 164, 92, .08), transparent 55%),
    var(--bg-2);
}
.page-hero h1 { font-size: clamp(34px, 5vw, 52px); margin: 0 0 12px; line-height: 1.15; }
.page-hero p { color: var(--muted); max-width: 680px; margin: 0; font-size: 17px; line-height: 1.65; }
@media (max-width: 759px) {
  .page-hero { padding: 56px 0 32px; }
}

/* ---------- Контакты ---------- */

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
}
.contact-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.contact-card h3 { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin-bottom: 10px; font-family: var(--font-body); font-weight: 500; }
.contact-card p, .contact-card a { font-size: 16px; }

/* ---------- Подвал ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  color: var(--muted);
  font-size: 14px;
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--gold); }
.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

/* Иконки в карточках-заметках (новости, оплата, мастерам) — через CSS mask */
.note-card--gold .hall__icon-svg { color: var(--gold); --icon: url("../img/icons/candy.svg?v=3"); }
.note-card--fire .hall__icon-svg { color: var(--fire); --icon: url("../img/icons/candle.svg?v=3"); }
.note-card--blood .hall__icon-svg { color: var(--blood); --icon: url("../img/icons/eye.svg?v=3"); }
.note-card--neon .hall__icon-svg { color: var(--neon); --icon: url("../img/icons/rocket.svg?v=3"); }

/* ---------- Дайс-виджет ---------- */

.dice-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1000;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid var(--gold-dim);
  background: var(--card);
  color: var(--gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(0,0,0,.5);
  transition: transform .2s ease, border-color .2s ease;
}
.dice-fab:hover { transform: scale(1.08); border-color: var(--gold); }
.dice-fab svg { width: 34px; height: 34px; }

.dice-panel {
  position: fixed;
  right: 22px;
  bottom: 94px;
  z-index: 1000;
  width: 280px;
  background: var(--card);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,.6);
  display: none;
}
.dice-panel.open { display: block; }
.dice-panel h3 { font-size: 20px; margin-bottom: 12px; text-align: center; }
.dice-types { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 16px; }
.dice-type {
  padding: 7px 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  transition: all .15s ease;
}
.dice-type:hover { border-color: var(--gold-dim); color: var(--text); }
.dice-type.active { border-color: var(--gold); color: var(--gold); }
.dice-result {
  text-align: center;
  font-family: var(--font-display);
  font-size: 56px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.dice-result.rolling { animation: shake .5s ease; }
.dice-result.crit { color: var(--gold); text-shadow: 0 0 24px rgba(201,164,92,.7); }
.dice-result.fail { color: var(--blood); }
.dice-comment {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  min-height: 22px;
  margin-bottom: 14px;
}
.dice-roll-btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: var(--gold);
  color: var(--bg);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}
.dice-roll-btn:hover { background: #D9B876; }
@keyframes shake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-14deg) scale(1.15); }
  50% { transform: rotate(10deg) scale(1.1); }
  75% { transform: rotate(-6deg) scale(1.05); }
}

/* ---------- Адаптив ---------- */

@media (max-width: 760px) {
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 20px;
    gap: 16px;
  }
  .nav.open { display: flex; }
  .nav-toggle {
    display: block;
    background: none;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    font-size: 20px;
    padding: 6px 12px;
    cursor: pointer;
  }
  .sched-item { grid-template-columns: 70px 36px 1fr; }
  .sched-item .seats { grid-column: 3; justify-self: start; }
  .section { padding: 52px 0; }
}

/* ---------- Расписание: таблица залов со свободными слотами ---------- */

.sched-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
@supports (overflow: clip) { @media (min-width: 760px) { .sched-table-wrap { overflow: hidden; } } }
.sched-table { width: 100%; border-collapse: collapse; min-width: 760px; font-size: 14px; }
.sched-table th, .sched-table td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }

/* Шапка: фоновая подложка под золото, названия залов — в цвет зала */
.sched-table thead th {
  background: rgba(201, 164, 92, .08);
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .02em;
}
.sched-table .th--fire { color: var(--fire); }
.sched-table .th--blood { color: var(--blood); }
.sched-table .th--neon { color: var(--neon); }
.sched-table .th--gold { color: var(--gold); }
.sched-table .sched-table__time {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: .04em;
  white-space: nowrap;
}

/* Колонка даты */
.sched-table td.sched-table__date { white-space: nowrap; }
.sched-table__day { font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--gold); line-height: 1; }
.sched-table__mon { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.sched-table__wd { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }

/* Слоты залов */
.slot { border-radius: 8px; padding: 8px 10px; height: 100%; }
.slot--event {
  border: 1px solid rgba(201, 164, 92, .4);
  background: rgba(201, 164, 92, .07);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  font-style: italic;
  font-size: 13px;
  line-height: 1.5;
}
.slot--free {
  border: none;
  padding: 4px 6px;
  opacity: .42;
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
}
.slot--busy { border: 1px solid; }
.slot--busy.slot--fire { border-color: rgba(224, 141, 60, .55); background: rgba(224, 141, 60, .07); }
.slot--busy.slot--blood { border-color: rgba(166, 27, 46, .6); background: rgba(166, 27, 46, .07); }
.slot--busy.slot--neon { border-color: rgba(63, 224, 176, .5); background: rgba(63, 224, 176, .07); }
.slot--busy.slot--gold { border-color: rgba(201, 164, 92, .55); background: rgba(201, 164, 92, .07); }
.slot__system { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; line-height: 1.25; }
.slot__master { color: var(--muted); font-size: 12px; margin-top: 4px; }
.slot__seats { margin-top: 8px; }
.slot .seats { font-size: 11px; padding: 3px 9px; }
.sched-table .seats--full { color: var(--blood); border-color: rgba(166, 27, 46, .55); }
.sicon--sm { width: 22px; height: 22px; flex: none; }
.sicon--sm svg { width: 100%; height: 100%; }

/* Мобильная версия: вкладки залов вместо широкой таблицы */
.sched-tabs, .sched-mobile { display: none; }

@media (max-width: 759px) {
  .sched-table-wrap.sched-table--desktop-wrap { display: none; }
  .sched-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 14px;
  }
  .sched-tab {
    padding: 10px 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: none;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: color .2s ease, border-color .2s ease, background .2s ease;
  }
  .sched-tab.is-active { border-color: var(--gold); color: var(--gold); background: rgba(201, 164, 92, .08); }
  .sched-mobile { display: block; overflow-x: auto; }
  .sched-mobile table.sched-table { min-width: 0; width: 100%; font-size: 13px; }
  .sched-mobile .sched-table th, .sched-mobile .sched-table td { padding: 8px 10px; }
  .sched-mobile .sched-table thead th { white-space: nowrap; }
  .sched-table__day { font-size: 21px; }
}
