/* ============================================
   Harry's iPodfolio — CSS
   Skeuomorphic iPod Classic Portfolio App
   ============================================ */

:root {
  /* Silver theme (default) */
  --body-bg: linear-gradient(180deg, #e3e3e3 0%, #d6d6d6 100%);
  --wheel-bg: #FFFFFF;
  --wheel-outline: #b9b9b9;
  --wheel-button: #AFAFAF;
  --center-bg: #ffffff;
  --center-shadow: rgb(191, 191, 191);
  --center-outline: #b9b9b9;

  /* Screen */
  --screen-bg: white;
  --header-bg: linear-gradient(180deg, #feffff 0%, #b1b6b9 100%);
  --header-border: #7995a3;
  --list-highlight: linear-gradient(rgb(60, 184, 255) 0%, rgb(52, 122, 181) 100%);
  --text-color: #000;
  --subtext-color: rgb(100, 100, 100);
}

[data-theme="black"] {
  --body-bg: linear-gradient(180deg, #7d7c7d 0%, #1e1e1e 100%);
  --wheel-bg: #2a2a2a;
  --wheel-outline: #1a1a1a;
  --wheel-button: #FFFFFF;
  --center-bg: #7d7c7d;
  --center-shadow: rgb(50, 50, 50);
  --center-outline: #1a1a1a;
}

[data-theme="u2"] {
  --body-bg: linear-gradient(180deg, #7d7c7d 0%, #1e1e1e 100%);
  --wheel-bg: #de2029;
  --wheel-outline: #1a1a1a;
  --wheel-button: #ffffff;
  --center-bg: #5d5c5d;
  --center-shadow: rgb(50, 50, 50);
  --center-outline: #1a1a1a;
}

[data-theme="pink"] {
  --body-bg: linear-gradient(180deg, #f7a8c4 0%, #e8779e 100%);
  --wheel-bg: #FFFFFF;
  --wheel-outline: #d4698c;
  --wheel-button: #AFAFAF;
  --center-bg: #f2a3be;
  --center-shadow: rgb(200, 120, 150);
  --center-outline: #d4698c;
}

/* ---- Reset ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  height: 100dvh;
  display: grid;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  color: var(--text-color);
  min-height: 550px;
  overflow: hidden;
  background: #f0f0f0;
  position: relative;
}

/* ---- Studio Backdrop ---- */
.studio-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
}

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

/* ---- iPod Shell ---- */
.ipod-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 370px;
  max-height: 37em;
  height: 100%;
  margin: auto;
  border-radius: 30px;
  box-shadow: inset 0 0 2.4em #555;
  background: var(--body-bg);
  -webkit-box-reflect: below 0px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(50%, transparent), to(rgba(250, 250, 250, 0.3)));
  animation: descend 1.5s ease;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}



@media (max-width: 576px) {
  .ipod-shell {
    animation: none;
    width: 100vw;
    max-height: unset;
    border-radius: 30px;
    -webkit-box-reflect: unset;
  }
}

@keyframes descend {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ---- Screen ---- */
.ipod-screen {
  position: relative;
  height: 260px;
  margin: 1.5rem 1.5rem 0;
  border: 4px solid black;
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--screen-bg);
  animation: fadeFromBlack 0.5s;
}

@media (max-width: 576px) {
  .ipod-screen {
    margin: 1rem 1rem 0;
  }
}

@keyframes fadeFromBlack {
  0% {
    filter: brightness(0);
  }
}

/* ---- Header Bar ---- */
.ipod-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 6px;
  height: 20px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  min-width: 0;
  flex-shrink: 0;
}

.ipod-header h3 {
  margin: 0;
  font-size: 13px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-play-icon,
.header-pause-icon {
  width: 12px;
  height: 12px;
}

/* Battery indicator */
.battery-indicator {
  width: 22px;
  height: 10px;
  border: 1.5px solid #555;
  border-radius: 2px;
  position: relative;
  display: inline-block;
}

.battery-indicator::after {
  content: '';
  position: absolute;
  right: -4px;
  top: 2px;
  width: 2px;
  height: 4px;
  background: #555;
  border-radius: 0 1px 1px 0;
}

.battery-fill {
  height: 100%;
  width: 80%;
  background: #4cd964;
  border-radius: 1px;
}

/* ---- Screen Content ---- */
.screen-content {
  position: relative;
  height: calc(100% - 20px);
  overflow: hidden;
}

/* ---- View Transitions ---- */
.view-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}

.view-enter-right {
  animation: slideInRight 0.3s ease forwards;
}

.view-enter-left {
  animation: slideInLeft 0.3s ease forwards;
}

.view-exit-right {
  animation: slideOutRight 0.3s ease forwards;
}

.view-exit-left {
  animation: slideOutLeft 0.3s ease forwards;
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes slideOutRight {
  from { transform: translateX(0); }
  to { transform: translateX(100%); }
}

@keyframes slideOutLeft {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* ---- Selectable List ---- */
.selectable-list {
  width: 100%;
  height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.list-item {
  display: flex;
  align-items: center;
  overflow: hidden;
  cursor: default;
}

.list-item.active {
  background: var(--list-highlight);
}

.list-item.active .list-label,
.list-item.active .list-sublabel {
  color: white;
}

.list-item-image {
  height: 3rem;
  width: 3rem;
  margin-right: 0.25rem;
  flex-shrink: 0;
  object-fit: cover;
}

.list-item-mosaic {
  height: 3rem;
  width: 3rem;
  margin-right: 0.25rem;
  flex-shrink: 0;
  overflow: hidden;
  background: #ddd;
  font-size: 1.2rem;
}

.list-item-mosaic.mosaic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0;
}

.mosaic-cell {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-label-container {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 1rem;
  min-width: 0;
}

.list-item.active .list-label-container {
  padding-right: 0;
}

.list-label {
  margin: 0;
  padding: 0.25rem;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-sublabel {
  margin: 0;
  padding: 0 0.25rem 0.25rem;
  margin-top: -4px;
  font-weight: normal;
  font-size: 12px;
  color: var(--subtext-color);
}

.list-arrow {
  margin-left: auto;
  margin-right: 8px;
  flex-shrink: 0;
  opacity: 0;
}

.list-item.active .list-arrow {
  opacity: 1;
}

.list-value {
  margin-left: auto;
  margin-right: 10px;
  font-size: 13px;
  color: #666;
  flex-shrink: 0;
}

.list-item.active .list-value {
  color: #fff;
}

/* Arrow SVG icon */
.arrow-right {
  width: 8px;
  height: 14px;
}

/* ---- Split Screen View (Top-Level Menus) ---- */
.split-screen {
  display: flex;
  height: 100%;
}

.split-screen .split-left {
  width: 60%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-right: 1px solid #ccc;
}

.split-screen .split-right {
  width: 40%;
  position: relative;
  background: linear-gradient(180deg, #f8f8f8, #e8e8e8);
  overflow: hidden;
}

@keyframes kenBurns {
  0%   { transform: scale(1.05) translateX(0%); }
  100% { transform: scale(1.05) translateX(8%); }
}

.ken-burns-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.ken-burns-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 1.2s ease;
}

.ken-burns-img.active {
  opacity: 1;
  animation: kenBurns 12s linear infinite alternate;
}

.ken-burns-img.inactive {
  opacity: 0;
}

/* ---- Now Playing ---- */
.now-playing {
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.now-playing-metadata {
  display: flex;
  flex: 1;
  min-height: 0;
  padding: 0 0.5rem;
  perspective: 1000px;
}

.now-playing-artwork-container {
  height: 8em;
  width: 8em;
  margin: auto 0.75rem;
  -webkit-box-reflect: below 0px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(70%, transparent), to(rgba(240, 240, 240, 0.2)));
  transform-style: preserve-3d;
  transform: rotateY(35deg);
  flex-shrink: 0;
  overflow: hidden;
}

.now-playing-artwork {
  height: 100%;
  width: 100%;
  border: 1px solid #f3f3f3;
  object-fit: cover;
}

.now-playing-info {
  flex: 1;
  margin: auto 0 auto 0.5rem;
  min-width: 0;
}

.now-playing-title {
  margin: 0 0 0.25rem;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-playing-subtitle {
  margin: 0;
  font-size: 0.75rem;
  color: rgb(99, 101, 103);
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-playing-caption {
  font-size: 0.68rem;
  color: rgb(99, 101, 103);
  font-weight: 600;
  line-height: 1.3;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.now-playing-caption.caption-fade-in,
.now-playing-subtitle.caption-fade-in {
  animation: captionFade 0.2s ease-in;
}

@keyframes captionFade {
  0% { opacity: 0; transform: translateY(2px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Shuffle / Repeat status row */
.now-playing-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 1rem;
  height: 16px;
  flex-shrink: 0;
}

.np-status-badge {
  display: flex;
  align-items: center;
  color: #bbb;
  transition: color 0.2s;
}

.np-status-badge.active {
  color: #1976d2;
}

.np-status-icon {
  width: 14px;
  height: 14px;
}

.np-track-counter {
  margin-left: auto;
  font-size: 10px;
  color: #888;
  font-weight: 500;
}

/* Controls area */
.now-playing-controls {
  display: flex;
  align-items: center;
  height: 48px;
  flex-shrink: 0;
  position: relative;
  padding: 0 1rem 0.5rem;
}

.controls-layer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0.5rem;
  right: 0.5rem;
  transition: transform 0.3s;
  display: flex;
  align-items: center;
}

.controls-layer.hidden-left {
  transform: translateX(-110%);
}

.controls-layer.hidden-right {
  transform: translateX(110%);
}

/* Progress Bar */
.progress-bar-container {
  position: relative;
  display: flex;
  flex: 1;
  height: 1em;
  align-items: center;
  -webkit-box-reflect: below 0px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(60%, transparent), to(rgba(250, 250, 250, 0.1)));
}

.progress-bar-track {
  position: relative;
  flex: 1;
  height: 10px;
  margin: 0 8px;
  background: linear-gradient(180deg, #bbb 0%, #ddd 50%, #ccc 100%);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  position: relative;
  height: 100%;
  background: linear-gradient(180deg, #5fc3ff 0%, #2196f3 50%, #1976d2 100%);
  transition: width 0.1s;
  border-radius: 3px 0 0 3px;
}

.progress-bar-diamond {
  position: absolute;
  right: -6px;
  top: -1px;
  width: 12px;
  height: 12px;
  background: #666;
  transform: rotate(45deg);
  border-radius: 2px;
}

.progress-time {
  font-size: 12px;
  min-width: 40px;
  text-align: center;
  font-weight: 500;
}

/* Volume bar */
.volume-container {
  position: relative;
  display: flex;
  flex: 1;
  height: 1em;
  padding: 0 0.75rem;
  align-items: center;
  -webkit-box-reflect: below 0px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(60%, transparent), to(rgba(250, 250, 250, 0.1)));
}

.volume-icon {
  width: 16px;
  height: 12px;
  flex-shrink: 0;
}

/* ---- Click Wheel ---- */
.clickwheel-container {
  margin: auto;
  padding: 12px 0;
}

.clickwheel {
  display: grid;
  position: relative;
  border-radius: 50%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  width: 220px;
  height: 220px;
  background-color: var(--wheel-bg);
  border: 1px solid var(--center-outline);
  place-items: center;
  cursor: pointer;
}

.wheel-button {
  position: absolute;
  padding: 12px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Position buttons at midpoint of ring (between outer edge and center button) */
/* Desktop: wheel 220px, center 90px → ring midpoint ≈ 28px from edge */
.wheel-button.top {
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.wheel-button.bottom {
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.wheel-button.left {
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.wheel-button.right {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.wheel-button svg {
  width: 22px;
  height: 17px;
}

.center-button {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 1px solid var(--center-outline);
  background: var(--center-bg);
  box-shadow: var(--center-shadow) 0px 1em 3em inset;
  user-select: none;
  cursor: pointer;
  transition: opacity 0.1s;
}

.center-button:active {
  opacity: 0.8;
}

/* Wheel button icons */
.wheel-icon {
  fill: var(--wheel-button);
}

.wheel-menu-text {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--wheel-button);
  letter-spacing: 0.5px;
  user-select: none;
}

@media (max-width: 300px) {
  .clickwheel {
    width: 176px;
    height: 176px;
  }
}

@media (max-width: 576px) {
  .clickwheel {
    width: 280px;
    height: 280px;
  }
  .center-button {
    width: 114px;
    height: 114px;
  }
  /* Mobile: wheel 280px, center 114px → ring midpoint ≈ 30px from edge */
  .wheel-button.top    { top: 18px; }
  .wheel-button.bottom { bottom: 18px; }
  .wheel-button.left   { left: 18px; }
  .wheel-button.right  { right: 18px; }
  .wheel-button svg { width: 26px; height: 20px; }
  .wheel-icon { width: 24px; height: 24px; }
  .wheel-menu-text { font-size: 16px; letter-spacing: 1px; }
}

/* ---- Album View ---- */
.album-view {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.album-header {
  display: flex;
  align-items: center;
  padding: 8px;
  background: linear-gradient(180deg, #f8f8f8, #e0e0e0);
  border-bottom: 1px solid #ccc;
  flex-shrink: 0;
}

.album-cover-small {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  margin-right: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.album-cover-clip,
.playlist-cover-clip {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  margin-right: 8px;
  flex-shrink: 0;
  overflow: hidden;
}

.album-cover-clip .album-cover-small,
.playlist-cover-clip .playlist-cover {
  margin-right: 0;
  width: 100%;
  height: 100%;
}

.playlist-cover-mosaic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0;
  width: 100%;
  height: 100%;
}

.album-header-info {
  min-width: 0;
}

.album-header-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-header-artist {
  font-size: 11px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-tracks {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---- Photo Album ---- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 2px;
  height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.photo-thumb {
  aspect-ratio: 1;
  object-fit: cover;
  width: 100%;
  cursor: pointer;
}

.photo-thumb.active {
  outline: 3px solid #2196f3;
  outline-offset: -3px;
}

.photo-fullscreen {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: black;
}

.photo-fullscreen img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.photo-caption {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  text-align: center;
  color: white;
  font-size: 12px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* ---- Text View (About) ---- */
.text-view {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.text-view-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.text-view p {
  margin-bottom: 12px;
}

.text-view-links {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #ddd;
}

.text-view-links a.list-item {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

/* ---- Video Player ---- */
.video-view {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: black;
}

.video-view video {
  width: 100%;
  flex: 1;
  object-fit: contain;
  background: black;
}

.video-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: white;
  font-size: 14px;
  background: #222;
}

/* ---- Settings View ---- */
.settings-view {
  height: 100%;
  overflow: auto;
}

.settings-section-header {
  padding: 4px 8px;
  background: linear-gradient(180deg, #ddd, #ccc);
  font-size: 12px;
  font-weight: 600;
  color: #555;
}

/* ---- Cover Flow ---- */
.coverflow-container {
  height: 100%;
  position: relative;
  background: linear-gradient(180deg, #333 0%, #111 100%);
  overflow: hidden;
}

.coverflow-albums {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: nowrap;
  height: 100%;
  padding-top: 20px;
  perspective: 500px;
}

.coverflow-album {
  position: absolute;
  height: 8em;
  width: 8em;
  transition: transform 0.25s, opacity 0.35s;
  transform-style: preserve-3d;
  -webkit-box-reflect: below 0px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(70%, transparent), to(rgba(240, 240, 240, 0.2)));
}

.coverflow-album.active {
  transition: transform 0.3s, opacity 0.35s;
}

.coverflow-album.selected {
  transition: transform 0.5s, opacity 0.35s;
  -webkit-box-reflect: none;
}

.coverflow-album.selected .coverflow-artwork-wrapper {
  opacity: 0;
}

.coverflow-album.playing .coverflow-artwork-wrapper {
  opacity: 1;
}

.coverflow-album.hidden {
  opacity: 0;
}

.coverflow-artwork-wrapper {
  position: absolute;
  height: 8em;
  width: 8em;
  overflow: hidden;
  border: 1px solid #555;
}

.coverflow-artwork {
  height: 100%;
  width: 100%;
  transition: opacity 0.5s;
  object-fit: cover;
}

.coverflow-artwork:not(img) {
  position: absolute;
  top: 0;
  left: 0;
}

.coverflow-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 0;
  padding-bottom: 16px;
  text-align: center;
  overflow: hidden;
  min-width: 0;
}

.coverflow-info h3 {
  margin: 0;
  padding: 0 16px;
  font-size: 16px;
  color: white;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.coverflow-info h3:first-of-type {
  margin-top: 8px;
}

/* Cover Flow Backside */
.coverflow-backside {
  position: absolute;
  display: flex;
  flex-direction: column;
  inset: -28% -50% -38%;
  border: 1px solid #d3d3d3;
  background: white;
  transform: rotateY(180deg);
  z-index: 10;
}

.coverflow-backside-header {
  flex-shrink: 0;
  padding: 4px 8px;
  background: linear-gradient(to bottom, #6585ad, #789ab3);
  border-bottom: 1px solid #6d87a3;
  min-width: 0;
}

.coverflow-backside-header h3 {
  margin: 0;
  font-size: 14px;
  color: white;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.coverflow-backside-header h4 {
  margin: 0;
  font-size: 12px;
  color: white;
  -webkit-line-clamp: 1;
}

.coverflow-backside-list {
  flex: 1;
  overflow: hidden;
}

/* ---- Brick Game ---- */
.brick-game-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brick-game-container canvas {
  width: 100%;
  height: 100%;
}

/* Score/Lives overlay */
.game-hud {
  position: absolute;
  top: 2px;
  left: 8px;
  font-size: 11px;
  font-weight: bold;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  z-index: 5;
  pointer-events: none;
}

.game-hud-right {
  position: absolute;
  top: 2px;
  right: 8px;
  font-size: 11px;
  font-weight: bold;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  z-index: 5;
  pointer-events: none;
}

/* ---- Empty State ---- */
.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #999;
  font-size: 14px;
}

/* ---- Playlist View ---- */
.playlist-view {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.playlist-header {
  display: flex;
  align-items: center;
  padding: 8px;
  background: linear-gradient(180deg, #f8f8f8, #e0e0e0);
  border-bottom: 1px solid #ccc;
  flex-shrink: 0;
}

.playlist-cover {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  margin-right: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.playlist-header-info {
  min-width: 0;
}

.playlist-header-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-header-count {
  font-size: 11px;
  color: #666;
}

.playlist-tracks {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}



/* ---- Loading State ---- */
.loading-text {
  text-align: center;
  padding: 20px;
  color: #999;
  font-size: 13px;
}

/* ============================================
   QR Screen View — "Best on Mobile" (in-iPod)
   ============================================ */
.qr-screen-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 12px 16px;
  text-align: center;
  background: #ffffff;
}

.qr-screen-heading {
  font-size: 13px;
  font-weight: 600;
  color: #222;
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}

.qr-screen-sub {
  font-size: 10px;
  color: #888;
  margin-bottom: 8px;
}

.qr-screen-code {
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-screen-canvas {
  border-radius: 4px;
  width: 160px;
  height: 160px;
  image-rendering: pixelated;
}

.qr-screen-hint {
  font-size: 9px;
  color: #aaa;
  margin-top: 6px;
  letter-spacing: 0.02em;
}

/* ============================================
   Boot Screen — inside iPod display
   ============================================ */
.boot-screen-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: #fff;
  text-align: center;
  gap: 8px;
  padding: 20px;
}

.boot-logo {
  margin-bottom: 4px;
}

.boot-logo-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  -webkit-user-drag: none;
}

.boot-title {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 22px;
  font-weight: 500;
  color: #000;
  letter-spacing: -0.02em;
}

.boot-hint {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 11px;
  color: #888;
  margin-top: 16px;
  letter-spacing: 0.02em;
}

/* ============================================
   Tutorial Callouts — floating labels on iPod body
   ============================================ */
.tutorial-callouts-container {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.tutorial-callouts-container.tutorial-callouts-visible {
  opacity: 1;
}

.tutorial-callouts-container.tutorial-callouts-hiding {
  opacity: 0;
  transition: opacity 0.3s ease;
}

svg.tutorial-callouts-visible {
  opacity: 1;
  transition: opacity 0.4s ease;
}

svg.tutorial-callouts-hiding {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Callout shared styles */
.tutorial-callout {
  pointer-events: none;
  white-space: nowrap;
}

.callout-label {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.callout-label-left {
  text-align: right;
}

.callout-label-right {
  text-align: left;
}

.callout-title {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #333;
  line-height: 1.2;
}

.callout-desc {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 9px;
  color: #555;
  line-height: 1.3;
  max-width: 120px;
}

.callout-label-left .callout-desc {
  margin-left: auto;
}

/* Mobile adjustments */
@media (max-width: 576px) {
  .boot-logo-img {
    width: 80px;
    height: 80px;
  }
  .boot-title {
    font-size: 26px;
  }
  .boot-hint {
    font-size: 12px;
  }
  .callout-title {
    font-size: 10px;
  }
  .callout-desc {
    font-size: 8px;
    max-width: 90px;
    white-space: normal;
  }
}

/* ============================================
   PWA Standalone Mode — Safe Area
   ============================================ */
@media all and (display-mode: standalone) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}
