:root {
  color-scheme: dark;
  --ink: #f6f8ff;
  --muted: #95a0b5;
  --paper: #070b12;
  --paper-strong: #101827;
  --panel: rgba(16, 24, 39, 0.82);
  --panel-strong: rgba(24, 35, 55, 0.94);
  --line: rgba(186, 200, 228, 0.14);
  --left: #2d7dff;
  --right: #ff6a3d;
  --green: #51e2a4;
  --warning: #f8c95d;
  --danger: #ff4f68;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  font-family: Avenir Next, Trebuchet MS, Segoe UI, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 0%, rgba(45, 125, 255, 0.22), transparent 28%),
    radial-gradient(circle at 84% 18%, rgba(255, 106, 61, 0.16), transparent 26%),
    repeating-linear-gradient(90deg, rgba(246, 248, 255, 0.035) 0 1px, transparent 1px 22px),
    var(--paper);
}

button,
a,
input {
  font: inherit;
}

button,
.player-card {
  -webkit-tap-highlight-color: transparent;
}

.studio-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 54px;
}

.hero-panel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
  min-height: 230px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(16, 24, 39, 0.96), rgba(12, 18, 30, 0.72)),
    radial-gradient(circle at 88% 22%, rgba(255, 106, 61, 0.16), transparent 28%);
  box-shadow: var(--shadow);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 6px;
  color: white;
  background: linear-gradient(135deg, var(--left) 0 49%, var(--right) 50% 100%);
  font-weight: 900;
  letter-spacing: 0.08em;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(2.6rem, 8vw, 6.4rem);
  line-height: 0.9;
}

h2 {
  font-size: clamp(1.3rem, 3vw, 2rem);
}

.lede {
  max-width: 640px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.status-strip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 13, 22, 0.72);
  color: var(--muted);
  white-space: nowrap;
}

.hero-actions {
  display: grid;
  justify-items: end;
  gap: 12px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #c3aa50;
}

.status-dot.ready {
  background: #1fb56f;
}

.control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 18px;
  margin-top: 18px;
}

.upload-zone,
.panel,
.playlist-section,
.override-panel,
.setup-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 46px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
}

.upload-zone {
  position: relative;
  min-height: 320px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.upload-zone::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 2px dashed rgba(149, 160, 181, 0.32);
  border-radius: 6px;
  pointer-events: none;
}

.upload-zone.dragging {
  background: rgba(45, 125, 255, 0.18);
}

.upload-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.upload-symbol {
  position: absolute;
  top: 34px;
  left: 34px;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  color: #061016;
  background: linear-gradient(135deg, var(--left), var(--green));
  font-size: 2.2rem;
  line-height: 1;
}

.upload-zone p {
  max-width: 520px;
  color: var(--muted);
  line-height: 1.5;
}

