:root {
  /* Theme: neon pink + black + white. Pink matches the "SCENE IN" marquee logo and drives
     focus, badges, clip affordances. Backgrounds are pure greyscale; text is white. */
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-tertiary: #161616;
  --bg-card: #1f1f1f;
  --text-primary: #ffffff;
  --text-secondary: #b8b8b8;
  --text-muted: #7a7a7a;
  --accent-primary: #ff2d78;
  --accent-secondary: #ff2d78;
  --accent-warm: #ff2d78;
  --danger: #ffffff;
  --focus-ring: #ff2d78;
  --focus-glow: rgba(255, 45, 120, 0.55);
  --success: #ff2d78;
  --warning: #ff2d78;
  --info: #ff2d78;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  width: 600px;
  height: 600px;
  overflow: hidden;
}

#app {
  width: 100%;
  height: 100%;
  position: relative;
}

.screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
}
.screen.hidden { display: none; }

.header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-secondary);
  gap: 12px;
  flex-shrink: 0;
}
.header-tagline {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
  padding: 8px 20px 0;
  text-align: center;
}

/* ===== Marquee banner — adapted from scenein.app for 600x600 ===== */
.marquee-header {
  position: relative;
  padding: 18px 20px 12px;
  background: var(--bg-secondary);
  border-bottom: 2px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.marquee-lights {
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  background-image: radial-gradient(circle 2.5px at center, rgba(255,255,255,0.7) 0%, transparent 100%);
  background-size: 16px 6px;
  background-position: 8px 0;
}
.marquee-lights-top { top: 0; }
.marquee-lights-bottom { bottom: 0; }

.marquee-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.marquee-logo-top {
  font-family: 'Monoton', cursive;
  font-size: 22px;
  letter-spacing: 0.25em;
  color: #ff2d78;
  text-shadow:
    0 0 6px #ff2d78,
    0 0 14px #ff2d78,
    0 0 28px #ff2d78,
    0 0 48px rgba(255, 45, 120, 0.6);
  line-height: 1;
  animation: marqueeFlicker 3s infinite alternate;
}
@keyframes marqueeFlicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% {
    text-shadow:
      0 0 6px #ff2d78,
      0 0 14px #ff2d78,
      0 0 28px #ff2d78,
      0 0 48px rgba(255, 45, 120, 0.6);
  }
  20%, 24%, 55% { text-shadow: none; }
}

