/* ==========================================================================
   THE GODFATHER (BABA) - SİNEMATİK REPLİK TİYATROSU
   Resmi Logo | Kuyruklu Piyano | Origami Gemiye Dönüşen Parşömen & Mermi
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;800;900&family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500;1,600;1,700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --bg-dark: #040406;
  --gold-primary: #c5a059;
  --gold-light: #f5e2be;
  --gold-dark: #8c6f33;
  --gold-glow: rgba(212, 175, 55, 0.35);

  --crimson-primary: #8b0000;
  --crimson-vivid: #b81414;
  --crimson-glow: rgba(184, 20, 20, 0.55);

  --ink-black: #140d07;
  --ink-secondary: #48321d;
  --ink-red: #7d0e0e;

  --font-title: 'Cinzel', Georgia, serif;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', sans-serif;

  --transition: all 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-sans);
  color: #f5f0e6;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* ---------------- Parçacık Tuvali (Mermiler & Gül Yaprakları) ---------------- */
#godfather-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 10;
}

/* Sinematik Vignette & Gölge */
.cinematic-vignette {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.92) 100%);
  pointer-events: none;
  z-index: 15;
}

.puppet-strings-bg {
  position: fixed;
  top: 0;
  right: 14%;
  width: 420px;
  height: 100%;
  opacity: 0.08;
  pointer-events: none;
  background-image: repeating-linear-gradient(90deg, var(--gold-primary) 0, var(--gold-primary) 1.5px, transparent 0, transparent 40px);
  mask-image: linear-gradient(to bottom, black 20%, transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, black 20%, transparent 85%);
  z-index: 5;
}

/* ---------------- Ana Düzen (Full Viewport) ---------------- */
.theater-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 24px 40px;
  z-index: 20;
}

/* ---------------- Üst Bar (Header) ---------------- */
.theater-header {
  width: 100%;
  max-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Sol Üst: Resmi The Godfather Film Logosu */
.godfather-movie-logo {
  display: inline-block;
  cursor: default;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 15px rgba(197, 160, 89, 0.2));
  transition: var(--transition);
}

.godfather-movie-logo:hover {
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 25px rgba(212, 175, 55, 0.45));
}

.godfather-logo-svg {
  height: 65px;
  width: auto;
  display: block;
}

/* Sağ Üst: Küçük Kuyruklu Piyano Butonu */
.piano-btn-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-grand-piano {
  background: rgba(18, 18, 24, 0.85);
  border: 1.5px solid rgba(197, 160, 89, 0.35);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.7);
  position: relative;
}

.btn-grand-piano:hover {
  border-color: var(--gold-primary);
  background: rgba(28, 28, 38, 0.95);
  box-shadow: 0 0 25px rgba(197, 160, 89, 0.4), 0 5px 20px rgba(0, 0, 0, 0.8);
  transform: translateY(-2px);
}

.grand-piano-svg {
  width: 48px;
  height: 40px;
  display: block;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.8));
}

.btn-grand-piano:hover .grand-piano-svg {
  transform: scale(1.05);
}

.btn-grand-piano.playing {
  border-color: var(--gold-primary);
  background: linear-gradient(145deg, rgba(35, 25, 15, 0.95) 0%, rgba(15, 12, 9, 0.95) 100%);
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.45), inset 0 0 15px rgba(212, 175, 55, 0.2);
}

.piano-music-notes {
  position: absolute;
  top: -16px;
  right: -6px;
  pointer-events: none;
  opacity: 0;
  display: flex;
  gap: 4px;
  font-size: 0.9rem;
  color: var(--gold-light);
  transition: opacity 0.3s ease;
}

.btn-grand-piano.playing .piano-music-notes {
  opacity: 1;
  animation: floatNotes 2s ease-in-out infinite alternate;
}

@keyframes floatNotes {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-6px) rotate(8deg); }
}

/* ---------------- ESKİ PARŞÖMEN KAĞIT (QUOTE CARD) ---------------- */
.theater-center {
  width: 100%;
  max-width: 960px;
  text-align: center;
  position: relative;
  perspective: 1400px;
}

