* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body, html {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body:not([data-view="init"])        .init,
body:not([data-view="player"])      .player,
body:not([data-view="book-picker"]) .book-picker {display:none!important;}

.player {
  display: grid;
  grid-template-rows: 1fr auto;
  height: 100%;
  width: 100%;
}

.player img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.player-controls {
  display: flex;
  justify-content: flex-end;
}
.player-controls audio {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

audio::-webkit-media-controls-panel {
  background-color: rgba(0, 0, 0, 0.05) !important;
}
audio::-webkit-media-controls-enclosure {
  border-radius: 0 !important;
}

.player-controls button {
  font-size: 1.2rem;
  min-width: 40px;
  border: none;
  cursor: pointer;
  background-color: rgba(0, 0, 0, 0.1) !important;
  filter: grayscale(100%) brightness(0.8);
}

.book-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  padding: 20px;
}

.book-picker .book {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  max-height: 300px;
}

.book-picker .book img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.book-picker .book .name {
  padding: 10px;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
}

.spinner {
  animation: rotate 2s linear infinite;
  height: 42px;
  width: 42px;
  border-radius: 50%;
  border-top-color: #3498db;
  border-right-color: #f1c40f;
  border-bottom-color: #e74c3c;
  border-left-color: #2ecc71;
  border-width: 2px;
  border-style: solid;
}
.path {
  stroke-dasharray: 90,150;
  stroke-dashoffset: 0;
  stroke-width: 2;
  stroke: #fff;
  animation: dash 1.5s ease-in-out infinite;
}
@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}
@keyframes dash {
  0% {
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }
  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}
