@import url("https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@700;900&display=swap");

:root {
  color-scheme: dark;
  --night-ink: #111827;
  --candle-gold: #d8b45c;
  --old-gold: #b98a2e;
  --burgundy: #7a1f2b;
  --parchment: #f2e4c8;
  --aged-parchment: #e1cfa6;
  --mahogany: #2a1518;
  --smoke-blue: #253044;
  --soft-mist: #b7ac95;
  --spell-green: #3f7f66;
  --danger: #ffb4a8;
  --shadow: rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--night-ink);
  color: var(--parchment);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(17, 24, 39, 0.45), rgba(17, 24, 39, 0.45)),
    url("./assets/wizarding_background.png") center / cover fixed;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

.app {
  min-height: 100vh;
  background: rgba(17, 24, 39, 0.45);
  padding-bottom: var(--player-space, 0px);
}

.screen {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px;
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.title {
  margin: 0;
  color: var(--parchment);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0;
}

.top-row .title {
  color: #f7e7be;
  font-family: "Cinzel Decorative", Georgia, "Times New Roman", serif;
  font-size: clamp(1.4rem, 3.5vw, 2.66rem);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 12px rgba(216, 180, 92, 0.36), 0 2px 0 rgba(49, 20, 23, 0.9);
}

.subtitle {
  margin: 0 0 18px;
  color: var(--soft-mist);
  font-size: 15px;
  line-height: 1.45;
}

.actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-button {
  position: relative;
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 999px;
  background: transparent;
  color: var(--parchment);
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: rgba(242, 228, 200, 0.12);
  outline: 0;
}

.icon-button:active {
  transform: scale(0.96);
}

.svg-icon {
  width: 1.35em;
  height: 1.35em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.badge {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff1744;
  color: #fff;
  font-size: 12px;
  line-height: 19px;
  text-align: center;
}

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

.row-card {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 8px;
  background: var(--mahogany);
  box-shadow: 0 14px 36px var(--shadow);
  text-align: left;
}

.row-card:hover,
.row-card:focus-visible {
  outline: 2px solid rgba(216, 180, 92, 0.42);
}

.cover {
  flex: 0 0 auto;
  width: 72px;
  height: 96px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--mahogany);
  color: var(--candle-gold);
  box-shadow: inset 0 0 0 1px rgba(242, 228, 200, 0.1);
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover.large {
  width: 118px;
  height: 158px;
}

.cover.player-cover {
  width: 220px;
  height: 292px;
  margin: 18px auto 28px;
}

.cover-fallback {
  font-size: 36px;
  line-height: 1;
}

.book-copy {
  min-width: 0;
  flex: 1;
}

.book-copy h2,
.book-copy h3,
.chapter-copy h3,
.notification-title {
  margin: 0;
  color: var(--parchment);
  font-size: 17px;
  font-weight: 650;
  line-height: 1.25;
}

.book-copy p,
.chapter-copy p,
.muted {
  margin: 4px 0 0;
  color: var(--soft-mist);
  font-size: 14px;
  line-height: 1.4;
}

.progress {
  width: 100%;
  height: 4px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(183, 172, 149, 0.28);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--candle-gold);
}

.download-done {
  color: var(--candle-gold);
  font-size: 22px;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.header-row .title {
  font-size: 25px;
}

.book-header {
  display: flex;
  gap: 18px;
  margin-bottom: 24px;
}

.book-header .title {
  font-size: 25px;
  line-height: 1.15;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 12px;
}

.section-head h2 {
  margin: 0;
  color: var(--parchment);
  font-size: 22px;
}

.chapter-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 8px;
  background: var(--mahogany);
  box-shadow: 0 14px 36px var(--shadow);
}

.chapter-copy {
  min-width: 0;
  flex: 1;
}

.chapter-play {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: var(--smoke-blue);
  color: var(--soft-mist);
}

.chapter-play.active {
  background: var(--candle-gold);
  color: var(--night-ink);
}

.screen-center {
  display: grid;
  min-height: 70vh;
  place-items: center;
  text-align: center;
}

.player-title {
  margin: 0;
  color: var(--parchment);
  font-size: 24px;
  font-weight: 700;
  text-align: center;
}

.player-author,
.player-chapter {
  margin: 5px 0 0;
  color: var(--soft-mist);
  text-align: center;
}

.player-chapter {
  color: var(--candle-gold);
  font-size: 17px;
}

.range {
  width: 100%;
  accent-color: var(--candle-gold);
}

.time-row,
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--soft-mist);
  font-size: 13px;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  margin: 28px 0;
}

.big-play {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 999px;
  background: var(--candle-gold);
  color: var(--night-ink);
  font-size: 32px;
}

.skip-button {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: transparent;
  color: var(--candle-gold);
  font-size: 26px;
}

.chip-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  min-width: 50px;
  padding: 8px 12px;
  border: 1px solid rgba(225, 207, 166, 0.34);
  border-radius: 999px;
  background: rgba(42, 21, 24, 0.78);
  color: var(--parchment);
}

.chip.active {
  background: var(--candle-gold);
  color: var(--night-ink);
  border-color: var(--candle-gold);
}

.settings-stack {
  display: grid;
  gap: 22px;
}

.setting-card {
  padding: 14px;
  border-radius: 8px;
  background: rgba(42, 21, 24, 0.9);
}

.setting-card h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
}

.check-row input {
  width: 22px;
  height: 22px;
  accent-color: var(--candle-gold);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--candle-gold);
  color: var(--night-ink);
  font-weight: 700;
}

.notification-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  background: var(--mahogany);
  text-align: left;
}

.unread-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--candle-gold);
}

.notification-body {
  padding: 14px;
  border-radius: 8px;
  background: var(--mahogany);
  color: var(--parchment);
  line-height: 1.55;
}

.notice {
  padding: 14px;
  border-radius: 8px;
  background: rgba(37, 48, 68, 0.88);
  color: var(--parchment);
}

.mini-player {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  border-top: 1px solid rgba(225, 207, 166, 0.24);
  background: var(--mahogany);
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.42);
}

.mini-inner {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 10px 16px;
}

.mini-content {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 10px;
}

.mini-open {
  min-width: 0;
  padding: 0;
  background: transparent;
  text-align: left;
}

.mini-open h2 {
  margin: 0;
  overflow: hidden;
  color: var(--parchment);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-open p {
  margin: 3px 0 4px;
  overflow: hidden;
  color: var(--soft-mist);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-times {
  display: flex;
  justify-content: space-between;
  color: var(--soft-mist);
  font-size: 12px;
}

.spin {
  animation: spin 1s linear infinite;
}

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

@media (max-width: 560px) {
  .screen {
    padding: 20px;
  }

  .book-header {
    align-items: flex-start;
  }

  .book-header .cover {
    width: 102px;
    height: 136px;
  }

  .book-header .title {
    font-size: 22px;
  }

  .mini-content {
    grid-template-columns: 1fr auto auto;
  }

  .mini-content .skip-forward {
    display: none;
  }
}
