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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0a0a0a;
  color: #fff;
  min-height: 100vh;
}

.header {
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #64ffda, #00bfa5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  color: #8892b0;
  font-size: 1.1rem;
}

.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: calc(100vh - 200px);
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid #1a1a2e;
  border-top-color: #64ffda;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error {
  text-align: center;
  padding: 40px;
  color: #ff6b6b;
}

.error button {
  margin-top: 20px;
  padding: 10px 20px;
  background: #64ffda;
  color: #0a0a0a;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}

.comics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.comic-card {
  background: #1a1a2e;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

.comic-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(100, 255, 218, 0.2);
}

.comic-cover {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #16213e;
}

.comic-info {
  padding: 15px;
}

.comic-title {
  font-size: 1.2rem;
  margin-bottom: 5px;
}

.comic-meta {
  color: #8892b0;
  font-size: 0.9rem;
}

.reader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #0a0a0a;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.reader-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: #1a1a2e;
  border-bottom: 1px solid #2a2a4e;
}

.back-btn {
  background: none;
  border: none;
  color: #64ffda;
  cursor: pointer;
  font-size: 1rem;
}

.reader-nav {
  display: flex;
  align-items: center;
  gap: 15px;
}

.reader-nav button {
  background: #2a2a4e;
  border: none;
  color: #fff;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
}

.reader-nav button:hover {
  background: #3a3a6e;
}

.reader-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

#scene-image {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 8px;
}

.dialogue-box {
  margin-top: 20px;
  padding: 20px;
  background: #1a1a2e;
  border-radius: 8px;
  max-width: 800px;
  width: 100%;
  min-height: 100px;
}

.dialogue-line {
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 5px;
}

.dialogue-line.narration {
  background: #2a2a4e;
  font-style: italic;
}

.dialogue-line.speech {
  background: #16213e;
  border-left: 3px solid #64ffda;
}

.dialogue-line .speaker {
  color: #64ffda;
  font-weight: bold;
  margin-right: 8px;
}

.reader-footer {
  padding: 15px 20px;
  background: #1a1a2e;
  border-top: 1px solid #2a2a4e;
  text-align: center;
}

.download-btn {
  background: #64ffda;
  color: #0a0a0a;
  border: none;
  padding: 12px 24px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
}

.download-btn:hover {
  background: #45e6b9;
}

.footer {
  text-align: center;
  padding: 20px;
  color: #8892b0;
  border-top: 1px solid #1a1a2e;
}

.countdown {
  margin-top: 10px;
  color: #64ffda;
}

.hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .header h1 {
    font-size: 1.8rem;
  }

  .comics-grid {
    grid-template-columns: 1fr;
  }

  .reader-header {
    flex-direction: column;
    gap: 10px;
  }

  .reader-nav {
    width: 100%;
    justify-content: space-between;
  }
}