/* ==========================================================================
   結婚祝福会 — Kanata & Shiho
   Minimal Off-White (#FAF8F4) × Antique Gold (#B8965A) × 細いひも (1.0)
   100% Offline Local Fonts + True 1920x1080 Responsive Coordinate System
   ========================================================================== */

@font-face {
  font-family: 'Shippori Mincho';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url('../assets/fonts/ShipporiMincho-Regular.ttf') format('truetype');
}

@font-face {
  font-family: 'Noto Sans JP';
  font-style: normal;
  font-weight: 100 900;
  font-display: block;
  src: url('../assets/fonts/NotoSansJP-VF.ttf') format('truetype');
}

:root {
  --bg: #FAF8F4;
  --bg-letterbox: #F3EFE8;
  --ink: #2C2A27;
  --muted: #787166;
  --romaji: #7E776B;
  --gold: #B8965A;
  --gold-soft: rgba(184, 150, 90, 0.36);
  --thread-width: 1.0;

  --font-mincho: 'Shippori Mincho', 'YuMincho', 'Hiragino Mincho ProN', serif;
  --font-sans: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-letterbox);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Stage Viewport & 1920x1080 Precision Scaler
   ========================================================================== */

.deck-viewport {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-letterbox);
  overflow: hidden;
}

.deck-viewport.cursor-hidden {
  cursor: none;
}

.slide-stage {
  position: relative;
  width: 1920px;
  height: 1080px;
  flex-shrink: 0;
  background-color: var(--bg);
  overflow: hidden;
  transform-origin: center center;
  box-shadow: 0 24px 80px rgba(44, 42, 39, 0.08);
}

/* Warm washi paper ambient sheen */
.slide-stage::before,
.slide-layer::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 18% 18%, rgba(255, 253, 248, 0.78) 0%, transparent 58%),
    radial-gradient(ellipse at 86% 84%, rgba(226, 214, 195, 0.24) 0%, transparent 65%);
  pointer-events: none;
  z-index: 1;
}

/* ==========================================================================
   Slide Layers & Restrained Transitions
   ========================================================================== */

.slide-layer {
  position: absolute;
  inset: 0;
  width: 1920px;
  height: 1080px;
  background-color: var(--bg);
  opacity: 0;
  transition: opacity 620ms cubic-bezier(0.25, 0.1, 0.25, 1);
  pointer-events: none;
}

.slide-layer.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 5;
}

.slide-layer.is-exiting {
  opacity: 0;
  z-index: 4;
}

.slide-content {
  position: relative;
  z-index: 12;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 680ms cubic-bezier(0.22, 1, 0.36, 1) 140ms,
    transform 760ms cubic-bezier(0.22, 1, 0.36, 1) 140ms;
}

.slide-layer.is-active .slide-content,
.slide-layer.is-static .slide-content {
  opacity: 1;
  transform: translateY(0);
}

.slide-layer.is-static {
  opacity: 1;
  transition: none;
}

.slide-layer.is-static .slide-content {
  transition: none;
}

/* ==========================================================================
   SVG Thin Gold Thread ("細いひも" — 1.0px hairline on 1600x900 viewBox)
   ========================================================================== */

.thread-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 18;
}

