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

:root {
  --bg-primary: #fafafa;
  --bg-card: #ffffff;
  --bg-dark: #1a1a1a;
  --accent: #d32f2f;
  --accent-light: #ff6659;
  --text-primary: #1a1a1a;
  --text-secondary: #616161;
  --text-muted: #9e9e9e;
  --border: #e0e0e0;
  --shadow: rgba(0, 0, 0, 0.08);
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
}

/* Header - Niemeyer inspired minimal */
.header {
  text-align: center;
  padding: 0.75rem 1rem 0.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 10;
}

/* Back Link */
.back-link {
  position: absolute;
  top: 0.75rem;
  left: 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--accent);
}

.header h1 {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
  letter-spacing: 0.1em;
}

/* Main layout - always vertical */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Swiper - overlapping cards with genie effect */
.poster-swiper {
  width: 100%;
  height: 48vh;
  min-height: 260px;
  max-height: 450px;
  padding: 0.5rem 0;
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-primary) 100%);
  overflow: visible;
  position: relative;
  z-index: 5;
}

.swiper-wrapper {
  align-items: center;
}

.swiper-slide {
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  transform-style: preserve-3d;
  perspective: 1000px;
  z-index: 1;
}

.swiper-slide-prev,
.swiper-slide-next {
  z-index: 2;
}

.swiper-slide-active {
  z-index: 3;
}

/* Genie effect - base for all images */
.swiper-slide img {
  max-width: 85%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 4px 16px var(--shadow), 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  transform-origin: center center;
}

/* Active slide - prominent */
.swiper-slide-active img {
  transform: scale(1) perspective(800px) rotateY(0deg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2), 0 20px 60px rgba(0, 0, 0, 0.15);
  opacity: 1;
  filter: brightness(1);
  z-index: 10;
}

/* Previous slide (left side, newer - tilt right) */
.swiper-slide-prev img {
  transform: scale(0.78) perspective(800px) rotateY(12deg) translateX(20%);
  opacity: 0.75;
  filter: brightness(0.92);
}

/* Next slide (right side, older - tilt left) */
.swiper-slide-next img {
  transform: scale(0.78) perspective(800px) rotateY(-12deg) translateX(-20%);
  opacity: 0.75;
  filter: brightness(0.92);
}

/* Far left slides (newer, tilt right) */
.swiper-slide.slide-far-left img {
  transform: scale(0.55) perspective(800px) rotateY(20deg) translateX(30%);
  opacity: 0.35;
  filter: brightness(0.75);
}

/* Far right slides (older, tilt left - OPPOSITE direction) */
.swiper-slide.slide-far-right img {
  transform: scale(0.55) perspective(800px) rotateY(-20deg) translateX(-30%);
  opacity: 0.35;
  filter: brightness(0.75);
}

/* Progress Bar Pagination */
.swiper-pagination {
  position: relative;
  padding: 0.75rem 1.5rem 1rem;
  background: var(--bg-primary);
  z-index: 15;
}

.progress-pagination {
  width: 66%;
  max-width: 200px;
  margin: 0 auto;
}

.progress-track {
  position: relative;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  cursor: pointer;
  touch-action: none;
}

.progress-track.is-dragging {
  cursor: grabbing;
}

.progress-handle {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  background: var(--accent);
  border: 2px solid var(--bg-card);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(211, 47, 47, 0.4);
  transition: left 0.15s ease-out, transform 0.15s ease;
  cursor: grab;
}

.progress-track.is-dragging .progress-handle {
  transform: translate(-50%, -50%) scale(1.2);
  cursor: grabbing;
}

.progress-track:hover .progress-handle {
  transform: translate(-50%, -50%) scale(1.1);
}

/* Info Panel - compact */
.info-panel {
  flex: 1;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  padding: 1.25rem 1.25rem 1.5rem;
  margin-top: -20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 -4px 30px var(--shadow);
  position: relative;
  z-index: 10;
}

.info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--text-primary);
}

.edition {
  background: var(--accent);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.year {
  color: var(--text-primary);
  font-size: 1.125rem;
  font-weight: 700;
  font-feature-settings: 'tnum';
}

.title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
  line-height: 1.4;
  color: var(--text-primary);
}

.venue {
  color: var(--text-secondary);
  font-size: 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  font-style: italic;
}

/* Stats - ultra compact inline */
.stats {
  display: flex;
  justify-content: flex-start;
  gap: 1.5rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.stat {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.stat-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--accent);
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Sections - editorial style */
.section {
  margin-bottom: 1rem;
}

.section h3 {
  font-size: 0.65rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.375rem;
  font-weight: 700;
}

.section p {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* 概要 section - larger text */
.section.overview h3 {
  font-size: 0.7rem;
}

.section.overview p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-primary);
  font-weight: 400;
}

/* Tablet+ */
@media (min-width: 768px) {
  .header {
    padding: 1rem 2rem 0.75rem;
  }

  .back-link {
    left: 2rem;
  }

  .header h1 {
    font-size: 1rem;
  }

  .poster-swiper {
    height: 52vh;
    max-height: 550px;
  }

  .swiper-slide img {
    max-width: 70%;
  }

  .info-panel {
    padding: 1.5rem 2.5rem;
    margin: 0 auto;
    max-width: 800px;
    width: 100%;
  }

  .title {
    font-size: 1.25rem;
  }

  .section.overview p {
    font-size: 1.0625rem;
    line-height: 1.8;
  }

  .progress-pagination {
    max-width: 400px;
  }

  .progress-track {
    height: 8px;
  }

  .progress-handle {
    width: 22px;
    height: 22px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .poster-swiper {
    height: 50vh;
    max-height: 500px;
  }

  .swiper-slide img {
    max-width: 55%;
  }

  .info-panel {
    max-width: 900px;
    padding: 1.5rem 3rem;
  }
}

/* Large desktop */
@media (min-width: 1400px) {
  .info-panel {
    max-width: 1000px;
  }

  .section.overview p {
    font-size: 1.125rem;
  }
}
