/* ============================================================
   THE BACK ROOM — neon video-store storefront, modern backbone
   Signature: the header is a buzzing neon sign; every card lights
   up in its platform's color on hover. Gold is reserved exclusively
   for Movies Anywhere, so "it travels" reads at a glance.
   ============================================================ */

:root {
  --ink: #0a0a0f;
  --ink-2: #111119;
  --panel: #15151f;
  --panel-2: #1c1c28;
  --line: #2a2a3a;
  --text: #f0eef7;
  --muted: #8a87a0;

  --cyan: #2ff3e0;     /* Vudu + primary neon */
  --magenta: #ff3da6;  /* iTunes + secondary neon */
  --gold: #ffc24b;     /* Movies Anywhere ONLY */
  --dim: #5a5570;      /* not-MA / stuck */

  --radius: 14px;
  --shadow: 0 18px 40px rgba(0,0,0,0.6);
  --display: "Bebas Neue", Impact, sans-serif;
  --body: "Space Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  color: var(--text);
  background:
    radial-gradient(1100px 500px at 50% -180px, #1b1430 0%, transparent 70%),
    radial-gradient(800px 400px at 12% 8%, rgba(47,243,224,0.10) 0%, transparent 60%),
    radial-gradient(800px 400px at 88% 4%, rgba(255,61,166,0.10) 0%, transparent 60%),
    var(--ink);
  background-attachment: fixed;
}

/* faint film grain over everything */
.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, header, footer { position: relative; z-index: 1; }

/* ---------- The neon sign ---------- */
.sign { padding: 60px 20px 30px; text-align: center; }
.sign-eyebrow {
  font-size: 0.72rem; letter-spacing: 0.42em; color: var(--muted);
  display: inline-block; padding-bottom: 14px;
}
.sign-name {
  font-family: var(--display);
  font-size: clamp(3.2rem, 11vw, 7rem);
  line-height: 0.9; margin: 0; letter-spacing: 0.04em;
  color: #fff;
  text-shadow:
    0 0 7px #fff,
    0 0 18px var(--cyan),
    0 0 40px var(--cyan),
    0 0 80px rgba(47,243,224,0.5);
}
.sign-name .flicker {
  color: var(--magenta);
  text-shadow:
    0 0 7px var(--magenta),
    0 0 20px var(--magenta),
    0 0 44px rgba(255,61,166,0.6);
  animation: flicker 6s infinite;
}
@keyframes flicker {
  0%, 92%, 100% { opacity: 1; }
  93% { opacity: 0.35; } 94% { opacity: 1; }
  96% { opacity: 0.5; } 97% { opacity: 1; }
}
.sign-sub { color: var(--muted); margin: 16px 0 22px; font-size: 1.02rem; }

.stats {
  display: inline-flex; gap: 22px; flex-wrap: wrap; justify-content: center;
  font-size: 0.82rem; color: var(--muted);
  border-top: 1px solid var(--line); padding-top: 18px;
}
.stats span { display: inline-flex; align-items: center; gap: 7px; }
.stats span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.stats span:first-child::before { display: none; }
.stats .dot-vudu::before { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.stats .dot-itunes::before { background: var(--magenta); box-shadow: 0 0 8px var(--magenta); }
.stats .dot-ma::before { background: var(--gold); box-shadow: 0 0 8px var(--gold); }

/* ---------- Layout ---------- */
main { max-width: 1280px; margin: 0 auto; padding: 10px 20px 80px; }
.hidden { display: none !important; }

/* ---------- Control rail ---------- */
.rail {
  position: sticky; top: 0; z-index: 20;
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  padding: 16px; margin-bottom: 26px;
  background: rgba(12,12,20,0.82);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.search-wrap { position: relative; flex: 1 1 260px; }
.search-ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round;
}
#search {
  width: 100%; padding: 12px 14px 12px 42px;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); font-family: var(--body); font-size: 1rem;
}
#search::placeholder { color: var(--muted); }
#search:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(47,243,224,0.15); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-family: var(--body); font-size: 0.82rem; font-weight: 500;
  padding: 9px 15px; border-radius: 999px; cursor: pointer;
  background: var(--ink-2); border: 1px solid var(--line); color: var(--muted);
  transition: all 0.14s ease;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip.active { color: var(--ink); background: var(--text); border-color: var(--text); font-weight: 700; }
