/* ==========================================================================
   5 WRZEŚNIA: KALENDARIUM WYDARZEŃ WYJĄTKOWYCH
   Stylistyka: Ciepły, nowoczesny minimalizm edytorski (Editorial Warm Minimalism)
   Bez zaokrąglonych ramek, bez "odpustowego AI", bez granatu i żółci.
   ========================================================================== */

:root {
  --bg-main: #f7f4ef;
  --bg-card: #ffffff;
  --bg-subtle: #efeae1;
  --bg-puenta: #f2ede4;

  --text-main: #18181b;
  --text-body: #3f3f46;
  --text-muted: #71717a;
  --text-dim: #a1a1aa;

  --accent-primary: #c2410c; /* Ciepła terakota / burnt sienna */
  --accent-olive: #4d5e46;   /* Spokojna oliwkowa zieleń */
  --border-hairline: #e2dcd2;
  --border-strong: #18181b;

  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --vh: 100vh;
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  position: fixed;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

/* Subtelna papierowa faktura tła */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.025;
  background-image: radial-gradient(#18181b 1px, transparent 1px);
  background-size: 16px 16px;
}

/* Główny kontener aplikacji */
.app-container {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  z-index: 1;
  background-color: var(--bg-main);
}

@media (min-width: 501px) {
  .app-container {
    border-left: 1px solid var(--border-hairline);
    border-right: 1px solid var(--border-hairline);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.06);
  }
}

/* Warstwa Canvas Konfetti */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99;
}

/* --------------------------------------------------------------------------
   GÓRNY NAGŁÓWEK: Paski Postępu i Licznik
   -------------------------------------------------------------------------- */
.top-header {
  position: relative;
  width: 100%;
  padding: 12px 16px 8px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-main);
  border-bottom: 1px solid var(--border-hairline);
}

/* Paski postępu w minimalistycznym stylu edytorskim */
.story-progress-strip {
  display: flex;
  gap: 3px;
  width: 100%;
  height: 3px;
}

.story-segment {
  flex: 1;
  height: 100%;
  background: #ded7cb;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  border-radius: 0; /* BRAK ZAOKRĄGLEŃ */
}

.story-segment-fill {
  height: 100%;
  width: 0%;
  background: var(--text-main);
  border-radius: 0;
  transition: width 0.22s ease-out;
}

.story-segment.completed .story-segment-fill {
  width: 100%;
}

.story-segment.active .story-segment-fill {
  width: 100%;
}

.header-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slide-counter {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.counter-square {
  width: 6px;
  height: 6px;
  background: var(--accent-primary);
  border-radius: 0; /* Prosty kwadracik zamiast kropki */
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--border-hairline);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 0; /* Bez zaokrągleń */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-btn:hover, .icon-btn:active {
  background: #ffffff;
  border-color: var(--text-main);
  color: var(--text-main);
}

/* --------------------------------------------------------------------------
   OBSZAR SLAJDÓW
   -------------------------------------------------------------------------- */
.slides-viewport {
  position: relative;
  flex: 1;
  width: 100%;
  overflow: hidden;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 12px 18px 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(28px);
  transition: opacity 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.slide::-webkit-scrollbar {
  display: none;
}

.slide.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  z-index: 10;
}

.slide.prev {
  opacity: 0;
  transform: translateY(-28px);
}

/* Strefy dotykowe góra / dół */
.tap-zone {
  position: absolute;
  left: 0;
  width: 100%;
  z-index: 15;
  cursor: pointer;
}
.tap-zone.top {
  top: 0;
  height: 18%;
}
.tap-zone.bottom {
  bottom: 0;
  height: 18%;
}

/* --------------------------------------------------------------------------
   STRUKTURA KARTY SLAJDU (Czysty styl edytorski, bez zaokrągleń)
   -------------------------------------------------------------------------- */
.slide-card {
  position: relative;
  width: 100%;
  margin: auto 0;
  background: #ffffff;
  border: 1px solid var(--border-hairline);
  border-radius: 0; /* BEZ ZAOKRĄGLEŃ */
  padding: 18px 18px 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Pasek z datą */
.slide-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-hairline);
  padding-bottom: 8px;
}