/* Eski Kağıt Görünümü */
.quote-card.parchment-paper {
  position: relative;
  background: radial-gradient(circle at 50% 50%, #f6edd9 0%, #edd9b5 45%, #d9bc8c 75%, #a67c46 92%, #4a2d10 100%);
  color: var(--ink-black);
  border: 2px solid #5e3b16;
  border-radius: 6px 24px 8px 28px / 26px 8px 25px 9px;
  padding: 60px 65px 50px;
  box-shadow: 
    inset 0 0 50px rgba(78, 44, 15, 0.75),
    inset 0 0 20px rgba(35, 17, 5, 0.9),
    0 25px 70px rgba(0, 0, 0, 0.95),
    0 0 35px rgba(0, 0, 0, 0.8);
  transform-origin: center center;
  transform-style: preserve-3d;
  clip-path: polygon(0% 0%, 50% 0%, 100% 0%, 100% 50%, 100% 100%, 50% 100%, 0% 100%, 0% 50%);
  transition: box-shadow 0.3s ease;
}

/* Yanık Kenar ve Damga Çerçevesi */
.quote-card.parchment-paper::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(82, 47, 17, 0.35);
  pointer-events: none;
  border-radius: 4px;
  transition: opacity 0.15s ease;
}

/* Balmumu Mühür (Wax Seal) */
.parchment-wax-seal {
  position: absolute;
  top: -24px;
  right: 45px;
  width: 52px;
  height: 52px;
  background: radial-gradient(circle at 35% 35%, #b51515 0%, #7a0000 65%, #420000 100%);
  border: 2px solid #ff4d4d;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.8), inset 0 2px 4px rgba(255, 255, 255, 0.3);
  transform: rotate(-12deg);
  z-index: 5;
  transition: opacity 0.15s ease;
}

.parchment-wax-seal i {
  color: #ffcccc;
  font-size: 1.4rem;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
}

/* Eski Kağıt Başlık Damgası */
.parchment-stamp {
  font-family: var(--font-title);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  font-weight: 800;
  color: var(--ink-red);
  text-transform: uppercase;
  margin-bottom: 22px;
  opacity: 0.85;
  border-bottom: 1px solid rgba(128, 14, 14, 0.25);
  display: inline-block;
  padding-bottom: 4px;
  transition: opacity 0.15s ease;
}

/* Türkçe Replik Metni (Eski Mürekkep) */
.quote-text-main {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  font-style: italic;
  font-weight: 700;
  color: var(--ink-black);
  line-height: 1.45;
  margin-bottom: 18px;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease;
}

/* İngilizce Orijinal Replik */
.quote-text-en {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-style: italic;
  color: var(--ink-secondary);
  margin-bottom: 28px;
  letter-spacing: 0.03em;
  font-weight: 600;
  transition: opacity 0.15s ease;
}

/* Konuşmacı ve Sahne Bilgisi */
.quote-speaker-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-top: 1px solid rgba(82, 47, 17, 0.2);
  padding-top: 18px;
  transition: opacity 0.15s ease;
}

.quote-speaker-name {
  font-family: var(--font-title);
  font-size: 1.25rem;
  letter-spacing: 0.22em;
  color: var(--ink-red);
  text-transform: uppercase;
  font-weight: 800;
}

.quote-scene-context {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  color: #634b35;
  text-transform: uppercase;
  font-weight: 600;
}

/* ==========================================================================
   ORIGAMI GEMİYE DÖNÜŞÜP SÜZÜLME ANİMASYONU (ORIGAMI BOAT VOYAGE)
   ========================================================================== */
.quote-card.parchment-paper.origami-boat-sail {
  animation: origamiBoatSail 0.90s cubic-bezier(0.28, 0.85, 0.35, 1) forwards;
  pointer-events: none;
}

/* Katlanırken yazılar, damga ve balmumu mühür hızla kaybolur */
.quote-card.parchment-paper.origami-boat-sail * {
  opacity: 0 !important;
  transition: opacity 0.12s ease !important;
}

.quote-card.parchment-paper.origami-boat-sail::before {
  opacity: 0 !important;
}

