:root {
  color-scheme: light;
  --ink: #1e2028;
  --muted: #65636f;
  --paper: #fff7e8;
  --panel: #fffdfa;
  --line: rgba(43, 39, 50, 0.16);
  --practice: #0f8b8d;
  --chanting: #d95d39;
  --healing: #7b3f98;
  --all: #2f5fbd;
  --rose: #c73564;
  --gold: #f7b731;
  --mint: #45b69c;
  --shadow: 0 22px 55px rgba(36, 32, 45, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 139, 141, 0.2) 0%, rgba(247, 183, 49, 0.14) 36%, transparent 36%),
    linear-gradient(315deg, rgba(123, 63, 152, 0.16) 0%, rgba(217, 93, 57, 0.13) 42%, transparent 42%),
    var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.topbar {
  margin-bottom: 20px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  display: inline-block;
  padding: 16px 22px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background: linear-gradient(135deg, #1f7a8c, #7b3f98 48%, #d95d39);
  color: white;
  font-size: 3.2rem;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: var(--shadow);
}

.group-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.group-tab {
  min-height: 58px;
  border: 0;
  border-radius: 8px;
  background: white;
  color: white;
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 13px 24px rgba(36, 32, 45, 0.12);
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.group-tab:nth-child(1) {
  background: linear-gradient(135deg, #0f8b8d, #34c3b2);
}

.group-tab:nth-child(2) {
  background: linear-gradient(135deg, #d95d39, #f7b731);
  color: #261506;
}

.group-tab:nth-child(3) {
  background: linear-gradient(135deg, #7b3f98, #c73564);
}

.group-tab:nth-child(4) {
  background: linear-gradient(135deg, #2f5fbd, #45b69c);
}

.group-tab:hover {
  filter: saturate(1.12);
  transform: translateY(-1px);
}

.group-tab.active {
  box-shadow: 0 16px 30px rgba(36, 32, 45, 0.24);
  outline: 3px solid rgba(255, 255, 255, 0.9);
  outline-offset: -6px;
}

.now-playing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  min-height: 172px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 249, 232, 0.95)),
    var(--panel);
  box-shadow: var(--shadow);
}

.group-label {
  display: inline-flex;
  padding: 7px 10px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: rgba(199, 53, 100, 0.1);
  color: var(--rose);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.track-meta h2 {
  margin-bottom: 8px;
  font-size: 2.1rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.track-meta p {
  color: var(--muted);
}

.controls {
  display: grid;
  grid-template-columns: 44px 96px 44px;
  align-items: center;
  gap: 10px;
}

.icon-button,
.play-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(36, 32, 45, 0.14);
}

.icon-button {
  width: 44px;
  height: 44px;
  background: #1f7a8c;
  color: white;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.play-button {
  min-height: 50px;
  background: linear-gradient(135deg, var(--gold), #ffdf6f);
  color: #1f1604;
  font-weight: 800;
}

.play-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.library-area {
  margin-top: 20px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.82);
  box-shadow: 0 14px 34px rgba(36, 32, 45, 0.1);
}

.library-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.library-heading h2 {
  font-size: 1.65rem;
}

#trackCount {
  color: var(--muted);
  white-space: nowrap;
}

.track-list {
  display: grid;
  gap: 10px;
}

.track-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid rgba(43, 39, 50, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(69, 182, 156, 0.12), rgba(255, 255, 255, 0.88) 28%),
    white;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 8px 18px rgba(36, 32, 45, 0.07);
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.track-button:hover,
.track-button.active {
  border-color: var(--all);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(36, 32, 45, 0.12);
}

.track-name {
  overflow-wrap: anywhere;
  font-weight: 700;
}

.track-badge {
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(47, 95, 189, 0.1);
  color: #2f5fbd;
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.empty-state {
  min-height: 130px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  text-align: center;
  padding: 20px;
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 18px;
  }

  h1 {
    width: 100%;
    font-size: 2.35rem;
  }

  .topbar,
  .now-playing,
  .library-heading {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .group-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .track-meta h2 {
    font-size: 1.65rem;
  }

  .controls {
    grid-template-columns: 44px minmax(88px, 1fr) 44px;
  }
}
