:root { --card-size: 450px; }
body { margin: 0; overflow: hidden; background: #121212; font-family: sans-serif; }
.app-container {
    height: 100dvh;
    width: 100dvw;
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    overflow: hidden;
}

.app-container.chrome-hidden {
    cursor: none;
}
.ui-chrome {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s ease;
}
.ui-chrome.is-visible {
    opacity: 1;
    pointer-events: auto;
}
.coverflow-scene {
    position: relative;
    width: 100%;
    height: 80%;
    perspective: 1000px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}
.album-card {
    position: absolute; left: 50%; top: 50%;
    width: var(--card-size); height: var(--card-size);
    margin-left: calc(var(--card-size) / -2); margin-top: calc(var(--card-size) / -2);
    background: #000; box-shadow: 0 20px 50px rgba(0,0,0,0.5); cursor: pointer;
    transform-style: preserve-3d;
}
.album-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    pointer-events: none;
}
.album-info {
    position: absolute;
    bottom: -40px;
    width: 100%;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.album-card:hover .album-info {
    opacity: 1;
}

@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 520px;
  padding: 2rem;
  box-sizing: border-box;
  background: rgba(12, 12, 12, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.service-picker-copy {
  width: 100%;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.4;
}

.service-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.service-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

.service-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.service-card h2 {
  margin: 0;
  font-size: 1.1rem;
}

.service-status {
  margin: 0.25rem 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
}

.service-current-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
}

.service-select {
  width: 100%;
  max-width: 400px;
  height: 50px;
  padding: 0 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 1rem;
  outline: none;
  cursor: pointer;
}

.service-select:focus {
  border-color: rgba(255, 255, 255, 0.28);
}

.service-select option {
  color: black;
}

.secondary-button {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.secondary-button:hover {
  background: rgba(255, 255, 255, 0.2);
}
.track-row {
    padding: 10px 20px;
    border-bottom: 1px solid #222;
    display: flex;
    align-items: center;
}
.track-row:hover { background: #2a2a2a; }
.controls-bar {
    position: absolute;
    bottom: 5%;
    display: flex;
    gap: 20px;
    z-index: 200;
    transform: translateY(18px);
}
.controls-bar.is-visible { transform: translateY(0); }
.open-album-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeUp 0.35s ease-out;
}

.album-back-button {
    position: absolute;
    top: 28px;
    left: 28px;
    width: auto;
    min-width: 110px;
    padding-inline: 22px;
    z-index: 220;
    transform: translateY(-14px);
}
.album-back-button.is-visible { transform: translateY(0); }

.service-switch-button {
    position: absolute;
    top: 28px;
    right: 28px;
    width: auto;
    min-width: 140px;
    padding-inline: 22px;
    z-index: 220;
    transform: translateY(-14px);
}

.service-switch-button.is-visible {
    transform: translateY(0);
}

.open-album-view {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.external-playback-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
}

.external-playback-back {
    position: absolute;
    top: 28px;
    left: 28px;
    width: auto;
    min-width: 110px;
    padding-inline: 22px;
    z-index: 220;
}

.external-playback-copy {
    position: absolute;
    left: 28px;
    bottom: 28px;
    z-index: 220;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    width: min(34rem, calc(100vw - 56px));
    text-align: left;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: rgba(8, 8, 8, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
    transform: translateY(18px);
}

.external-playback-actions {
    display: block;
    margin-top: 0.6rem;
}

.external-playback-actions button {
    width: 100%;
    max-width: none;
}

.external-playback-card-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.external-playback-card {
    position: relative;
    width: min(62vw, 660px);
    aspect-ratio: 1;
    background: #000;
    box-shadow: 0 35px 90px rgba(0,0,0,0.65);
}

.external-playback-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.external-playback-progress {
    stroke-width: 0.85px;
}

.open-album-meta {
    position: absolute;
    left: 28px;
    bottom: 28px;
    z-index: 220;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: min(34rem, calc(100vw - 56px));
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: rgba(8, 8, 8, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
    transform: translateY(18px);
}

.open-album-eyebrow,
.open-album-artist,
.open-album-track,
.open-album-volume-label,
.open-album-volume-value {
    margin: 0;
}

.open-album-eyebrow {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.56);
}

.open-album-title {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.5rem);
    line-height: 1.05;
}

.open-album-artist {
    color: rgba(255, 255, 255, 0.72);
    font-size: 1rem;
}

.open-album-track {
    color: white;
    font-size: 1.05rem;
}

.open-album-volume {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.9rem;
    margin-top: 0.35rem;
    pointer-events: auto;
    touch-action: auto;
}

.open-album-volume-label,
.open-album-volume-value {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.82);
}

.open-album-volume-slider {
    width: 100%;
    accent-color: white;
    cursor: pointer;
    pointer-events: auto;
    touch-action: auto;
    -webkit-appearance: auto;
    appearance: auto;
    user-select: none;
}

.open-album-card {
    position: relative;
    width: min(62vw, 660px);
    aspect-ratio: 1;
    background: #000;
    box-shadow: 0 35px 90px rgba(0,0,0,0.65);
}

.open-album-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.open-album-progress {
    stroke-width: 0.85px;
}

button {
    padding: 10px 20px;
    border-radius: 20px;
    border: none;
    background: white;
    color: black;
    font-weight: bold;
    width: 100%;
    height: 50px;
    max-width: 400px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    transition: background 0.2s, transform 0.1s;
}

button:hover {
    background: #ff0000;
}
.progress-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    overflow: visible;
}

.progress-rect {
    stroke-width: 1px;
    transition: none;
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 1.0));
}

.jellyfin-form-box {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
  background: #1e1e1e;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  width: 100%;
  max-width: 33%;
  box-sizing: border-box;
  animation: fadeUp 0.3s ease-out;
}

.jellyfin-form-box input {
  padding: 12px 15px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #252525;
  color: white;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.jellyfin-form-box input::placeholder {
  color: #777;
}

.jellyfin-form-box input:focus {
  border-color: #aa5cc3;
  box-shadow: 0 0 0 2px rgba(170, 92, 195, 0.3);
}

.jellyfin-form-box button {
  margin-top: 10px;
  background: #aa5cc3;
  color: white;
  transition: background 0.2s, transform 0.1s;
}

.jellyfin-form-box button:hover {
  background: #8e49a6;
}

.jellyfin-form-box button:active {
  transform: scale(0.98);
}

@media (max-width: 960px) {
    :root { --card-size: min(72vw, 360px); }

    .open-album-card { width: min(80vw, 500px); }
    .external-playback-card { width: min(80vw, 500px); }
    .open-album-meta {
        left: 16px;
        right: 16px;
        bottom: 16px;
        width: auto;
    }
    .external-playback-copy {
        left: 16px;
        right: 16px;
        bottom: 16px;
        width: auto;
    }
    .open-album-volume {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .controls-bar {
        width: calc(100vw - 32px);
        justify-content: center;
        gap: 10px;
    }

    .controls-bar button {
        min-width: 0;
    }
}
