:root {
  color-scheme: dark;
  font-family: "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(254, 93, 38, 0.26), transparent 28%),
    radial-gradient(circle at top right, rgba(53, 120, 255, 0.18), transparent 30%),
    linear-gradient(180deg, #0b0f16 0%, #121826 58%, #0b0f16 100%);
  color: #f4f7fb;
  --panel: rgba(17, 23, 35, 0.88);
  --panel-border: rgba(255, 255, 255, 0.08);
  --muted: #a8b1c5;
  --accent: #ff6a3d;
  --accent-strong: #ff7f57;
  --soft: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

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

.app-shell {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 18px 16px 40px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 14, 0.62);
  backdrop-filter: blur(6px);
  z-index: 20;
}

.connection-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(86vw, 360px);
  padding: 22px 18px;
  background:
    linear-gradient(180deg, rgba(22, 28, 41, 0.98) 0%, rgba(13, 17, 27, 0.98) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 18px 0 44px rgba(0, 0, 0, 0.34);
  transform: translateX(-100%);
  transition: transform 180ms ease;
  z-index: 30;
}

.connection-drawer.open {
  transform: translateX(0);
}

.drawer-head,
.topbar,
.slider-head,
.search-row,
.now-chips,
.browse-toolbar,
.drawer-status-card {
  display: flex;
  align-items: center;
}

.drawer-head,
.topbar,
.slider-head {
  justify-content: space-between;
}

.drawer-head {
  margin-bottom: 24px;
}

.drawer-eyebrow,
.topbar-eyebrow,
.section-eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.drawer-title,
.section-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.topbar {
  gap: 12px;
  margin-bottom: 18px;
}

.topbar-copy {
  flex: 1 1 auto;
}

.topbar-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: #f4f7fb;
  flex: 0 0 auto;
}

.icon-button span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  margin: 2px 0;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #677289;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.05);
}

.status-dot.connected {
  background: #29d17c;
}

.status-dot.disconnected {
  background: #ff6a3d;
}

.connect-form {
  display: grid;
  gap: 14px;
}

.field span,
.slider-head span:first-child {
  display: block;
  font-weight: 700;
}

.field span {
  margin-bottom: 8px;
}

input[type="text"] {
  width: 100%;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f4f7fb;
}

input[type="text"]::placeholder {
  color: #7f899c;
}

.primary-button,
.secondary-button,
.transport-button,
.platform-card,
.preview-item {
  border-radius: 18px;
  transition: transform 140ms ease, opacity 140ms ease, border-color 140ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.transport-button:hover,
.platform-card:hover,
.preview-item:hover {
  transform: translateY(-1px);
}

.primary-button {
  width: 100%;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fffaf7;
  font-weight: 800;
}

.secondary-button {
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.07);
  color: #f4f7fb;
}

.drawer-status-card {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.connection-badge,
.mode-badge,
.meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.mode-badge {
  background: rgba(255, 255, 255, 0.08);
  color: #d3dbeb;
}

.connection-badge.connected,
.mode-badge.playback {
  background: rgba(41, 209, 124, 0.12);
  color: #7bf0b0;
}

.connection-badge.disconnected,
.mode-badge.browse {
  background: rgba(255, 106, 61, 0.12);
  color: #ffb196;
}

.meta-chip {
  background: rgba(255, 255, 255, 0.08);
  color: #d3dbeb;
}

.drawer-copy,
.drawer-note,
.now-subtitle,
.page-url,
.preview-subtitle,
.preview-empty,
.slider-value {
  color: var(--muted);
}

.drawer-copy,
.drawer-note,
.page-url,
.preview-empty {
  margin: 0;
}

.drawer-note {
  font-size: 13px;
  line-height: 1.4;
}

.now-card,
.controls-card,
.platforms-card,
.preview-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
}

.now-card {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 18px;
  padding: 18px;
}

.now-art {
  position: relative;
  min-height: 144px;
  border-radius: 24px;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(255, 106, 61, 0.82) 0%, rgba(81, 105, 255, 0.86) 100%);
}

.cover-image,
.cover-fallback {
  width: 100%;
  height: 100%;
}

.cover-image {
  display: block;
  object-fit: cover;
}

.cover-fallback {
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 34px;
  font-weight: 900;
}

.now-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.now-chips {
  gap: 8px;
  flex-wrap: wrap;
}

.now-title {
  margin: 14px 0 8px;
  font-size: 30px;
  line-height: 1.02;
}

.now-subtitle {
  margin: 0;
  font-size: 15px;
}

.page-url {
  margin-top: 10px;
  font-size: 13px;
  word-break: break-word;
}

.controls-card,
.platforms-card,
.preview-card {
  margin-top: 16px;
  padding: 18px;
}

.transport-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.transport-button {
  min-height: 58px;
  padding: 14px;
  font-weight: 800;
  color: #f4f7fb;
}

.transport-button-soft {
  background: rgba(255, 255, 255, 0.08);
}

.transport-button-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
}

.slider-stack {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.slider-card,
.search-card {
  display: block;
  padding: 14px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.slider-head {
  gap: 12px;
  margin-bottom: 10px;
}

.slider-value {
  font-size: 13px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.search-card {
  margin-top: 12px;
}

.search-row {
  gap: 10px;
}

.search-row input {
  flex: 1 1 auto;
}

.section-head {
  margin-bottom: 14px;
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.platform-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 88px;
  padding: 16px;
  text-align: left;
  color: #ffffff;
}

.platform-logo {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.platform-name {
  font-size: 16px;
  font-weight: 800;
}

.platform-youtube {
  background: linear-gradient(135deg, #ff3d2f 0%, #b90d0d 100%);
}

.platform-netflix {
  background: linear-gradient(135deg, #6f0000 0%, #e50914 100%);
}

.platform-prime {
  background: linear-gradient(135deg, #00a8e1 0%, #103a73 100%);
}

.platform-disney {
  background: linear-gradient(135deg, #10285f 0%, #2d86ff 100%);
}

.platform-max {
  background: linear-gradient(135deg, #3726a6 0%, #895cff 100%);
}

.platform-globoplay {
  background: linear-gradient(135deg, #ff7e2f 0%, #ff3f7e 100%);
}

.platform-apple-tv {
  background: linear-gradient(135deg, #181818 0%, #7f8a96 100%);
}

.browse-toolbar {
  gap: 10px;
  margin-bottom: 14px;
}

.browse-toolbar .secondary-button {
  flex: 1 1 0;
}

.preview-empty {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

.preview-grid {
  display: grid;
  gap: 12px;
}

.preview-item {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px;
  text-align: left;
  background: rgba(255, 255, 255, 0.05);
  color: #f4f7fb;
}

.preview-image {
  width: 86px;
  height: 86px;
  border-radius: 18px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}

.preview-body {
  display: grid;
  gap: 6px;
}

.preview-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.24;
}

.preview-subtitle {
  font-size: 13px;
  line-height: 1.3;
}

@media (max-width: 560px) {
  .app-shell {
    padding: 16px 14px 30px;
  }

  .now-card {
    grid-template-columns: 1fr;
  }

  .now-art {
    min-height: 220px;
  }

  .platform-grid,
  .transport-row {
    grid-template-columns: 1fr;
  }
}
