:root {
  color-scheme: dark;
  --bg: #080604;
  --gold: #d39a2a;
  --copper: #9a5a2a;
  --red-hot: #9f1713;
  --blood: #5e0908;
  --text: #f4dfb6;
  --muted: #b99062;
  --line: rgba(211, 154, 42, 0.32);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.58);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 118px;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 8%, rgba(159, 23, 19, 0.5), transparent 30%),
    radial-gradient(circle at 82% 5%, rgba(211, 154, 42, 0.18), transparent 24%),
    linear-gradient(180deg, rgba(27, 12, 8, 0.82), rgba(5, 3, 2, 0.98)),
    url("https://www.transparenttextures.com/patterns/old-wall.png"),
    var(--bg);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 9px 15px;
  color: #fff7df;
  background: linear-gradient(180deg, var(--red-hot), var(--blood));
  box-shadow: inset 0 1px 0 rgba(255, 222, 150, 0.18);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: #ffe38a;
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.28);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 42px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(33, 13, 8, 0.96), rgba(7, 4, 3, 0.94)),
    url("https://www.transparenttextures.com/patterns/dark-leather.png");
  backdrop-filter: blur(14px);
}

.logo-title {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gold);
  text-decoration: none;
  font-family: Cinzel, serif;
  font-size: clamp(1.1rem, 2.2vw, 1.65rem);
  font-weight: 700;
  letter-spacing: 4px;
  text-shadow: 0 2px 0 #1b0705, 0 0 18px rgba(211, 154, 42, 0.42);
}

.logo {
  width: 48px;
  height: 48px;
  border: 2px solid var(--copper);
  border-radius: 50%;
  background: #120806;
  object-fit: cover;
  filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.55));
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 17, 11, 0.48);
  background:
    linear-gradient(90deg, rgba(94, 9, 8, 0.22), rgba(24, 17, 11, 0.34)),
    rgba(16, 8, 5, 0.5);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 820px;
  font-family: Cinzel, serif;
  font-size: clamp(1.05rem, 2vw, 1.55rem);
  line-height: 1.22;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.52);
}

.hero-copy {
  max-width: 680px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

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

.hero-stats div,
.featured-player,
#sidebar,
.card,
.popup-content {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(62, 28, 13, 0.82), rgba(14, 7, 4, 0.94)),
    url("https://www.transparenttextures.com/patterns/dark-wood.png");
  box-shadow: var(--shadow);
}

.hero-stats div {
  padding: 9px 11px;
  box-shadow: none;
  background: rgba(0, 0, 0, 0.18);
}

.hero-stats strong,
.hero-stats span {
  display: block;
}

.hero-stats strong {
  color: var(--gold);
  font-size: 1.05rem;
}

.hero-stats span {
  color: var(--muted);
  font-size: 0.72rem;
}

.featured-player {
  position: fixed;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 30;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 16px;
  color: var(--muted);
  backdrop-filter: blur(14px);
}

.featured-player audio,
.featured-player video {
  width: 100%;
  display: block;
}

.featured-player:empty {
  display: none;
}

.featured-player.is-active {
  display: grid;
  grid-template-columns: minmax(180px, 320px) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.now-playing {
  min-width: 0;
}

.now-playing span,
.now-playing strong {
  display: block;
}

.now-playing span {
  margin-bottom: 3px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.now-playing strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: 24px;
  margin-top: 24px;
}

#sidebar h2 {
  font-family: Cinzel, serif;
  color: var(--text);
  letter-spacing: 1px;
}

.media-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(244, 211, 126, 0.72);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.58), 0 0 22px rgba(159, 23, 19, 0.28);
}

.card.new {
  border-color: var(--gold);
}

