/* Layout: criteria panel on the left, live results on the right; stacks on phones. Ticket-stub posters for films, player badges for games. */
:root{
  --bg:#EEF0F6; --surface:#FFFFFF; --ink:#1B1A3A; --muted:#5D5C7A; --line:#D9DBE8;
  --chip:#E4E6F1; --accent:#F2A900; --accent-ink:#1B1A3A; --teal:#0E7F74; --teal-soft:#D5EEEB;
  --award-bg:#FCEFC7; --award-fg:#6E4A00; --danger:#B42318;
  --display:"Bricolage Grotesque", "Arial Black", system-ui, sans-serif;
  --body:"Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --mono:"JetBrains Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){
  --bg:#121128; --surface:#1C1B38; --ink:#ECEBF8; --muted:#A3A2C2; --line:#2E2D52;
  --chip:#26254A; --accent:#F7B928; --accent-ink:#121128; --teal:#5CCABD; --teal-soft:#1D3A42;
  --award-bg:#3A3016; --award-fg:#F7CD6B; --danger:#FF8A7A; color-scheme:dark }}
:root[data-theme="dark"]{
  --bg:#121128; --surface:#1C1B38; --ink:#ECEBF8; --muted:#A3A2C2; --line:#2E2D52;
  --chip:#26254A; --accent:#F7B928; --accent-ink:#121128; --teal:#5CCABD; --teal-soft:#1D3A42;
  --award-bg:#3A3016; --award-fg:#F7CD6B; --danger:#FF8A7A; color-scheme:dark }

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0}
img{max-width:100%}
[hidden]{display:none!important}
footer .copy{display:block;margin-top:8px}
body{background:var(--bg);color:var(--ink);font-family:var(--body);font-size:15px;line-height:1.5}
.wrap{max-width:1180px;margin:0 auto;padding-left:max(16px, env(safe-area-inset-left, 0px));padding-right:max(16px, env(safe-area-inset-right, 0px));padding-block:20px 48px;display:flex;flex-direction:column;gap:24px}

main{display:flex;flex-direction:column;gap:24px}
header{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.brand{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap}
.brand h1{font-family:var(--display);font-weight:800;font-size:clamp(28px,5vw,40px);letter-spacing:-0.02em;margin:0;line-height:1}
.brand h1 span{color:var(--accent)}
.brand p{margin:0;color:var(--muted)}
.lang{display:flex;border:1px solid var(--line);border-radius:999px;padding:3px;background:var(--surface)}
.lang button{font:600 13px/1 var(--body);border:0;background:none;color:var(--muted);padding:7px 12px;border-radius:999px;cursor:pointer}
.lang button[aria-pressed="true"]{background:var(--ink);color:var(--bg)}

.modes{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.mode{display:flex;flex-direction:column;align-items:flex-start;gap:4px;text-align:left;cursor:pointer;
  border:2px solid var(--line);background:var(--surface);color:var(--ink);border-radius:16px;padding:16px 20px;font:inherit;transition:border-color .15s}
.mode:hover{border-color:var(--muted)}
.mode b{font-family:var(--display);font-weight:800;font-size:clamp(22px,4vw,30px);letter-spacing:-0.01em;line-height:1.1}
.mode small{color:var(--muted);font-size:14px}
.mode[aria-pressed="true"]{border-color:var(--accent);background:var(--accent);color:var(--accent-ink)}
.mode[aria-pressed="true"] small{color:var(--accent-ink);opacity:.75}

.layout{display:grid;grid-template-columns:330px minmax(0,1fr);gap:24px;align-items:start}
@media (max-width:860px){ .layout{grid-template-columns:minmax(0,1fr)} }

.panel{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:20px;display:flex;flex-direction:column;gap:20px;position:sticky;top:calc(16px + env(safe-area-inset-top, 0px))}
@media (max-width:860px){ .panel{position:static} }
.field{display:flex;flex-direction:column;gap:8px;border:0;margin:0;padding:0;min-width:0}
.field legend, .field .lbl{font:600 12px/1.2 var(--body);text-transform:uppercase;letter-spacing:.08em;color:var(--muted);padding:0;margin-bottom:8px}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chip{font:500 14px/1 var(--body);border:1px solid transparent;background:var(--chip);color:var(--ink);padding:9px 12px;border-radius:999px;cursor:pointer}
.chip:hover{border-color:var(--muted)}
.chip[aria-pressed="true"]{background:var(--ink);color:var(--bg)}
.hint{font-size:12.5px;color:var(--muted);margin:0}
.hint.solo{background:var(--teal-soft);color:var(--teal);padding:8px 10px;border-radius:8px;font-weight:500}

.stepper{display:flex;align-items:center;gap:10px}
.stepper button{width:40px;height:40px;border-radius:12px;border:1px solid var(--line);background:var(--chip);color:var(--ink);font:600 20px/1 var(--body);cursor:pointer}
.stepper button:disabled{opacity:.4;cursor:default}
.stepper output{font-family:var(--display);font-weight:800;font-size:30px;min-width:2ch;text-align:center;font-variant-numeric:tabular-nums}
.stepper span{color:var(--muted)}
.toggles{display:flex;flex-direction:column;gap:10px}
.toggle{display:flex;align-items:center;gap:10px;cursor:pointer;font-weight:500}
.toggle input{width:20px;height:20px;accent-color:var(--teal)}

button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,a:focus-visible{outline:3px solid var(--teal);outline-offset:2px}

.results{display:flex;flex-direction:column;gap:16px;min-width:0}
.rhead{display:flex;justify-content:space-between;align-items:baseline;gap:12px;flex-wrap:wrap}
.rhead h2, .sug h2{font-family:var(--display);font-weight:800;font-size:24px;margin:0;letter-spacing:-0.01em;text-wrap:balance}
.rhead p{margin:0;color:var(--muted);font-size:14px}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:14px}

.card{background:var(--surface);border:1px solid var(--line);border-radius:14px;overflow:hidden;display:flex;flex-direction:column;min-width:0}
.card.featured{grid-column:1/-1;flex-direction:row;border-color:var(--accent);border-width:2px}
@media (max-width:620px){ .card.featured{flex-direction:column} }
.poster{--h:220;position:relative;background:linear-gradient(150deg,hsl(var(--h) 55% 40%),hsl(calc(var(--h) + 40) 60% 26%));color:#fff;padding:14px 16px;min-height:120px;display:flex;flex-direction:column;justify-content:space-between;gap:10px}
.featured .poster{width:38%;min-height:200px;flex-shrink:0}
@media (max-width:620px){ .featured .poster{width:auto;min-height:150px} }
.poster.ticket::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:10px;
  background:radial-gradient(circle at 8px 10px, var(--surface) 5px, transparent 5.5px) 0 0/16px 10px repeat-x}
.featured .poster.ticket::after{left:auto;top:0;bottom:0;right:-1px;width:10px;height:auto;
  background:radial-gradient(circle at 10px 8px, var(--surface) 5px, transparent 5.5px) 0 0/10px 16px repeat-y}
@media (max-width:620px){ .featured .poster.ticket::after{left:0;right:0;top:auto;bottom:-1px;height:10px;width:auto;
  background:radial-gradient(circle at 8px 10px, var(--surface) 5px, transparent 5.5px) 0 0/16px 10px repeat-x} }
.pk{font:500 11px/1 var(--mono);letter-spacing:.12em;text-transform:uppercase;opacity:.85;display:flex;justify-content:space-between;gap:8px}
.pt{font-family:var(--display);font-weight:800;font-size:22px;line-height:1.05;letter-spacing:-0.01em;text-wrap:balance}
.featured .pt{font-size:clamp(26px,4vw,38px)}
.badge{align-self:flex-start;font:500 12px/1 var(--mono);background:rgba(255,255,255,.18);border:1px solid rgba(255,255,255,.35);padding:6px 9px;border-radius:6px}

.cbody{padding:14px 16px 16px;display:flex;flex-direction:column;gap:8px;flex:1;min-width:0}
.featured .cbody{padding:20px 22px;gap:10px;justify-content:center}
.pick{font:600 12px/1 var(--body);text-transform:uppercase;letter-spacing:.1em;color:var(--teal)}
.ctop{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.ctop h3{margin:0;font-size:17px;font-weight:600;line-height:1.25}
.featured .ctop h3{font-size:20px}
.match{flex-shrink:0;font:500 13px/1 var(--mono);color:var(--teal);background:var(--teal-soft);padding:6px 8px;border-radius:6px;font-variant-numeric:tabular-nums}
.sub{margin:0;color:var(--muted);font-size:13px}
.blurb{margin:0;font-size:14.5px;max-width:65ch}
.award{align-self:flex-start;display:inline-flex;align-items:center;gap:6px;font:600 12.5px/1.3 var(--body);background:var(--award-bg);color:var(--award-fg);padding:5px 9px;border-radius:6px}
.award svg{flex-shrink:0}
.tags{list-style:none;margin:2px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:6px}
.tags li{font-size:12.5px;padding:4px 8px;border-radius:6px;background:var(--chip);color:var(--ink)}
.tags li.hit{background:var(--teal-soft);color:var(--teal);font-weight:600}
.stores{margin:2px 0 0;display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;font-size:13px}
.stores span{color:var(--muted)}
.stores a{font-weight:600;color:var(--teal);text-decoration:none}
.stores a:hover{text-decoration:underline}

.empty{background:var(--surface);border:1px dashed var(--line);border-radius:14px;padding:28px;text-align:left}
.empty h3{margin:0 0 6px;font-family:var(--display);font-weight:800;font-size:20px}
.empty p{margin:0;color:var(--muted)}

/* live (TMDB) results */
.grid.tgrid{grid-template-columns:repeat(auto-fill,minmax(300px,1fr))}
.card.tcard{flex-direction:row}
.tposter{flex:0 0 104px;width:104px;aspect-ratio:2/3;object-fit:cover;background:var(--chip);display:block;align-self:flex-start}
.featured .tposter{flex-basis:180px;width:180px}
@media (max-width:620px){ .card.featured.tcard{flex-direction:row} .featured .tposter{flex-basis:120px;width:120px} }
.clamp{display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
.streams{margin:0;display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:13px}
.streams span{color:var(--muted);margin-right:2px}
.streams img{width:24px;height:24px;border-radius:6px;display:block}
.streams b{font-weight:600}
.streams.none{color:var(--muted)}
.more{font-size:13px;font-weight:600;color:var(--teal);text-decoration:none;align-self:flex-start}
.more:hover{text-decoration:underline}
.chip.logo{display:inline-flex;align-items:center;gap:7px;padding:5px 12px 5px 5px}
.chip.logo img{width:22px;height:22px;border-radius:5px;display:block}
.note{margin:0;font-size:13.5px;color:var(--muted)}
.skel .sk{background:var(--chip);border-radius:6px;height:12px}
.skel .sk.t{height:18px;width:70%}
.skel .sk.s{width:40%}
@media (prefers-reduced-motion: no-preference){ .skel{animation:pulse 1.2s ease-in-out infinite alternate} }
@keyframes pulse{from{opacity:1}to{opacity:.55}}

footer{border-top:1px solid var(--line);padding-top:16px;color:var(--muted);font-size:13.5px;max-width:80ch}
footer b{color:var(--ink)}
@media (prefers-reduced-motion: reduce){ *{transition:none!important} }
