/* style.css */
/* Filmivinkki: bright, chunky, friendly. Thick ink outlines and hard shadows. */
/* Light theme (default). The dark theme below overrides the same tokens. */
:root {
  --bg: #fff6e5;
  --bg-alt: #ffe9c7;
  --surface: #ffffff;
  --surface-tint: #fff1d6;
  --surface-hover: #fff8ea;
  --card: var(--surface);
  --field: var(--surface);
  --ink: #241b3f;
  --ink-fixed: #241b3f;
  --text: var(--ink);
  --muted: #6a6188;
  --border: #241b3f;
  --line: var(--border);
  --line-soft: rgba(36, 27, 63, 0.16);
  --shadow-color: #241b3f;
  --dots: rgba(36, 27, 63, 0.09);
  --bar-bg: #ffd23f;
  --bar-ink: #241b3f;
  --accent: #d63a3f;
  --accent-2: #0a9d8f;
  --accent-3: #ffb400;
  --purple: #6b48ff;
  --sun: #ffd23f;
  --on-accent: #241b3f;
  --shadow: 4px 4px 0 var(--shadow-color);
  --shadow-sm: 3px 3px 0 var(--shadow-color);
  --glow-pink: 3px 3px 0 var(--shadow-color);
  --glow-cyan: 3px 3px 0 var(--shadow-color);
  --font-display: "Baloo 2", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;
}

/* Dark theme: applied when <html data-theme="dark"> (set by features/theme.js
   from the phone/computer setting or the visitor's own choice). */
:root[data-theme="dark"] {
  --bg: #150f27;
  --bg-alt: #1d1637;
  --surface: #241b3f;
  --surface-tint: #34285c;
  --surface-hover: #2d2350;
  --ink: #efe8ff;
  --muted: #a99ecb;
  --border: #9a8fd0;
  --line-soft: rgba(239, 232, 255, 0.16);
  --shadow-color: #0a0716;
  --dots: rgba(255, 255, 255, 0.05);
  --bar-bg: #241b3f;
  --bar-ink: #efe8ff;
  --purple: #a996ff;
  --accent-2: #3cd6c6;
}

* { box-sizing: border-box; }

html { color-scheme: light; font-size: 17px; }
html[data-theme="dark"] { color-scheme: dark; }

body {
  margin: 0;
  font-family: var(--font-body);
  line-height: 1.5;
  background:
    radial-gradient(circle at 1px 1px, var(--dots) 1.3px, transparent 0) 0 0 / 24px 24px,
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

button { font-family: inherit; color: inherit; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1.5rem;
  background: var(--bar-bg);
  color: var(--bar-ink);
  border-bottom: 3px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--bar-ink);
  text-decoration: none;
}

.logo-mark {
  display: block;
  width: 2.6rem;
  height: 2.6rem;
  filter: drop-shadow(2px 2px 0 var(--shadow-color));
  transform: rotate(-6deg);
  transition: transform 0.15s ease;
}

.logo:hover .logo-mark { transform: rotate(4deg) scale(1.06); }

.logo-svg { display: block; width: 100%; height: 100%; }

.logo-text {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.tagline {
  flex: 1;
  margin: 0;
  color: var(--bar-ink);
  opacity: 0.8;
  font-weight: 700;
  font-size: 0.95rem;
}

.lang-switch {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
}

.lang-btn {
  padding: 0.3rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.lang-btn:hover { transform: translateY(-2px); }

.lang-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 2px 2px 0 var(--shadow-color);
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 3rem;
}

/* ---------- Home intro (the first thing painted, before the app has loaded) ---------- */
.home-hero { max-width: 1180px; margin: 0 auto; padding: 1.5rem 1.5rem 0; }
.home-hero h1 { margin: 0 0 0.5rem; font-family: var(--font-display); font-size: clamp(1.9rem, 5vw, 2.6rem); line-height: 1.1; }
.home-hero p { margin: 0; max-width: 46rem; color: var(--muted); font-size: 1.05rem; font-weight: 700; line-height: 1.5; }
body:not(.home-view) .home-hero { display: none; }
@media (max-width: 700px) { .home-hero { padding: 1.1rem 1rem 0; } }

/* ---------- Start panel ---------- */
.start-panel { margin-bottom: 1.5rem; }

.primary-actions {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 1.1rem;
  margin-bottom: 1.4rem;
}

.big-action {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.4rem;
  min-height: 92px;
  border: 3px solid var(--border);
  border-radius: 24px;
  box-shadow: 5px 5px 0 var(--shadow-color);
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.big-action:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--shadow-color);
}

.big-action:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--shadow-color);
}

.big-emoji { font-size: 2.6rem; line-height: 1; }

.big-text { display: flex; flex-direction: column; }

.big-text strong {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.1;
}

.big-text small { font-size: 0.95rem; font-weight: 700; }