/* Origami kağıt katlama ve yelken gölge çizgileri (Paper Creases) */
.quote-card.parchment-paper.origami-boat-sail::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: 
    linear-gradient(135deg, rgba(0, 0, 0, 0.32) 0%, transparent 48%, rgba(255, 255, 255, 0.4) 50%, rgba(0, 0, 0, 0.28) 52%, transparent 100%),
    linear-gradient(to bottom, transparent 49%, rgba(45, 22, 7, 0.45) 53%, transparent 57%);
  opacity: 0.95;
  transition: opacity 0.2s ease;
}

@keyframes origamiBoatSail {
  0% {
    /* 1. Başlangıç: Tam açılmış parşömen kağıdı */
    transform: perspective(1200px) rotateX(0deg) rotateY(0deg) scale(1) translateY(0) translateX(0);
    clip-path: polygon(0% 0%, 50% 0%, 100% 0%, 100% 50%, 100% 100%, 50% 100%, 0% 100%, 0% 50%);
    box-shadow: inset 0 0 50px rgba(78, 44, 15, 0.75), 0 25px 70px rgba(0, 0, 0, 0.95);
    opacity: 1;
  }
  20% {
    /* 2. Dikey Eksende Katlanma: Kağıt ikiye bükülür */
    transform: perspective(1200px) rotateY(-32deg) scale(0.72) translateY(-8px) translateX(0);
    clip-path: polygon(20% 8%, 50% 4%, 80% 8%, 92% 50%, 82% 90%, 50% 92%, 18% 90%, 8% 50%);
    box-shadow: inset 0 35px 50px rgba(35, 18, 6, 0.85), 0 15px 40px rgba(0, 0, 0, 0.8);
    opacity: 0.98;
  }
  42% {
    /* 3. Köşeler İçe Katlanır: Üçgen şapka origami aşaması */
    transform: perspective(1200px) rotateX(20deg) scale(0.52) translateY(6px) translateX(10px);
    clip-path: polygon(50% 6%, 50% 6%, 86% 50%, 78% 88%, 50% 90%, 22% 88%, 14% 50%, 50% 6%);
    box-shadow: inset 0 20px 30px rgba(35, 18, 6, 0.8), 0 12px 30px rgba(0, 0, 0, 0.85);
    opacity: 1;
  }
  56% {
    /* 4. Tam Origami Gemiye Dönüşme: Yelken dikleşir, gövde açılır */
    transform: perspective(1200px) rotate(-4deg) scale(0.38) translateY(12px) translateX(25px);
    clip-path: polygon(50% 8%, 62% 52%, 95% 54%, 76% 88%, 50% 88%, 24% 88%, 5% 54%, 38% 52%);
    box-shadow: inset 0 15px 25px rgba(25, 12, 4, 0.7), 0 10px 25px rgba(0, 0, 0, 0.85);
    opacity: 1;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.85));
  }
  72% {
    /* 5. Gemi Suda Hafifçe Dalgalanır ve Rüzgarı Alır */
    transform: perspective(1200px) rotate(4deg) scale(0.38) translateY(4px) translateX(120px);
    clip-path: polygon(50% 8%, 62% 52%, 95% 54%, 76% 88%, 50% 88%, 24% 88%, 5% 54%, 38% 52%);
    opacity: 1;
    filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.8));
  }
  100% {
    /* 6. Gemi Sağa Doğru Hızla ve Zarifçe Süzülerek Ekrandan Çıkar */
    transform: perspective(1200px) rotate(7deg) scale(0.32) translateY(-40px) translateX(1200px);
    clip-path: polygon(50% 8%, 62% 52%, 95% 54%, 76% 88%, 50% 88%, 24% 88%, 5% 54%, 38% 52%);
    opacity: 0;
  }
}

