:root {
  --page-bg: #e7d4b6;
  --wood-1: #6a4228;
  --wood-2: #8a5a33;
  --wood-3: #4c2f1c;
  --screen-bezel: #37261b;
  --screen-dark: #0e1718;
  --accent: #d0502d;
  --text: #f6ead5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 0;
  background:
    radial-gradient(circle at top, rgba(255, 246, 213, 0.9), transparent 35%),
    linear-gradient(180deg, #f4e5ca 0%, var(--page-bg) 48%, #d2b089 100%);
  color: var(--text);
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
}

.stage {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  gap: 20px;
}

.home-admin-bar {
  width: min(1400px, calc(100vw - 44px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
}

.home-admin-bar strong,
.home-admin-bar span {
  display: block;
}

.tv-shell {
  position: relative;
  width: min(1400px, calc(100vw - 44px));
  min-height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 42px 28px;
  border-radius: 42px;
  background:
    linear-gradient(145deg, var(--wood-2), var(--wood-1) 45%, var(--wood-3));
  box-shadow:
    inset 0 2px 4px rgba(255, 227, 178, 0.35),
    inset 0 -8px 18px rgba(0, 0, 0, 0.28),
    0 28px 40px rgba(84, 43, 17, 0.28);
}

.panel {
  width: min(1400px, calc(100vw - 44px));
  border-radius: 24px;
  background: rgba(63, 35, 18, 0.78);
  box-shadow: 0 18px 30px rgba(84, 43, 17, 0.22);
  border: 1px solid rgba(255, 235, 202, 0.08);
}

.tv-shell::before,
.tv-shell::after {
  content: "";
  position: absolute;
  top: -72px;
  width: 6px;
  height: 108px;
  background: linear-gradient(180deg, #4b4037, #9a8d7d);
  border-radius: 999px;
  transform-origin: bottom center;
  box-shadow: 0 0 0 2px rgba(60, 38, 18, 0.18);
}

.tv-shell::before {
  left: 32%;
  transform: rotate(-24deg);
}

.tv-shell::after {
  right: 32%;
  transform: rotate(24deg);
}

.tv-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 24px;
  align-items: stretch;
}

.screen-bezel {
  height: 100%;
  padding: 20px;
  border-radius: 28px;
  background:
    linear-gradient(145deg, #54392a, var(--screen-bezel));
  box-shadow:
    inset 0 0 0 2px rgba(235, 214, 186, 0.15),
    inset 0 20px 24px rgba(255, 255, 255, 0.05),
    0 10px 20px rgba(0, 0, 0, 0.2);
}

.screen {
  position: relative;
  height: 100%;
  min-height: clamp(420px, 68vh, 920px);
  border-radius: 22px;
  overflow: hidden;
  border: 4px solid rgba(234, 219, 194, 0.22);
  background:
    radial-gradient(circle at 50% 35%, rgba(145, 217, 209, 0.35), transparent 36%),
    linear-gradient(180deg, #1a2c2d 0%, var(--screen-dark) 100%);
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.8),
    inset 0 0 60px rgba(145, 217, 209, 0.15);
}

.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.05) 0,
      rgba(255, 255, 255, 0.05) 2px,
      transparent 2px,
      transparent 6px
    );
  mix-blend-mode: screen;
  opacity: 0.35;
  pointer-events: none;
}

.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 54%, rgba(0, 0, 0, 0.42) 100%);
  pointer-events: none;
}

.video-slot {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(151, 224, 215, 0.24), rgba(8, 12, 12, 0.7)),
    #000;
  display: grid;
  place-items: center;
}

.screen-status {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 4;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(12, 18, 18, 0.72);
  border: 1px solid rgba(213, 255, 246, 0.12);
  box-shadow: 0 0 18px rgba(145, 217, 209, 0.16);
}

.screen-status-channel {
  color: #f4f0ca;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.screen-status-title {
  color: #cbece4;
  max-width: min(32vw, 360px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.screen-static {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.14) 0,
      rgba(255, 255, 255, 0.14) 2px,
      rgba(0, 0, 0, 0.1) 2px,
      rgba(0, 0, 0, 0.1) 4px
    ),
    linear-gradient(90deg, rgba(163, 255, 244, 0.18), rgba(255, 226, 170, 0.1), rgba(255, 131, 131, 0.14)),
    radial-gradient(circle at center, rgba(255, 255, 255, 0.3), rgba(0, 0, 0, 0.5));
  mix-blend-mode: screen;
}