.marquee-logo-lightbox {
  position: relative;
  background: #111111;
  border-radius: 3px;
  padding: 8px 14px;
  min-width: 260px;
  text-align: center;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.5),
    0 0 18px rgba(255, 45, 120, 0.18);
}
/* White letterboard inset */
.marquee-logo-lightbox::before {
  content: '';
  position: absolute;
  inset: 6px;
  background: #ffffff;
  border-radius: 2px;
  background-image:
    linear-gradient(to right, rgba(0,0,0,0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,0.07) 1px, transparent 1px);
  background-size: 18px 100%, 100% 14px;
  pointer-events: none;
}
/* Neon pink chasing bulbs */
.marquee-logo-lightbox::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 2px;
  pointer-events: none;
  background-image:
    radial-gradient(circle 2px, #ff2d78 80%, transparent 100%),
    radial-gradient(circle 2px, #ff2d78 80%, transparent 100%),
    radial-gradient(circle 2px, #ff2d78 80%, transparent 100%),
    radial-gradient(circle 2px, #ff2d78 80%, transparent 100%);
  background-size: 12px 4px, 12px 4px, 4px 12px, 4px 12px;
  background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
  background-position: 0 0, 0 100%, 0 0, 100% 0;
  animation: marqueeBulbChase 2s linear infinite;
}
@keyframes marqueeBulbChase {
  100% { background-position: 12px 0, -12px 100%, 0 -12px, 100% 12px; }
}
.marquee-logo-city {
  position: relative;
  z-index: 1;
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: 26px;
  letter-spacing: 0.22em;
  color: #111111;
  font-weight: 400;
}
.marquee-status {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.header h1 {
  font-size: 22px;
  font-weight: 600;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-meta {
  font-size: 13px;
  color: var(--text-secondary);
}
.back-btn {
  background: transparent;
  color: var(--text-primary);
  font-size: 22px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
}

.content {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.focusable {
  transition: all 0.15s ease;
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 44px;
}
.focusable:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
}

.nav-bar {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.nav-item {
  flex: 1;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.nav-item:focus { background: var(--bg-card); }

.card-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
}
.list-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  text-align: left;
  gap: 12px;
  width: 100%;
}
.list-item:focus { background: var(--bg-card); }
.list-thumb {
  width: 44px;
  height: 66px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-card);
}
.list-thumb-fallback {
  width: 44px;
  height: 66px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.list-item-content { flex: 1; min-width: 0; }
.list-item-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  background: rgba(255, 45, 120, 0.16);
  color: var(--accent-primary);
}

.detail-content {
  padding-top: 12px;
  gap: 12px;
}

.detail-bottom {
  flex: 1;
  display: flex;
  gap: 12px;
  min-height: 0;
}
.trailer-btn {
  flex: 0 0 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.trailer-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.trailer-btn-icon {
  font-size: 22px;
  color: var(--accent-primary);
}
.trailer-btn-label {
  line-height: 1;
}

.detail-mini {
  flex: 1;
  display: flex;
  gap: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 12px;
  min-width: 0;
  overflow-y: auto;
}
.detail-mini-poster {
  width: 70px;
  height: 105px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-card);
}
.detail-mini-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.detail-mini-titlerow {
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-mini-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-mini-meta {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
}
.detail-mini-credit {
  display: flex;
  gap: 6px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-primary);
}
.detail-mini-credit .detail-credit-label {
  flex: 0 0 28px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  padding-top: 1px;
}

.detail-clip-stage {
  width: 100%;
  height: 300px; /* half of the 600px page height */
  flex-shrink: 0;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}
.detail-clip-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.detail-top {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.poster {
  width: 110px;
  height: 165px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--bg-card);
  flex-shrink: 0;
}
.detail-meta-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.detail-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.detail-body {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-primary);
}
.detail-credits {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.detail-credit {
  display: flex;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
}
.detail-credit-label {
  flex: 0 0 64px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: var(--text-muted);
  padding-top: 1px;
}
.detail-credit-value {
  flex: 1;
  color: var(--text-primary);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}
.badge-info { background: rgba(255, 45, 120, 0.18); color: var(--info); }
.badge-success { background: rgba(255, 45, 120, 0.18); color: var(--success); }
.badge-warning { background: rgba(255, 45, 120, 0.18); color: var(--warning); }

.player-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  position: relative;
}
.video-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.player-message {
  color: var(--text-secondary);
  font-size: 16px;
  text-align: center;
  padding: 24px;
}

.category-card {
  display: flex;
  align-items: center;
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-align: left;
  gap: 14px;
  width: 100%;
}
.category-card:focus { background: var(--bg-card); }
.cat-icon {
  font-size: 28px;
  width: 40px;
  text-align: center;
  flex-shrink: 0;
}
.cat-content { flex: 1; min-width: 0; }
.cat-title {
  font-size: 16px;
  font-weight: 600;
}
.cat-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.cat-chev {
  font-size: 22px;
  color: var(--text-secondary);
  padding-left: 8px;
}

.confirm-overlay {
  background: rgba(0, 0, 0, 0.78);
  align-items: center;
  justify-content: center;
}
.confirm-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 2px solid rgba(255, 255, 255, 0.12);
  padding: 24px 22px;
  margin: 0 28px;
  max-width: 520px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
.confirm-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
}
.confirm-body {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 20px;
}
.confirm-actions {
  display: flex;
  gap: 10px;
}
.confirm-actions .nav-item { background: var(--bg-tertiary); }
#confirm-yes { background: rgba(255, 45, 120, 0.18); color: var(--accent-primary); }

.hidden { display: none !important; }
.text-muted { color: var(--text-secondary); }

/* ===== Curated clip affordances ===== */
.clip-marker {
  display: inline-block;
  color: var(--accent-secondary);
  font-size: 11px;
  margin-right: 6px;
  vertical-align: 1px;
  text-shadow: 0 0 6px rgba(255, 45, 120, 0.55);
}
.list-item--has-clip {
  border-left: 3px solid var(--accent-secondary);
  padding-left: 11px; /* compensate for the 3px border so content doesn't shift */
}
.player-titles { flex: 1; min-width: 0; }
.player-titles h1 {
  font-size: 22px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-clip-label {
  font-size: 12px;
  color: var(--accent-secondary);
  margin-top: 2px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.poster-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-content: start;
  overflow-y: auto;
  flex: 1;
}
.poster-card {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  padding: 0;
  display: block;
  border: 2px solid transparent;
}
.poster-card:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
}
.poster-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.poster-card-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  background: var(--bg-card);
}
.poster-card-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 12px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.55) 55%, transparent 100%);
  color: var(--text-primary);
  pointer-events: none;
}
.poster-card-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}
.poster-card-loc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.25;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.poster-card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
}

.home-empty {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  padding: 24px 16px;
  line-height: 1.5;
}
.home-empty code {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.bearing-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 45, 120, 0.16);
  border: 1px solid rgba(255, 45, 120, 0.45);
  color: var(--accent-primary);
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}
.bearing-arrow-glyph {
  display: inline-block;
  transform: rotate(0deg);
  transition: transform 200ms cubic-bezier(0.4, 0.04, 0.5, 1);
  will-change: transform;
}
.bearing-arrow--sm {
  width: 22px;
  height: 22px;
  font-size: 12px;
}
.list-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
