:root {
  color-scheme: dark;
  --bg: #081015;
  --panel: #121b22;
  --panel-2: #18252f;
  --text: #f5f8fb;
  --muted: #98a7b3;
  --line: #2b3a45;
  --accent: #38bdf8;
  --accent-2: #f59e0b;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.screen {
  min-height: 100vh;
  min-height: 100dvh;
}

.player-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #000;
}

.tv-video,
.tv-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  background: #000;
  display: block;
  opacity: 0;
  transform: scale(1.015);
  transition: opacity 700ms ease, transform 1800ms ease;
}

.tv-image {
  max-width: none;
  max-height: none;
}

.tv-video.is-visible,
.tv-image.is-visible {
  opacity: 1;
  transform: scale(1);
}

.empty-player {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 18px;
  text-align: center;
  background: radial-gradient(circle at center, #17242e, #020405 70%);
}

.empty-player p {
  margin: 0;
  font-size: clamp(28px, 5vw, 64px);
  font-weight: 800;
}

.empty-player a,
.admin-shortcut,
.watch-link,
button,
.file-picker span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  padding: 10px 14px;
  text-decoration: none;
}

.admin-shortcut {
  position: fixed;
  right: 16px;
  top: 16px;
  z-index: 5;
  opacity: 0.18;
  transition: opacity 160ms ease;
}

.admin-shortcut:hover,
.admin-shortcut:focus-visible {
  opacity: 1;
}

.upload-progress {
  height: 7px;
  flex: 1;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.upload-progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 160ms ease;
}

.admin-screen {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: auto;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  background: #0b1117;
}

.sidebar {
  min-height: 100vh;
  border-right: 1px solid var(--line);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #101820;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 34px;
}

h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

.admin-panel {
  width: min(1080px, 100%);
  padding: 28px;
}

.upload-box {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.upload-box p,
.status-text,
.meta {
  color: var(--muted);
}

.file-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.file-picker span {
  display: inline-flex;
}

.toolbar {
  margin: 28px 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.danger {
  border-color: rgba(239, 68, 68, 0.45);
  color: #fecaca;
}

.playlist {
  list-style: none;
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
}

.playlist-item {
  display: grid;
  grid-template-columns: 144px minmax(180px, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.thumb-wrap,
.thumb {
  width: 144px;
  aspect-ratio: 16 / 9;
}

.thumb-wrap {
  overflow: hidden;
  border-radius: 6px;
  background: #020405;
}

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

.title-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: #0d151c;
  color: var(--text);
}

.duration-field {
  width: fit-content;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.duration-field input {
  width: 72px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 8px;
  background: #0d151c;
  color: var(--text);
}

.duration-field[hidden] {
  display: none !important;
}

.meta {
  margin: 8px 0 0;
  font-size: 13px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 8px;
}

.actions button {
  min-width: 42px;
}

@media (max-width: 820px) {
  .admin-screen {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    gap: 18px;
  }

  .playlist-item {
    grid-template-columns: 110px minmax(0, 1fr);
  }

  .switch,
  .actions {
    grid-column: 2;
  }

  .thumb-wrap,
  .thumb {
    width: 110px;
  }
}