.big-primary { background: var(--accent); color: #fff; }

.big-secondary { background: var(--sun); color: var(--ink-fixed); }

.search-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.search-input {
  flex: 1 1 100%;
  padding: 0.95rem 1.5rem;
  border: 3px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.search-input::placeholder { color: var(--muted); font-weight: 600; }

.search-input:focus,
.year-input:focus,
select:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 4px 4px 0 var(--purple);
}

/* small pill buttons in the search row (my movies, share) */
.quiz-btn {
  padding: 0.45rem 1rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.quiz-btn:hover { background: var(--sun); transform: translateY(-2px); color: var(--ink-fixed); }

.genre-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.genre-chip {
  padding: 0.55rem 1.05rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.genre-chip:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }

.genre-chip.selected {
  background: var(--sun);
  box-shadow: var(--shadow-sm);
  color: var(--ink-fixed);
}

.more-filters {
  padding: 0.5rem 1rem;
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

.more-filters:hover { background: var(--surface); }

/* ---------- Filters panel ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.filters.collapsed { display: none; }

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.filter-group label {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
}

select,
.year-input {
  min-width: 140px;
  padding: 0.55rem 0.8rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.year-input { width: 110px; min-width: 0; cursor: text; }

.reset-btn {
  padding: 0.6rem 1.1rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 800;
  cursor: pointer;
}

.reset-btn:hover { background: var(--sun); color: var(--ink-fixed); }

/* ---------- Results ---------- */
.result-count {
  margin: 0.5rem 0 1rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
}

.clear-all {
  display: block;
  margin: 0 0 1.25rem;
  padding: 0.5rem 1.1rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

.clear-all[hidden] { display: none; }

.clear-all:hover { background: var(--accent); color: #fff; }

.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1.3rem;
}

.movie-card {
  overflow: hidden;
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  animation: pop 0.35s ease both;
}

@keyframes pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.movie-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--shadow-color);
}

.poster {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 172px;
  border-bottom: 3px solid var(--border);
}

.card-body { padding: 1.6rem 1rem 1.05rem; }

.movie-card h3 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.15;
}

.movie-card .meta {
  margin-bottom: 0.6rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.tag {
  padding: 0.12rem 0.6rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 800;
}

.no-results {
  grid-column: 1 / -1;
  padding: 3rem;
  text-align: center;
  color: var(--muted);
  font-size: 1.2rem;
  font-weight: 700;
}

/* Home (shelves) vs results (grid) */
body.home-view #movieGrid,
body.home-view #resultCount,
body.home-view .lazy-footer { display: none; }

body:not(.home-view) #shelves,
body:not(.home-view) #dailyBanner { display: none; }

/* The app fills in its texts, genre chips and shelves with JavaScript. Keep that unfinished state out of sight
   (hidden, so it neither paints nor counts as layout shift) until script.js adds .app-ready; the animation
   opens it anyway after five seconds, in case the script never arrives. */
body.app-page:not(.app-ready) > main,
body.app-page:not(.app-ready) > footer { visibility: hidden; animation: app-reveal 0s 5s forwards; }

/* Shelves are drawn one after another; holding their place keeps the footer from jumping into view. */
.shelves { min-height: 70vh; }
@keyframes app-reveal { to { visibility: visible; } }

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(36, 27, 63, 0.6);
  backdrop-filter: blur(3px);
  animation: pop 0.15s ease both;
}

.modal.hidden { display: none; }

.modal-content {
  position: relative;
  width: 92%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.8rem;
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: 28px;
  box-shadow: 8px 8px 0 var(--shadow-color);
}

.close-btn {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--shadow-color);
}

