:root {
  --bg0: #0d1612;
  --bg1: #15241c;
  --ink: #e8efe6;
  --muted: #9bb09f;
  --accent: #d4a35c;
  --accent-2: #6f9b7a;
  --card: rgba(22, 36, 28, 0.82);
  --line: rgba(212, 163, 92, 0.28);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Manrope, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg0);
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(111, 155, 122, 0.22), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(212, 163, 92, 0.16), transparent 55%),
    linear-gradient(180deg, #101c16 0%, #0d1612 45%, #0a1210 100%);
}

.top {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 1rem;
}
.brand { display: flex; gap: 1rem; align-items: center; }
.brand-mark {
  width: 3rem; height: 3rem; border-radius: 0.9rem;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #2a4634, #1a2c22);
  border: 1px solid var(--line);
  color: var(--accent);
  font-family: Spectral, Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
}
.brand h1, .player-top h1 {
  margin: 0;
  font-family: Spectral, Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
}
.brand p { margin: 0.25rem 0 0; color: var(--muted); }

.library {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
}

.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  min-height: 320px;
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 163, 92, 0.55);
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
}
.card-cover {
  aspect-ratio: 4/3;
  background:
    linear-gradient(160deg, rgba(42,70,52,.9), rgba(13,22,18,.95)),
    repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 8px, transparent 8px 16px);
  display: grid;
  place-items: center;
  position: relative;
}
.card-cover img {
  width: 100%; height: 100%; object-fit: contain; object-position: center; display: block;
}
.card-cover .glyph {
  font-family: Spectral, Georgia, serif;
  font-size: 3rem;
  color: rgba(212,163,92,.55);
}
.badge {
  position: absolute; top: .7rem; right: .7rem;
  font-size: .72rem; letter-spacing: .04em;
  padding: .25rem .55rem; border-radius: 999px;
  background: rgba(0,0,0,.45); border: 1px solid var(--line); color: var(--accent);
}
.card-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.card-body h2 {
  margin: 0;
  font-family: Spectral, Georgia, serif;
  font-size: 1.25rem;
  line-height: 1.25;
}
.card-body p { margin: 0; color: var(--muted); font-size: .9rem; }
.card-cta {
  margin-top: auto;
  color: var(--accent);
  font-weight: 700;
  font-size: .92rem;
}

.player-top { display: flex; flex-direction: column; gap: .5rem; }
.back { color: var(--muted); text-decoration: none; width: fit-content; }
.back:hover { color: var(--accent); }

.player-layout {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
  display: grid;
  gap: 1rem;
}

.stage {
  position: relative;
  border-radius: 1.2rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #132018;
  min-height: 320px;
  /* квадратная сцена: и альбом, и портрет влезают целиком */
  aspect-ratio: 1 / 1;
  max-height: min(72vh, 720px);
  margin: 0 auto;
  width: 100%;
}
.illustration {
  width: 100%; height: 100%;
  object-fit: contain; /* целиком по длинной стороне, без обрезки */
  object-position: center;
  display: block;
  background:
    radial-gradient(circle at 30% 20%, rgba(212,163,92,.18), transparent 45%),
    linear-gradient(160deg, #1d3226, #101a14);
}
.stage-overlay {
  position: absolute; inset: auto 0 0 0;
  padding: .8rem 1rem;
  background: linear-gradient(transparent, rgba(0,0,0,.65));
}
.part-label { margin: 0; color: var(--accent); font-size: .85rem; letter-spacing: .04em; }

.console {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  padding: 1rem 1.1rem 1.2rem;
}
.caption {
  margin: 0 0 1rem;
  font-family: Spectral, Georgia, serif;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  line-height: 1.55;
  max-height: 9.5rem;
  overflow: auto;
}
.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .8rem;
  margin-bottom: .8rem;
}
.controls button {
  border: 1px solid var(--line);
  background: #1a2b21;
  color: var(--ink);
  width: 3rem; height: 3rem;
  border-radius: 999px;
  font-size: 1.1rem;
  cursor: pointer;
}
.controls button.play {
  width: 4rem; height: 4rem;
  background: linear-gradient(145deg, #c7924a, #8f6230);
  border-color: transparent;
  color: #1a1208;
  font-weight: 700;
}
.controls button:hover { border-color: var(--accent); }
#seek {
  width: 100%;
  accent-color: var(--accent);
}
.meta-row {
  display: flex; justify-content: space-between;
  color: var(--muted); font-size: .85rem; margin-top: .35rem;
}
.status { color: var(--accent-2); font-size: .85rem; min-height: 1.2em; }

@media (max-width: 640px) {
  .stage { aspect-ratio: 1 / 1; min-height: 240px; max-height: 70vh; }
}
