@import url('https://fonts.googleapis.com/css2?family=Amarante&family=Aubrey&display=swap');

:root {
  --panel: rgba(10, 0, 18, .84);
  --line: rgba(255, 255, 255, .14);
  --muted: #c9c4cf;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #000;
}

body {
  color: #fff;
  font-family: Amarante, serif;
}

a {
  color: #fff;
}

button,
input {
  font: inherit;
}

#page-background {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: url('../assets/bg.png') center/cover no-repeat;
  z-index: 0;
  pointer-events: none;
}

#cinder-background {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  background: transparent;
  mix-blend-mode: screen;
}

.site-content {
  position: relative;
  z-index: 2;
}

.comic-site {
  width: min(1100px, calc(100% - 32px));
  margin: auto;
  padding: 28px 0 64px;
}

.site-header,
.panel,
.hero {
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.site-header {
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.brand {
  text-decoration: none;
  font-size: 1.35rem;
  white-space: nowrap;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: flex-end;
}

.nav a {
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current='page'] {
  text-decoration: underline;
}

.hero {
  margin-top: 28px;
  padding: 60px 40px;
  text-align: center;
}

.comic-logo img {
  display: block;
  width: min(760px, 100%);
  height: auto;
  margin: 0 auto;
}

.hero p,
.muted {
  color: var(--muted);
}

.button {
  display: inline-block;
  padding: 11px 18px;
  background: #fff;
  color: #000;
  text-decoration: none;
  font-weight: 700;
  border: 0;
  cursor: pointer;
}

.grid {
  display: grid;
  gap: 28px;
}

.two {
  grid-template-columns: 2fr 1fr;
}

.panel {
  padding: 28px;
}

.section-title {
  margin: 0 0 18px;
}

.archive-list {
  display: grid;
  gap: 14px;
}

.episode-card {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .28);
}

.icon
{
  
  display: grid;
  place-items: center;
  overflow: hidden;
}
.portrait,
.comic-placeholder {
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.portrait {
  
  aspect-ratio: 314 / 440;
}

.icon {
  width: 100px;
  height: 100px;
}

.icon img,
.portrait img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.episode-card h3 {
  margin: 0 0 5px;
}

.episode-card p {
  margin: 5px 0;
  color: var(--muted);
}

.episode-card time {
  color: var(--muted);
  white-space: nowrap;
}

.pagination {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.pagination button {
  padding: 9px 14px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  border: 1px solid var(--line);
  cursor: pointer;
}

.pagination button[disabled] {
  opacity: .45;
  cursor: not-allowed;
}

.characters-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 20px;
}

.character-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.character-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  color: #fff;
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
}

.character-button[aria-selected='true'] {
  background: rgba(255, 255, 255, .13);
}

.character-button .icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
}

.character-main {
  min-width: 0;
}

.character-hero {
  display: grid;
  grid-template-columns: minmax(240px, 40%) 1fr;
  gap: 25px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.tab {
  padding: 10px 14px;
  color: #fff;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.tab[aria-selected='true'] {
  border-bottom-color: #fff;
}

.tab-panel[hidden] {
  display: none;
}

.data-list {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px 16px;
}

.data-list dt {
  color: var(--muted);
}

.data-list dd {
  margin: 0;
}

.dnd-stats {
  width: 100%;
  border-collapse: collapse;
}

.dnd-stats th,
.dnd-stats td {
  border: 1px solid var(--line);
  padding: 8px;
  text-align: left;
}

.comic-reader {
  text-align: center;
}

.comic-page {
  width: min(900px, 100%);
  min-height: 500px;
  margin: auto;
  border: 1px solid var(--line);
  background: #050505;
  display: grid;
  place-items: center;
}

.comic-page img {
  max-width: 100%;
  height: auto;
  display: block;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.product {
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .28);
}

.product-image {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  margin-bottom: 14px;
}

.product h3 {
  margin: 0 0 6px;
}

.product .price {
  color: var(--muted);
}

.footer {
  margin-top: 28px;
  padding: 18px;
  text-align: center;
  color: var(--muted);
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 10px;
  top: 10px;
  z-index: 10;
  background: #fff;
  color: #000;
  padding: 8px;
}

@media(max-width:760px) {
  .comic-site {
    width: min(100% - 20px, 1100px);
    padding-top: 10px;
  }

  .site-header {
    flex-direction: column;
    align-items: stretch;
  }

  .nav {
    justify-content: center;
  }

  .two,
  .characters-layout,
  .character-hero {
    grid-template-columns: 1fr;
  }

  .portrait {
    min-height: 320px;
  }

  .episode-card {
    grid-template-columns: 70px 1fr;
  }

  .episode-card .icon {
    width: 70px;
    height: 70px;
  }

  .episode-card time {
    grid-column: 2;
  }

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

  .hero {
    padding: 40px 20px;
  }

  .data-list {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* Expanded-cast character navigation */
.character-sidebar {
  min-width: 0;
  position: relative;
  align-self: start;
  min-height: 0;
  height: var(--character-panel-height, auto);
  display: flex;
  flex-direction: column;
}
.character-divider {
  grid-column: 1 / -1;
  width: 100%;
  margin: 6px 0;
  border: 0;
  border-top: 1px solid var(--line);
}
.character-search-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: .9rem;
}

.character-search {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 10px;
  color: #fff;
  background: rgba(0, 0, 0, .42);
  border: 1px solid var(--line);
  outline: none;
}

.character-search:focus {
  border-color: rgba(255, 255, 255, .45);
}
.tab-panel p {
  text-indent: 27px;
}
.character-list {
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 7px;
  padding-right: 3px;
  /* Keep the native scrollbar visually quiet and in-theme. */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .18) transparent;
}

.character-list::-webkit-scrollbar {
  width: 5px;
}

.character-list::-webkit-scrollbar-track {
  background: transparent;
}

.character-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .18);
  border-radius: 999px;
}