.gold-path {
  fill: none;
  stroke: var(--gold);
  stroke-width: var(--thread-width);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gold-path-secondary {
  fill: none;
  stroke: var(--gold);
  stroke-width: 0.65;
  stroke-opacity: 0.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.slide-layer.is-active.animate-draw .gold-path,
.slide-layer.is-active.animate-draw .gold-path-secondary {
  stroke-dasharray: 2800;
  stroke-dashoffset: 2800;
  animation: drawGoldThread 1220ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.slide-layer.is-active.animate-draw .gold-path-secondary {
  animation-delay: 160ms;
}

@keyframes drawGoldThread {
  to {
    stroke-dashoffset: 0;
  }
}

/* ==========================================================================
   Photo Integration Layers (Plan A: Soft Veil / Plan B: Gallery Frame)
   ========================================================================== */

.photo-full {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
}

.photo-veil {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.photo-veil--silk {
  background: linear-gradient(
    102deg,
    rgba(250, 248, 244, 0.89) 0%,
    rgba(250, 248, 244, 0.74) 52%,
    rgba(250, 248, 244, 0.36) 100%
  );
}

.photo-veil--silk-center {
  background: radial-gradient(
    ellipse at 44% 50%,
    rgba(250, 248, 244, 0.86) 0%,
    rgba(250, 248, 244, 0.66) 58%,
    rgba(250, 248, 244, 0.38) 100%
  );
}

.photo-veil--lace {
  background: radial-gradient(
    ellipse at center,
    rgba(250, 248, 244, 0.90) 0%,
    rgba(250, 248, 244, 0.62) 100%
  );
}

.photo-veil--lace-lyrics {
  background: radial-gradient(
    ellipse at center,
    rgba(250, 248, 244, 0.93) 0%,
    rgba(250, 248, 244, 0.72) 100%
  );
}

/* Plan B: Editorial Gallery Frame */
.gallery-frame {
  position: absolute;
  z-index: 6;
  overflow: hidden;
  box-shadow: 0 26px 70px rgba(44, 42, 39, 0.09);
}

.gallery-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-hairline {
  position: absolute;
  z-index: 4;
  border: 1px solid var(--gold-soft);
  pointer-events: none;
}

.gallery-frame--right {
  top: 146px;
  right: 150px;
  width: 816px;
  height: 788px;
}

.gallery-hairline--right {
  top: 170px;
  right: 126px;
  width: 816px;
  height: 788px;
}

.gallery-frame--left {
  top: 146px;
  left: 150px;
  width: 792px;
  height: 788px;
}

.gallery-hairline--left {
  top: 170px;
  left: 174px;
  width: 792px;
  height: 788px;
}

/* ==========================================================================
   Typography & Slide Layout Archetypes (1920x1080 exact proportions)
   ========================================================================== */

.font-mincho {
  font-family: var(--font-mincho);
}

.font-sans {
  font-family: var(--font-sans);
}

/* 1. Cover & Closing (Photo 1 Plan A + Alphabet Minimal "Kanata & Shiho") */
.layout-cover {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 224px;
  padding-right: 680px;
  padding-bottom: 42px;
}

.cover-kicker {
  font-family: var(--font-mincho);
  font-size: 27px;
  font-weight: 400;
  letter-spacing: 0.44em;
  color: var(--muted);
  margin-bottom: 34px;
}

.cover-names {
  font-family: var(--font-mincho);
  font-size: 98px;
  font-weight: 400;
  letter-spacing: 0.13em;
  line-height: 1.15;
  color: var(--ink);
}

.cover-amp {
  color: var(--gold);
  font-style: italic;
  font-size: 0.86em;
  margin: 0 0.12em;
}

/* 2. Centered Minimal / Veil Title Slides */
.layout-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: 44px;
}

.title-main {
  font-family: var(--font-mincho);
  font-size: 76px;
  font-weight: 400;
  letter-spacing: 0.30em;
  text-indent: 0.30em;
  line-height: 1.35;
  color: var(--ink);
}

.title-main--games {
  font-family: var(--font-mincho);
  font-size: 94px;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  color: var(--ink);
}

/* 2b. Quiz Prompt Slides (Noto Sans JP, generous breathing room, zero numbers/labels) */
.layout-quiz {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 210px 76px;
}

.quiz-question {
  font-family: var(--font-sans);
  font-size: 62px;
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.72;
  color: var(--ink);
}

/* 3. Gallery Split Title Slides (Plan B Left/Right) */
.layout-split-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 186px;
  padding-right: 1030px;
}

.layout-split-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 1054px;
  padding-right: 150px;
}

.title-split {
  font-family: var(--font-mincho);
  font-size: 68px;
  font-weight: 400;
  letter-spacing: 0.26em;
  line-height: 1.4;
  color: var(--ink);
}

/* 4. Praise Lyrics Slide (Plan L3: Left JP + Furigana, Lower-Right Upright Romaji lifted gently) */
.layout-lyrics {
  position: relative;
  width: 100%;
  height: 100%;
}

.lyrics-jp-column {
  position: absolute;
  top: 50%;
  left: 148px;
  transform: translateY(-53%);
  width: 1180px;
  font-family: var(--font-sans);
  font-size: 36px;
  font-weight: 400;
  line-height: 2.24;
  letter-spacing: 0.055em;
  color: var(--ink);
  text-align: left;
}

.lyrics-jp-column p + p {
  margin-top: 12px;
}

.lyrics-jp-column ruby {
  ruby-align: center;
}

.lyrics-jp-column rt {
  font-size: 0.43em;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #746D62;
}

.lyrics-gold-line {
  color: var(--gold);
  font-weight: 500;
  letter-spacing: 0.11em;
}

/* Lower-right anchored upright Romaji, lifted comfortably above the bottom gold thread */
.lyrics-romaji-block {
  position: absolute;
  right: 112px;
  bottom: 158px;
  width: 780px;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 25px;
  font-weight: 400;
  line-height: 1.72;
  letter-spacing: 0.02em;
  color: var(--romaji);
  text-align: right;
  opacity: 0.90;
}

.lyrics-romaji-block p + p {
  margin-top: 4px;
}

.lyrics-romaji-block .is-gold {
  color: var(--gold);
  opacity: 0.92;
}

/* ==========================================================================
   Operator Overlays: Blackout (B), Standby (W), Quick Jump Drawer (G)
   ========================================================================== */

.mode-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 420ms ease;
}