.primary-action,
.ghost-action,
.mini-action,
.push-action,
.danger-action,
.entry-chip {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-action {
  width: fit-content;
  padding: 0 22px;
  color: #061016;
  background: var(--green);
  box-shadow: 0 10px 24px rgba(81, 226, 164, 0.22);
}

.ghost-action,
.mini-action {
  padding: 0 16px;
  color: var(--ink);
  background: rgba(246, 248, 255, 0.08);
}

.push-action {
  min-width: 132px;
  padding: 0 16px;
  color: #061016;
  background: var(--warning);
}

.danger-action {
  padding: 0 18px;
  color: white;
  background: var(--danger);
}

.primary-action:hover,
.ghost-action:hover,
.mini-action:hover,
.player-card:hover,
.push-action:hover,
.danger-action:hover,
.entry-chip:hover {
  transform: translateY(-1px);
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(100%, 520px);
}

.login-card {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(16, 24, 39, 0.96), rgba(12, 18, 30, 0.82)),
    radial-gradient(circle at top right, rgba(255, 106, 61, 0.18), transparent 36%);
  box-shadow: var(--shadow);
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.login-form input {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(7, 11, 18, 0.84);
}

.form-error {
  margin: 0;
  color: #ff92a4;
}

.panel {
  padding: 24px;
}

.panel-header,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.player-links {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.player-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 94px;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 8px solid var(--left);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(246, 248, 255, 0.06);
  text-decoration: none;
}

.player-card::after {
  content: "Öffnen";
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.player-card.right {
  border-left-color: var(--right);
}

.player-card span {
  font-weight: 900;
  font-size: 1.1rem;
}

.hint-box {
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(81, 226, 164, 0.08);
  line-height: 1.45;
}

.override-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 22px 24px;
  border-color: rgba(248, 201, 93, 0.42);
  background:
    linear-gradient(135deg, rgba(248, 201, 93, 0.16), rgba(16, 24, 39, 0.86)),
    var(--panel);
}

.override-panel[hidden] {
  display: none;
}

.setup-panel {
  margin-top: 18px;
  padding: 24px;
}

.setup-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.setup-links div {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(246, 248, 255, 0.055);
}

.setup-links span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.setup-links code {
  overflow: hidden;
  color: var(--green);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playlist-section {
  margin-top: 18px;
  padding: 24px;
}

.planner-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.media-library,
.playlists-panel,
.schedule-slots {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.library-card,
.playlist-card,
.slot-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(246, 248, 255, 0.055);
}

.library-card {
  grid-template-columns: 150px minmax(0, 1fr) auto;
  align-items: start;
}

.library-main,
.slot-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.library-main strong,
.slot-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-main span,
.slot-main span {
  color: var(--muted);
  font-size: 0.92rem;
}

.library-actions,
.slot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.media-setting {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.playlist-manager-panel,
.schedule-manager-panel {
  padding: 24px;
}

.planner-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.planner-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.planner-form input,
.planner-form select,
.playlist-title-input,
.playlist-add-row select {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(7, 11, 18, 0.84);
}

.playlist-card {
  align-items: start;
}

.playlist-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}

.playlist-title-input {
  flex: 1 1 240px;
}

.playlist-title-stack {
  display: grid;
  gap: 6px;
  min-width: 0;
  flex: 1 1 260px;
}

.playlist-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.playlist-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.playlist-add-row {
  display: grid;
  gap: 12px;
}

.playlist-picker-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(186, 200, 228, 0.12);
  border-radius: 12px;
  background: rgba(7, 11, 18, 0.38);
}

.playlist-picker-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: space-between;
}

.playlist-picker-head span:first-child {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
}

.playlist-picker-head span:last-child,
.playlist-picker-empty {
  color: var(--muted);
  font-size: 0.88rem;
}

.playlist-media-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.playlist-media-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(186, 200, 228, 0.12);
  border-radius: 10px;
  text-align: left;
  color: var(--ink);
  background: rgba(9, 14, 24, 0.9);
}

.playlist-media-row[data-selected="true"] {
  border-color: rgba(81, 226, 164, 0.7);
  background: rgba(18, 31, 34, 0.96);
  box-shadow: 0 0 0 1px rgba(81, 226, 164, 0.18) inset;
}

.checkbox-indicator {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(186, 200, 228, 0.24);
  border-radius: 6px;
  color: #061016;
  background: rgba(246, 248, 255, 0.08);
  font-size: 0.8rem;
  font-weight: 900;
}

.playlist-media-row[data-selected="true"] .checkbox-indicator {
  border-color: rgba(81, 226, 164, 0.8);
  background: rgba(81, 226, 164, 0.92);
}

.playlist-media-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.playlist-media-copy strong,
.playlist-entry-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playlist-media-copy span,
.playlist-entry-copy span {
  color: var(--muted);
  font-size: 0.84rem;
}

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

.playlist-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(186, 200, 228, 0.12);
  border-radius: 8px;
  background: rgba(7, 11, 18, 0.42);
}

.playlist-entry-media {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.playlist-drag-handle {
  color: var(--muted);
  font-size: 1rem;
  letter-spacing: -0.12em;
  cursor: grab;
  user-select: none;
}

.playlist-entry-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.playlist-entry.empty {
  color: var(--muted);
  justify-content: flex-start;
}

.playlist-entry.dragging {
  opacity: 0.55;
}

.playlist-entry.drag-over {
  border-color: rgba(81, 226, 164, 0.72);
  box-shadow: 0 0 0 1px rgba(81, 226, 164, 0.16) inset;
}

.entry-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.slot-form .primary-action,
.slot-form .schedule-note {
  grid-column: 1 / -1;
}

.slot-end-wrap.disabled {
  opacity: 0.5;
}

.slot-end-wrap.disabled input,
.slot-end-wrap.disabled select {
  pointer-events: none;
}

.schedule-slots {
  padding: 0;
  list-style: none;
}

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

.playlist-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(246, 248, 255, 0.055);
}