.screen-static.active {
  animation: static-burst 280ms steps(6) 1;
}

.video-slot iframe,
.video-slot video {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  display: block;
}

.screen-idle {
  position: absolute;
  z-index: 2;
}

.channel-bank-wrap {
  width: auto;
  padding: 8px;
  border-radius: 16px;
  background: rgba(31, 18, 10, 0.42);
  border: 1px solid rgba(255, 233, 191, 0.1);
}

.channel-bank-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: #f0debb;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.channel-bank-live {
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 239, 206, 0.12);
  color: #f7e9c7;
}

.channel-bank-panel {
  display: grid;
  grid-template-columns: repeat(4, 22px);
  justify-content: center;
  gap: 4px;
}

.channel-button {
  position: relative;
  width: 22px;
  height: 19px;
  border: 0;
  border-radius: 5px;
  background: linear-gradient(180deg, #efd8a1, #9d7947);
  color: #2e1c11;
  font-weight: 700;
  font-size: 0.58rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.channel-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 8;
  display: grid;
  gap: 2px;
  min-width: 96px;
  padding: 7px 8px;
  border-radius: 10px;
  background: rgba(19, 12, 8, 0.94);
  border: 1px solid rgba(255, 233, 191, 0.18);
  color: #f6ead5;
  text-align: center;
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.28);
  transition: opacity 120ms ease, transform 120ms ease;
}

.channel-tooltip strong,
.channel-tooltip span {
  display: block;
}

.channel-tooltip strong {
  font-size: 0.58rem;
  line-height: 1.2;
}

.channel-tooltip span {
  color: rgba(246, 234, 213, 0.78);
  font-size: 0.5rem;
}

.channel-button:hover .channel-tooltip,
.channel-button:focus-visible .channel-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.channel-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.22);
}

.channel-button.active {
  background: linear-gradient(180deg, #f3b572, #d16734);
  color: #fff7ec;
  box-shadow: 0 0 14px rgba(243, 181, 114, 0.4);
}

.channel-button.empty,
.channel-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.screen-copy {
  width: min(80%, 520px);
  text-align: center;
  padding: 24px;
  border: 2px solid rgba(214, 255, 249, 0.25);
  border-radius: 16px;
  background: rgba(11, 21, 21, 0.55);
  box-shadow: 0 0 30px rgba(145, 217, 209, 0.15);
}

.screen-copy h2 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f3f1d1;
}

.screen-copy p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: #d3ece7;
}

.screen-copy-link {
  margin-top: 16px !important;
}

.screen-copy-link a {
  color: #f6ead5;
  text-decoration: none;
  border-bottom: 1px solid rgba(246, 234, 213, 0.45);
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-header h1,
.create-user h2,
.auth-panel h1 {
  margin: 0;
}

.admin-nav a {
  color: #f8e7c2;
  text-decoration: none;
  font-weight: 700;
}

.movie-list-item,
.movie-card,
.create-user,
.admin-actions,
.auth-panel,
.filter-panel {
  padding: 18px;
  border-radius: 18px;
  background: rgba(23, 15, 10, 0.45);
  border: 1px solid rgba(255, 234, 198, 0.08);
}

.movie-card h2 {
  margin: 0 0 8px;
}

.admin-header p,
.movie-path,
.movie-meta-line {
  margin: 0 0 8px;
  color: #e5d4b3;
}

.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 16px 10px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(243, 225, 187, 0.2), rgba(65, 40, 22, 0.32));
  box-shadow: inset 0 0 0 2px rgba(255, 233, 191, 0.12);
}

.speaker {
  width: 100%;
  max-width: 120px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(32, 18, 10, 0.45);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.speaker span {
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #8b7458, #3b281a 72%);
  box-shadow: inset 0 1px 1px rgba(255, 239, 209, 0.18);
}

.knob-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  color: #f0debb;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.knob-readout {
  display: block;
  margin-top: 4px;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: rgba(246, 234, 213, 0.8);
}

.knob {
  position: relative;
  width: 86px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #f4e0b5, #a68a5f 42%, #624a31 75%, #2e1d12 100%);
  box-shadow:
    inset 0 3px 6px rgba(255, 244, 220, 0.3),
    0 6px 12px rgba(0, 0, 0, 0.25);
  border: 0;
  padding: 0;
}

.knob-button {
  cursor: pointer;
}

.knob-button:active {
  transform: scale(0.98);
}

