:root {
  --bg: #080a0f;
  --surface: #11151d;
  --surface-raised: #181d28;
  --surface-soft: #202735;
  --border: rgba(255, 255, 255, 0.11);
  --border-strong: rgba(255, 255, 255, 0.22);
  --text: #f6f8fb;
  --text-muted: #aeb7c6;
  --text-dim: #788397;
  --accent: #ffb547;
  --accent-bright: #ffd08a;
  --accent-ink: #211302;
  --success: #73d9a0;
  --danger: #ff7b7b;
  --focus: #fff0bd;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --radius-sm: 0.75rem;
  --radius-md: 1.1rem;
  --radius-lg: 1.55rem;
  --header-height: 10.5rem;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 280px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 85% -10%, rgba(255, 181, 71, 0.11), transparent 32rem),
    linear-gradient(180deg, #0c0f16 0%, var(--bg) 28rem);
  color: var(--text);
  font-size: clamp(1rem, 0.8rem + 0.25vw, 1.25rem);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

svg {
  display: block;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 1rem;
  left: 1rem;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-sm);
  background: var(--focus);
  color: #17120a;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(100px);
  opacity: 0.08;
}

.ambient-one {
  top: 20%;
  left: -16rem;
  background: #e94f86;
}

.ambient-two {
  right: -17rem;
  bottom: -8rem;
  background: #4b94ff;
}

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  width: min(100% - clamp(2rem, 5vw, 7rem), 112rem);
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
  min-width: 0;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: clamp(6.25rem, 7.75vw, 8.5rem);
  height: clamp(6.25rem, 7.75vw, 8.5rem);
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent-bright), var(--accent));
  box-shadow: 0 0 2.8rem rgba(255, 181, 71, 0.24);
}

.brand-mark svg {
  width: 72%;
  height: 72%;
}

.brand-mark .nut-shell {
  fill: var(--accent-ink);
  stroke: rgba(255, 240, 189, 0.5);
  stroke-width: 1.25;
}

.brand-mark .nut-texture {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.8;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-name {
  font-size: clamp(2.2rem, 1.5rem + 1.35vw, 3.5rem);
  font-weight: 750;
  letter-spacing: -0.035em;
}

.brand-subtitle {
  margin-top: 0.25rem;
  color: var(--accent);
  font-size: 0.72em;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.header-status,
.subtitle-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex: 0 0 auto;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(17, 21, 29, 0.76);
  color: var(--text-muted);
  font-size: 0.83em;
  font-weight: 700;
  backdrop-filter: blur(14px);
}

.status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0.28rem rgba(115, 217, 160, 0.11);
}

.header-status[data-state="offline"] .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 0.28rem rgba(255, 123, 123, 0.11);
}

main {
  width: min(100% - clamp(2rem, 5vw, 7rem), 112rem);
  margin: 0 auto;
}

.view {
  min-height: calc(100vh - var(--header-height));
  padding: clamp(2.25rem, 5vw, 5rem) 0 2rem;
}

.library-intro,
.player-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.library-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
  color: var(--text-dim);
  font-size: 0.86em;
  font-weight: 750;
}

.breadcrumb-button {
  appearance: none;
  min-height: 2.35rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 0.55rem;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.breadcrumb-button:hover,
.breadcrumb-button:focus-visible {
  border-color: var(--border);
  background: var(--surface-raised);
  color: var(--text);
}

.breadcrumb-current {
  max-width: min(42vw, 28rem);
  overflow: hidden;
  color: var(--accent-bright);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumb-separator {
  color: var(--text-dim);
  opacity: 0.65;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--accent);
  font-size: clamp(0.76rem, 0.7rem + 0.15vw, 0.94rem);
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: break-word;
}

h1 {
  max-width: 22ch;
  margin: 0;
  font-size: clamp(2rem, 1.35rem + 2vw, 4.4rem);
  font-weight: 760;
  letter-spacing: -0.055em;
  line-height: 1.05;
}

#libraryHeading {
  font-size: clamp(1.9rem, 1.35rem + 1.5vw, 3.5rem);
}

.library-count,
#nowPlayingMeta {
  margin: 0.9rem 0 0;
  color: var(--text-muted);
  font-size: clamp(1rem, 0.92rem + 0.22vw, 1.3rem);
}

.icon-button,
.text-button,
.primary-button,
.back-button,
.control-button {
  appearance: none;
  border: 1px solid var(--border);
  cursor: pointer;
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  width: clamp(3.5rem, 5vw, 4.5rem);
  height: clamp(3.5rem, 5vw, 4.5rem);
  place-items: center;
  border-radius: 50%;
  background: var(--surface-raised);
}

.icon-button svg {
  width: 48%;
  height: 48%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.refresh-button.is-loading svg {
  animation: spin 900ms linear infinite;
}

.library-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: clamp(2rem, 4vw, 3.75rem);
}