.mode-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.mode-overlay--blackout {
  background-color: #0B0A09;
}

.mode-overlay--standby {
  background-color: var(--bg);
}

.mode-overlay--standby::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(255, 253, 248, 0.78) 0%, transparent 60%),
    radial-gradient(ellipse at 85% 85%, rgba(226, 214, 195, 0.24) 0%, transparent 65%);
}

/* Subtle bottom-right floating operator hint (auto-hides on idle) */
.operator-hud {
  position: fixed;
  right: 20px;
  bottom: 16px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(44, 42, 39, 0.76);
  color: rgba(250, 248, 244, 0.92);
  font-size: 12px;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 260ms ease, transform 260ms ease;
  pointer-events: none;
}

.operator-hud.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.operator-hud button {
  background: rgba(255, 255, 255, 0.12);
  color: #FAF8F4;
  border: none;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 150ms ease;
}

.operator-hud button:hover {
  background: rgba(184, 150, 90, 0.55);
}

/* Single-screen Quick Jump Overlay (G) */
.jump-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(20, 19, 17, 0.64);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.jump-drawer-backdrop.is-open {
  display: flex;
}

.jump-drawer {
  width: 100%;
  max-width: 960px;
  max-height: 86vh;
  background: #1C1B19;
  color: #F4F1EA;
  border: 1px solid rgba(184, 150, 90, 0.30);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.jump-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
}

.jump-drawer-grid {
  padding: 16px 20px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.jump-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  color: #F4F1EA;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: border-color 150ms ease, background 150ms ease;
}

.jump-item:hover {
  background: rgba(184, 150, 90, 0.16);
  border-color: rgba(184, 150, 90, 0.65);
}

.jump-item.is-current {
  background: rgba(184, 150, 90, 0.24);
  border-color: #B8965A;
}

.jump-item-meta {
  font-size: 11px;
  color: rgba(244, 241, 234, 0.58);
  display: flex;
  justify-content: space-between;
}

.jump-item-title {
  font-size: 14px;
  font-weight: 500;
}