.chip-vudu.active   { background: var(--cyan);    border-color: var(--cyan);    box-shadow: 0 0 16px rgba(47,243,224,0.5); }
.chip-itunes.active { background: var(--magenta); border-color: var(--magenta); box-shadow: 0 0 16px rgba(255,61,166,0.5); color: #fff; }
.chip-ma.active     { background: var(--gold);    border-color: var(--gold);    box-shadow: 0 0 16px rgba(255,194,75,0.5); }
.chip-noma.active   { background: var(--dim);     border-color: var(--dim);     color: #fff; }

.tools { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.ghost, .solid, .btn-add {
  font-family: var(--body); font-size: 0.85rem; font-weight: 600;
  padding: 10px 16px; border-radius: 10px; cursor: pointer; transition: all 0.14s ease;
}
.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.ghost:hover { color: var(--text); border-color: var(--cyan); }
.ghost:disabled { opacity: 0.5; cursor: wait; }
.solid, .btn-add {
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  border: none; color: var(--ink); font-weight: 700;
}
.solid:hover, .btn-add:hover { filter: brightness(1.12); box-shadow: 0 0 22px rgba(255,61,166,0.4); }
.solid:disabled { opacity: 0.55; cursor: wait; }

/* ---------- Sync bar ---------- */
.syncbar {
  background: linear-gradient(120deg, rgba(47,243,224,0.08), rgba(255,61,166,0.08));
  border: 1px solid var(--line); border-left: 3px solid var(--gold);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 24px;
  line-height: 1.8; color: var(--text); font-size: 0.92rem;
}
.syncbar .btn-add { padding: 7px 13px; margin: 0 4px; font-size: 0.8rem; }

/* ---------- Add panel ---------- */
.add-panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; margin-bottom: 28px;
}
.add-panel h2 { font-family: var(--display); letter-spacing: 0.04em; font-size: 1.7rem; margin: 0 0 14px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.form-row label { display: flex; flex-direction: column; gap: 5px; font-size: 0.8rem; color: var(--muted); }
.form-row input[type="text"], .form-row input[type="number"] {
  padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--ink-2); color: var(--text); font-family: var(--body); font-size: 1rem;
}
.form-row input[type="text"] { min-width: 300px; }
.form-row input:focus { outline: none; border-color: var(--cyan); }
.checks .check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); cursor: pointer; padding-left: 10px; }
.check-vudu   { border-left: 3px solid var(--cyan); }
.check-itunes { border-left: 3px solid var(--magenta); }
.check-ma     { border-left: 3px solid var(--gold); }
.form-status { color: var(--cyan); font-size: 0.9rem; }
.dupe-warning {
  background: rgba(255,194,75,0.08); border: 1px solid rgba(255,194,75,0.4);
  color: #ffe0a3; border-radius: 9px; padding: 11px 15px; font-size: 0.9rem; line-height: 1.65;
}

/* ---------- The shelf ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 22px;
}
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--cyan); }
/* platform-tinted glow: MA cards glow gold, the premium tier */
.card.is-ma:hover { border-color: var(--gold); box-shadow: 0 18px 44px rgba(255,194,75,0.22), var(--shadow); }

.poster { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; background: var(--ink-2); }
img.poster { transition: transform 0.35s ease; }
.card:hover img.poster { transform: scale(1.06); }

/* VHS / DVD placeholders */
.poster.placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 20px 14px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(47,243,224,0.06), transparent 60%),
    linear-gradient(165deg, var(--panel-2), #0e0e16);
}
.poster.placeholder svg { width: 62%; max-width: 130px; filter: drop-shadow(0 6px 12px rgba(0,0,0,0.55)); transition: transform 0.25s ease; }
.card:hover .poster.placeholder svg { transform: rotate(-3deg) scale(1.05); }
.ph-title { font-family: var(--display); font-size: 1.25rem; letter-spacing: 0.04em; color: #cfd2de; text-align: center; line-height: 1.1; }
.ph-tag {
  font-size: 0.56rem; letter-spacing: 0.24em; color: var(--cyan);
  border: 1px solid rgba(47,243,224,0.35); border-radius: 3px; padding: 2px 7px;
}
.ph-dvd .ph-tag { color: var(--magenta); border-color: rgba(255,61,166,0.35); }

.card-body { padding: 13px 14px 15px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.card-body h3 { margin: 0; font-size: 0.96rem; font-weight: 600; line-height: 1.28; }
.year { margin: 0; color: var(--muted); font-size: 0.78rem; }

.ratings { display: flex; gap: 11px; flex-wrap: wrap; font-size: 0.8rem; color: var(--muted); align-items: center; }
.ratings .mpaa { border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
.btn-info {
  font-family: var(--body); background: transparent; border: 1px dashed var(--line);
  color: var(--muted); border-radius: 7px; padding: 4px 9px; font-size: 0.72rem; cursor: pointer;
}
.btn-info:hover { color: var(--cyan); border-color: var(--cyan); }

.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.badge {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.03em;
  padding: 4px 9px; border-radius: 6px; text-transform: uppercase;
}
.badge-vudu   { background: rgba(47,243,224,0.14); color: var(--cyan); }
.badge-itunes { background: rgba(255,61,166,0.14); color: var(--magenta); }
.badge-ma     { background: rgba(255,194,75,0.16); color: var(--gold); }
.badge-noma   { background: rgba(90,85,112,0.25); color: #a8a3bd; }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; font-size: 1.02rem; line-height: 1.6; }

/* ---------- Footer ---------- */
footer {
  text-align: center; color: var(--muted); font-size: 0.8rem;
  padding: 30px; border-top: 1px solid var(--line); margin-top: 40px;
}
footer code { color: var(--cyan); font-size: 0.78rem; }
.bulb { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); vertical-align: middle; margin-right: 5px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .tools { margin-left: 0; width: 100%; }
  .tools .solid { flex: 1; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
  .sign { padding: 40px 16px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
  .card, img.poster, .poster.placeholder svg { transition: none; }
  html { scroll-behavior: auto; }
}

/* Walk-the-store link styled as a button */
.walk-link { text-decoration: none; display: inline-flex; align-items: center; }
