/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body and background */
body {
  background-color: #000; /* AMOLED black */
  color: #eee;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  padding: 1rem;
  text-align: center;
  background: linear-gradient(90deg, #121212, #1a1a1a);
  box-shadow: 0 2px 8px rgba(255,255,255,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  user-select: none;
  font-weight: 600;
  font-size: 1.5rem;
}

.back-button {
  color: #bbb;
  text-decoration: none;
  font-size: 1rem;
  position: absolute;
  left: 1rem;
  top: 1.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: color 0.3s ease;
  user-select: none;
}

.back-button:hover {
  color: #1e90ff;
}

/* Main container */
main {
  flex: 1;
  padding: 1rem;
  max-width: 720px;
  margin: 0 auto;
}

/* Chapter list grid */
.chapter-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

/* Chapter card */
.chapter-card {
  display: block;
  background: #111;
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
  color: #eee;
  text-decoration: none;
  box-shadow: 0 0 10px rgba(255,255,255,0.05);
  transition: box-shadow 0.3s ease;
  user-select: none;
}

.chapter-card:hover {
  box-shadow: 0 0 15px #1e90ff;
}

.chapter-card img {
  width: 100%;
  display: block;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  filter: brightness(0.9);
}

.chapter-card h3 {
  padding: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
}

/* Chapter image container (vertical scroll) */
.image-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
  padding-bottom: 2rem;
}

/* Manga page images */
.manga-page {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(255,255,255,0.1);
  user-select: none;
  -webkit-user-drag: none;
}

/* Responsive tweaks */
@media (max-width: 480px) {
  .chapter-card h3 {
    font-size: 0.9rem;
  }

  .back-button {
    font-size: 0.9rem;
    top: 1rem;
  }

  header {
    font-size: 1.25rem;
  }
}