.date-badge {
  color: var(--accent-primary);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.event-number {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* Tytuł nagłówkowy */
.slide-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

/* Ramka na ilustrację (Płaska, techniczna, bez zaokrągleń) */
.image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 11;
  max-height: 27vh;
  border-radius: 0; /* BEZ ZAOKRĄGLEŃ */
  overflow: hidden;
  background: #fbf9f5;
  border: 1px solid var(--border-hairline);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Treść: Fakt i Puenta */
.content-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fact-box {
  font-size: 0.88rem;
  line-height: 1.48;
  color: var(--text-body);
}

.fact-box strong {
  color: var(--text-main);
  font-weight: 700;
}

.puenta-box {
  position: relative;
  background: var(--bg-puenta);
  border-left: 3px solid var(--accent-primary);
  border-radius: 0; /* BEZ ZAOKRĄGLEŃ */
  padding: 10px 14px;
  font-size: 0.88rem;
  line-height: 1.46;
  color: var(--text-main);
}

.puenta-badge {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-primary);
  margin-bottom: 4px;
}

.puenta-text {
  font-family: var(--font-serif);
  font-style: italic;
  color: #27272a;
}

/* --------------------------------------------------------------------------
   SLAJD 0: INTRO
   -------------------------------------------------------------------------- */
.slide.intro-slide .slide-card {
  text-align: center;
  align-items: center;
  padding: 24px 20px 24px;
  gap: 14px;
}

.intro-pretitle {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent-primary);
}

.intro-title {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
  letter-spacing: 2px;
}

.intro-subtitle {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-body);
  max-width: 380px;
}

.intro-image-frame {
  width: 100%;
  max-width: 250px;
  aspect-ratio: 5 / 6;
  max-height: 28vh;
  border: 1px solid var(--border-hairline);
  background: #ffffff;
  padding: 4px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.start-btn {
  width: 100%;
  max-width: 260px;
  padding: 12px 20px;
  border-radius: 0; /* BEZ ZAOKRĄGLEŃ */
  background: var(--text-main);
  border: 1px solid var(--text-main);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.start-btn:hover, .start-btn:active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.intro-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* --------------------------------------------------------------------------
   SLAJD 11: FINAŁ — ŻYCZENIA ŚLUBNE
   -------------------------------------------------------------------------- */
.slide.finale-slide .slide-card {
  text-align: center;
  align-items: center;
  padding: 22px 20px 22px;
  gap: 12px;
  border: 1px solid var(--accent-primary);
  background: #ffffff;
}

.finale-badge {
  color: var(--accent-primary);
  font-weight: 800;
  font-size: 0.76rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-hairline);
  padding-bottom: 6px;
  width: 100%;
}

.finale-couple-title {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
}

.finale-artwork {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 16 / 11;
  border: 1px solid var(--border-hairline);
  background: #fbf9f5;
  padding: 4px;
}

.finale-artwork img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.finale-quote {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-body);
  max-width: 400px;
  font-style: normal;
}

.finale-wish-container {
  background: var(--bg-puenta);
  border: 1px solid var(--border-hairline);
  border-left: 3px solid var(--accent-primary);
  border-radius: 0;
  padding: 14px 16px;
  width: 100%;
}

.finale-wish-text {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  margin-bottom: 6px;
}

.finale-signature {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-primary);
  letter-spacing: 0.5px;
}

.finale-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}