.knob::before {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  border: 2px dashed rgba(63, 42, 24, 0.6);
}

.knob::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 24px;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(208, 80, 45, 0.4);
}

.button-row {
  display: flex;
  gap: 10px;
  margin-top: 0;
  padding: 4px 0 2px;
}

.tracking-panel {
  width: 100%;
  max-width: 132px;
  padding: 10px 10px 8px;
  border-radius: 16px;
  background: rgba(32, 18, 10, 0.45);
  border: 1px solid rgba(255, 233, 191, 0.08);
}

.tracking-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #f0debb;
  font-size: 0.54rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tracking-bar {
  --track-progress: 0%;
  width: 100%;
  height: 10px;
  margin: 0;
  appearance: none;
  border-radius: 999px;
  background:
    linear-gradient(90deg, #f1b472 0%, #d36d39 var(--track-progress), rgba(113, 74, 42, 0.82) var(--track-progress), rgba(113, 74, 42, 0.82) 100%);
  box-shadow:
    inset 0 1px 2px rgba(255, 235, 202, 0.18),
    0 1px 4px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

.tracking-bar::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f7e2b4, #9b784e 70%, #563821);
  box-shadow:
    inset 0 1px 1px rgba(255, 244, 220, 0.35),
    0 2px 4px rgba(0, 0, 0, 0.25);
}

.tracking-bar::-moz-range-thumb {
  width: 12px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #f7e2b4, #9b784e 70%, #563821);
  box-shadow:
    inset 0 1px 1px rgba(255, 244, 220, 0.35),
    0 2px 4px rgba(0, 0, 0, 0.25);
}

.tracking-bar::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: transparent;
}

.button {
  width: 18px;
  height: 54px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f2ddaf, #8f724d 70%, #50351f);
  box-shadow:
    inset 0 2px 2px rgba(255, 244, 221, 0.35),
    0 4px 8px rgba(0, 0, 0, 0.2);
  border: 0;
  padding: 0;
}

.tv-control {
  display: grid;
  place-items: center;
}

.button-icon {
  color: #3b2414;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.button.tv-control:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 3px 3px rgba(73, 48, 28, 0.35),
    0 2px 4px rgba(0, 0, 0, 0.2);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 239, 206, 0.14);
  color: #f7e9c7;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 239, 206, 0.24);
}

.hidden-admin-trigger {
  cursor: pointer;
}

.tv-legs {
  display: flex;
  justify-content: space-between;
  width: calc(100% - 110px);
  margin: 0 auto;
  padding-top: 10px;
}

