:root {
  --bg: #0d0e12;
  --panel: #16181f;
  --panel2: #1e212b;
  --line: #2a2e3a;
  --text: #f2f0eb;
  --muted: #a7abb8;
  --accent: #e8b34b;
  --accent2: #e4572e;
  --chip-on: #e8b34b;
  --chip-on-text: #191407;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 640px; margin: 0 auto; padding: 20px 16px 40px; }

/* ------------------------------------------------------------- marquee */
.head { text-align: center; }
.marquee {
  position: relative;
  display: inline-block;
  margin: 6px auto 10px;
  padding: 24px 40px;
  background: linear-gradient(180deg, #1b1409, #100d08);
  border: 2px solid #4a3512;
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(0,0,0,.55), inset 0 0 22px rgba(0,0,0,.65);
}
.marquee h1 {
  margin: 0;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #ffcf6e;
  text-shadow: 0 0 16px rgba(255,180,60,.45), 0 2px 0 rgba(0,0,0,.6);
}
.marquee .bulb {
  position: absolute;
  width: 9px; height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: #57420f;
  pointer-events: none;
  animation: chase 1.5s linear infinite;
}
@keyframes chase {
  0%, 100% { background: #57420f; box-shadow: none; }
  12% { background: #ffd873; box-shadow: 0 0 10px 3px rgba(255,196,64,.85); }
  32% { background: #57420f; box-shadow: none; }
}
.head .sub { margin: 0 0 18px; color: var(--muted); font-size: 16px; }

.error {
  background: #3a1620;
  border: 1px solid #7a2b3d;
  color: #ffd9de;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 15px;
}

/* -------------------------------------------------------------- filters */
.filters-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.filters-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  padding: 14px 16px;
  cursor: pointer;
}
.filters-head .chev { color: var(--muted); transition: transform .3s ease; }
.filters-wrap.open .filters-head .chev { transform: rotate(180deg); }
.filters-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .35s ease;
}
.filters-wrap.open .filters-panel { grid-template-rows: 1fr; }
.filters-inner { overflow: hidden; min-height: 0; }
.filters {
  border-top: 1px solid var(--line);
  padding: 14px 14px 6px;
}
.frow { margin-bottom: 12px; }
.flabel {
  display: block;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}

.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg button, .chips button {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 13px;
  font-size: 14px;
  cursor: pointer;
}
.seg button.on, .chips button.on {
  background: var(--chip-on);
  border-color: var(--chip-on);
  color: var(--chip-on-text);
  font-weight: 600;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  vertical-align: middle;
}
.toggle input { width: 19px; height: 19px; accent-color: var(--accent); }

.clear-row { text-align: right; }
.clear {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
}
.clear:active { color: var(--text); border-color: var(--muted); }

.count { text-align: center; color: var(--muted); font-size: 15px; margin: 16px 0 4px; }
.count span { color: var(--text); font-weight: 600; }

/* ---------------------------------------------------------------- wheel */
.stage { text-align: center; margin-top: 8px; }
.wheelbox {
  position: relative;
  width: min(86vw, 500px);
  margin: 0 auto;
}
#wheel {
  width: 100%; height: auto; display: block;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#wheel.grabbing { cursor: grabbing; }
.hint { color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.note { color: var(--muted); font-size: 14px; margin-top: 10px; }

/* --------------------------------------------------------------- result */
.result {
  margin-top: 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  gap: 16px;
  text-align: left;
}
.result .poster {
  width: 110px;
  flex: 0 0 110px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel2);
  aspect-ratio: 2 / 3;
}
.result .poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.result .poster .tile {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 10px; text-align: center;
  font-weight: 700; font-size: 15px; line-height: 1.25;
  color: var(--accent);
}
.result .meta { flex: 1; min-width: 0; }
.result h2 { margin: 0 0 4px; font-size: 22px; line-height: 1.2; }
.result .line { color: var(--muted); font-size: 14px; margin: 0 0 4px; }
.result .genres { color: var(--text); font-size: 14px; margin: 0 0 12px; }
.result .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.result .actions a {
  text-decoration: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 600;
}
.result .actions a.primary { background: var(--accent); color: var(--chip-on-text); }
.foot { margin-top: 30px; color: var(--muted); font-size: 13px; text-align: center; }
@media (max-width: 420px) {
  .marquee { padding: 20px 30px; }
  .marquee h1 { font-size: 36px; }
  .result { flex-direction: column; }
  .result .poster { width: 140px; flex-basis: 140px; margin: 0 auto; }
  .result .meta { text-align: center; }
  .result .actions { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee .bulb {
    animation: none;
    background: #ffd873;
    box-shadow: 0 0 8px 2px rgba(255,196,64,.7);
  }
  .filters-panel { transition: none; }
  .filters-head .chev { transition: none; }
}
