    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      -webkit-tap-highlight-color: transparent;
    }

    :root {
      --primary: #ED5564;
      --primary-dark: #D63C4D;
      --bg: #1C1B1F;
      --surface: #1C1B1F;
      --surface-variant: #49454F;
      --surface-container: #211F26;
      --surface-container-high: #2B2930;
      --on-surface: #E6E1E5;
      --on-surface-variant: #CAC4D0;
      --outline: #938F99;
      --nav-height: 80px;
      --mini-player-height: 64px;
      --safe-bottom: env(safe-area-inset-bottom);
    }

    html, body {
      height: 100%;
      overflow: hidden;
      background: var(--bg);
      color: var(--on-surface);
      font-family: 'Roboto', -apple-system, sans-serif;
      -webkit-font-smoothing: antialiased;
      overscroll-behavior: none;
    }

    /* Performance optimizations */
    .app {
      display: flex;
      flex-direction: column;
      height: 100vh;
      height: 100dvh;
      transform: translateZ(0);
      backface-visibility: hidden;
    }

    .top-bar {
      position: sticky;
      top: 0;
      z-index: 10;
      background: var(--surface);
      height: 64px;
      display: flex;
      align-items: center;
      padding: 0 16px;
      border-bottom: 1px solid var(--outline);
      will-change: transform;
    }

    .title {
      flex: 1;
      font-size: 22px;
      font-weight: 500;
    }

    .icon-btn {
      width: 48px;
      height: 48px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      background: none;
      border: none;
      color: var(--on-surface);
    }

    .icon-btn:active {
      background: var(--surface-variant);
    }

    .icon {
      width: 24px;
      height: 24px;
      fill: currentColor;
    }

    .content {
      flex: 1;
      overflow: hidden;
      position: relative;
    }

    .viewport {
      display: flex;
      height: 100%;
      will-change: transform;
      transform: translateX(0) translateZ(0);
      transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
    }

    .page {
      flex: 0 0 100%;
      height: 100%;
      overflow-y: auto;
      overflow-x: hidden;
      -webkit-overflow-scrolling: touch;
      padding: 16px;
      padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
      transform: translateZ(0);
    }

    .page.with-player {
      padding-bottom: calc(var(--nav-height) + var(--mini-player-height) + var(--safe-bottom) + 24px);
    }

    /* Horizontal scroll optimization */
    .section {
      margin-bottom: 24px;
    }

    .section-title {
      font-size: 22px;
      font-weight: 500;
      margin-bottom: 12px;
    }

    .h-scroll {
      display: flex;
      gap: 12px;
      overflow-x: auto;
      scrollbar-width: none;
      -webkit-overflow-scrolling: touch;
      scroll-snap-type: x mandatory;
      padding: 4px 0;
      transform: translateZ(0);
    }

    .h-scroll::-webkit-scrollbar {
      display: none;
    }

    .grid-item {
      flex: 0 0 128px;
      scroll-snap-align: start;
      cursor: pointer;
    }

    .thumb {
      width: 100%;
      aspect-ratio: 1;
      border-radius: 6px;
      background: var(--surface-container-high);
      overflow: hidden;
      margin-bottom: 8px;
      transform: translateZ(0);
    }

    .thumb.circle {
      border-radius: 50%;
    }

    .thumb img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .grid-title {
      font-size: 14px;
      font-weight: 500;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .grid-sub {
      font-size: 12px;
      color: var(--on-surface-variant);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    /* List items */
    .list-item {
      display: flex;
      align-items: center;
      gap: 12px;
      height: 64px;
      padding: 8px;
      border-radius: 8px;
      cursor: pointer;
      transform: translateZ(0);
    }

    .list-item:active {
      background: var(--surface-container-high);
    }

    .list-thumb {
      width: 48px;
      height: 48px;
      border-radius: 6px;
      background: var(--surface-container);
      overflow: hidden;
      flex-shrink: 0;
    }

    .list-thumb img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .list-info {
      flex: 1;
      min-width: 0;
    }

    .list-title {
      font-size: 14px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      margin-bottom: 2px;
    }

    .list-sub {
      font-size: 12px;
      color: var(--on-surface-variant);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    /* Mini Player */
    .mini-player {
      position: fixed;
      bottom: var(--nav-height);
      left: 0;
      right: 0;
      height: var(--mini-player-height);
      background: var(--surface-container-high);
      z-index: 40;
      display: none !important;
      cursor: pointer;
      box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
    }

    .mini-player.active {
      display: flex !important;
      flex-direction: column;
      transform: translateY(0);
      transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
      will-change: transform;
    }

    .mini-progress {
      height: 2px;
      background: var(--surface-variant);
    }

    .mini-progress-bar {
      height: 100%;
      background: var(--primary);
      width: 0%;
      will-change: width;
    }

    .mini-content {
      display: flex;
      align-items: center;
      padding: 8px 16px;
      gap: 12px;
      height: calc(var(--mini-player-height) - 2px);
    }

    .mini-thumb {
      width: 48px;
      height: 48px;
      border-radius: 6px;
      background: var(--surface-container);
      overflow: hidden;
      flex-shrink: 0;
    }

    .mini-thumb img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .mini-info {
      flex: 1;
      min-width: 0;
    }

    .mini-title {
      font-size: 14px;
      font-weight: 500;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      margin-bottom: 2px;
    }

    .mini-artist {
      font-size: 12px;
      color: var(--on-surface-variant);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .mini-btn {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      background: none;
      border: none;
      color: var(--on-surface);
      cursor: pointer;
    }

    .mini-btn:active {
      background: var(--surface-variant);
    }

    .mini-btn svg {
      width: 24px;
      height: 24px;
      fill: currentColor;
    }

    /* Full Player */
    .player-sheet {
      position: fixed;
      inset: 0;
      z-index: 100;
      pointer-events: none;
      background: transparent;
      transition: background 250ms;
    }

    .player-sheet.open {
      background: rgba(0, 0, 0, 0.5);
      pointer-events: all;
    }

    .player-content {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 100%;
      background: var(--surface);
      border-radius: 28px 28px 0 0;
      transform: translateY(100%);
      transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
      overflow: hidden;
      display: flex;
      flex-direction: column;
      will-change: transform;
    }

    .player-sheet.open .player-content {
      transform: translateY(0);
    }

    .player-content.gradient {
      background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 60%, #000 100%);
    }

    .handle {
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: grab;
    }

    .handle-bar {
      width: 32px;
      height: 4px;
      background: var(--on-surface-variant);
      border-radius: 2px;
      opacity: 0.4;
    }

    .player-close-btn {
      position: absolute;
      top: 16px;
      right: 16px;
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: none;
      border: none;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      color: var(--on-surface);
      z-index: 10;
    }

    .player-close-btn:active {
      background: var(--surface-variant);
    }

    .player-close-btn svg {
      width: 24px;
      height: 24px;
      fill: currentColor;
    }

    .artwork-container {
      padding: 32px;
      display: flex;
      justify-content: center;
    }

    .artwork {
      width: min(100%, 320px);
      aspect-ratio: 1;
      border-radius: 12px;
      background: var(--surface-container);
      overflow: hidden;
      box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    }

    .artwork img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .track-info {
      padding: 0 32px 16px;
    }

    .track-title {
      font-size: 22px;
      font-weight: 500;
      margin-bottom: 4px;
    }

    .track-artist {
      font-size: 16px;
      color: var(--on-surface-variant);
    }

    .slider-container {
      padding: 8px 32px;
    }

    .slider {
      width: 100%;
      height: 4px;
      background: var(--surface-variant);
      border-radius: 2px;
      position: relative;
      cursor: pointer;
      margin-bottom: 8px;
    }

    .slider-fill {
      height: 100%;
      background: var(--primary);
      border-radius: 2px;
      width: 0%;
      will-change: width;
    }

    .time {
      display: flex;
      justify-content: space-between;
      font-size: 12px;
      color: var(--on-surface-variant);
    }

    .controls {
      padding: 16px 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 16px;
    }

    .ctrl-btn {
      width: 56px;
      height: 56px;
      border-radius: 50%;
      background: var(--primary);
      border: none;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      color: white;
    }

    .ctrl-btn:active {
      transform: scale(0.95);
    }

    .ctrl-btn.secondary {
      background: var(--surface-container-high);
      color: var(--on-surface);
      width: 48px;
      height: 48px;
    }

    .ctrl-btn svg {
      width: 32px;
      height: 32px;
      fill: currentColor;
    }

    .ctrl-btn.secondary svg {
      width: 24px;
      height: 24px;
    }

    /* Bottom Nav */
    .bottom-nav {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      height: calc(var(--nav-height) + var(--safe-bottom));
      background: var(--surface);
      border-top: 1px solid var(--outline);
      display: flex;
      z-index: 30;
      padding-bottom: var(--safe-bottom);
      transform: translateZ(0);
    }

    .nav-item {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
      cursor: pointer;
      color: var(--on-surface-variant);
      position: relative;
    }

    .nav-item.active {
      color: var(--primary);
    }

    .nav-item::before {
      content: '';
      position: absolute;
      top: 0;
      width: 64px;
      height: 32px;
      background: var(--primary);
      border-radius: 16px;
      opacity: 0;
      transition: opacity 150ms;
    }

    .nav-item.active::before {
      opacity: 0.12;
    }

    .nav-item svg {
      width: 24px;
      height: 24px;
      fill: currentColor;
      position: relative;
    }

    .nav-label {
      font-size: 12px;
      font-weight: 500;
      position: relative;
    }

    /* Search */
    .search-bar {
      padding: 8px 16px 12px;
    }

    .search-box {
      background: var(--surface-container-high);
      border-radius: 28px;
      display: flex;
      align-items: center;
      padding: 0 16px;
    }

    .search-icon {
      width: 24px;
      height: 24px;
      fill: var(--on-surface-variant);
      margin-right: 12px;
    }

    .search-input {
      flex: 1;
      background: none;
      border: none;
      outline: none;
      color: var(--on-surface);
      font-size: 16px;
      padding: 14px 0;
    }

    .search-input::placeholder {
      color: var(--on-surface-variant);
    }

    .search-clear {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      display: none;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      background: none;
      border: none;
    }

    .search-clear.visible {
      display: flex;
    }

    .search-clear svg {
      width: 20px;
      height: 20px;
      fill: var(--on-surface-variant);
    }

    /* States */
    .empty {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 60px 32px;
      text-align: center;
    }

    .empty-icon {
      font-size: 64px;
      opacity: 0.3;
      margin-bottom: 16px;
    }

    .empty-title {
      font-size: 16px;
      font-weight: 500;
      margin-bottom: 8px;
    }

    .empty-text {
      font-size: 14px;
      color: var(--on-surface-variant);
    }

    .loading {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 60px 32px;
    }

    .spinner {
      width: 40px;
      height: 40px;
      border: 4px solid var(--surface-variant);
      border-top-color: var(--primary);
      border-radius: 50%;
      animation: spin 1s linear infinite;
      margin-bottom: 16px;
    }

    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    .snackbar {
      position: fixed;
      bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
      left: 16px;
      right: 16px;
      background: var(--surface-container-high);
      padding: 14px 16px;
      border-radius: 8px;
      font-size: 14px;
      transform: translateY(150%);
      transition: transform 250ms;
      z-index: 50;
      box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }

    .snackbar.show {
      transform: translateY(0);
    }

    .snackbar.with-player {
      bottom: calc(var(--nav-height) + var(--mini-player-height) + var(--safe-bottom) + 24px);
    }

    #yt-player {
      position: fixed;
      top: -9999px;
      left: -9999px;
      width: 1px;
      height: 1px;
    }

/* Artist Detail Overlay */
.artist-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--nav-height);
  z-index: 90;
  pointer-events: none;
  background: transparent;
  transition: background 250ms;
}

.artist-overlay.open {
  background: rgba(0, 0, 0, 0.7);
  pointer-events: all;
}

.artist-detail {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 16px;
}

.artist-detail.with-player {
  padding-bottom: calc(var(--mini-player-height) + 16px);
}

.artist-overlay.open .artist-detail {
  transform: translateX(0);
}

.artist-detail-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--outline);
}

.artist-detail-title {
  flex: 1;
  font-size: 22px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artist-close-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--on-surface);
}

.artist-close-btn:active {
  background: var(--surface-variant);
}

.artist-close-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Secondary controls (repeat/shuffle) */
.secondary-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 16px 32px;
}

.secondary-controls .icon-btn {
  color: var(--on-surface-variant);
  transition: color 150ms, background 150ms;
}

.secondary-controls .icon-btn.active {
  color: var(--primary);
}

/* Main playback controls */
.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 0 32px 32px;
}

.ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: none;
  cursor: pointer;
  transition: background 150ms, transform 150ms;
}

.ctrl-btn svg {
  fill: currentColor;
}

.ctrl-btn:active {
  transform: scale(0.95);
}

.ctrl-btn:not(.secondary) {
  width: 64px;
  height: 64px;
  background: var(--primary);
  color: white;
}

.ctrl-btn:not(.secondary) svg {
  width: 32px;
  height: 32px;
}

.ctrl-btn.secondary {
  width: 48px;
  height: 48px;
  color: var(--on-surface);
}

.ctrl-btn.secondary svg {
  width: 24px;
  height: 24px;
}

.ctrl-btn.secondary:active {
  background: var(--surface-variant);
}