.leg {
  width: 16px;
  height: 92px;
  border-radius: 999px;
  background: linear-gradient(180deg, #613d24, #382012);
  transform-origin: top center;
  box-shadow: inset 0 1px 2px rgba(255, 228, 191, 0.14);
}

.leg.left {
  transform: rotate(18deg);
}

.leg.right {
  transform: rotate(-18deg);
}

@media (max-width: 860px) {
  .tv-shell {
    width: min(100vw - 24px, 1400px);
    min-height: calc(100vh - 24px);
    padding: 42px 24px 24px;
  }

  .tv-frame {
    grid-template-columns: 1fr;
  }

  .admin-header,
  .library-header,
  .library-pagination,
  .home-admin-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .controls {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .channel-bank-wrap {
    width: auto;
  }

  .speaker {
    max-width: 120px;
  }

  .screen {
    min-height: 320px;
  }

  .tv-legs {
    width: calc(100% - 56px);
  }

  .admin-stats {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

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

  .library-stats {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

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

  .poster-admin-grid {
    grid-template-columns: 1fr;
  }

  .library-alpha-bar {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  body {
    padding: 0;
  }

  .screen {
    min-height: 52vh;
  }

  .video-slot {
    inset: 0;
  }

  .screen-status {
    top: 10px;
    left: 10px;
    gap: 8px;
    padding: 8px 10px;
  }

  .screen-status-title {
    max-width: 150px;
  }

  .channel-bank-panel {
    grid-template-columns: repeat(4, 38px);
    gap: 6px;
    padding: 10px;
  }

  .channel-button {
    width: 38px;
    height: 34px;
    font-size: 0.9rem;
  }

  .screen-copy {
    width: calc(100% - 20px);
    padding: 18px;
  }

  .library-body {
    padding: 16px;
  }

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

  .library-alpha-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .knob {
    width: 72px;
  }

  .stage {
    padding: 12px;
  }
}

@keyframes static-burst {
  0% {
    opacity: 0;
    transform: scaleY(1.02);
  }

  20% {
    opacity: 0.95;
    transform: scaleY(1);
  }

  60% {
    opacity: 0.7;
  }

  100% {
    opacity: 0;
    transform: scaleY(0.99);
  }
}

.admin-body {
  display: block;
  padding: 24px;
}

.library-body {
  display: block;
  min-height: 100vh;
  padding: 24px;
}

.admin-shell,
.auth-shell,
.library-shell {
  width: min(1400px, 100%);
  margin: 0 auto;
}

.admin-shell {
  width: min(1680px, 100%);
}

.library-shell {
  display: grid;
  gap: 18px;
}

.auth-shell {
  min-height: calc(100vh - 48px);
  display: grid;
  place-items: center;
}

.auth-panel {
  width: min(460px, 100%);
}

.auth-links-grid,
.auth-helper-links,
.token-link {
  margin-top: 14px;
}

.auth-links-grid {
  display: grid;
  gap: 8px;
}

.auth-links-grid a,
.auth-helper-links a,
.token-link a {
  color: #f8e7c2;
  text-decoration: none;
}

.library-header,
.library-filter-panel,
.library-empty-state,
.library-pagination {
  width: 100%;
  padding: 20px;
}

.library-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.library-kicker {
  margin: 0 0 10px;
  color: #f3c481;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.library-header h1,
.library-empty-state h2 {
  margin: 0;
}

.library-subtitle {
  margin: 10px 0 0;
  color: #ead8b7;
}

.auth-nav,
.library-nav,
.library-pagination-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.auth-nav {
  justify-content: center;
  margin-bottom: 16px;
}

.auth-nav a,
.library-nav a,
.library-pagination-links a {
  color: #f8e7c2;
  text-decoration: none;
  font-weight: 700;
}

.auth-nav a,
.admin-nav a,
.library-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 239, 206, 0.08);
  border: 1px solid rgba(255, 239, 206, 0.08);
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.auth-nav a.active,
.admin-nav a.active,
.library-nav a.active {
  background: linear-gradient(180deg, #efb86e, #d07a34);
  color: #2a180d;
  border-color: transparent;
}

.tool-link-list {
  margin: 10px 0 0;
}

.tool-link-list a {
  color: #f3c481;
  text-decoration: none;
  font-weight: 700;
}

.long-running-status {
  margin: 4px 0 0;
  color: #f3c481;
  font-weight: 700;
}

.migration-output {
  margin: 16px 0 0;
  padding: 16px;
  border-radius: 18px;
  background: rgba(20, 12, 8, 0.86);
  color: #e9dbc1;
  overflow: auto;
}

.library-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.library-stat-card {
  width: 100%;
  padding: 18px;
  text-align: center;
}

.library-stat-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.9rem;
}

.library-filter-form {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(140px, 1fr)) minmax(110px, 140px) auto;
  gap: 12px;
  align-items: end;
}

.library-filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.library-filter-actions a {
  color: #f8e7c2;
  text-decoration: none;
  font-weight: 700;
}

.library-poster-batch-form {
  display: flex;
  align-items: end;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.library-poster-batch-form label {
  min-width: 180px;
}

.library-alpha-bar {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.library-alpha-bar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 12px;
  background: rgba(255, 239, 206, 0.1);
  color: #f8e7c2;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
}

.library-alpha-bar a.active {
  background: linear-gradient(180deg, #efb86e, #d07a34);
  color: #2a180d;
}

.library-active-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.library-filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(243, 196, 129, 0.14);
  color: #f6ead5;
  font-size: 0.8rem;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.library-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 14px;
  overflow: hidden;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.library-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 34px rgba(0, 0, 0, 0.24);
}

.library-poster {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 12px;
  min-height: 340px;
  padding: 18px;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 235, 202, 0.18), transparent 24%),
    linear-gradient(180deg, rgba(201, 115, 53, 0.9), rgba(79, 43, 21, 0.92));
  color: #fff6e7;
  text-decoration: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 237, 208, 0.14),
    inset 0 -30px 40px rgba(0, 0, 0, 0.28);
}

.library-poster-image-frame {
  display: block;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(24, 14, 9, 0.72);
  text-decoration: none;
}

.library-poster-image {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.library-poster::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 237, 208, 0.16);
  border-radius: 12px;
  pointer-events: none;
}

.library-poster-kicker,
.library-poster-hint {
  position: relative;
  z-index: 1;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.library-poster-monogram {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(18, 11, 8, 0.24);
  border: 1px solid rgba(255, 237, 208, 0.18);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.library-poster-title,
.library-poster-year {
  position: relative;
  z-index: 1;
  display: block;
}

.library-poster-title {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.15;
}

.library-poster-year {
  font-size: 0.9rem;
  color: rgba(255, 246, 231, 0.82);
}

.library-card-body {
  display: grid;
  gap: 10px;
  padding: 16px 6px 4px;
}

.library-card-topline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}

.library-library-pill,
.library-format-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 239, 206, 0.12);
  color: #f8e7c2;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.library-card h2 {
  margin: 0;
  font-size: 1.2rem;
}