.character-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, .27);
}

.character-button {
  min-width: 0;
}

.character-button>span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Shop and gallery category tabs */
.shop-tabs,
.gallery-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.shop-tab,
.gallery-tab {
  padding: 9px 14px;
  color: #fff;
  background: rgba(0, 0, 0, .32);
  border: 1px solid var(--line);
  cursor: pointer;
}

.shop-tab[aria-selected='true'],
.gallery-tab[aria-selected='true'] {
  background: rgba(255, 255, 255, .14);
}

.product[hidden],
.gallery-item[hidden] {
  display: none;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.gallery-item {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .28);
}

.gallery-image {
  aspect-ratio: 4/3;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
}

.gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-item figcaption {
  padding-top: 10px;
  color: var(--muted);
}

/* Long-form comic pages */
.comic-pages {
  width: min(900px, 100%);
  margin: auto;
  background: #050505;
  border: 1px solid var(--line);
}

.comic-pages img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
}

.episode-kicker {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.episode-characters {
  display: flex;
  gap: 5px;
  margin-top: 8px;
}

.episode-characters img {
  width: 42px;
  height: 42px;
  object-fit: cover;
}

@media(max-width:760px) {
  .character-sidebar {
    position: static;
    height: auto;
    --character-panel-height: auto;
  }

  .character-list {
    flex: 0 1 auto;
    max-height: 42vh;
    grid-template-columns: 1fr 1fr 1fr;
  }

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

@media(max-width:480px) {

  .character-list {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .shop-tabs,
  .gallery-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .shop-tab,
  .gallery-tab {
    white-space: nowrap;
  }
}

/* Character selector: icon-first navigation for large casts */
.character-button {
  justify-content: center;
  padding: 8px;
  aspect-ratio: 1;
}

.character-button .icon {
  width: 100%;
  height: 100%;
  flex: 0 0 100%;
}

.character-button .icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.character-placeholder {
  color: var(--muted);
  font-size: .8rem;
  text-align: center;
}

@media(max-width:760px) {
  .character-button .icon {
    width: 100%;
    height: 100%;
    flex-basis: 100%;
  }
}

.shop-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 22px;
  align-items: stretch;
  margin: 20px 0;
}

.shop-toolbar .shop-tabs {
  margin: 0;
  align-self: start;
}

.featured-product {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .06);
}

.featured-product-image {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
}

.featured-product h2 {
  margin: 2px 0 5px;
  font-size: 1.1rem;
}

.featured-product p {
  margin: 5px 0;
}

.featured-label {
  margin: 0 0 2px !important;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .75rem;
}

@media(max-width:760px) {
  .shop-toolbar {
    grid-template-columns: 1fr;
  }

  .featured-product {
    grid-template-columns: 90px 1fr;
  }
}
/* Typography: Amarante for headings/titles, Aubrey for readable text. */
body {
  font-family: 'Aubrey', sans-serif;
}

h1, h2, h3, h4, h5, h6,
.brand,
.section-title,
.episode-kicker {
  font-family: 'Amarante', serif;
}
