/* 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: #ff5a5f;
  --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: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.4rem;
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: 50%;
  box-shadow: 2px 2px 0 var(--shadow-color);
  transform: rotate(-8deg);
}

.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;
}

/* ---------- 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; opacity: 0.9; }

.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; }

/* ---------- 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-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; }
}

/* 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;
}