.library-year,
.library-file {
  margin: 0;
  color: #e5d4b3;
}

.library-file {
  overflow-wrap: anywhere;
  font-size: 0.92rem;
}

.library-card-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.library-card-actions a {
  color: #f3c481;
  text-decoration: none;
  font-weight: 700;
}

.poster-admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 18px;
}

.poster-admin-card {
  width: 100%;
  padding: 20px;
}

.poster-admin-card h2 {
  margin-top: 0;
}

.poster-admin-image,
.poster-admin-placeholder {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 18px;
}

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

.poster-admin-placeholder {
  display: grid;
  place-items: center;
  background: rgba(26, 17, 12, 0.7);
  color: #e8d7b7;
  border: 1px solid rgba(255, 234, 198, 0.08);
}

.poster-save-details {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.poster-save-details p {
  margin: 0;
}

.poster-save-path {
  font-family: "Courier New", monospace;
  font-size: 0.92rem;
  color: #ead8b7;
  overflow-wrap: anywhere;
}

.library-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-actions {
  margin: 18px 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
  width: 100%;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
  width: 100%;
}

.stat-card {
  width: 100%;
  padding: 18px;
  text-align: center;
}

.admin-grid > .panel,
.admin-stats > .panel {
  width: 100%;
  min-width: 0;
}

.stat-card strong {
  display: block;
  font-size: 2rem;
  margin-bottom: 6px;
}

.stack-form,
.movie-card {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.movie-card {
  width: 100%;
  overflow: hidden;
}

.movie-card h2,
.movie-path,
.movie-meta-line {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

label {
  display: grid;
  gap: 6px;
  color: #f0debb;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 234, 198, 0.16);
  background: rgba(255, 248, 234, 0.96);
  color: #2f1b0f;
}

button {
  padding: 12px 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #efb86e, #d07a34);
  color: #2a180d;
  cursor: pointer;
  font-weight: 700;
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.checkbox-row input {
  width: auto;
}

.alert {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 16px;
}

.alert.success {
  background: rgba(91, 154, 108, 0.18);
  color: #dbf4da;
}

.alert.error {
  background: rgba(181, 77, 61, 0.2);
  color: #ffe3da;
}

.alert.warning {
  background: rgba(197, 145, 59, 0.2);
  color: #fff0c9;
}

.filter-form {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(160px, 220px) auto;
  gap: 12px;
  align-items: end;
}

.audit-filter-form {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(160px, 220px) minmax(160px, 220px) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.audit-panel h2 {
  margin: 0 0 16px;
}

.audit-list {
  display: grid;
  gap: 12px;
}

.audit-item {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(17, 11, 7, 0.42);
  border: 1px solid rgba(255, 234, 198, 0.08);
}

.audit-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.audit-item p {
  margin: 0;
}

.audit-meta {
  margin-top: 8px !important;
  color: #d7c4a3;
  font-size: 0.9rem;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

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

.page-link {
  color: #f8e7c2;
  text-decoration: none;
  font-weight: 700;
}

.disabled-link {
  opacity: 0.45;
  pointer-events: none;
}

.card-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.danger-button {
  background: linear-gradient(180deg, #dd8f7f, #b55444);
  color: #fff4ef;
}

.muted-button {
  background: linear-gradient(180deg, #bca88a, #8c7558);
  color: #f7efe2;
  opacity: 0.65;
  cursor: not-allowed;
}

.user-status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 239, 206, 0.12);
  color: #f8e7c2;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-pill.active {
  background: rgba(84, 161, 108, 0.2);
  color: #dbf4da;
}

.status-pill.disabled,
.warning-pill {
  background: rgba(181, 77, 61, 0.2);
  color: #ffe3da;
}
