:root {
  --bg-color: #0f0a14;
  --text-main: #f2ecf5;
  --text-muted: #a393b0;
  --brand-color: #e82d5a;
  --brand-glow: rgba(232, 45, 90, 0.4);
  --card-bg: rgba(255, 255, 255, 0.05);
  --border-color: rgba(255, 255, 255, 0.1);
  --font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.6;
  overflow-x: hidden;
  padding-bottom: 150px; /* space for danmaku */
}

a {
  color: inherit;
  text-decoration: none;
}

/* Progress Bar */
.progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 1000;
}
.progress-bar {
  height: 100%;
  background: var(--brand-color);
  width: 0%;
  box-shadow: 0 0 10px var(--brand-glow);
  transition: width 0.1s;
}
.now-playing-text {
  position: fixed;
  top: 10px;
  left: 20px;
  font-size: 12px;
  color: var(--text-muted);
  z-index: 1000;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 10px;
  border-radius: 12px;
}

/* Nav */
.episode-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(15, 10, 20, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-color);
  z-index: 1000;
  padding: 10px 15px;
  overflow-x: auto;
  white-space: nowrap;
  display: flex;
  gap: 10px;
  scrollbar-width: none;
}
.episode-nav::-webkit-scrollbar { display: none; }
.ep-btn {
  padding: 6px 16px;
  border-radius: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  font-size: 13px;
  color: var(--text-muted);
  transition: all 0.3s;
}
.ep-btn.active {
  background: var(--brand-color);
  color: #fff;
  border-color: var(--brand-color);
  box-shadow: 0 0 10px var(--brand-glow);
}

/* Danmaku */
.danmaku-layer {
  position: fixed;
  bottom: 60px;
  left: 0;
  width: 100%;
  height: 80px;
  pointer-events: none;
  z-index: 900;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}
.danmaku-item {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  white-space: nowrap;
  animation: danmakuMove linear infinite;
}
.danmaku-item img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}
@keyframes danmakuMove {
  from { transform: translateX(100vw); }
  to { transform: translateX(-100%); }
}

/* Common Section */
section {
  padding: 80px 20px;
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}
.section-title {
  text-align: center;
  font-size: 28px;
  margin-bottom: 40px;
  letter-spacing: 2px;
}
.section-title span {
  color: var(--brand-color);
}

/* Act 1 */
.act-hero {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.brand-logo {
  height: 36px;
  margin-bottom: 20px;
}
.hero-h1 {
  font-size: 48px;
  line-height: 1.2;
  margin-bottom: 20px;
  max-width: 800px;
}
.hero-desc {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 40px;
}
.btn-download {
  display: inline-block;
  background: var(--brand-color);
  color: #fff;
  padding: 15px 40px;
  border-radius: 30px;
  font-size: 18px;
  font-weight: bold;
  box-shadow: 0 4px 20px var(--brand-glow);
  transition: transform 0.2s;
}
.btn-download:hover {
  transform: scale(1.05);
}
.marquee-wrapper {
  margin-top: 60px;
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}
.marquee-content {
  display: inline-block;
  animation: marquee 25s linear infinite;
}
.marquee-content img {
  width: 120px;
  border-radius: 8px;
  margin: 0 10px;
  vertical-align: middle;
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Act 2 */
.act-cast {
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.cast-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: 12px;
  transition: transform 0.3s;
}
.cast-card:nth-child(even) {
  flex-direction: row-reverse;
  text-align: right;
}
.cast-card:hover {
  transform: translateY(-5px);
  border-color: var(--brand-color);
}
.cast-card img {
  width: 100px;
  border-radius: 8px;
}
.cast-info h3 {
  font-size: 20px;
  margin-bottom: 8px;
}
.cast-info p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.cast-tag {
  display: inline-block;
  background: rgba(232, 45, 90, 0.2);
  color: var(--brand-color);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin-right: 5px;
}

/* Act 3 */
.act-conflict {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.script-card {
  background: #1a1520;
  border: 1px solid var(--border-color);
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transition: transform 0.3s;
}
.script-card:hover {
  transform: rotate(-1deg);
}
.script-card h3 {
  color: var(--brand-color);
  margin-bottom: 20px;
  font-size: 22px;
}
.script-img-grid {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.script-img-grid img {
  width: 80px;
  border-radius: 4px;
}
.dialogue {
  font-family: monospace;
  background: rgba(255,255,255,0.05);
  padding: 15px;
  border-left: 3px solid var(--brand-color);
  color: #ddd;
  font-size: 14px;
}

/* Act 4 */
.act-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 30px;
  padding: 20px;
}
.polaroid {
  background: #fff;
  padding: 10px 10px 40px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  position: relative;
  transition: transform 0.3s;
}
.polaroid:nth-child(odd) { transform: rotate(3deg); }
.polaroid:nth-child(even) { transform: rotate(-3deg); }
.polaroid:hover { transform: scale(1.05) rotate(0); z-index: 10; }
.polaroid img {
  width: 100%;
  display: block;
}
.polaroid::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 20px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(2px);
}
.top-rank {
  border: 4px solid #ffd700;
  transform: scale(1.1) !important;
  z-index: 20;
}
.rank-note {
  position: absolute;
  bottom: 10px;
  left: 0;
  width: 100%;
  text-align: center;
  color: #333;
  font-family: cursive;
  font-weight: bold;
  font-size: 14px;
}

/* Act 5 */
.act-preview {
  background: var(--brand-color);
  color: #fff;
  border-radius: 20px;
  padding: 50px 30px;
  text-align: center;
}
.act-preview h2 { margin-bottom: 20px; font-size: 36px; }
.preview-row {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 30px 0;
  overflow-x: auto;
}
.preview-row img {
  width: 80px;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.countdown {
  font-size: 32px;
  font-weight: bold;
  letter-spacing: 4px;
  margin-bottom: 20px;
}
.btn-reserve {
  background: #fff;
  color: var(--brand-color);
  padding: 12px 30px;
  border-radius: 20px;
  font-weight: bold;
  border: none;
  cursor: pointer;
}

/* Act 6 */
.act-finale {
  text-align: center;
}
.phone-mockup {
  width: 280px;
  height: 580px;
  background: #000;
  border-radius: 40px;
  margin: 0 auto 40px;
  border: 8px solid #333;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}
.phone-screen {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}
.phone-screen img { width: 100%; border-radius: 8px; }
.download-group {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.btn-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--brand-color);
  color: var(--brand-color);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.3s;
}
.btn-next:hover {
  background: var(--brand-color);
  color: #fff;
}

/* Act 7 Footer */
.site-footer {
  background: #050308;
  padding: 60px 20px 100px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
.footer-content { max-width: 800px; margin: 0 auto; display: flex; flex-direction: column; gap: 15px; }
.footer-links a { margin: 0 10px; color: var(--text-muted); }
.footer-links a:hover { color: #fff; }

/* Responsive */
@media (max-width: 768px) {
  .hero-h1 { font-size: 32px; }
  .act-conflict { grid-template-columns: 1fr; }
  .cast-card { flex-direction: column !important; text-align: center !important; }
  .danmaku-layer { height: 120px; flex-direction: row; flex-wrap: wrap; gap: 5px; bottom: 50px; pointer-events: auto; }
  .danmaku-item { position: relative; animation: none; transform: none; margin: 2px; width: auto; display: inline-flex; }
  .marquee-wrapper { overflow-x: auto; mask-image: none; scrollbar-width: none; }
  .marquee-content { animation: none; }
  .marquee-content img { width: 90px; }
  .download-group { flex-direction: column; }
  .btn-next { width: 100%; justify-content: center; }
}