.close-btn:hover { background: var(--accent); color: #fff; }

.modal-content h2 {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.15;
}

.modal-content .poster {
  margin: -1.8rem -1.8rem 1.3rem;
  height: 160px;
  border-bottom: 3px solid var(--border);
  border-radius: 25px 25px 0 0;
}

.modal-content > .tags { margin-bottom: 1rem; }

.modal-content p { font-size: 1.05rem; }

.modal-content .long-desc { margin-top: 0.2rem; color: var(--ink); font-size: 1rem; line-height: 1.6; }
.modal-content .long-desc[hidden] { display: none; }

.modal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.modal-links a {
  padding: 0.7rem 1.3rem;
  border: 3px solid var(--border);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: var(--shadow-sm);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.12s ease;
}

.modal-links a + a { background: var(--sun); color: var(--ink-fixed); }

.modal-links a:hover { transform: translate(-1px, -1px); }

/* ---------- Guided picker (quiz) ---------- */
.quiz h2 {
  margin: 0;
  font-size: 1.6rem;
}

.quiz-title {
  margin-bottom: 0.6rem;
  padding-right: 2.9rem;
  color: var(--purple);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
}

.quiz-progress { display: flex; gap: 0.35rem; margin-bottom: 0.9rem; }

.quiz-progress .dot {
  flex: 1;
  height: 8px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.quiz-progress .dot.on { background: var(--accent); }

.quiz-q {
  margin: 0.4rem 0 0.2rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.quiz-hint { margin: 0.2rem 0 1rem; color: var(--muted); font-size: 0.95rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.chip {
  padding: 0.45rem 0.95rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

.chip:hover { background: var(--surface-tint); }

.chip.selected { background: var(--sun); box-shadow: var(--shadow-sm); color: var(--ink-fixed); }

.chips.big .chip { padding: 0.7rem 1.2rem; font-size: 1.05rem; }

.quiz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.quiz-go {
  padding: 0.75rem 1.5rem;
  border: 3px solid var(--border);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: var(--shadow-sm);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}

.quiz-go:hover { transform: translate(-1px, -1px); }

.quiz-secondary {
  padding: 0.7rem 1.2rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 800;
  cursor: pointer;
}

.quiz-secondary:hover { background: var(--surface-tint); }

.back-link { margin-top: 1rem; }

.quiz-pick {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  width: 100%;
  margin-bottom: 0.7rem;
  padding: 0.7rem 0.9rem;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.quiz-pick:hover { background: var(--surface-hover); }

.quiz-pick .emoji { font-size: 2rem; line-height: 1.1; }

.quiz-pick-text { display: block; font-size: 1rem; }

.quiz-pick small { display: block; margin: 0.1rem 0; color: var(--muted); font-weight: 700; }

.quiz-pick em { display: block; font-style: normal; font-size: 0.9rem; line-height: 1.4; }

.quiz-pick .why { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.45rem; }

/* ---------- Footer ---------- */
footer {
  padding: 2rem 1.5rem 3rem;
  border-top: 3px dashed var(--line-soft);
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

footer p { margin: 0; }

/* ---------- Small screens ---------- */
@media (max-width: 700px) {
  .topbar { padding: 0.5rem 1rem; }
  .tagline { display: none; }
  .logo-text { font-size: 1.5rem; }
  main { padding: 1.25rem 1rem 2.5rem; }
  .primary-actions { grid-template-columns: 1fr; gap: 0.9rem; }
  .big-action { min-height: 80px; }
  .big-text strong { font-size: 1.35rem; }
  .movie-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
  .poster { height: 130px; }
  .poster-emoji { font-size: 3.4rem; }
  .modal-content { padding: 1.3rem; }
  .modal-content .poster { margin: -1.3rem -1.3rem 1.1rem; }
}

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


/* ---------- Poster-style cards ---------- */
.poster::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--pat, none);
  opacity: 0.4;
  pointer-events: none;
}

.poster-emoji {
  position: relative;
  font-size: 4.4rem;
  line-height: 1;
  filter: drop-shadow(0 5px 0 rgba(36, 27, 63, 0.28));
  transform: rotate(-6deg);
  transition: transform 0.2s ease;
}

.movie-card:hover .poster-emoji { transform: rotate(6deg) scale(1.14); }

.poster[data-genre="drama"] { --pat: repeating-linear-gradient(90deg, rgba(255,255,255,0.6) 0 10px, transparent 10px 24px); }
.poster[data-genre="crime"] { --pat: repeating-linear-gradient(45deg, rgba(36,27,63,0.28) 0 6px, transparent 6px 16px); }
.poster[data-genre="scifi"] { --pat: radial-gradient(circle, rgba(255,255,255,0.95) 1.5px, transparent 2px) 0 0 / 26px 26px, radial-gradient(circle, rgba(255,255,255,0.65) 1px, transparent 1.5px) 13px 13px / 26px 26px; }
.poster[data-genre="fantasy"] { --pat: radial-gradient(circle, rgba(255,255,255,0.9) 3px, transparent 3.5px) 0 0 / 34px 34px; }
.poster[data-genre="romance"] { --pat: radial-gradient(circle, rgba(255,255,255,0.75) 5px, transparent 5.5px) 0 0 / 28px 28px; }
.poster[data-genre="musical"] { --pat: repeating-radial-gradient(circle at 50% 130%, rgba(255,255,255,0.65) 0 8px, transparent 8px 18px); }
.poster[data-genre="comedy"] { --pat: radial-gradient(circle, rgba(255,255,255,0.85) 7px, transparent 7.5px) 0 0 / 38px 38px; }
.poster[data-genre="action"] { --pat: repeating-conic-gradient(from 0deg at 50% 62%, rgba(255,255,255,0.6) 0 10deg, transparent 10deg 20deg); }
.poster[data-genre="war"] { --pat: repeating-linear-gradient(-30deg, rgba(36,27,63,0.24) 0 12px, transparent 12px 26px); }
.poster[data-genre="horror"] { --pat: radial-gradient(circle at 50% 100%, rgba(36,27,63,0.38) 30%, transparent 31%) 0 0 / 40px 40px; }
.poster[data-genre="thriller"] { --pat: linear-gradient(rgba(255,255,255,0.55) 1px, transparent 1px) 0 0 / 22px 22px, linear-gradient(90deg, rgba(255,255,255,0.55) 1px, transparent 1px) 0 0 / 22px 22px; }
.poster[data-genre="animation"] { --pat: radial-gradient(circle, rgba(255,255,255,0.95) 3px, transparent 3.5px) 0 0 / 30px 30px, radial-gradient(circle, rgba(36,27,63,0.28) 2px, transparent 2.5px) 15px 15px / 30px 30px; }

.rating-sticker {
  position: absolute;
  right: 12px;
  bottom: -22px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 3.2rem;
  height: 3.2rem;
  border: 3px solid var(--border);
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 2px 2px 0 var(--shadow-color);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  transform: rotate(8deg);
  color: var(--ink-fixed);
}

.rating-sticker small { font-size: 0.7rem; margin-bottom: 1px; }

.modal-content .poster-emoji { font-size: 5rem; }

/* ---------- Guided picker v2 ---------- */
.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.quiz-top { padding-right: 2.9rem; }

.quiz-top .quiz-title { margin: 0; }

.quiz-count { color: var(--muted); font-size: 0.85rem; font-weight: 800; }

.quiz-question {
  margin: 0.2rem 0 0.1rem !important;
  font-size: 2rem !important;
  line-height: 1.1;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
}

.tiles-genre { grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); }

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 108px;
  padding: 0.8rem 0.6rem;
  border: 3px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.tile:hover { transform: translate(-2px, -2px); background: var(--surface-hover); }

.tile:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow-color); }

.tile.selected { background: var(--sun); color: var(--ink-fixed); }

.tile.selected::after {
  content: "✓";
  position: absolute;
  top: -11px;
  right: -9px;
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border: 3px solid var(--border);
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}

.tile-icon { font-size: 2.5rem; line-height: 1; }

.quiz-drumroll { padding: 3rem 0 2.5rem; text-align: center; }

.quiz-drumroll p { margin: 0.5rem 0 0; font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; }

.drum-emoji { font-size: 4.5rem; animation: drum 0.3s ease-in-out infinite alternate; }

@keyframes drum {
  from { transform: rotate(-14deg) scale(1); }
  to { transform: rotate(14deg) scale(1.18); }
}

.quiz-best {
  position: relative;
  overflow: hidden;
  margin: 0.6rem 0 1.4rem;
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.modal-content .quiz-best .poster { height: 180px; margin: 0; border-radius: 0; }

.quiz-best-body { padding: 1.7rem 1.3rem 1.3rem; }

.quiz-best-body h2 { margin: 0 0 0.6rem !important; font-size: 1.6rem !important; }

.quiz-best-body p { margin: 0.8rem 0 0; }

.tag-why { background: var(--sun); color: var(--ink-fixed); }

.quiz-more { margin-top: 0.9rem; }

.quiz-others-title {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
}

.confetti {
  position: absolute;
  top: 6%;
  z-index: 5;
  width: 10px;
  height: 15px;
  border-radius: 2px;
  pointer-events: none;
  animation: confetti-fall 1.5s ease-out forwards;
}

@keyframes confetti-fall {
  from { opacity: 1; transform: translate(0, 0) rotate(0); }
  to { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); }
}

/* ---------- Picker: extra questions, match percentage ---------- */
.tiles-topic,
.tiles-origin,
.tiles-decade { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }

.tiles-topic .tile,
.tiles-origin .tile,
.tiles-decade .tile { min-height: 96px; font-size: 0.92rem; }

.quiz-enough {
  display: block;
  width: 100%;
  margin-top: 1.1rem;
  padding: 0.65rem 1rem;
  border: 2px dashed var(--border);
  border-radius: 14px;
  background: #e6f8f4;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  color: var(--ink-fixed);
}

.quiz-enough:hover { background: #bff0e6; color: var(--ink-fixed); }

.match-pct {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.1rem 0.8rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: #9be8d8;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink-fixed);
}

.pick-pct {
  flex: 0 0 auto;
  margin-left: auto;
  align-self: center;
  padding: 0.1rem 0.6rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: #9be8d8;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
  color: var(--ink-fixed);
}

.quiz .quiz-nav {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-left: -0.3rem;
  margin-right: -0.3rem;
  padding: 0.9rem 0.3rem 0.35rem;
  background: linear-gradient(to top, var(--surface) 78%, transparent);
}


select option { background: var(--surface); color: var(--text); }

.lang-btn,
.theme-btn { color: var(--text); }

/* ---------- Theme switch (auto / light / dark) ---------- */
.theme-switch {
  display: flex;
  gap: 0.3rem;
}

.theme-btn {
  padding: 0.28rem 0.55rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.95rem;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.theme-btn:hover { transform: translateY(-2px); }

.theme-btn[aria-pressed="true"] {
  background: var(--sun);
  color: var(--ink-fixed);
  box-shadow: 2px 2px 0 var(--shadow-color);
}

@media (max-width: 700px) {
  .topbar { gap: 0.5rem; }
  .lang-btn { padding: 0.25rem 0.55rem; font-size: 0.8rem; }
  .theme-btn { padding: 0.22rem 0.45rem; font-size: 0.85rem; }
  .lang-switch, .theme-switch { gap: 0.25rem; }
}

/* Tablets and small windows: the tagline gives way and the header may wrap, so the language, theme and sound buttons never push the page wider than the screen */
@media (max-width: 1100px) {
  .topbar { flex-wrap: wrap; row-gap: 0.45rem; }
  .tagline { display: none; }
}

/* Very narrow phones: logo on its own row, switches below it */
@media (max-width: 480px) {
  .topbar {
    position: static;
    flex-wrap: wrap;
    justify-content: space-between;
    row-gap: 0.45rem;
  }
  .logo { flex: 1 1 100%; }
  .lang-switch { margin-left: 0; }
}

.footer-note {
  max-width: 46rem;
  margin: 0.8rem auto 0;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.5;
}

/* features/favorites.css */
.fav-heart {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.fav-heart:hover { transform: scale(1.15); }

.fav-heart.on {
  background: var(--accent);
  color: #fff;
  box-shadow: 2px 2px 0 var(--shadow-color);
}

.later-mark {
  position: absolute;
  top: 3.15rem;
  right: 0.55rem;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
  transition: transform 0.12s ease;
}

.later-mark:hover { transform: scale(1.15); opacity: 1; }

.later-mark.on {
  background: var(--sun);
  box-shadow: 2px 2px 0 var(--shadow-color);
  opacity: 1;
}

.seen-badge {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  z-index: 1;
  padding: 0.05rem 0.55rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: #9be8d8;
  color: var(--ink-fixed);
  font-size: 0.8rem;
  font-weight: 800;
}

.list-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.list-toggle {
  padding: 0.5rem 1.05rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 800;
  cursor: pointer;
}

.list-toggle:hover { background: var(--surface-tint); }

.list-toggle[data-list="fav"].on {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.list-toggle[data-list="later"].on {
  background: var(--sun);
  box-shadow: var(--shadow-sm);
  color: var(--ink-fixed);
}

.list-toggle[data-list="seen"].on {
  background: #9be8d8;
  box-shadow: var(--shadow-sm);
  color: var(--ink-fixed);
}

.my-list .chips { margin: 0.8rem 0 1rem; }

.my-list-empty {
  padding: 1.5rem 0;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

#myListBtn { background: #ffe0e6; color: var(--ink-fixed); }
#myListBtn:hover { background: var(--accent); color: #fff; }

/* features/kidsmode.css */
#kidsModeBtn { background: #d9f5d0; color: var(--ink-fixed); }
#kidsModeBtn:hover { background: #7bc96f; color: var(--ink-fixed); }

#kidsModeBanner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
  padding: 0.8rem 1.2rem;
  border: 3px solid var(--border);
  border-radius: 18px;
  background: #d9f5d0;
  font-weight: 800;
  color: var(--ink-fixed);
}

body.kids-mode #kidsModeBanner { display: flex; }

.kids-gate-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 1rem;
}

.kids-gate-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-weight: 800;
}

.kids-gate-form input {
  padding: 0.65rem 0.9rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
}

.kids-gate-error {
  margin: 0;
  padding: 0.6rem 0.9rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #ffd9dc;
  font-weight: 700;
  color: var(--ink-fixed);
}

.kids-gate-error[hidden] { display: none; }

/* The banner keeps dark text on its light-green background in both themes,
   but its exit button sits on a themed surface and needs the themed text. */
#kidsModeBanner .quiz-secondary { color: var(--text); }

.kids-gate-form input { background: var(--surface); color: var(--text); }

/* features/series.css */
.series-section { margin-top: 1.2rem; }

.series-section summary {
  margin: 0 0 0.6rem;
  padding: 0.65rem 1rem;
  border: 2px dashed var(--border);
  border-radius: 14px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}

.series-section summary:hover { background: var(--surface-tint); }

.series-section[open] summary { border-style: solid; background: var(--surface-tint); }

.series-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.series-chip, .series-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.series-chip {
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

.series-row {
  width: 100%;
  margin-bottom: 0.45rem;
  padding: 0.5rem 0.8rem;
  border-radius: 14px;
  font-size: 0.95rem;
}

.series-chip:hover, .series-row:hover { background: var(--surface-tint); }

.series-chip.current {
  background: var(--sun);
  box-shadow: 2px 2px 0 var(--shadow-color);
  font-weight: 800;
  cursor: default;
  color: var(--ink-fixed);
}

.series-emoji { font-size: 1.3rem; }
.series-chip .series-emoji { display: none; }
.series-row .series-title { flex: 1; min-width: 0; }
.series-chip .series-title { order: 2; }
.series-meta { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.series-chip .series-meta { order: 1; color: inherit; opacity: 0.8; }
.series-chip.current .series-meta { opacity: 1; }

/* features/kids.css */
.age-badge {
  display: inline-block;
  padding: 0.05rem 0.55rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.4;
}

.poster > .age-badge {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  z-index: 1;
}

.age-badge.age-0 { background: #a8ecab; color: var(--ink-fixed); }
.age-badge.age-7 { background: #9ee9fb; color: var(--ink-fixed); }
.age-badge.age-12 { background: var(--sun); color: var(--ink-fixed); }
.age-badge.age-16 { background: #ffb98a; color: var(--ink-fixed); }
.age-badge.age-18 { background: var(--accent); color: #fff; }

.age-line {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

/* features/daily.css */
/* Movie of the day: big billboard above the shelves on the home view. */
.daily-banner {
  position: relative;
  display: grid;
  grid-template-columns: 230px 1fr;
  margin: 0 0 1.9rem;
  overflow: hidden;
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: 28px;
  box-shadow: 7px 7px 0 var(--shadow-color);
}

.daily-poster {
  display: grid;
  place-items: center;
  min-height: 230px;
  font-size: 5.5rem;
  border-right: 3px solid var(--border);
}

.daily-info { min-width: 0; padding: 1.3rem 3.2rem 1.4rem 1.7rem; }

.daily-kicker {
  display: inline-block;
  padding: 0.1rem 0.9rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  transform: rotate(-2deg);
}

.daily-title {
  margin: 0.5rem 0 0.45rem;
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.05;
}

.daily-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.daily-year,
.daily-rating { font-size: 1rem; font-weight: 800; }

.daily-year { color: var(--muted); }

.daily-desc {
  display: -webkit-box;
  margin: 0.7rem 0 1rem;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  font-size: 1.05rem;
}

.daily-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.daily-close {
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.daily-close:hover { background: var(--accent); color: #fff; }

@media (max-width: 700px) {
  .daily-banner { grid-template-columns: 1fr; }
  .daily-poster { min-height: 120px; font-size: 4rem; border-right: none; border-bottom: 3px solid var(--border); }
  .daily-info { padding: 1.1rem 1.2rem 1.3rem; }
  .daily-title { font-size: 1.8rem; }
}

/* features/foryou.css */
/* "Recommended for you" shelf: the line under each card telling which marked movie it is based on. */
.foryou-reason {
  margin: 0.55rem 0 0;
  padding-top: 0.5rem;
  border-top: 2px dashed var(--line-soft);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.3;
}

.shelf[data-shelf="foryou"] .shelf-title { color: var(--accent); }

/* Shelves rebuilt live (features/mylists.js) appear without the card pop-in animation. */
.shelf.no-intro .movie-card { animation: none; opacity: 1; }

/* features/music.css */
/* Background music button, sits next to the theme switch in the top bar. */
.music-btn {
  padding: 0.28rem 0.6rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.music-btn:hover { transform: translateY(-2px); }

.music-btn[aria-pressed="true"] {
  background: var(--sun);
  color: var(--ink-fixed);
  box-shadow: 2px 2px 0 var(--shadow-color);
}

@media (max-width: 700px) {
  .music-btn { padding: 0.22rem 0.5rem; font-size: 0.85rem; }
}

/* features/group.css */
/* Group pick: start button, setup tiles, secret ballot chips and result badges. */

.primary-actions .big-group {
  grid-column: 1 / -1;
  min-height: 78px;
  background: #9be8d8;
  color: var(--ink-fixed);
}

.group .group-question { margin: 1.2rem 0 0.5rem; font-size: 1.15rem; }

.tiles-group { grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); }
.tiles-group .tile { min-height: 84px; font-size: 0.9rem; }

.group-names { display: flex; flex-direction: column; gap: 0.7rem; margin: 0.5rem 0 1rem; }

.group-name { display: flex; align-items: center; gap: 0.7rem; }

.group-name span {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--sun);
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--ink-fixed);
}

.group-name input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.65rem 0.9rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
}

.group-handoff { text-align: center; }
.group-handoff .handoff-emoji { margin: 1rem 0 0.4rem; font-size: 4rem; line-height: 1; }
.group-handoff .handoff-name { margin: 0 0 0.4rem; font-size: 1.7rem; }
.group-handoff p { margin: 0 0 1.4rem; color: var(--muted); font-weight: 700; }

.group-section { margin: 1.1rem 0 0.5rem; font-size: 1.02rem; }

.gchips { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.gchip {
  padding: 0.4rem 0.8rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.gchip:hover { transform: translate(-1px, -1px); background: var(--surface-hover); }
.gchip.selected { background: var(--sun); color: var(--ink-fixed); }
.gchip.avoid.selected { background: #ffd9dc; color: var(--ink-fixed); text-decoration: line-through; }

.gscores { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0; }

.gscore {
  padding: 0.1rem 0.6rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--ink-fixed);
}

.gscore-high { background: #9be8d8; }
.gscore-mid { background: #ffe9a8; }
.gscore-low { background: #ffd9dc; }

.group-warn { margin: 0.4rem 0 0; font-weight: 800; }

@media (max-width: 480px) {
  .group-handoff .handoff-name { font-size: 1.4rem; }
}

.group-share { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }
.group-share[hidden], .group-share [hidden] { display: none; }
.group-share a.quiz-secondary { display: inline-block; text-decoration: none; }

/* features/assistant.css */
/* Movie assistant: the big button, the window with the wish field, the chips of what was understood, and the suggestions. */

.primary-actions .big-assistant {
  grid-column: 1 / -1;
  min-height: 78px;
  background: #6b48ff;
  color: #fff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.assistant-form { display: flex; flex-direction: column; gap: 0.7rem; margin: 0.6rem 0 0.2rem; }

.assistant-form textarea {
  width: 100%;
  min-height: 5.4rem;
  padding: 0.85rem 1.1rem;
  border: 3px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  resize: vertical;
}

.assistant-form textarea:focus-visible,
.assist-refine input:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }

.assistant-send { align-self: flex-end; }

.assistant-examples-title,
.assistant-private { margin: 1rem 0 0.4rem; color: var(--muted); font-size: 0.92rem; font-weight: 700; }

.assistant-private { margin-top: 0.9rem; font-size: 0.85rem; }

.assistant-examples { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.assistant-example {
  padding: 0.45rem 0.95rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: start;
  cursor: pointer;
}

.assistant-example:hover,
.assistant-example:focus-visible { background: var(--sun); color: var(--ink-fixed); }

.assistant-section { display: block; margin: 1.5rem 0 0.6rem; font-family: var(--font-display); font-size: 1.15rem; font-weight: 800; }

.assistant-note { margin: 1rem 0; padding: 0.8rem 1rem; border: 2px dashed var(--border); border-radius: 14px; font-weight: 700; line-height: 1.4; }
.assistant-note.small { margin: 0.7rem 0 0; padding: 0.5rem 0.8rem; font-size: 0.88rem; }

/* what was understood */
.assist-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.assist-chip {
  display: inline-flex;
  align-items: stretch;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 800;
}

.assist-chip-text {
  padding: 0.3rem 0.75rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
}

button.assist-chip-text { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.assist-chip-text.neg { color: var(--accent); }

.assist-chip-x {
  padding: 0 0.65rem;
  border: 0;
  border-inline-start: 2px solid var(--border);
  background: var(--surface-tint);
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.assist-chip-x:hover,
.assist-chip-x:focus-visible { background: var(--accent); color: #fff; }

/* suggestions */
.assist-list { display: flex; flex-direction: column; gap: 0.8rem; }

.assist-pick {
  display: flex;
  gap: 0.9rem;
  padding: 0.8rem;
  border: 3px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.assist-pick:hover { background: var(--surface-hover); }

.assist-poster {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 4.6rem;
  align-self: flex-start;
  height: 6.6rem;
  padding: 0.5rem 0.2rem 0.35rem;
  border: 2px solid var(--border);
  border-radius: 14px;
  font-size: 2.2rem;
  line-height: 1;
}

.assist-poster b {
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: var(--sun);
  color: var(--ink-fixed);
  font-size: 0.72rem;
}

.assist-body { flex: 1 1 auto; min-width: 0; }
.assist-body h3 { margin: 0; font-family: var(--font-display); font-size: 1.12rem; line-height: 1.2; overflow-wrap: anywhere; }
.assist-body h3 small { color: var(--muted); font-family: var(--font-body); font-size: 0.85rem; font-weight: 700; }
.assist-meta { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.assist-desc { margin: 0.35rem 0 0; font-size: 0.93rem; line-height: 1.4; }
.assist-why { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.assist-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.65rem; }
.assist-buttons .quiz-secondary { display: inline-block; padding: 0.4rem 0.9rem; color: var(--text); font-size: 0.85rem; text-decoration: none; }

.assist-more { display: block; width: 100%; margin-top: 0.9rem; }
.assist-restart { margin-top: 1rem; }

.assist-refine { margin-top: 1.2rem; }
.assist-refine .assistant-section { margin-top: 0.4rem; }
.assist-refine-row { display: flex; gap: 0.5rem; }

.assist-refine input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.65rem 1rem;
  border: 3px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
}

@media (max-width: 480px) {
  .assist-pick { gap: 0.7rem; padding: 0.65rem; }
  .assist-poster { width: 3.6rem; height: 5.4rem; font-size: 1.8rem; }
  .assist-refine-row { flex-direction: column; }
}

/* the note under the search ("showing results for ...", see features/search.js) */
.search-note {
  margin: 0 0 1rem;
  padding: 0.6rem 0.9rem;
  border: 2px dashed var(--border);
  border-radius: 14px;
  background: var(--surface);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.5;
}

.search-exact {
  margin-inline-start: 0.4rem;
  padding: 0.15rem 0.7rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.search-exact:hover,
.search-exact:focus-visible { background: var(--sun); color: var(--ink-fixed); }

body.home-view .search-note { display: none; }

.primary-actions .big-assistant.loading { opacity: 0.75; cursor: progress; }

/* features/games.css */
/* Games: the big button on the home page, the tabs, the daily puzzle (poster, guess rows, result) and the emoji quiz. */

.primary-actions .big-games {
  grid-column: 1 / -1;
  min-height: 78px;
  background: #ff8a3d;
  color: var(--ink-fixed);
}

.primary-actions .big-games.loading { opacity: 0.75; cursor: progress; }

.game-tabs { display: flex; gap: 0.4rem; margin: 0.4rem 0 0.9rem; }

.game-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.45rem 0.5rem;
  border: 3px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.1;
  cursor: pointer;
}

.game-tab.on { background: var(--sun); color: var(--ink-fixed); box-shadow: 2px 2px 0 var(--shadow-color); }

.game-note { margin: 0 0 0.8rem; color: var(--muted); font-size: 0.9rem; font-weight: 700; }

.game-stage { display: flex; gap: 0.9rem; align-items: flex-start; margin: 0.4rem 0 0.9rem; }

.game-poster {
  position: relative;
  flex: 0 0 auto;
  width: 7.2rem;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 3px solid var(--border);
  border-radius: 14px;
  box-shadow: 3px 3px 0 var(--shadow-color);
  background: #241b3f;
}

.game-poster svg { display: block; width: 100%; height: 100%; filter: blur(var(--blur, 12px)); transform: scale(1.12); transition: filter 0.5s ease; }
.game-poster:not(.revealed) .poster-title,
.game-poster:not(.revealed) .poster-tag,
.game-poster:not(.revealed) .poster-year { visibility: hidden; }
.game-poster.revealed svg { transform: none; }

.game-side { flex: 1; min-width: 0; }

.game-attempt {
  display: inline-block;
  padding: 0.12rem 0.8rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface-tint);
  font-family: var(--font-display);
  font-weight: 800;
}

.game-hint {
  margin: 0.6rem 0 0;
  padding: 0.55rem 0.8rem;
  border: 2px dashed var(--border);
  border-radius: 14px;
  background: var(--surface);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
}

/* the field with the list of matching titles */
.game-picker { position: relative; margin: 0.2rem 0 0.8rem; }

.game-input {
  width: 100%;
  padding: 0.75rem 1.1rem;
  border: 3px solid var(--border);
  border-radius: 999px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.game-input:focus { outline: 3px solid var(--purple); outline-offset: 2px; }

.game-list {
  position: absolute;
  z-index: 5;
  left: 0.4rem;
  right: 0.4rem;
  margin: 0.3rem 0 0;
  padding: 0.3rem;
  list-style: none;
  border: 3px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.game-list[hidden] { display: none; }
.game-list li { padding: 0.5rem 0.75rem; border-radius: 10px; font-weight: 700; cursor: pointer; }
.game-list li small { color: var(--muted); font-weight: 700; }
.game-list li.on, .game-list li:hover { background: var(--sun); color: var(--ink-fixed); }
.game-list li.on small, .game-list li:hover small { color: var(--ink-fixed); }
.game-list li.none { color: var(--muted); cursor: default; }
.game-list li.none:hover { background: none; }

/* the guesses */
.game-rows { display: flex; flex-direction: column; gap: 0.6rem; }

.game-row {
  padding: 0.6rem 0.7rem 0.7rem;
  border: 3px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.game-row-title { margin: 0 0 0.4rem; font-family: var(--font-display); font-size: 1.05rem; font-weight: 800; line-height: 1.1; }
.game-cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.35rem; }

.game-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 3rem;
  padding: 0.25rem 0.4rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--surface-tint);
  color: var(--ink);
  text-align: center;
  line-height: 1.15;
}

.game-cell small { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; opacity: 0.75; }
.game-cell b { font-size: 0.9rem; font-weight: 800; }
.game-cell.st2 { background: #58cc7a; color: var(--ink-fixed); }
.game-cell.st1 { background: var(--sun); color: var(--ink-fixed); }

.game-legend { margin: 0.8rem 0 0; color: var(--muted); font-size: 0.82rem; font-weight: 700; }

.game-result {
  margin: 0.9rem 0 0.6rem;
  padding: 0.9rem 1rem;
  border: 3px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  color: var(--ink-fixed);
}

.game-result.good { background: #8de7c9; }
.game-result.bad { background: #ffd0c4; }
.game-result strong { font-family: var(--font-display); font-size: 1.35rem; }
.game-result p { margin: 0.3rem 0; font-weight: 700; }
.game-big { font-family: var(--font-display); font-size: 2rem; font-weight: 800; }
.game-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.7rem; }

.game-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; margin: 0.6rem 0; text-align: center; }
.game-stats div { padding: 0.4rem 0.2rem; border: 2px solid var(--border); border-radius: 12px; background: var(--surface); }
.game-stats b { display: block; font-family: var(--font-display); font-size: 1.4rem; }
.game-stats small { font-size: 0.68rem; font-weight: 800; color: var(--muted); text-transform: uppercase; }
.game-countdown { margin: 0.2rem 0 0; text-align: center; font-weight: 800; }

/* the emoji quiz */
.game-emoji-top { display: flex; justify-content: space-between; margin: 0.2rem 0 0.4rem; font-family: var(--font-display); font-size: 1.05rem; font-weight: 800; }

.game-emoji {
  margin: 0.4rem 0 0.2rem;
  padding: 1rem 0.6rem;
  border: 3px solid var(--border);
  border-radius: 20px;
  background: var(--surface-tint);
  box-shadow: var(--shadow-sm);
  font-size: 3.1rem;
  line-height: 1.25;
  letter-spacing: 0.15rem;
  text-align: center;
  overflow-wrap: anywhere;
}

.game-msg { min-height: 1.4rem; margin: 0.5rem 0 0; font-weight: 800; }
.game-msg.good { color: #0a7a52; }
.game-msg.bad { color: var(--accent); }
.game-emoji-actions { margin-top: 0.3rem; }

@media (max-width: 480px) {
  .game-poster { width: 5.8rem; }
  .game-emoji { font-size: 2.5rem; }
  .game-cell b { font-size: 0.84rem; }
}

/* features/lazy.css */
.lazy-footer {
  display: flex;
  justify-content: center;
  padding: 1.8rem 1rem 0.5rem;
}

.lazy-more {
  max-width: 100%;
  padding: 0.75rem 1.7rem;
  border: 3px solid var(--border);
  border-radius: 999px;
  background: var(--sun);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  color: var(--ink-fixed);
}

.lazy-more:hover,
.lazy-more:focus-visible {
  background: var(--accent);
  color: #fff;
}

/* features/shelves.css */
.shelves {
  display: flex;
  flex-direction: column;
  gap: 2.3rem;
}

.shelf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

.shelf-title {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.1;
}

.shelf-emoji {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.7rem;
  height: 2.7rem;
  border: 3px solid var(--border);
  border-radius: 14px;
  background: var(--sun);
  box-shadow: 2px 2px 0 var(--shadow-color);
  font-size: 1.5rem;
  color: var(--ink-fixed);
}

.shelf:nth-child(3n + 2) .shelf-emoji { background: #ffb3c7; color: var(--ink-fixed); }
.shelf:nth-child(3n) .shelf-emoji { background: #9be8d8; color: var(--ink-fixed); }

.shelf-more {
  flex: 0 0 auto;
  padding: 0.4rem 1rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.shelf-more:hover { background: var(--sun); transform: translateY(-2px); color: var(--ink-fixed); }

.shelf-scroller { position: relative; }

.shelf-row {
  display: flex;
  gap: 1.15rem;
  padding: 0.3rem 0.4rem 1.3rem 0.1rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--ink) transparent;
}

.shelf-row .movie-card {
  flex: 0 0 190px;
  scroll-snap-align: start;
}

.shelf-arrow {
  position: absolute;
  top: 42%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  padding: 0 0 0.25rem;
  border: 3px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.shelf-arrow:hover { background: var(--sun); color: var(--ink-fixed); }

.shelf-arrow-left { left: -1.1rem; }
.shelf-arrow-right { right: -1.1rem; }

@media (max-width: 900px) {
  .shelf-arrow { display: none; }
}

@media (max-width: 700px) {
  .shelf-title { font-size: 1.4rem; }
  .shelf-emoji { width: 2.3rem; height: 2.3rem; font-size: 1.2rem; }
  .shelf-row .movie-card { flex-basis: 160px; }
}

/* features/posters.css */
/* Portrait poster art (features/posters.js). The old banner height and emoji pattern of .poster are replaced for these posters. */
.poster.poster-art {
  display: block;
  height: auto;
  aspect-ratio: 2 / 3;
  border-bottom: 3px solid var(--border);
  background: #241b3f;
}

.poster-art::before { display: none; }

.poster-svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Silhouettes (features/posters.js): dark fill with a thin rim light in the colour of the svg. */
.poster-svg .s { fill: #07030f; stroke: currentColor; stroke-width: 1.6; stroke-opacity: 0.55; }

.poster-title text {
  font-family: var(--font-display);
  font-weight: 800;
  stroke: rgba(20, 20, 60, 0.55);
  stroke-width: 1.5px;
  paint-order: stroke;
}

.poster-tag {
  fill: #fff;
  opacity: 0.92;
  font-family: var(--font-display);
  font-weight: 800;
}

.poster-year {
  fill: #fff;
  opacity: 0.7;
  font-family: var(--font-display);
  font-weight: 700;
}

/* In the film window the poster stands on its own above the text instead of stretching across it. */
.modal-content .poster.poster-art {
  width: min(230px, 60%);
  height: auto;
  margin: 0 auto 1.3rem;
  overflow: hidden;
  border: 3px solid var(--border);
  border-radius: 16px;
  box-shadow: 4px 4px 0 var(--shadow-color);
}

@media (max-width: 700px) {
  .poster.poster-art { height: auto; }
  .modal-content .poster.poster-art { margin: 0 auto 1.1rem; }
}

/* The best-match card of the guided picker keeps its wide banner: the picture is cropped, the title is in the text below. */
.modal-content .quiz-best .poster.poster-art {
  width: auto;
  height: 180px;
  aspect-ratio: auto;
  margin: 0;
  border: 0;
  border-bottom: 3px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}

/* Static film pages (tools/build-pages.js): the poster fills the 2:3 frame of .page-poster. */
.page-poster.poster-art {
  display: block;
  overflow: hidden;
  background: #241b3f;
}

@media (max-width: 700px) {
  .page-poster.poster-art { width: 11rem; aspect-ratio: 2 / 3; margin: 0 auto; }
}

/* Movie of the day: the poster fills the left column; on a phone it stands on its own above the text. */
.daily-poster.poster-art {
  position: relative;
  display: block;
  min-height: 300px;
  overflow: hidden;
  background: #241b3f;
}

.daily-poster.poster-art .poster-svg { position: absolute; inset: 0; }

@media (max-width: 700px) {
  .daily-poster.poster-art {
    width: 9.5rem;
    min-height: 0;
    aspect-ratio: 2 / 3;
    margin: 1.1rem auto 0;
    border: 3px solid var(--border);
    border-radius: 16px;
    box-shadow: 4px 4px 0 var(--shadow-color);
  }
}

/* Thumbnails of the movie assistant's suggestions. */
.assist-poster.poster-art {
  position: relative;
  display: block;
  height: auto;
  aspect-ratio: 2 / 3;
  padding: 0;
  overflow: hidden;
  background: #241b3f;
}

.assist-poster.poster-art b {
  position: absolute;
  left: 50%;
  bottom: 0.25rem;
  transform: translateX(-50%);
  white-space: nowrap;
}

/* features/consent.css */
.consent-banner {
  position: fixed;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 0.8rem;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1.2rem;
  max-width: 52rem;
  margin: 0 auto;
  padding: 0.9rem 1.1rem;
  border: 3px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  font-weight: 700;
}
.consent-banner p { margin: 0; flex: 1 1 18rem; font-size: 0.92rem; line-height: 1.4; }
.consent-banner a { color: inherit; text-decoration: underline; }
.consent-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.consent-actions button { padding: 0.55rem 1.1rem; border: 2px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 800; cursor: pointer; }
.consent-actions .consent-accept { background: var(--sun); color: var(--ink-fixed); box-shadow: 2px 2px 0 var(--shadow-color); }
.consent-link { margin: 0.5rem 0.6rem 0; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 0.85rem; font-weight: 700; text-decoration: underline; cursor: pointer; }

/* features/ads.css */
/* Ad slots: invisible until ads.js switches them on; reserve space so the page never jumps. */
.ad-slot { display: none; }
.ad-slot.ad-on {
  display: block;
  min-height: 280px;
  max-width: 62rem;
  margin: 2.2rem auto;
  padding: 0 1rem;
  text-align: center;
}
.ad-slot.ad-on::before {
  content: attr(data-label);
  display: block;
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
body.kids-mode .ad-slot, body:not(.home-view) .ad-slot[data-ad-placement="home"] { display: none !important; }

/* i18n/rtl.css */
/* Right-to-left layout (Arabic). <html dir="rtl"> already mirrors flex rows and text flow;
   this file mirrors everything that is placed with a fixed left/right. */

[dir="rtl"] .lang-switch { margin-left: 0; margin-right: auto; }
@media (max-width: 700px) { [dir="rtl"] .lang-switch { margin-right: 0; } }

/* corner buttons and badges swap sides */
[dir="rtl"] .close-btn,
[dir="rtl"] .daily-close { right: auto; left: 0.8rem; }
[dir="rtl"] .rating-sticker { right: auto; left: 12px; }
[dir="rtl"] .tile.selected::after { right: auto; left: -9px; }
[dir="rtl"] .fav-heart,
[dir="rtl"] .later-mark { right: auto; left: 0.55rem; }
[dir="rtl"] .seen-badge { left: auto; right: 0.5rem; }
[dir="rtl"] .poster > .age-badge { left: auto; right: 0.55rem; }

/* room for the close button moves with it */
[dir="rtl"] .quiz-title,
[dir="rtl"] .quiz-top { padding-right: 0; padding-left: 2.9rem; }
[dir="rtl"] .daily-info { padding: 1.3rem 1.7rem 1.4rem 3.2rem; }
[dir="rtl"] .daily-poster { border-right: 0; border-left: 3px solid var(--border); }

/* text that was left-aligned by hand */
[dir="rtl"] .big-action,
[dir="rtl"] .quiz-pick,
[dir="rtl"] .series-chip,
[dir="rtl"] .series-row { text-align: right; }
[dir="rtl"] .pick-pct { margin-left: 0; margin-right: auto; }

/* Latin movie titles inside Arabic text: keep each title's own direction and punctuation in place */
[dir="rtl"] .movie-card h3,
[dir="rtl"] .modal h2,
[dir="rtl"] .quiz-pick-text strong { unicode-bidi: plaintext; }
[dir="rtl"] .movie-card h3,
[dir="rtl"] .modal h2,
[dir="rtl"] .quiz-pick-text strong { text-align: right; }
