/* CHERNOV MUSEUM — UI поверх 3D */

@font-face {
  font-family: 'Bw Gradual';
  src: url('../../assets/fonts/bw-gradual-medium.woff2') format('woff2');
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: 'Craftwork Grotesk';
  src: url('../../assets/fonts/craftwork-semibold.woff2') format('woff2');
  font-weight: 600; font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('../../assets/fonts/manrope-regular.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('../../assets/fonts/manrope-semibold.woff2') format('woff2');
  font-weight: 600; font-display: swap;
}

:root {
  --ink: #060605;
  --paper: #f2f0ea;
  --gold: #d4af37;
  --gold-soft: #e8cf7a;
  --emerald: #0d2b22;
  --acid: #d7ff00;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; overflow: hidden; background: var(--ink); }
body { font-family: 'Manrope', system-ui, sans-serif; color: var(--paper); }
body.comic, body.comic * { font-family: 'Comic Sans MS', 'Comic Sans', cursive !important; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- Ар-деко рамка (общая) ---------- */
.deco-line {
  height: 3px; width: min(420px, 70%);
  margin: 26px auto;
  background:
    radial-gradient(circle at center, var(--gold) 0 30%, transparent 31%) center/9px 9px no-repeat,
    linear-gradient(90deg, transparent, var(--gold) 18%, var(--gold) 82%, transparent);
  position: relative;
}
.deco-line::before, .deco-line::after {
  content: ''; position: absolute; top: 50%; width: 34px; height: 11px; transform: translateY(-50%);
  background:
    linear-gradient(var(--gold), var(--gold)) center/100% 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) center 0/60% 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) center 100%/60% 1px no-repeat;
}
.deco-line::before { left: -46px; }
.deco-line::after  { right: -46px; }

/* ---------- Интро ---------- */
.intro {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background:
    radial-gradient(1200px 700px at 50% 118%, rgba(212,175,55,.14), transparent 60%),
    radial-gradient(900px 500px at 50% -10%, rgba(13,43,34,.9), transparent 70%),
    var(--ink);
  transition: opacity .8s ease, visibility .8s;
}
.intro.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-frame {
  text-align: center; padding: 48px 64px; max-width: 720px;
  border: 1px solid rgba(212,175,55,.35);
  outline: 1px solid rgba(212,175,55,.15);
  outline-offset: 6px;
  background: rgba(6,6,5,.55);
  backdrop-filter: blur(6px);
}
.intro-kicker, .stub-kicker {
  font-size: 13px; letter-spacing: .34em; text-transform: uppercase;
  color: var(--gold-soft); margin-bottom: 18px;
}
.intro-title {
  font-family: 'Bw Gradual', serif; font-weight: 500;
  font-size: clamp(48px, 8vw, 92px); line-height: .98;
  letter-spacing: .04em; color: var(--paper);
  text-shadow: 0 0 42px rgba(212,175,55,.35);
}
.intro-sub { margin-top: 18px; color: rgba(242,240,234,.66); font-size: 15px; letter-spacing: .06em; }

.intro-load { margin-top: 34px; }
.intro-load .bar {
  width: min(380px, 80%); height: 2px; margin: 0 auto 12px;
  background: rgba(242,240,234,.14); position: relative; overflow: hidden;
}
.intro-load .bar i {
  position: absolute; inset: 0; width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  transition: width .3s ease;
}
.intro-load span { font-size: 12px; letter-spacing: .12em; color: rgba(242,240,234,.5); }

.intro-enter {
  margin-top: 34px; padding: 16px 54px;
  font: 600 15px/1 'Craftwork Grotesk', sans-serif; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink); background: linear-gradient(120deg, var(--gold), var(--gold-soft), var(--gold));
  border: none; cursor: pointer; transition: transform .25s ease, box-shadow .25s ease;
  box-shadow: 0 0 0 1px rgba(212,175,55,.6), 0 12px 40px rgba(212,175,55,.25);
}
.intro-enter:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 0 0 1px var(--gold), 0 18px 50px rgba(212,175,55,.4); }

