:root {
  --background: #f0f0f0;
  --foreground: #0a0a0f;
  --card: #ffffff;
  --muted: #f5f5f5;
  --muted-foreground: #999999;
  --border: #e5e5e5;
  --primary: #ff9933;
  --primary-foreground: #ffffff;
  --accent: #336699;
  --accent-foreground: #ffffff;
  --primary-soft: rgba(255, 153, 51, 0.1);
  --primary-softer: rgba(255, 153, 51, 0.2);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12);
  --radius: 0.5rem;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: underline;
}
a:hover {
  color: var(--primary);
}

.container {
  max-width: 56rem;
  margin: 0 auto;
  padding: 2rem 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Header */
.app-header {
  text-align: center;
  margin-bottom: 1.5rem;
}
.title-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.title-row h1 {
  margin: 0;
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}
.subtitle {
  margin: 0.5rem 0 0;
  color: var(--muted-foreground);
  font-size: 1.125rem;
}

/* Player card */
.player-card {
  width: 100%;
  background: var(--card);
  border: 2px solid var(--primary-softer);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  margin-bottom: 1.5rem;
}
.player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.player iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.player .thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.player .thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: pointer;
}
.player:hover .thumb-overlay {
  opacity: 1;
}
.player:hover .thumb {
  transform: scale(1.05);
}
.player .big-play {
  background: transparent;
  border: 0;
  color: #fff;
  width: 6rem;
  height: 6rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}
.player .big-play:hover {
  background: rgba(255, 153, 51, 0.5);
}
.player .big-play svg {
  width: 5rem;
  height: 5rem;
}

/* Now playing / controls */
.now-playing {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}
.track-title {
  margin: 0;
  font-weight: 600;
  font-size: 1.25rem;
  text-align: center;
  width: 100%;
  padding: 0 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.btn-icon {
  background: transparent;
  border: 0;
  color: var(--foreground);
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}
.btn-icon:hover {
  background: var(--muted);
}
.btn-play {
  background: var(--primary);
  color: var(--primary-foreground);
  border: 0;
  width: 5rem;
  height: 5rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: transform 0.15s ease, background 0.2s ease;
}
.btn-play:hover {
  transform: scale(1.05);
}

/* Library / tabs */
.library {
  width: 100%;
}
.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--primary-soft);
  border-radius: var(--radius);
  padding: 0.25rem;
  gap: 0.25rem;
}
.tab {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  border-radius: calc(var(--radius) - 0.125rem);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.tab[aria-selected="true"] {
  background: var(--accent);
  color: var(--accent-foreground);
}
.tab-panels {
  margin-top: 1rem;
}
.tab-panel {
  display: none;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.tab-panel.active {
  display: grid;
}
@media (min-width: 768px) {
  .tab-panel.active {
    grid-template-columns: 1fr 1fr;
  }
}
.track {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 1rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--foreground);
  cursor: pointer;
  transition: background 0.2s ease;
}
.track:hover {
  background: var(--muted);
}
.track.is-current {
  background: var(--primary-softer);
}
.track .icon {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted-foreground);
}
.track:hover .icon,
.track.is-current .icon {
  color: var(--primary);
}
.track .label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Footer */
.app-footer {
  margin-top: auto;
  padding-top: 2rem;
  text-align: center;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}
.app-footer p {
  margin: 0.5rem 0;
}

/* Small screens */
@media (max-width: 480px) {
  .title-row h1 {
    font-size: 2.25rem;
  }
  .tabs {
    grid-template-columns: repeat(2, 1fr);
  }
  .btn-play {
    width: 4.5rem;
    height: 4.5rem;
  }
}