.card.new::before {
  content: "NEW";
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 7px;
  border-radius: 6px;
  color: #180905;
  background: linear-gradient(180deg, #f0c35d, var(--gold));
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.card h3 {
  min-height: 38px;
  color: #fff5df;
  font-size: 0.96rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.cover,
.no-cover,
.card video {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  border: 1px solid rgba(211, 154, 42, 0.3);
  background: #100704;
  object-fit: cover;
}

.no-cover {
  display: grid;
  place-items: center;
  color: rgba(247, 234, 209, 0.42);
  font-size: 0.85rem;
}

.stars {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.9rem;
}

.star {
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: rgba(247, 234, 209, 0.32);
  cursor: pointer;
  font-size: 1.12rem;
  transition: color 0.18s ease, transform 0.18s ease;
}

.star:hover {
  transform: scale(1.18);
  color: #ffe38a;
}

.star.active {
  color: var(--gold);
  text-shadow: 0 0 7px rgba(212, 175, 55, 0.72);
}

.custom-player {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(166, 124, 82, 0.5);
  border-radius: 8px;
  background: rgba(5, 2, 1, 0.58);
}

.custom-player audio {
  display: none;
}

.play-btn {
  display: grid;
  place-items: center;
  min-height: 38px;
  padding: 0;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  cursor: pointer;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blood), var(--gold));
}

.time {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: right;
}

#sidebar {
  position: sticky;
  top: 92px;
  padding: 18px;
}

#rankingList {
  display: grid;
  gap: 10px;
}

.ranking-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  border-left: 2px solid rgba(211, 154, 42, 0.42);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.ranking-item:hover {
  transform: translateX(4px);
  border-left-color: var(--gold);
  background: linear-gradient(90deg, rgba(159, 23, 19, 0.32), rgba(255, 255, 255, 0.07));
  box-shadow: inset 0 0 0 1px rgba(211, 154, 42, 0.16), 0 8px 18px rgba(0, 0, 0, 0.22);
}

.ranking-item.rank-1 {
  border-left-color: #f0c35d;
  background: linear-gradient(90deg, rgba(240, 195, 93, 0.22), rgba(255, 255, 255, 0.055));
}

.ranking-item.rank-2 {
  border-left-color: #c9c6bb;
  background: linear-gradient(90deg, rgba(201, 198, 187, 0.18), rgba(255, 255, 255, 0.05));
}

.ranking-item.rank-3 {
  border-left-color: #b8773e;
  background: linear-gradient(90deg, rgba(184, 119, 62, 0.2), rgba(255, 255, 255, 0.05));
}

.ranking-item.rank-1 strong {
  color: #f0c35d;
}

.ranking-item.rank-2 strong {
  color: #d8d3c7;
}

.ranking-item.rank-3 strong {
  color: #d08a4b;
}

.ranking-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.vote-count {
  white-space: nowrap;
  color: var(--gold);
  font-size: 0.92rem;
}

#footer {
  width: min(1480px, 100%);
  margin: 18px auto 0;
  padding: 22px 34px 34px;
  color: rgba(247, 234, 209, 0.55);
  font-size: 0.82rem;
  text-align: center;
}

.popup {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.78);
}

.popup-content {
  width: min(440px, 100%);
  padding: 24px;
}

.popup-content h2 {
  margin-bottom: 10px;
  font-family: Cinzel, serif;
}

.popup-description {
  margin-bottom: 16px;
  color: var(--muted);
  line-height: 1.55;
}

.popup-content input,
.popup-content textarea {
  width: 100%;
  margin-bottom: 12px;
  border: 1px solid rgba(166, 124, 82, 0.55);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  background: rgba(7, 3, 2, 0.5);
}

.popup-content textarea {
  min-height: 130px;
  resize: vertical;
}

.honeypot {
  display: none;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

@media (max-width: 960px) {
  .hero {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

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

  .top-actions {
    width: 100%;
  }

  .top-actions button {
    flex: 1 1 180px;
  }

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

  #sidebar {
    position: static;
  }
}

@media (max-width: 560px) {
  .logo-title {
    letter-spacing: 1.5px;
  }

  .hero,
  main {
    padding: 16px;
  }

  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .hero-stats div {
    padding: 7px 8px;
  }

  .hero-stats strong {
    font-size: 0.95rem;
  }

  .hero-stats span {
    font-size: 0.66rem;
  }

  .media-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .card {
    gap: 8px;
    padding: 9px;
  }

  .card h3 {
    min-height: 32px;
    font-size: 0.78rem;
    line-height: 1.25;
  }

  .cover,
  .no-cover,
  .card video {
    aspect-ratio: 1 / 0.82;
  }

  .stars {
    gap: 3px;
    font-size: 0.76rem;
  }

  .star {
    font-size: 0.95rem;
  }

  .custom-player {
    gap: 7px;
    padding: 7px;
  }

  .play-btn {
    min-height: 32px;
  }

  .custom-player {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .time {
    grid-column: 2;
    text-align: left;
  }

  .featured-player {
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: calc(100% - 20px);
    padding: 12px;
  }

  .featured-player.is-active {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
