body {
  margin: 0 auto;
  background: no-repeat center center fixed;
  background-size: cover;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  color: white;
  padding: 40px 20px;
  overflow-x: hidden !important;
}

.lib-wrapper {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.lib-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(25, 25, 25, 0.7);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  padding: 24px 30px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

.lib-back {
  font-size: 12px;
  color: #888;
  text-decoration: none;
  letter-spacing: 1px;
  transition: color 0.2s;
  width: fit-content;
}

.lib-back:hover {
  color: var(--accent);
}

.lib-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(36px, 8vw, 64px);
  font-weight: 600;
  margin: 0;
  letter-spacing: -1px;
  line-height: 1;
}

.lib-sub {
  font-size: 12px;
  color: #666;
  margin: 0;
  letter-spacing: 1px;
}

.lib-topbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: rgba(25, 25, 25, 0.7);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  padding: 24px 30px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  justify-content: center;
}

.lib-filter {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: rgba(22, 22, 22, 0.6);
  border: 1px solid rgba(255,255,255,0.06);
  color: #999;
  padding: 7px 16px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
}

.lib-filter:hover {
  color: white;
  border-color: rgba(255,255,255,0.15);
}

.lib-filter.active {
  background: var(--accent);
  color: black;
  border-color: transparent;
  font-weight: 500;
}

.lib-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lib-card {
  background: rgba(25, 25, 25, 0.7);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: fadeIn 0.4s ease both;
  position: relative;
}

.lib-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
}

.lib-card.type-hidden,
.lib-card.page-hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lib-inner {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: rgba(0,0,0,0.25);
  border-radius: 12px;
  padding: 14px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.lib-inner:hover {
  transform: scale(1.02);
  background: rgba(0,0,0,0.4);
}

.lib-cover {
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.lib-cover.square { width: 90px; height: 90px; }
.lib-cover.portrait { width: 80px; height: 120px; }

.lib-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lib-name {
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  color: white;
}

.lib-author {
  font-size: 13px;
  color: #aaa;
}

.lib-meta {
  font-size: 11px;
  color: #777;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.lib-tag {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 4px;
}

.lib-synopsis {
  font-size: 12px;
  color: #999;
  line-height: 1.6;
  margin-top: 6px;
}

.lib-bar-wrap {
  height: 3px;
  background: #1a1a1a;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 8px;
}

@media (max-width: 768px) {
  .lib-cover.landscape {
    width: 60px;
    height: 90px;
  }
}

.lib-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 10px;
}

.lib-percent {
  font-size: 10px;
  color: #666;
  margin-top: 4px;
  text-align: right;
}

.lib-note {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.lib-note-label {
  font-size: 10px;
  color: #666;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.lib-note-text {
  font-size: 13px;
  color: #aaa;
  font-style: italic;
  line-height: 1.6;
}

.lib-type-badge {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #666;
  padding: 4px 10px;
  background: rgba(255,255,255,0.06);
  border-radius: 0 20px 0 8px;
}

.maintenance {
  display: flex;
  letter-spacing: 0.5px;
  background: rgba(25, 25, 25, 0.7);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  padding: 24px 30px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

#games-container,
#music-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lib-cover.landscape {
  width: 184px;
  height: 69px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.lib-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.lib-rating-bar-wrap {
  flex: 1;
  height: 3px;
  background: #1a1a1a;
  border-radius: 10px;
  overflow: hidden;
  max-width: 120px;
}

.lib-rating-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 10px;
}

.lib-rating-num {
  font-size: 11px;
  color: #777;
  white-space: nowrap;
}

.lib-pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.lib-page-btn {
  font-size: 11px;
  letter-spacing: 1px;
  background: rgba(22, 22, 22, 0.6);
  border: 1px solid rgba(255,255,255,0.06);
  color: #999;
  padding: 6px 14px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
}

.lib-page-btn:hover {
  color: white;
  border-color: rgba(255,255,255,0.15);
}

.lib-page-btn.active {
  background: var(--accent);
  color: black;
  border-color: transparent;
}

.page-hidden {
  display: none !important;
}

.lib-divider {
  width: 1px;
  background: rgba(255,255,255,0.08);
  margin: 0 4px;
  align-self: stretch;
}

.lib-sort {
  appearance: none;
  -webkit-appearance: none;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: rgba(22, 22, 22, 0.6);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  border: 1px solid rgba(255,255,255,0.06);
  color: #999;
  padding: 7px 8px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: flex-end;
  padding-right: 32px;
  width: auto;
}

.lib-sort:hover {
  color: white;
  border-color: rgba(255,255,255,0.15);
}

.lib-sort option {
  background: #1a1a1a;
  color: white;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.lib-collection-badges {
  position: absolute;
  bottom: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.lib-collection-badge {
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  padding: 3px 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px 0 0 8px;
}

.lib-collection-badge:last-child {
  border-radius: 8px 0 20px 0;
}
