:root {
  --bg: #f7f8fb;
  --panel: #ffffff;
  --ink: #151821;
  --muted: #626b7a;
  --line: #dfe4ec;
  --brand: #0f8f7b;
  --brand-dark: #09685b;
  --accent: #f4b942;
  --danger: #c63c3c;
  --shadow: 0 18px 45px rgba(20, 24, 33, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

.shell {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  background: #10151f;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 10px 24px rgba(16, 21, 31, 0.16);
}

.topbar ins,
.topbar iframe,
.topbar .adsbygoogle,
.hero > .adsbygoogle,
body > .adsbygoogle:first-child {
  display: none !important;
}

.topbar .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 800;
  min-width: 0;
}

.brand span:last-child {
  overflow-wrap: anywhere;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
}

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

.nav a,
.btn,
button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 15px;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.nav a {
  color: #d9e2ef;
  display: inline-flex;
  align-items: center;
}

.btn,
button {
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:hover,
button:hover { background: var(--brand-dark); }

.btn.secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.btn.danger {
  background: var(--danger);
}

.play-btn {
  background: #10151f;
}

.play-btn:hover,
.play-btn.is-playing {
  background: var(--accent);
  color: #10151f;
}

.hero {
  padding: 56px 0 26px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: stretch;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 72px);
  line-height: 0.96;
  letter-spacing: 0;
  max-width: 760px;
}

.hero p {
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.hero-card,
.panel,
.song-card,
.form-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 24px;
  display: grid;
  gap: 14px;
  align-content: center;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.stat strong {
  display: block;
  font-size: 24px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.filters {
  margin: 22px 0;
  display: grid;
  grid-template-columns: 1fr 220px auto;
  gap: 12px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.songs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
  padding: 10px 0 56px;
}

.song-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.clickable-card {
  cursor: pointer;
}

.clickable-card:hover {
  transform: translateY(-2px);
  transition: transform .18s ease, box-shadow .18s ease;
  box-shadow: 0 22px 52px rgba(20, 24, 33, 0.13);
}

.cover {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #0f8f7b, #10151f);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 42px;
  font-weight: 900;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: linear-gradient(135deg, #0f8f7b, #10151f);
}

.song-body {
  padding: 16px;
  display: grid;
  gap: 10px;
  flex: 1;
}

.song-title {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.meta {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.song-body > p.meta {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tag {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border-radius: 999px;
  background: #e8f6f3;
  color: var(--brand-dark);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}

.song-actions {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.song-actions .btn,
.song-actions button {
  width: 100%;
}

.song-card audio {
  display: none;
}

.ad-slot {
  grid-column: 1 / -1;
  min-height: 150px;
  margin: 4px 0 6px;
  border: 1px dashed #b8c3d4;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  display: grid;
  justify-items: stretch;
  align-items: center;
  overflow: hidden;
  padding: 14px;
  align-content: center;
}

.ad-label {
  width: 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.ad-slot ins.adsbygoogle {
  display: block !important;
  width: 100%;
  min-width: 100%;
}

.ad-fallback {
  width: 100%;
  min-height: 96px;
  display: grid;
  place-items: center;
  gap: 4px;
  text-align: center;
  color: var(--muted);
}

.ad-fallback strong {
  color: var(--ink);
  font-size: 16px;
}

.ad-fallback span {
  font-size: 13px;
}

.detail-page {
  padding: 34px 0 60px;
}

.detail-card {
  display: grid;
  grid-template-columns: minmax(360px, 440px) 1fr;
  gap: 28px;
  align-items: stretch;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.premium-detail {
  border-color: #cbd6e4;
}

.detail-cover {
  min-height: 440px;
  background: linear-gradient(135deg, #0f8f7b, #10151f);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 72px;
  font-weight: 900;
}

.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: linear-gradient(135deg, #0f8f7b, #10151f);
}

.detail-info {
  padding: 30px;
  display: grid;
  gap: 14px;
  align-content: center;
}

.detail-info h1 {
  margin: 0;
  font-size: clamp(32px, 5.6vw, 58px);
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.detail-artist {
  margin: 0;
  color: var(--muted);
  font-size: 20px;
  font-weight: 750;
}

.detail-description {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  max-width: 680px;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 160px));
  gap: 10px;
}

.player-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfd;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.player-panel strong {
  display: block;
  font-size: 15px;
}

.player-panel span {
  color: var(--muted);
  font-size: 13px;
}

.player-panel audio {
  width: 100%;
  display: block;
}

.section-title {
  margin: 34px 0 14px;
  font-size: 24px;
}

.compact-songs {
  padding-bottom: 0;
}

.admin-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  padding: 34px 0 60px;
}

.form-card,
.panel {
  padding: 20px;
}

.form-card h2,
.panel h2 {
  margin: 0 0 18px;
  font-size: 22px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.settings-form {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.admin-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: #10151f;
  color: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-weight: 900;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.notice,
.error,
.empty {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.notice { border-color: #bfe7db; background: #eefbf7; color: #07594f; }
.error { border-color: #f0b5b5; background: #fff0f0; color: #9c2020; }
.empty { color: var(--muted); text-align: center; padding: 36px 18px; }

.login-wrap {
  width: min(420px, calc(100% - 32px));
  margin: 72px auto;
}

@media (min-width: 1200px) {
  .songs {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 900px) {
  .hero-grid,
  .admin-layout,
  .detail-card {
    grid-template-columns: 1fr;
  }

  .detail-cover {
    min-height: auto;
    aspect-ratio: 16 / 10;
  }
  .songs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 1480px);
  }

  .topbar .shell {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 11px 0 12px;
    min-height: auto;
  }

  .brand {
    font-size: 18px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

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

  .nav a {
    justify-content: center;
    min-height: 40px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 8px;
    padding: 8px 10px;
  }

  .nav a:only-child {
    grid-column: 1 / -1;
  }

  .hero {
    padding: 28px 0 18px;
  }

  .hero h1 {
    font-size: clamp(32px, 12vw, 44px);
    line-height: 1.02;
  }

  .hero p {
    font-size: 16px;
    line-height: 1.55;
  }

  .hero-card,
  .form-card,
  .panel {
    padding: 16px;
  }

  .filters {
    margin: 16px 0;
  }

  .stat-row,
  .filters,
  .songs {
    grid-template-columns: 1fr;
  }

  .admin-item {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
  }

  .row-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .row-actions .btn,
  .row-actions button {
    width: 100%;
  }

  .detail-info {
    padding: 18px;
    gap: 12px;
  }

  .detail-info h1 {
    font-size: clamp(30px, 10vw, 38px);
    line-height: 1.08;
  }

  .detail-stats {
    grid-template-columns: 1fr;
  }

  .detail-page,
  .admin-layout {
    padding: 20px 0 44px;
  }
}

@media (max-width: 420px) {
  .shell {
    width: min(100% - 16px, 1480px);
  }

  .song-body {
    padding: 14px;
  }

  .cover,
  .detail-cover {
    aspect-ratio: 4 / 3;
  }

  .btn,
  button {
    width: 100%;
  }

  .login-wrap {
    width: min(100% - 16px, 420px);
    margin: 28px auto;
  }
}
