body {
  padding: 0;
  margin: 0;
}

/* Header scroll behavior */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: white;
  z-index: 1000;
  transition: transform 0.3s ease;
  border-bottom: 2px solid #000;
}

header.header-hidden {
  transform: translateY(-100%);
}

.content {
  padding-top: 5rem;
  /* Adjust based on your header height */
}

.toon-overview {
  max-width: 800px;
  margin: 0 auto;
}

.toon-header {
  text-align: center;
  margin-bottom: 2rem;
}

.toon-header img {
  width: 100%;
  height: auto;
}

.toon-header .meta-info {
  color: #6b6b6b;
  margin-top: 0.5rem;
}

.toon-download {
  margin-top: 2rem;
}

.view {
  padding: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.view table {
  width: 100%;
  border-collapse: collapse;
}

.view table td {
  padding: 0.5rem;
  border: 1px solid #ccc;
}

.view table td:first-child {
  background: #f0f0f0;
  min-width: 33%;
}

.account-view section {
  margin-top: 2rem;
}

.season-view {
  max-width: 800px;
  margin: 0 auto;
}

.season-view img {
  width: 100%;
  height: auto;
  margin: 1rem 0;
}

.season-view h1 {
  margin-bottom: 0.5rem;
}

.song-view {
  max-width: 100%;
  padding: 0;
  min-height: calc(100vh - 5rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.song-header {
  font-size: 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  justify-content: center;
}
.song-title {
	font-size: 1rem;
	margin-bottom: 1rem;
}
.song-description {
	font-size: 1rem;
	font-style: italic;
	border: 2px solid;
	padding: 1rem;
	margin: 0 1rem 1rem 1rem;
}

.key-visual-container {
  position: relative;
  width: 100%;
  margin-bottom: 0;
}

.key-visual-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 216.67%; /* 845/390 aspect ratio for key visual */
  overflow: hidden;
}

.key-visual-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.key-visual {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin-bottom: 0;
  display: block;
}

.key-visual-replay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: 3px solid white;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  padding: 0;
}

.key-visual-replay:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: translate(-50%, -50%) scale(1.1);
}

.key-visual-replay svg {
  width: 40px;
  height: 40px;
  margin-left: 4px;
}

/* Toon View - Chapter Section */
.chapters-header,
.chapters-list {
  margin-bottom: 2rem;
  padding: 0 2rem;
}

.chapter-item {
  display: grid;
  grid-template-columns: 6rem auto 3rem;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
}

.chapter-item .chapter-info {
  display: grid;
  grid-template-columns: auto 7rem;
  align-items: center;
  gap: 0.5rem;
}

.chapter-item img {
  width: 100%;
  height: auto;
}

.chapter-item .chapter-thumbnail {
  width: 100%;
  height: auto;
}

.chapter-item .chapter-icon {
  width: 1rem;
  height: auto;
}

.chapter-item .chapter-release {
  font-size: 0.75rem;
}

.chapter-item .chapter-release,
.chapter-item .chapter-number {
  color: #6b6b6b;
}

.chapter-item .chapter-number {
  justify-content: space-between;
  display: flex;
  align-items: center;
}

.chapter-item:hover {
  background-color: #f0f0f0;
}

.chapter-item .chapter-release span {
  display: block;
}

.chapter-item.published .chapter-release span {
  display: none;
}

.chapter-item.coming-soon {
  opacity: 0.5;
  cursor: not-allowed;
}

.chapter-item.coming-soon .chapter-release .chapter-release-badge {
  font-size: 0.5rem;
}

@media (max-width: 768px) {
  .chapters-header,
  .chapters-list {
    padding: 0 1rem;
  }

  .chapter-item {
    grid-template-columns: 5rem auto 3rem;
    gap: 0.5rem;
  }

  .chapter-item .chapter-info {
    display: block;
  }

  .chapter-item .chapter-release span {
    display: inline;
  }

  .chapter-item.coming-soon .chapter-release .chapter-release-badge {
    font-size: 0.75rem;
    margin-right: 0.5rem;
  }
}

/* Toon View - Credits Section */
.toon-overview .credits-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
}

.webtoon-container {
  margin: 0 auto;
  max-width: 480px;
}

.membership-required {
  border: 4px solid #000;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

.webtoon-slice {
  position: relative;
}

/* Sequential lazy loading styles */
.webtoon-slice.lazy {
  position: relative;
}

.slice-image-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 166.67%; /* 650/390 aspect ratio for slices */
  overflow: hidden;
  background: #f5f5f5;
}

.slice-placeholder-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slice-content-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slice-loading-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #666;
  font-size: 0.8rem;
}

.webtoon-slice.loaded .slice-loading-text {
  display: none;
}

.webtoon-slice.error .slice-loading-text {
  background: #fff5f5;
  color: #e74c3c;
}

.webtoon-slice.error .slice-image-wrapper {
  background: #fff5f5;
  border: 1px dashed #e74c3c;
}

/* Audio Hotzones */
.audio-hotzone {
  position: absolute;
  border: 2px dashed rgba(255, 193, 7, 0.8);
  background: rgba(255, 193, 7, 0.1);
  pointer-events: auto;
  opacity: 0.5;
  transition: opacity 0.3s ease;
  z-index: 10;
  box-shadow: inset 0 0 20px rgba(255, 193, 7, 0.3);
  cursor: pointer;
}

.audio-hotzone:hover {
  opacity: 0.8;
}

.audio-hotzone:active {
  opacity: 1;
}

/* Flash animation when hotzone comes into view */
@keyframes hotzoneFlash {
  0% {
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.5;
  }
}

.audio-hotzone.flash {
  animation: hotzoneFlash 0.5s ease-in-out;
}

/* Sequence Navigation */
.sequence-navigation {
  padding: 1rem;
  border-top: 2px solid;
}
.sequence-navigation [onclick] {
  cursor: pointer;
}
.sequence-nav-container {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
}

.sequence-navigation .btn-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-direction: row;
}
.sequence-navigation .btn-nav .nav-image {
  width: 5rem;
}
.sequence-navigation .btn-nav > div {
  display: flex;
  align-items: left;
  justify-content: center;
  flex-direction: column;
}
.sequence-navigation .btn-nav .nav-type {
  font-size: 0.75rem;
}
.sequence-navigation .btn-prev .nav-icon,
.sequence-navigation .btn-next .nav-icon {
  width: 2rem;
  background: black;
  color: white;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.sequence-navigation .btn-prev {
  justify-self: start;
}
.sequence-navigation .btn-prev > div {
  display: none;
}

.sequence-navigation .btn-overview {
  justify-self: left;
  flex-direction: row;
  padding: 1rem;
}

.sequence-navigation .btn-next {
  justify-self: end;
}
.sequence-navigation .btn-nav:hover {
  background-color: #f0f0f0;
}
.sequence-navigation .btn-next > div:nth-child(2) {
  min-width: 33vw;
}

.sequence-navigation .btn-disabled {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.5;
}
.sequence-navigation .btn-hidden {
  visibility: hidden;
}

@media (max-width: 768px) {
  .sequence-nav-container {
    gap: 0.5rem;
  }
}
