.container {
  text-align: center;
  max-width: 800px;
  width: 95%;
  margin: 0 auto;
}

/* Nav buttons inherited from main.css mostly, add specific comic nav styles if needed */
/* Comic reader specific nav buttons to look like they did previously */
nav button {
  padding: 8px 15px;
  margin: 0 5px;
  cursor: pointer;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #eee;
  font-weight: normal; /* Override bold from main.css */
  color: #333;
}

nav button:hover:not(:disabled) {
  background-color: #ddd;
}

nav button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #eaeaea;
  color: #999;
}

#comic-panel {
  margin-bottom: 20px;
}

.comic-nav {
  position: static;
  transform: none;
  width: auto;
  height: auto;
  background: none;
  z-index: 1;
}

.comic-nav.top-nav {
  margin-bottom: 2em;
}

.comic-nav.bottom-nav {
  margin-top: 2em;
}

.current-episode {
  display: inline-block;
  width: 5.3em;       /* wide enough for "Part III" at any font size */
  text-align: center;
  color: black;
}

.comic-page-wrapper {
  position: relative;
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.comic-page-canvas {
  display: block;
  max-width: 100%;
  width: 100%;
  height: auto;
  border-radius: 0.3%;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  user-drag: none;
}

.comic-page-shield {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background: rgba(0, 0, 0, 0);
  pointer-events: auto;
}

.black {
    color: black;
}

#episode-title {
  font-weight: 600;
}

@media only screen and (max-width: 800px) {
  .container {
    width: 100%;
    padding: 0;
    margin: 0;
  }
  #comic-panel {
    margin-left: -1em;
    margin-right: -1em;
    margin-bottom: 10px;
    width: auto;
  }

  #episode-title {
    font-size: 19px;
  }

  .comic-page-canvas {
    width: 100%;
    box-sizing: border-box;
    border-radius: 0; /* Remove rounded corners entirely on mobile */
  }
  
  /* Align buttons in a single row for mobile screens */
  .comic-nav {
    display: flex;
    justify-content: space-between; /* Spread buttons out to the 6px padded edges */
    align-items: center;
    flex-wrap: nowrap;
    width: auto;
    margin-left: -1em;
    margin-right: -1em;
    padding: 0 6px;
    box-sizing: border-box;
  }
  
  .comic-nav.top-nav {
    margin-bottom: calc(2em - 15px); /* Brings closer to image */
  }
  
  .comic-nav.bottom-nav {
    margin-top: calc(2em - 20px); /* Adjusting bottom too for balanced proximity */
  }
  
  nav button {
    padding: 8px 10px; /* Bigger padding */
    margin: 0; /* Let space-between handle gaps */
    font-size: 14px;
    white-space: nowrap;
  }
  
  .current-episode {
    margin: 0;
    font-size: 14px; /* Same 15% bump */
    white-space: nowrap;
  }
}

.title-image-wrapper {
  text-align: center;
  margin: 1rem 0;
}

.title-image-wrapper img {
  width: 850px;
  max-width: 100%;
}

@media only screen and (max-width: 800px) {
  .title-image-wrapper {
    margin: 1rem -1rem;
  }
  
  .title-image-wrapper img {
    width: 100%;
    margin: 0; 
  }
  
  .title-image-wrapper figure {
    margin: 0;
  }
}
    