/* Movie Poll — dark cinema theme */
:root {
  --bg: #0b0e15;
  --bg-glow: #131a2b;
  --panel: #151b2a;
  --panel-2: #1b2336;
  --line: #263049;
  --text: #edf0f8;
  --muted: #939cb4;
  --accent: #f6b83c;
  --accent-soft: rgba(246, 184, 60, 0.14);
  --green: #4ade80;
  --red: #f87171;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  /* red curtain corners + warm projector beam + original cool glow */
  background:
    radial-gradient(700px 360px at -6% -4%, rgba(126, 30, 44, 0.24), transparent 65%),
    radial-gradient(700px 360px at 106% -4%, rgba(126, 30, 44, 0.24), transparent 65%),
    radial-gradient(900px 430px at 50% -8%, rgba(246, 184, 60, 0.07), transparent 60%),
    radial-gradient(1100px 500px at 50% -10%, var(--bg-glow), transparent 70%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* film-grain overlay over everything (very faint) */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

.container { max-width: 960px; margin: 0 auto; padding: 0 20px 120px; }

/* ---------- header ---------- */
.topbar { padding: 22px 0 8px; display: flex; align-items: center; gap: 10px; }
.brand {
  font-size: 20px; font-weight: 700; letter-spacing: 0.4px;
  color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 9px;
}
.brand .logo { font-size: 24px; display: inline-block; transition: transform 0.15s; }
.brand:hover .logo { transform: rotate(-12deg); }
.brand em { color: var(--accent); font-style: normal; }

.hero { text-align: center; padding: 26px 0 6px; }
.hero h1 { font-size: clamp(26px, 5vw, 40px); margin: 0 0 8px; letter-spacing: 0.3px; }
.hero p { color: var(--muted); margin: 0 auto; max-width: 560px; }

/* ---------- cinema marquee around the title ---------- */
.marquee {
  position: relative; display: inline-block;
  padding: 24px 36px; margin-bottom: 12px; max-width: 100%;
  border: 2px solid rgba(246, 184, 60, 0.55);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(246, 184, 60, 0.10), rgba(246, 184, 60, 0.02) 45%, transparent),
    var(--panel);
  box-shadow: 0 0 36px rgba(246, 184, 60, 0.14), var(--shadow), inset 0 0 24px rgba(0, 0, 0, 0.45);
}
.marquee h1 { margin: 0; }
.marquee::before, .marquee::after {
  content: ""; position: absolute; left: 14px; right: 14px; height: 8px;
  background-image: radial-gradient(circle 3px at 11px 4px, var(--accent) 55%, rgba(246, 184, 60, 0.15) 63%, transparent 70%);
  background-size: 22px 8px; background-repeat: repeat-x;
  filter: drop-shadow(0 0 4px rgba(246, 184, 60, 0.75));
  animation: bulb-chase 1.2s linear infinite;
}
.marquee::before { top: 6px; }
.marquee::after { bottom: 6px; }
@keyframes bulb-chase { to { background-position-x: 22px; } }

/* ---------- film-strip divider ---------- */
.filmstrip {
  height: 30px; margin: 28px 0 6px; border-radius: 4px;
  background-color: #06080f;
  border-top: 1px solid #2a3145; border-bottom: 1px solid #2a3145;
  background-image:
    radial-gradient(ellipse 3.5px 4.5px at 10px 7px, #131b2f 92%, transparent 100%),
    radial-gradient(ellipse 3.5px 4.5px at 10px 23px, #131b2f 92%, transparent 100%);
  background-size: 20px 30px;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.55);
}

/* ---------- cards & layout ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin: 18px 0;
  box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 14px; font-size: 18px; }
.card h2 .step { color: var(--accent); margin-right: 6px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

input[type="text"], input[type="number"], input[type="url"], textarea {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
input:focus-visible, textarea:focus-visible { border-color: var(--accent); }
textarea { resize: vertical; min-height: 64px; }

.row-2 { display: grid; grid-template-columns: 1fr 110px; gap: 10px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: #1a1405;
  border: none; border-radius: 999px;
  font-size: 15px; font-weight: 700; font-family: inherit;
  padding: 11px 22px; cursor: pointer;
  transition: transform 0.12s, filter 0.15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); filter: none; }
.btn-danger { background: transparent; border: 1px solid var(--line); color: var(--red); }
.btn-danger:hover { border-color: var(--red); filter: none; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ticket-stub styling for the big vote button */
.btn-ticket { position: relative; padding-left: 26px; padding-right: 26px; }
.btn-ticket::before { content: "🎟️"; font-size: 16px; line-height: 1; }
.btn-ticket::after {
  content: ""; position: absolute; inset: 4px; border-radius: 999px;
  border: 1.5px dashed rgba(26, 20, 5, 0.35); pointer-events: none;
}

button:focus-visible, a:focus-visible, .movie-card:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ---------- movie search ---------- */
.search-wrap { position: relative; }
.search-results {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
  max-height: 340px; overflow-y: auto; box-shadow: var(--shadow);
}
.search-item {
  display: flex; gap: 12px; align-items: center; width: 100%; text-align: left;
  padding: 9px 12px; background: none; border: none; border-bottom: 1px solid var(--line);
  color: var(--text); font-family: inherit; font-size: 14px; cursor: pointer;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover, .search-item.active { background: var(--accent-soft); }
.search-item .thumb-wrap { width: 38px; height: 57px; }
.search-item .meta { color: var(--muted); font-size: 12.5px; }
.search-empty { padding: 12px 14px; color: var(--muted); font-size: 14px; }

/* ---------- lineup (movies added to the poll) ---------- */
.lineup { list-style: none; margin: 14px 0 0; padding: 0; }
.lineup li {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 12px; margin-bottom: 8px;
}
.lineup .info { flex: 1; min-width: 0; }
.lineup .info .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lineup .remove {
  background: none; border: none; color: var(--muted); font-size: 18px;
  cursor: pointer; padding: 6px 8px; border-radius: 8px; line-height: 1;
}
.lineup .remove:hover { color: var(--red); background: rgba(248, 113, 113, 0.1); }

.poster-box img { object-fit: cover; background: var(--bg); }

.thumb-wrap {
  position: relative; width: 42px; height: 63px;
  border-radius: 6px; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(160deg, var(--panel), var(--line));
}
.thumb-wrap img.thumb {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.thumb-fallback {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}

/* ---------- stepper ---------- */
.stepper { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.stepper button {
  background: var(--panel-2); border: none; color: var(--text);
  width: 40px; height: 38px; font-size: 18px; cursor: pointer;
}
.stepper button:hover { background: var(--accent-soft); color: var(--accent); }
.stepper .val { min-width: 46px; text-align: center; font-weight: 700; font-size: 16px; }
.stepper-line { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.stepper-line .hint { color: var(--muted); font-size: 14px; }

/* ---------- notices, chips, pills ---------- */
.notice {
  background: var(--accent-soft); border: 1px solid rgba(246, 184, 60, 0.35);
  color: var(--text); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin: 12px 0;
}
.notice a { color: var(--accent); }

.ratings { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.chip {
  font-size: 11.5px; font-weight: 600; color: var(--text);
  background: rgba(0, 0, 0, 0.45); border: 1px solid var(--line);
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.chip .star { color: var(--accent); }

.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  padding: 4px 12px; border-radius: 999px;
}
.status-pill.open { color: var(--green); background: rgba(74, 222, 128, 0.12); }
.status-pill.closed { color: var(--red); background: rgba(248, 113, 113, 0.12); }
.status-pill.suggesting { color: var(--accent); background: var(--accent-soft); }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 1.6s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
.status-pill.suggesting .live-dot { background: var(--accent); animation-name: pulse-amber; }
@keyframes pulse-amber {
  0% { box-shadow: 0 0 0 0 rgba(246, 184, 60, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(246, 184, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(246, 184, 60, 0); }
}

.pick-pill {
  display: inline-block; background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(246, 184, 60, 0.35); border-radius: 999px;
  font-weight: 700; font-size: 14px; padding: 5px 16px;
}

/* ---------- voting grid ---------- */
.movie-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  margin-top: 18px;
}
.movie-card {
  position: relative;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; cursor: pointer; text-align: left;
  padding: 0; font-family: inherit; color: var(--text);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.movie-card:hover { transform: translateY(-3px); border-color: #3a4666; }
.movie-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), var(--shadow);
}
.movie-card .tick {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #1a1405;
  display: none; align-items: center; justify-content: center;
  font-weight: 900; font-size: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.movie-card.selected .tick { display: flex; }
.poster-box { position: relative; aspect-ratio: 2 / 3; width: 100%; overflow: hidden; }
.poster-box img { width: 100%; height: 100%; display: block; }
.poster-fallback {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, var(--panel-2), var(--bg));
  display: flex; align-items: center; justify-content: center; font-size: 42px;
}
/* sprocket holes on missing-poster frames */
.poster-fallback::before, .poster-fallback::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 7px;
  background-image: radial-gradient(circle 1.8px at 3.5px 6px, rgba(237, 240, 248, 0.25) 92%, transparent);
  background-size: 7px 12px;
}
.poster-fallback::before { left: 3px; }
.poster-fallback::after { right: 3px; }
.movie-card .body { padding: 10px 12px 12px; }
.movie-card .t { font-weight: 600; font-size: 14px; line-height: 1.3; }
.movie-card .y { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.movie-card .desc {
  color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 6px;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}
.movie-card.static { cursor: pointer; }
.movie-card .info-btn {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.55); color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.15s, transform 0.12s;
}
.movie-card .info-btn:hover { background: var(--accent); color: #1a1405; transform: scale(1.08); }
.movie-card .card-remove {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.55); color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.15s, transform 0.12s;
}
.movie-card .card-remove:hover { background: var(--red); color: #fff; transform: scale(1.08); }
.hidden { display: none !important; }

.creator-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--accent-soft); border: 1px solid rgba(246, 184, 60, 0.35);
  border-radius: 12px; padding: 10px 14px; margin: 0 0 16px;
  font-size: 13.5px;
}

/* ---------- movie details modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(5, 7, 12, 0.72);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-panel {
  position: relative;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  max-width: 640px; width: 100%; max-height: 86vh;
  overflow-y: auto; padding: 22px;
  animation: modal-in 0.18s ease-out;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--panel-2); color: var(--muted);
  border: 1px solid var(--line); cursor: pointer; font-size: 14px;
}
.modal-close:hover { color: var(--red); border-color: var(--red); }
.modal-body { display: flex; gap: 20px; }
.modal-poster { width: 190px; flex-shrink: 0; }
.modal-poster .poster-box { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.modal-info { flex: 1; min-width: 0; }
.modal-info h3 { margin: 2px 28px 10px 0; font-size: 20px; line-height: 1.3; }
.modal-desc { color: var(--text); font-size: 14.5px; line-height: 1.65; white-space: pre-line; }
@media (max-width: 560px) {
  .modal-body { flex-direction: column; }
  .modal-poster { width: 150px; margin: 0 auto; }
}

.check {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px; line-height: 1.45; cursor: pointer; margin-bottom: 16px;
}
.check input {
  accent-color: var(--accent); width: 18px; height: 18px;
  margin: 2px 0 0; flex-shrink: 0; cursor: pointer;
}

/* ---------- sticky action bar ---------- */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(11, 14, 21, 0.85);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
}
.actionbar .inner {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.actionbar .count { font-weight: 700; }
.actionbar .count small { color: var(--muted); font-weight: 400; display: block; font-size: 12.5px; }

/* ---------- results ---------- */
.results-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 4px;
}
.results-meta { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; }

/* "NOW SHOWING" letterboard treatment for the results title */
.now-showing {
  text-transform: uppercase; letter-spacing: 2.5px;
  color: var(--accent); font-size: 15.5px !important;
  text-shadow: 0 0 16px rgba(246, 184, 60, 0.45);
}
.now-showing::before { content: "★ "; opacity: 0.75; }
.now-showing::after { content: " ★"; opacity: 0.75; }

.standings { margin-top: 14px; }
.standing {
  display: grid; grid-template-columns: 34px 46px 1fr auto;
  gap: 12px; align-items: center;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; margin-bottom: 8px;
  transition: border-color 0.3s;
}
.standing .rank { font-weight: 800; font-size: 16px; color: var(--muted); text-align: center; }
.standing .thumb-wrap { width: 42px; height: 63px; }
.standing .info { min-width: 0; }
.standing .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.standing .y { color: var(--muted); font-size: 12.5px; }
.bar-track { height: 7px; background: var(--bg); border-radius: 999px; margin-top: 7px; overflow: hidden; }
.bar-fill {
  height: 100%; border-radius: 999px; background: #55617f;
  width: 0%; transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  min-width: 0;
}
.standing .votes { font-weight: 800; font-size: 17px; text-align: right; white-space: nowrap; }
.standing .votes small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.standing.winner { border-color: rgba(246, 184, 60, 0.6); background: linear-gradient(90deg, var(--accent-soft), var(--panel-2) 60%); }
.standing.winner .rank { color: var(--accent); }
.standing.winner .bar-fill { background: var(--accent); }
.standing.removable { grid-template-columns: 34px 46px 1fr auto auto; }
.standing .remove {
  background: none; border: none; color: var(--muted); font-size: 16px;
  cursor: pointer; padding: 6px 8px; border-radius: 8px; line-height: 1;
}
.standing .remove:hover { color: var(--red); background: rgba(248, 113, 113, 0.1); }

/* ---------- share panel ---------- */
.linkbox {
  display: flex; gap: 8px; align-items: stretch; margin: 8px 0 16px;
}
.linkbox input {
  flex: 1; font-family: Consolas, monospace; font-size: 13.5px; color: var(--accent);
}
.big-check { font-size: 44px; text-align: center; margin: 4px 0 2px; }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%) translateY(16px);
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 20px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
  z-index: 60; box-shadow: var(--shadow); max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- misc ---------- */
.center { text-align: center; }
.muted { color: var(--muted); }
.mt0 { margin-top: 0; }
.spacer { flex: 1; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.footer { text-align: center; color: var(--muted); font-size: 12.5px; padding: 30px 0 10px; }
.footer a { color: var(--muted); }

.poll-list { list-style: none; padding: 0; margin: 0; }
.poll-list li {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.poll-list li:last-child { border-bottom: none; }
.poll-list .t { font-weight: 600; flex: 1; min-width: 140px; }
.poll-list .remove {
  background: none; border: none; color: var(--muted); font-size: 16px;
  cursor: pointer; padding: 6px 8px; border-radius: 8px; line-height: 1;
}
.poll-list .remove:hover { color: var(--red); background: rgba(248, 113, 113, 0.1); }

@media (max-width: 520px) {
  .movie-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
  .card { padding: 16px; }
  .standing { grid-template-columns: 26px 38px 1fr auto; padding: 9px 10px; }
  .standing .thumb-wrap { width: 38px; height: 57px; }
  .row-2 { grid-template-columns: 1fr 90px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
