/* ============================================================
   Общие стили сайта "The other side"
   Тёмная тема-заглушка. Фоны и точная разметка придут позже —
   замените значения в :root под свою палитру.
   ============================================================ */

:root {
  --bg: #0b0e14;            /* фон страниц */
  --fg: #dfe6f0;            /* основной текст */
  --muted: #7a8699;         /* второстепенный текст */
  --accent: #66ccaa;        /* акцент (кнопки, точки пинкода) */
  --panel: rgba(15, 20, 30, 0.72);
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* Полноэкранный canvas для three.js */
canvas.scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* --- Подсказка внизу экрана --- */
.hint {
  position: fixed;
  left: 0; right: 0;
  bottom: 8vh;
  text-align: center;
  color: var(--muted);
  font-size: 1rem;
  letter-spacing: 0.08em;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
  padding: 0 1rem;
}
.hint.visible { opacity: 1; }

/* --- Кнопка продолжения (сцена 2) --- */
.action-button {
  position: fixed;
  left: 50%;
  bottom: 6vh;
  transform: translate(-50%, 20px);
  padding: 0.9rem 2.4rem;
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.action-button.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}
.action-button:hover { filter: brightness(1.1); }

/* --- Затемнение при переходе между сценами --- */
.fade-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  transition: opacity 0.9s ease;
  z-index: 100;
  pointer-events: none;
}
.fade-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

/* --- Сцена 3: пинкод --- */
.pin-stage {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 1rem;
}
.pin-title {
  font-size: 1.1rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.pin-display {
  display: flex;
  gap: 1rem;
}
.pin-display .dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1px solid var(--muted);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.pin-display .dot.filled {
  background: var(--accent);
  border-color: var(--accent);
}
.pin-display.shake { animation: shake 0.4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  50% { transform: translateX(10px); }
  75% { transform: translateX(-6px); }
}
.pin-status {
  min-height: 1.4em;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.pin-status.ok { color: var(--accent); }
.pin-status.error { color: #d06a5a; }

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 4.2rem);
  gap: 0.7rem;
}
.key {
  height: 4.2rem;
  font-size: 1.4rem;
  color: var(--fg);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.key:hover { background: rgba(255, 255, 255, 0.1); }
.key:active { transform: scale(0.96); }
.key-fn { font-size: 1.1rem; color: var(--muted); }

/* --- Финальная страница: видео --- */
.video-stage {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
}
.video-title {
  font-size: 1rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 2rem;
}
.video-mount {
  width: min(1100px, 100%);
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.video-mount iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.video-placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--muted);
  text-align: center;
  padding: 1rem;
}
.video-placeholder .small { font-size: 0.85rem; }
.video-placeholder code { color: var(--accent); }