.intro-controls {
  margin-top: 26px; display: flex; gap: 18px; justify-content: center; flex-wrap: wrap;
  font-size: 12.5px; color: rgba(242,240,234,.55);
}
.intro-controls b { color: var(--gold-soft); font-weight: 600; }

/* ---------- Заглушка (мобильные) ---------- */
.stub {
  position: fixed; inset: 0; z-index: 100; overflow: auto;
  display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 500px at 50% 115%, rgba(212,175,55,.16), transparent 60%),
    var(--ink);
}
.stub-frame {
  max-width: 460px; text-align: center; padding: 40px 28px;
  border: 1px solid rgba(212,175,55,.4);
}
.stub-deco {
  height: 26px; margin-bottom: 26px;
  background:
    radial-gradient(circle at 50% 100%, transparent 8px, rgba(212,175,55,.5) 8px 9px, transparent 10px) center/28px 100% repeat-x;
}
.stub-deco.flip { transform: scaleY(-1); margin: 26px 0 0; }
.stub-title { font-family: 'Craftwork Grotesk', sans-serif; font-size: 26px; line-height: 1.2; margin-bottom: 16px; }
.stub-text { color: rgba(242,240,234,.68); font-size: 14.5px; line-height: 1.6; margin-bottom: 12px; }
.stub-url {
  font-family: 'Craftwork Grotesk', monospace; color: var(--gold-soft);
  font-size: 15px; letter-spacing: .04em; margin-bottom: 26px; user-select: all;
}
.stub-btn {
  display: inline-block; padding: 13px 30px; color: var(--ink);
  background: var(--gold); text-decoration: none;
  font: 600 13px/1 'Craftwork Grotesk', sans-serif; letter-spacing: .14em; text-transform: uppercase;
}