.search-box {
  display: flex;
  position: relative;
  align-items: center;
  width: min(100%, 42rem);
  min-height: 4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(17, 21, 29, 0.82);
  color: var(--text-muted);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.search-box:focus-within {
  border-color: var(--focus);
  background: var(--surface-raised);
  box-shadow: 0 0 0 0.28rem rgba(255, 240, 189, 0.17);
}

.search-box > svg {
  flex: 0 0 auto;
  width: 1.55rem;
  height: 1.55rem;
  margin-left: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.search-box input {
  width: 100%;
  min-width: 0;
  min-height: 3.9rem;
  padding: 0.75rem 1rem;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 1.05em;
}

.search-box input::placeholder {
  color: var(--text-dim);
  opacity: 1;
}

.search-box input::-webkit-search-cancel-button {
  display: none;
}

.key-hint,
kbd {
  display: inline-grid;
  min-width: 1.85rem;
  min-height: 1.85rem;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-bottom-color: rgba(255, 255, 255, 0.32);
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1;
}

.key-hint {
  flex: 0 0 auto;
  margin-right: 1rem;
}

.text-button {
  min-height: 3.75rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-weight: 750;
}

.library-content {
  position: relative;
  min-height: 22rem;
  margin-top: clamp(2rem, 3.5vw, 3.25rem);
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: clamp(1.4rem, 2vw, 2.25rem);
}

.video-card-wrap {
  min-width: 0;
}

.video-card {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  outline: 0;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  transform: translateZ(0);
  transition: border-color 160ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

.video-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-raised);
  transform: translateY(-0.28rem);
}

.video-card:focus,
.video-card:focus-visible {
  z-index: 2;
  border-color: var(--focus);
  background: var(--surface-raised);
  box-shadow: 0 0 0 0.32rem rgba(255, 240, 189, 0.21), var(--shadow);
  transform: scale(1.035);
}

.video-card[aria-current="true"]::after {
  position: absolute;
  z-index: 3;
  top: 0.9rem;
  right: 0.9rem;
  width: 0.72rem;
  height: 0.72rem;
  border: 0.16rem solid rgba(8, 10, 15, 0.65);
  border-radius: 50%;
  background: var(--accent);
  content: "";
  box-shadow: 0 0 1.3rem rgba(255, 181, 71, 0.8);
}

.card-artwork {
  display: flex;
  position: relative;
  min-height: clamp(10rem, 12vw, 14rem);
  align-items: flex-end;
  justify-content: space-between;
  overflow: hidden;
  padding: 1.1rem;
  background:
    radial-gradient(circle at 72% 22%, rgba(255, 255, 255, 0.16), transparent 20%),
    linear-gradient(135deg, #383f51, #151923);
  isolation: isolate;
}

.card-thumbnail {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 220ms ease, transform 300ms ease;
}

.card-thumbnail.is-loaded {
  opacity: 1;
}

.video-card:hover .card-thumbnail,
.video-card:focus .card-thumbnail {
  transform: scale(1.055);
}

.file-type,
.card-play {
  position: relative;
  z-index: 2;
}

.card-artwork::before,
.card-artwork::after {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  content: "";
}

.card-artwork::before {
  top: -55%;
  right: -14%;
  width: 76%;
  padding-bottom: 76%;
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 0 0 2rem rgba(255, 255, 255, 0.025), 0 0 0 5rem rgba(255, 255, 255, 0.018);
}

.card-artwork::after {
  bottom: -38%;
  left: -10%;
  width: 60%;
  padding-bottom: 60%;
  background: rgba(0, 0, 0, 0.12);
  filter: blur(1rem);
}

.card-artwork.has-thumbnail::before {
  z-index: 1;
  inset: 0;
  width: auto;
  padding-bottom: 0;
  border: 0;
  border-radius: 0;
  background: linear-gradient(
    180deg,
    rgba(8, 10, 15, 0.08) 30%,
    rgba(8, 10, 15, 0.56) 100%
  );
  box-shadow: none;
}

.card-artwork.has-thumbnail::after {
  display: none;
}

.video-card.tone-0 .card-artwork {
  background: radial-gradient(circle at 78% 12%, rgba(255, 210, 142, 0.28), transparent 28%), linear-gradient(135deg, #714936, #262331 62%, #151822);
}

.video-card.tone-1 .card-artwork {
  background: radial-gradient(circle at 78% 12%, rgba(137, 220, 255, 0.27), transparent 28%), linear-gradient(135deg, #315d6e, #252a3d 62%, #151822);
}

.video-card.tone-2 .card-artwork {
  background: radial-gradient(circle at 78% 12%, rgba(183, 157, 255, 0.3), transparent 28%), linear-gradient(135deg, #514272, #282438 62%, #151822);
}

.video-card.tone-3 .card-artwork {
  background: radial-gradient(circle at 78% 12%, rgba(146, 239, 180, 0.24), transparent 28%), linear-gradient(135deg, #35604f, #252e35 62%, #151822);
}

.video-card.tone-4 .card-artwork {
  background: radial-gradient(circle at 78% 12%, rgba(255, 148, 174, 0.26), transparent 28%), linear-gradient(135deg, #724153, #302536 62%, #151822);
}

.file-type {
  padding: 0.38rem 0.58rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.45rem;
  background: rgba(8, 10, 15, 0.38);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.68em;
  font-weight: 850;
  letter-spacing: 0.09em;
  line-height: 1;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.card-play {
  display: grid;
  width: clamp(3.25rem, 4.3vw, 4.3rem);
  height: clamp(3.25rem, 4.3vw, 4.3rem);
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  background: rgba(248, 249, 252, 0.91);
  color: #161922;
  box-shadow: 0 0.8rem 2rem rgba(0, 0, 0, 0.24);
  transition: transform 160ms ease, background 160ms ease;
}

.card-play svg {
  width: 46%;
  height: 46%;
  margin-left: 0.12rem;
  fill: currentColor;
}

.video-card:hover .card-play,
.video-card:focus .card-play {
  background: var(--accent-bright);
  transform: scale(1.08);
}

.folder-card .file-type {
  border-color: rgba(255, 208, 138, 0.35);
  background: rgba(33, 19, 2, 0.62);
  color: var(--accent-bright);
}

.folder-card .card-play {
  background: var(--accent);
  color: var(--accent-ink);
}

.folder-card .card-play svg {
  width: 42%;
  height: 42%;
  margin-left: 0;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.card-body {
  padding: clamp(1.05rem, 1.4vw, 1.45rem);
}

.card-title {
  display: -webkit-box;
  min-height: 2.7em;
  margin: 0;
  overflow: hidden;
  font-size: clamp(1.08rem, 0.96rem + 0.35vw, 1.42rem);
  font-weight: 740;
  letter-spacing: -0.025em;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 0.75rem;
  color: var(--text-dim);
  font-size: 0.78em;
}

.card-details > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.caption-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.32rem;
  color: var(--success);
  font-weight: 750;
}

.caption-badge svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.library-state {
  display: flex;
  min-height: 25rem;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 3rem 1rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  text-align: center;
}

.library-state h2 {
  margin: 1.2rem 0 0;
  color: var(--text);
  font-size: clamp(1.4rem, 1.1rem + 0.65vw, 2.1rem);
  letter-spacing: -0.035em;
}

.library-state p {
  max-width: 42rem;
  margin: 0.65rem 0 0;
}

.library-state code {
  color: var(--accent-bright);
  font-size: 0.9em;
}

.state-icon {
  display: grid;
  width: 5rem;
  height: 5rem;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--text-muted);
}

.state-icon svg {
  width: 58%;
  height: 58%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.primary-button {
  min-height: 3.7rem;
  margin-top: 1.6rem;
  padding: 0.8rem 1.5rem;
  border-color: transparent;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 850;
}

.loader {
  display: block;
  width: 2.6rem;
  height: 2.6rem;
  border: 0.24rem solid rgba(255, 255, 255, 0.13);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.remote-help {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: clamp(2rem, 4vw, 4rem) 0 0;
  color: var(--text-dim);
  font-size: 0.74em;
  font-weight: 650;
}

.remote-help > span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Player view */
.player-view {
  padding-top: clamp(1.75rem, 3vw, 3rem);
}

.player-topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.back-button {
  display: inline-flex;
  min-height: 3.75rem;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1.15rem 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  font-weight: 780;
}

.back-button svg {
  width: 1.55rem;
  height: 1.55rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.now-playing-copy {
  min-width: 0;
}

.now-playing-copy h1 {
  max-width: none;
  overflow: hidden;
  font-size: clamp(1.55rem, 1.18rem + 1vw, 2.65rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

#nowPlayingMeta {
  margin-top: 0.3rem;
  overflow: hidden;
  font-size: 0.88em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subtitle-pill svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.subtitle-pill[data-state="available"],
.subtitle-pill[data-state="showing"] {
  border-color: rgba(115, 217, 160, 0.27);
  color: var(--success);
}

.subtitle-pill[data-state="error"] {
  border-color: rgba(255, 123, 123, 0.3);
  color: var(--danger);
}

.player-shell {
  margin-top: clamp(1.5rem, 2.5vw, 2.5rem);
}

.player-stage {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #000;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

.player-stage:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 0.28rem rgba(255, 240, 189, 0.2), var(--shadow);
}

.player-stage video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 18rem);
  background: #000;
  object-fit: contain;
}

.player-stage video::cue {
  padding: 0.16em 0.3em;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 1.15em;
  line-height: 1.35;
  text-shadow: 0 0.08em 0.15em #000;
}

.player-stage:fullscreen,
.player-stage:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #000;
}

.player-stage:fullscreen video,
.player-stage:-webkit-full-screen video {
  width: 100%;
  height: 100%;
  max-height: none;
}

.player-status {
  display: flex;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.1rem;
  background: rgba(0, 0, 0, 0.72);
  color: var(--text-muted);
  font-size: 1.05em;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
}

.player-status[data-state="playing"] {
  display: none;
}

.player-status[data-state="error"] {
  color: var(--danger);
}

.player-status[data-state="error"] .loader,
.player-status[data-state="idle"] .loader,
.player-status[data-state="ready"] .loader,
.player-status[data-state="paused"] .loader,
.player-status[data-state="ended"] .loader,
.player-status[data-state="warning"] .loader,
.player-status[data-state="volume"] .loader,
.player-status[data-state="captions"] .loader,
.player-status[data-state="resuming"] .loader {
  display: none;
}

.player-status[data-state="volume"],
.player-status[data-state="captions"],
.player-status[data-state="resuming"] {
  inset: auto auto 1.5rem 50%;
  width: max-content;
  max-width: calc(100% - 3rem);
  min-height: 3rem;
  padding: 0.75rem 1.15rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(8, 10, 15, 0.88);
  color: var(--text);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

.player-controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(0.65rem, 1.3vw, 1.2rem);
  margin-top: 1rem;
}

.control-button {
  display: flex;
  min-width: 0;
  min-height: clamp(4.25rem, 5.4vw, 5.3rem);
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.7rem;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--text-muted);
  font-size: 0.88em;
  font-weight: 760;
}

.control-button svg {
  flex: 0 0 auto;
  width: clamp(1.7rem, 2.2vw, 2.2rem);
  height: clamp(1.7rem, 2.2vw, 2.2rem);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.control-button .play-icon {
  fill: currentColor;
}

.control-button.primary-control {
  border-color: rgba(255, 181, 71, 0.32);
  background: rgba(255, 181, 71, 0.11);
  color: var(--accent-bright);
}

.control-button[aria-pressed="true"] {
  border-color: rgba(115, 217, 160, 0.45);
  background: rgba(115, 217, 160, 0.1);
  color: var(--success);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.icon-button:hover:not(:disabled),
.text-button:hover:not(:disabled),
.back-button:hover:not(:disabled),
.control-button:hover:not(:disabled) {
  border-color: var(--border-strong);
  background-color: var(--surface-soft);
  color: var(--text);
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-bright);
}

button:focus,
a:focus,
input:focus {
  outline: 0.18rem solid var(--focus);
  outline-offset: 0.23rem;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible) {
  outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 0.18rem solid var(--focus);
  outline-offset: 0.23rem;
}

.video-card:focus:not(:focus-visible) {
  outline: 0;
}

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

@media (max-width: 900px) {
  :root {
    --header-height: 6.5rem;
  }

  .player-topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .subtitle-pill {
    display: none;
  }

  .player-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .control-button:nth-child(4),
  .control-button:nth-child(5) {
    grid-column: span 1;
  }
}

@media (max-width: 620px) {
  :root {
    --header-height: 7.75rem;
  }

  body {
    font-size: 1rem;
  }

  .site-header,
  main {
    width: min(100% - 1.25rem, 112rem);
  }

  .brand-mark {
    width: 5rem;
    height: 5rem;
  }

  .brand-subtitle,
  .header-status .connection-label,
  .key-hint,
  .remote-help {
    display: none;
  }

  .header-status {
    padding: 0.7rem;
  }

  .library-intro {
    align-items: center;
  }

  .library-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .clear-search {
    align-self: flex-start;
  }

  .library-grid {
    grid-template-columns: 1fr;
  }

  .card-artwork {
    min-height: 11rem;
  }

  .player-view {
    padding-top: 1rem;
  }

  .player-topbar {
    align-items: start;
  }

  .back-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .back-button {
    min-width: 3.4rem;
    min-height: 3.4rem;
    justify-content: center;
    padding: 0.7rem;
  }

  .now-playing-copy .eyebrow,
  #nowPlayingMeta {
    display: none;
  }

  .now-playing-copy h1 {
    padding-top: 0.5rem;
    font-size: 1.25rem;
  }

  .player-stage {
    border-radius: var(--radius-md);
  }

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

  .control-button {
    min-height: 4rem;
  }

  .control-button.primary-control {
    grid-column: span 2;
    grid-row: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@supports not (aspect-ratio: 16 / 9) {
  .player-stage {
    height: 0;
    padding-bottom: 56.25%;
  }

  .player-stage video,
  .player-status {
    position: absolute;
    inset: 0;
  }
}
