/* Movie Grid — classic cinema marquee theme.
   Palette: dark theater, gold trim, deep red velvet, glowing bulbs. */

:root {
  --bg: #0d0a08;
  --bg2: #171110;
  --panel: #1e1512;
  --panel-edge: #3a2a20;
  --gold: #d4af37;
  --gold-dim: #9a7b24;
  --velvet: #7a0e1a;
  --velvet-deep: #4a0810;
  --cream: #f5e9d0;
  --muted: #b8a88f;
  --bulb: #ffe9a8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  /* faint velvet curtain texture */
  background-image: repeating-linear-gradient(90deg, rgba(122,14,26,.12) 0 18px, rgba(0,0,0,0) 18px 36px);
  color: var(--cream);
  font-family: Georgia, "Times New Roman", serif;
}

a { color: var(--gold); }

/* ---------- Marquee sign ---------- */
.marquee-wrap { padding: 24px 16px 0; text-align: center; }

.marquee-sign {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  border: 4px solid var(--gold);
  border-radius: 14px;
  background: linear-gradient(180deg, #2a0d12, var(--velvet-deep));
  box-shadow: 0 0 40px rgba(212,175,55,.35), inset 0 0 30px rgba(0,0,0,.6);
  padding: 34px 20px 30px;
}

.marquee-inner h1 {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #fff7dd;
  text-shadow: 0 0 18px rgba(255,233,168,.9), 0 2px 0 #000;
}

.marquee-kicker, .marquee-sub {
  margin: 0;
  color: var(--gold);
  letter-spacing: .3em;
  text-transform: uppercase;
  font-size: .85rem;
}
.marquee-sub { margin-top: 10px; font-size: 1.35rem; font-style: italic; font-family: Georgia, 'Times New Roman', serif; letter-spacing: .04em; background: linear-gradient(180deg, #ffedb0, #d4a017); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 12px rgba(255, 214, 100, .45)); }

/* Bulb rows: repeating radial-gradient dots + glow pulse */
.bulbs {
  height: 14px;
  background-image: radial-gradient(circle, var(--bulb) 0 5px, rgba(255,233,168,0) 6px);
  background-size: 28px 14px;
  background-repeat: repeat-x;
  filter: drop-shadow(0 0 6px rgba(255,233,168,.9));
  animation: bulbPulse 1.6s ease-in-out infinite alternate;
}
.bulbs-top { position: absolute; top: 8px; left: 16px; right: 16px; }
.bulbs-bottom { position: absolute; bottom: 8px; left: 16px; right: 16px; animation-delay: .8s; }

@keyframes bulbPulse {
  from { opacity: .55; }
  to { opacity: 1; }
}

/* ---------- Nav ---------- */
.top-nav {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; align-items: center;
  margin: 20px auto 0; max-width: 900px;
}
.nav-btn, .google-btn, .btn-gold, .btn-ghost {
  font-family: inherit; cursor: pointer;
  border: 2px solid var(--gold); border-radius: 8px;
  padding: 9px 16px; font-size: 1rem;
  background: var(--panel); color: var(--cream);
}
.nav-btn.active { background: var(--velvet); color: #fff; }
.google-btn {
  background: #fff; color: #222; border-color: #ccc;
  display: inline-flex; align-items: center; gap: 8px;
}
.google-btn:disabled { opacity: .75; cursor: not-allowed; }
.g-logo {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: #4285f4; color: #fff; font-weight: bold; font-family: Arial, sans-serif;
}
.soon-badge {
  font-size: .65rem; text-transform: uppercase; letter-spacing: .08em;
  background: var(--velvet); color: #fff; border-radius: 10px; padding: 2px 7px;
}

/* ---------- Layout / panels ---------- */
main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 40px; }
.view { display: none; }
.view.active { display: block; }

.panel {
  background: var(--panel);
  border: 2px solid var(--gold-dim);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.builder-layout { display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; align-items: start; }
@media (max-width: 820px) { .builder-layout { grid-template-columns: 1fr; } }

h2 { margin-top: 0; letter-spacing: .04em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- Search ---------- */
.slot-hint {
  background: rgba(212,175,55,.12);
  border-left: 3px solid var(--gold);
  padding: 8px 10px; margin: 0 0 12px; font-size: .95rem;
}
#searchInput, #reviewMovie, #reviewHtml {
  width: 100%; padding: 11px 12px;
  border: 2px solid var(--gold-dim); border-radius: 8px;
  background: #120d0b; color: var(--cream);
  font-family: inherit; font-size: 1rem;
}
.search-status { min-height: 1.4em; color: var(--muted); font-size: .9rem; margin: 8px 0; }

.results {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px; margin-top: 8px; max-height: 560px; overflow-y: auto;
}
/* Ticket-stub feel on result cards */
.result-card {
  cursor: pointer; text-align: center;
  background: #241a15; border: 1px dashed var(--gold-dim); border-radius: 8px;
  padding: 8px; transition: transform .12s, border-color .12s;
}
.result-card:hover { transform: translateY(-2px); border-color: var(--gold); }
.result-card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 4px; background: #000; }
.result-card .no-poster {
  aspect-ratio: 2/3; display: grid; place-items: center;
  background: #120d0b; color: var(--muted); font-size: 2rem; border-radius: 4px;
}
.result-card p { margin: 6px 0 0; font-size: .85rem; line-height: 1.25; }
.result-card .year { color: var(--muted); font-size: .8rem; }

/* ---------- Grid ---------- */
.size-toggle { display: flex; gap: 8px; margin-bottom: 10px; }
.size-toggle button {
  font-family: inherit; cursor: pointer; padding: 7px 14px;
  border: 2px solid var(--gold-dim); border-radius: 8px;
  background: #120d0b; color: var(--cream);
}
.size-toggle button.active { background: var(--gold); color: #1a1206; border-color: var(--gold); }
.grid-count { margin: 0 0 12px; color: var(--muted); }

.grid { display: grid; gap: 8px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.tile {
  position: relative; aspect-ratio: 2/3; cursor: pointer;
  border-radius: 8px; overflow: hidden;
  border: 2px dashed var(--gold-dim); background: #120d0b;
  padding: 0; color: var(--cream);
}
.tile:hover { border-color: var(--gold); }
.tile.active-slot { border-style: solid; border-color: var(--gold); box-shadow: 0 0 14px rgba(212,175,55,.7); }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .empty-label { display: grid; place-items: center; height: 100%; text-align: center; color: var(--muted); font-size: .9rem; padding: 8px; }
.tile .remove-btn {
  position: absolute; top: 4px; right: 4px; z-index: 2;
  width: 26px; height: 26px; border: none; border-radius: 50%;
  background: rgba(0,0,0,.75); color: #fff; font-size: 16px; line-height: 1; cursor: pointer;
}
.tile .tile-title {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  padding: 18px 6px 6px; font-size: .75rem; text-align: center;
}

.grid-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* Watermark bar: spans the full grid width as its own row, so every grid
   (builder + saved) carries the brand in screenshots and shares. */
.grid-watermark {
  grid-column: 1 / -1;
  text-align: center;
  font-size: .8rem;
  letter-spacing: .15em;
  color: var(--gold);
  background: rgba(0,0,0,.55);
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  padding: 6px 4px;
  pointer-events: none;
  user-select: none;
}
.profile-grid-watermark {
  margin-top: 8px;
  text-align: center;
  font-size: .75rem;
  letter-spacing: .15em;
  color: var(--gold);
  background: rgba(0,0,0,.55);
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  padding: 5px 4px;
  pointer-events: none;
  user-select: none;
}
.btn-gold { background: var(--gold); color: #1a1206; border-color: var(--gold); font-weight: bold; }
.btn-gold:disabled { opacity: .6; cursor: not-allowed; }
.btn-ghost { background: transparent; }
.tip { color: var(--muted); font-size: .88rem; }

/* ---------- Profile / reviews shells ---------- */
.soon-banner {
  background: var(--velvet); color: #fff; text-align: center;
  border-radius: 8px; padding: 10px; margin-bottom: 16px; font-weight: bold;
}
.profile-head { display: flex; gap: 16px; align-items: center; }
.avatar {
  width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 2rem;
  background: var(--velvet-deep); border: 3px solid var(--gold);
}
.review-shell label { display: block; margin: 14px 0 6px; font-weight: bold; }
.review-preview {
  border: 2px dashed var(--gold-dim); border-radius: 8px;
  padding: 14px; min-height: 80px; margin-bottom: 14px; background: #120d0b;
}
.review-preview img { max-width: 100%; }

/* ---------- Auth chip / profile / reviews (backend-wired) ---------- */
#googleSignIn { display: inline-block; }
#googleSignIn.hidden { display: none; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel); border: 2px solid var(--gold-dim); border-radius: 8px;
  padding: 4px 10px 4px 4px; font-size: .95rem;
}
.user-chip img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }

/* ---------- Email + password auth panel ---------- */
.email-auth {
  display: flex; gap: 18px; flex-wrap: wrap; width: 100%;
  background: var(--panel); border: 2px solid var(--gold-dim); border-radius: 8px;
  padding: 12px 14px; margin-top: 8px;
}
.email-auth.hidden { display: none; }
.email-auth form { display: flex; flex-direction: column; gap: 6px; min-width: 220px; flex: 1; }
.email-auth h3 { margin: 0 0 2px; }
.email-auth label { font-size: .85rem; }
.email-auth input {
  padding: 6px 8px; border-radius: 6px;
  border: 1px solid var(--gold-dim); background: #120d0b; color: inherit;
}
.small-btn { padding: 5px 10px; font-size: .85rem; }
.profile-grid-card { border: 1px dashed var(--gold-dim); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.profile-grid-card h4 { margin: 0 0 8px; }
.profile-grid-posters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.profile-grid-posters img { width: 46px; aspect-ratio: 2/3; object-fit: cover; border-radius: 3px; }
.review-item { border: 1px dashed var(--gold-dim); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.review-item h4 { margin: 0 0 6px; }
.review-item img { max-width: 100%; }

/* ---------- Setup note / footer ---------- */
.setup-note {
  max-width: 1100px; margin: 20px auto 0; padding: 12px 16px;
  background: #3a2408; border: 2px solid var(--gold); border-radius: 8px;
}
.hidden { display: none; }

.ticket-stub {
  max-width: 900px; margin: 0 auto 30px; padding: 12px 18px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-top: 2px dashed var(--gold-dim); border-bottom: 2px dashed var(--gold-dim);
  color: var(--muted); letter-spacing: .15em; font-size: .85rem;
}

/* Ad slots: placeholders until AdSense approves mymoviegrid.com.
   Slots hide automatically for ad-free subscribers (body.ad-free). */
.ad-slot { display: flex; align-items: center; justify-content: center; margin: 16px auto; border: 1px dashed rgba(212, 175, 55, .5); color: #b8a88a; font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; background: rgba(0, 0, 0, .25); }
.ad-leaderboard { max-width: 728px; height: 90px; }
.ad-infeed { max-width: 600px; height: 250px; }
body.ad-free .ad-slot { display: none; }
@media (max-width: 640px) { .ad-leaderboard { height: 100px; } }

/* ---------- Ad-free pitch popup ---------- */
.popup-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(0, 0, 0, .75);
}
.popup-overlay.hidden { display: none; }
.popup-card {
  position: relative; max-width: 480px; width: 100%;
  background: linear-gradient(180deg, #2a0d12, var(--velvet-deep));
  border: 3px solid var(--gold); border-radius: 14px;
  box-shadow: 0 0 40px rgba(212,175,55,.35), 0 16px 48px rgba(0,0,0,.7);
  padding: 28px 24px 24px; text-align: center;
}
.popup-close {
  position: absolute; top: 8px; right: 10px;
  border: none; background: transparent; color: var(--muted);
  font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.popup-close:hover { color: var(--cream); }
.popup-kicker {
  margin: 0 0 8px; color: var(--gold);
  letter-spacing: .3em; text-transform: uppercase; font-size: .75rem;
}
.popup-card h2 { margin: 0 0 12px; font-size: 1.8rem; }
.popup-blurb { margin: 0 0 20px; font-size: 1.05rem; line-height: 1.55; color: var(--cream); }
.popup-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