/* ---------- HUD ---------- */
.hud { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.crosshair {
  position: absolute; left: 50%; top: 50%; width: 6px; height: 6px;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: rgba(242,240,234,.85);
  box-shadow: 0 0 8px rgba(0,0,0,.6);
  transition: width .18s ease, height .18s ease, background .18s ease;
}
.crosshair.hot {
  width: 14px; height: 14px; background: transparent;
  border: 2px solid var(--acid); box-shadow: 0 0 14px rgba(215,255,0,.5);
}
.hint {
  position: absolute; left: 50%; top: calc(50% + 34px); transform: translateX(-50%);
  font-size: 13px; letter-spacing: .08em; color: var(--paper);
  background: rgba(6,6,5,.72); padding: 7px 16px; border: 1px solid rgba(212,175,55,.35);
  opacity: 0; transition: opacity .18s ease; white-space: nowrap;
}
.hint.on { opacity: 1; }
.room-label {
  position: absolute; left: 26px; bottom: 22px;
  font: 600 12px/1 'Craftwork Grotesk', sans-serif; letter-spacing: .26em; text-transform: uppercase;
  color: rgba(242,240,234,.55);
  border-left: 2px solid var(--gold); padding-left: 12px;
}
.toast {
  position: absolute; left: 50%; top: 12%; transform: translateX(-50%) translateY(-8px);
  font-family: 'Craftwork Grotesk', sans-serif; font-size: clamp(22px, 3vw, 34px);
  letter-spacing: .14em; text-transform: uppercase; text-align: center;
  color: var(--paper); text-shadow: 0 2px 30px rgba(0,0,0,.7);
  opacity: 0; transition: opacity .5s ease, transform .5s ease; white-space: pre-line;
}
.toast small { display: block; font-size: .42em; letter-spacing: .3em; color: var(--gold-soft); margin-top: 8px; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.map {
  position: absolute; right: 26px; top: 50%; transform: translateY(-50%);
  width: min(330px, 26vw); height: auto;
  border: 1px solid rgba(212,175,55,.35); border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
}

/* ---------- Инфо-панель ---------- */
.info {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 40;
  width: min(430px, 92vw); padding: 54px 40px;
  background: rgba(8,9,8,.92); backdrop-filter: blur(14px);
  border-left: 1px solid rgba(212,175,55,.4);
  transform: translateX(100%); transition: transform .45s cubic-bezier(.22,.8,.24,1);
  display: flex; flex-direction: column; overflow-y: auto;
}
.info.open { transform: translateX(0); }
.info-close {
  position: absolute; top: 18px; right: 18px; width: 40px; height: 40px;
  background: none; border: 1px solid rgba(242,240,234,.25); color: var(--paper);
  font-size: 16px; cursor: pointer; transition: border-color .2s, color .2s;
}
.info-close:hover { border-color: var(--acid); color: var(--acid); }
.info-kicker { font-size: 11.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold-soft); margin-bottom: 14px; }
.info-title { font-family: 'Craftwork Grotesk', sans-serif; font-size: 30px; line-height: 1.12; margin-bottom: 18px; }
.info-desc { color: rgba(242,240,234,.72); font-size: 15px; line-height: 1.65; }
.info-actions { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; }
.info-actions a, .info-actions button {
  display: block; width: 100%; padding: 14px 18px; text-align: center; cursor: pointer;
  font: 600 13px/1 'Craftwork Grotesk', sans-serif; letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; transition: transform .2s ease, background .2s ease, color .2s ease;
}
.info-actions .primary { background: var(--acid); color: var(--ink); border: none; }
.info-actions .primary:hover { transform: translateY(-2px); }
.info-actions .ghost { background: none; color: var(--paper); border: 1px solid rgba(242,240,234,.3); }
.info-actions .ghost:hover { border-color: var(--acid); color: var(--acid); }
.info-actions .danger { background: none; color: #ff6b6b; border: 1px dashed rgba(255,107,107,.5); }
.info-actions .danger:hover { background: rgba(255,107,107,.12); }

/* ---------- Пауза ---------- */
.pause {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: rgba(6,6,5,.78); backdrop-filter: blur(8px);
}
.pause-card { text-align: center; padding: 46px 60px; border: 1px solid rgba(212,175,55,.4); background: rgba(6,6,5,.6); }
.pause-card h2 {
  font-family: 'Bw Gradual', 'Craftwork Grotesk', serif; font-size: 40px; letter-spacing: .08em;
  color: var(--gold-soft); margin-bottom: 26px;
}
.pause-card button {
  display: block; width: 100%; margin-bottom: 12px; padding: 15px 40px; cursor: pointer;
  font: 600 14px/1 'Craftwork Grotesk', sans-serif; letter-spacing: .16em; text-transform: uppercase;
  background: var(--gold); border: none; color: var(--ink);
}
.pause-card a {
  display: block; padding: 13px 40px; color: var(--paper); text-decoration: none;
  font: 600 12.5px/1 'Craftwork Grotesk', sans-serif; letter-spacing: .16em; text-transform: uppercase;
  border: 1px solid rgba(242,240,234,.3);
}
.pause-card a:hover { border-color: var(--acid); color: var(--acid); }
.pause-controls { margin-top: 22px; font-size: 12px; color: rgba(242,240,234,.5); }
.pause-controls b { color: var(--gold-soft); }
.credits { margin-top: 18px; max-width: 360px; font-size: 10.5px; line-height: 1.6; color: rgba(242,240,234,.34); }

/* ---------- Вспышка камеры ---------- */
.flash {
  position: fixed; inset: 0; z-index: 55; background: #fff; opacity: 0; pointer-events: none;
  transition: opacity .09s ease;
}
.flash.on { opacity: .96; }

@media (max-width: 720px) {
  .intro-frame { padding: 34px 22px; }
  .info { padding: 46px 26px; }
}
