/* ponytail: compatibility layer for classes still emitted by public/app.js. */
.rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scrollbar-width: none;
}

.rail::-webkit-scrollbar {
  display: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.card,
.hero,
.segmented,
.catalog-form,
.searchbar,
.filter-grid {
  min-width: 0;
}

.card {
  overflow: hidden;
  border: 1px solid rgba(87, 65, 74, 0.35);
  border-radius: 16px;
  background: #291c22;
}

.rail .card {
  flex: 0 0 148px;
}

.card button {
  display: flex;
  width: 100%;
  min-height: 100%;
  flex-direction: column;
  text-align: left;
}

.card img,
.card > button > div:first-child,
.card .w-full.h-full {
  aspect-ratio: 2 / 3;
}

.card-body {
  display: flex;
  min-height: 86px;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
}

.card-title {
  color: #f4dde5;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.meta {
  color: #ddbfca;
  font-size: 11px;
  line-height: 1.25;
}

.shelf-card {
  position: relative;
}

.shelf-controls {
  padding: 0 10px 10px;
}

.shelf-controls select,
.catalog-form input,
.catalog-form select {
  width: 100%;
  border: 1px solid rgba(87, 65, 74, 0.55);
  border-radius: 14px;
  background: #160b10;
  color: #f4dde5;
  font-size: 13px;
}

.shelf-controls select {
  padding: 8px 10px;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(87, 65, 74, 0.45);
  border-radius: 9999px;
  background: #34262c;
}

.segmented button {
  border-radius: 9999px;
  padding: 8px 14px;
  color: #ddbfca;
  font-size: 13px;
  font-weight: 800;
}

.segmented button.active {
  background: #f451b0;
  color: #560039;
}

.catalog-form {
  display: grid;
  gap: 12px;
  margin: 14px 0 18px;
}

.searchbar {
  display: flex;
  gap: 8px;
}

.catalog-form input,
.catalog-form select {
  padding: 10px 12px;
}

.searchbar input {
  flex: 1 1 auto;
}

.searchbar button,
.primary {
  border-radius: 9999px;
  background: #ffafd5;
  color: #620041;
  font-size: 13px;
  font-weight: 900;
  padding: 10px 16px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.filter-grid select {
  grid-column: 1 / -1;
}

.hero {
  position: relative;
  min-height: 280px;
  overflow: hidden;
  border-radius: 24px;
  background: #291c22;
}

.hero > img,
.hero > div:first-child {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #1c1015 0%, rgba(28, 16, 21, 0.55) 55%, transparent 100%);
}

.hero-content {
  position: absolute;
  inset-inline: 18px;
  bottom: 18px;
  z-index: 1;
}

.hero-content h1 {
  color: #f4dde5;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.hero-content p {
  margin-top: 8px;
  color: #ddbfca;
  font-size: 14px;
}

.reader-mode-btn,
.reader-page-btn {
  border-radius: 9999px;
  color: #ddbfca;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 10px;
  white-space: nowrap;
}

.reader-mode-btn.active,
.reader-page-btn {
  background: #f451b0;
  color: #560039;
}

.player-fullscreen-fallback {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100000 !important;
  width: 100vw !important;
  height: 100dvh !important;
  padding: 0 !important;
  max-height: none !important;
  border-radius: 0 !important;
  border: 0 !important;
  background: #000 !important;
}

.player-fullscreen-fallback .artplayer-app,
.player-fullscreen-fallback video {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  border-radius: 0 !important;
}

.player-fullscreen-fallback > :not(.player-stage) {
  display: none !important;
}

.player-fullscreen-fallback .player-stage {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  padding: 0 !important;
}

body.reader-open #app > header,
body.reader-open #bottomNav {
  display: none;
}

@media (max-width: 420px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .rail .card {
    flex-basis: 132px;
  }

  #bottomNav {
    gap: 2px;
    padding-inline: 8px;
  }

  #bottomNav button {
    padding-inline: 8px;
  }
}