.btn-secondary {
  flex: 1;
  padding: 10px 14px;
  border-radius: 0; /* BEZ ZAOKRĄGLEŃ */
  background: #ffffff;
  border: 1px solid var(--border-hairline);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-secondary:hover, .btn-secondary:active {
  background: var(--bg-subtle);
  border-color: var(--text-main);
}

.btn-confetti {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.btn-confetti:hover, .btn-confetti:active {
  background: #9a3412;
  border-color: #9a3412;
}

/* --------------------------------------------------------------------------
   SLAJD 12: POSTSCRIPTUM POETYCKIE (BEZ OBRAZKA)
   -------------------------------------------------------------------------- */
.slide.epilogue-slide .slide-card {
  text-align: center;
  align-items: center;
  padding: 22px 18px 24px;
  gap: 14px;
  border: 1px solid var(--border-hairline);
  background: #ffffff;
}

.epilogue-badge {
  color: var(--accent-primary);
  font-weight: 800;
  font-size: 0.74rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-hairline);
  padding-bottom: 6px;
  width: 100%;
}

.epilogue-intro {
  font-size: 0.88rem;
  line-height: 1.48;
  color: var(--text-body);
  font-style: italic;
  max-width: 440px;
  margin: 2px 0 4px;
}

.poem-container {
  width: 100%;
  background: var(--bg-puenta);
  border: 1px solid var(--border-hairline);
  border-left: 3px solid var(--accent-primary);
  border-radius: 0;
  padding: 16px 16px 18px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.poem-stanza {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-main);
}

.poem-stanza.chorus {
  font-weight: 700;
  padding-top: 10px;
  border-top: 1px dashed rgba(24, 24, 28, 0.2);
  color: var(--accent-primary);
}

.poem-question-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding-top: 4px;
}

.poem-question {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-primary);
  text-align: center;
  line-height: 1.35;
  margin: 0;
}

.btn-reveal {
  width: 100%;
  max-width: 260px;
  padding: 10px 18px;
  border-radius: 0; /* BEZ ZAOKRĄGLEŃ */
  background: var(--text-main);
  border: 1px solid var(--text-main);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-reveal:hover, .btn-reveal:active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* --------------------------------------------------------------------------
   SLAJD 13: WIDEO YOUTUBE
   -------------------------------------------------------------------------- */
.slide.video-slide .slide-card {
  text-align: center;
  align-items: center;
  padding: 20px 18px 22px;
  gap: 12px;
  border: 1px solid var(--border-hairline);
  background: #ffffff;
}

.video-title {
  font-size: 1.25rem;
  margin: 0;
}

.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 36vh;
  background: #000000;
  border: 1px solid var(--border-hairline);
  border-radius: 0;
  overflow: hidden;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* --------------------------------------------------------------------------
   DOLNY PASEK KONTROLNY
   -------------------------------------------------------------------------- */
.bottom-controls {
  position: relative;
  width: 100%;
  padding: 10px 18px 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-main);
  border-top: 1px solid var(--border-hairline);
}

.nav-arrow-btn {
  width: 40px;
  height: 40px;
  border-radius: 0; /* BEZ ZAOKRĄGLEŃ */
  background: #ffffff;
  border: 1px solid var(--border-hairline);
  color: var(--text-main);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.nav-arrow-btn:hover, .nav-arrow-btn:active {
  background: var(--text-main);
  color: #ffffff;
  border-color: var(--text-main);
}

.nav-arrow-btn:disabled {
  opacity: 0.25;
  pointer-events: none;
}

.swipe-indicator {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   RESPONSYWNOŚĆ DLA BARDZO MAŁYCH EKRANÓW
   -------------------------------------------------------------------------- */
@media (max-height: 680px) {
  .slide-card {
    padding: 12px 14px 14px;
    gap: 8px;
  }
  .image-container {
    max-height: 22vh;
  }
  .slide-title {
    font-size: 1.05rem;
  }
  .fact-box, .puenta-box {
    font-size: 0.82rem;
    line-height: 1.38;
  }
  .intro-title {
    font-size: 1.7rem;
  }
  .finale-couple-title {
    font-size: 1.4rem;
  }
  .finale-artwork {
    max-width: 200px;
  }
}