/* Yeni Kağıdın Pürüzsüzce Açılması */
.quote-card.parchment-paper.unfolding {
  animation: unfoldNewPaper 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes unfoldNewPaper {
  0% {
    opacity: 0;
    transform: perspective(1200px) scale(0.82) translateY(28px) rotateX(12deg);
    clip-path: polygon(4% 4%, 50% 0%, 96% 4%, 100% 50%, 96% 96%, 50% 100%, 4% 96%, 0% 50%);
  }
  100% {
    opacity: 1;
    transform: perspective(1200px) scale(1) translateY(0) rotateX(0deg);
    clip-path: polygon(0% 0%, 50% 0%, 100% 0%, 100% 50%, 100% 100%, 50% 100%, 0% 100%, 0% 50%);
    box-shadow: inset 0 0 50px rgba(78, 44, 15, 0.75), 0 25px 70px rgba(0, 0, 0, 0.95);
  }
}

/* ==========================================================================
   İLERLEYEN ALTIN MERMİ GÖSTERGESİ (TRAVELING BULLET TIMELINE)
   ========================================================================== */
.bullet-trajectory-wrapper {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 20px;
  position: relative;
}

.trajectory-track {
  width: 100%;
  height: 3px;
  background: rgba(197, 160, 89, 0.2);
  border-radius: 2px;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
}

.tracer-line {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(139, 0, 0, 0.2) 0%, #b81414 50%, #d4af37 100%);
  box-shadow: 0 0 10px #d4af37, 0 0 20px #ff3700;
  border-radius: 2px;
  transition: width 0.08s linear;
}

.traveling-bullet {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.8)) drop-shadow(0 0 18px rgba(255, 69, 0, 0.6));
  transition: left 0.08s linear;
}

.traveling-bullet svg {
  display: block;
}

/* ---------------- Alt Kontroller & Mermi Navigasyon Butonları ---------------- */
.theater-footer {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.nav-buttons-group {
  display: flex;
  align-items: center;
  gap: 20px;
}

.btn-bullet-nav {
  width: 68px;
  height: 48px;
  background: rgba(16, 16, 22, 0.88);
  border: 1px solid rgba(197, 160, 89, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
  padding: 0 8px;
}

.btn-bullet-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(212, 175, 55, 0.15), transparent 70%);
  opacity: 0;
  transition: var(--transition);
}

.btn-bullet-nav:hover {
  border-color: var(--gold-primary);
  box-shadow: 0 0 25px rgba(197, 160, 89, 0.45);
  background: rgba(25, 25, 34, 0.95);
  transform: translateY(-2px);
}

.btn-bullet-nav:hover::before {
  opacity: 1;
}

.bullet-svg {
  transition: transform 0.25s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.bullet-left {
  transform: scaleX(-1);
}

.btn-bullet-nav:hover .bullet-left {
  transform: scaleX(-1) translateX(4px);
}

.btn-bullet-nav:hover .bullet-right {
  transform: translateX(4px);
}

.btn-bullet-nav:active {
  transform: scale(0.95);
}

.btn-play-pause {
  padding: 12px 28px;
  background: rgba(18, 18, 24, 0.85);
  border: 1px solid rgba(197, 160, 89, 0.35);
  color: #f5f0e6;
  font-family: var(--font-title);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-play-pause:hover {
  border-color: var(--crimson-vivid);
  background: rgba(139, 0, 0, 0.3);
  color: #ffffff;
}

.keyboard-hint {
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  color: #807769;
  text-transform: uppercase;
}

.keyboard-hint kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 2px 6px;
  border-radius: 2px;
  color: var(--gold-light);
}

/* ---------------- Responsive ---------------- */
@media (max-width: 768px) {
  .theater-container {
    padding: 18px 14px;
  }
  .godfather-logo-svg {
    height: 48px;
  }
  .quote-card.parchment-paper {
    padding: 45px 22px 30px;
  }
  .quote-text-main {
    font-size: 1.85rem;
    min-height: 120px;
  }
  .quote-text-en {
    font-size: 1.05rem;
    margin-bottom: 20px;
  }
  .quote-speaker-name {
    font-size: 1.05rem;
  }
  .bullet-trajectory-wrapper {
    max-width: 90%;
    padding: 10px 0;
  }
  .keyboard-hint {
    display: none;
  }
  .btn-bullet-nav {
    width: 56px;
    height: 42px;
  }
}