.media-preview {
  display: grid;
  gap: 8px;
  width: 150px;
  margin: 0;
}

.media-preview.compact {
  width: 56px;
  flex: 0 0 56px;
}

.preview-frame {
  position: relative;
  width: 150px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(186, 200, 228, 0.16);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(45, 125, 255, 0.16), rgba(81, 226, 164, 0.08)),
    #050914;
}

.preview-frame.compact {
  width: 56px;
  border-radius: 8px;
}

.thumb {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  object-fit: cover;
  background: #050914;
}

.media-preview figcaption {
  width: fit-content;
  padding: 5px 10px;
  border: 1px solid rgba(186, 200, 228, 0.16);
  border-radius: 999px;
  color: var(--green);
  background: rgba(81, 226, 164, 0.08);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.play-mark {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: #061016;
  background: rgba(81, 226, 164, 0.9);
  font-size: 0.82rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.item-main {
  min-width: 0;
}

.item-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-main span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.schedule-editor {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.schedule-editor.disabled {
  opacity: 0.78;
}

.switch-line {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.92rem;
}

.switch-line input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.entry-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.entry-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(45, 125, 255, 0.14);
}

.entry-chip span {
  margin: 0;
  color: var(--green);
  font-size: 1rem;
}

.schedule-empty,
.schedule-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.entry-creator {
  display: grid;
  grid-template-columns: minmax(0, 110px) minmax(0, 140px) auto;
  gap: 10px;
}

.entry-creator select,
.entry-creator input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(7, 11, 18, 0.82);
}

.entry-creator select:disabled,
.entry-creator input:disabled,
.entry-creator button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.entry-creator input,
.entry-creator select,
.duration-input,
.screen-target-select {
  color-scheme: dark;
}

.item-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 360px;
}

.duration-input {
  width: 86px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(7, 11, 18, 0.82);
}

.screen-target-select {
  min-width: 154px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(7, 11, 18, 0.82);
}

.empty-state {
  display: none;
  margin-top: 18px;
  padding: 22px;
  border: 1px dashed rgba(149, 160, 181, 0.32);
  border-radius: 8px;
  color: var(--muted);
}

.empty-state.visible {
  display: block;
}

.player-body {
  overflow: hidden;
  background: #000;
}

.player-stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #000;
}

.wall-media {
  position: absolute;
  top: 0;
  left: 0;
  width: 200vw;
  height: 100vh;
  object-fit: cover;
  transform: translateX(0);
}

.wall-media.right-screen {
  transform: translateX(-100vw);
}

.wall-media.single-screen {
  width: 100vw;
  transform: none;
}

.player-label {
  position: fixed;
  z-index: 5;
  left: 16px;
  bottom: 16px;
  padding: 8px 10px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(0, 0, 0, 0.45);
  font-size: 0.82rem;
}

.empty-player {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  font-size: clamp(1.4rem, 4vw, 3rem);
}

@media (max-width: 780px) {
  .studio-shell {
    width: min(100% - 20px, 560px);
    padding-top: 10px;
  }

  .hero-panel,
  .control-grid,
  .planner-grid,
  .playlist-item,
  .setup-links {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    min-height: 0;
    padding: 20px;
  }

  .status-strip {
    justify-self: start;
  }

  .hero-actions {
    justify-items: start;
  }

  .control-grid {
    gap: 12px;
  }

  .upload-zone {
    min-height: 290px;
  }

  .library-card,
  .slot-form,
  .playlist-add-row {
    grid-template-columns: 1fr;
  }

  .playlist-header,
  .library-actions,
  .slot-actions {
    justify-content: flex-start;
  }

  .entry-creator {
    grid-template-columns: 1fr;
  }

  .item-controls {
    flex-wrap: wrap;
  }

  .media-preview,
  .preview-frame {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
