/* ===== Theme: Projected Dust. All colours and fonts live here. ===== */
:root {
  --bg: #0b0907;            /* dark auditorium */
  --bg-raised: #17130f;     /* cards */
  --bg-raised-2: #211b15;
  --line: #2e261d;
  --text: #f3eadb;          /* warm screen white */
  --text-dim: #b3a48e;
  --beam: #ffd9a0;          /* projector light */
  --amber: #f5b85a;         /* stars, primary accent */
  --pink: #d91a5d;          /* festival brand */
  --blue: #9cdcf8;          /* festival brand, links */
  --font-display: "Source Sans 3", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  --gutter: 16px;
}


/* Source Sans 3 (SIL Open Font License, see fonts/OFL.txt). One variable file per script range, weights 400-900. */
@font-face { font-family: "Source Sans 3"; src: url("fonts/source-sans-3-latin-ext.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Sans 3"; src: url("fonts/source-sans-3-latin.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--text);
  font: 18px/1.45 var(--font-body);
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--blue); }

/* ----- Atmosphere ----- */
.beam {
  position: fixed; inset: -20% -40% auto -40%; height: 95vh; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 28% 9% at 78% 0%, rgba(255,230,185,.55), transparent 70%),
    conic-gradient(from 196deg at 78% -4%, transparent 0deg, rgba(255,217,160,.20) 10deg, rgba(255,217,160,.09) 26deg, transparent 38deg);
  filter: blur(14px);
  animation: shutter 1s steps(24) infinite;
}
@keyframes shutter {            /* 24 steps a second, barely-there flicker */
  0%, 100% { opacity: .96 } 13% { opacity: 1 } 29% { opacity: .93 }
  46% { opacity: .99 } 63% { opacity: .94 } 79% { opacity: 1 }
}
#dust { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.grain {
  position: fixed; inset: -50%; z-index: 3; pointer-events: none; opacity: .09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain .5s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0,0) } 20% { transform: translate(-3%,2%) } 40% { transform: translate(2%,-4%) }
  60% { transform: translate(-2%,3%) } 80% { transform: translate(4%,1%) } 100% { transform: translate(0,0) }
}
@media (prefers-reduced-motion: reduce) {
  .beam, .grain { animation: none; }
  #dust { display: none; }
}

/* ----- Layout ----- */
.top, main, .foot { position: relative; z-index: 2; max-width: 640px; margin: 0 auto; padding: 0 var(--gutter); }
.top { padding-top: 28px; }
.kicker { margin: 0 0 6px; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--amber); }
h1 { margin: 0 0 20px; font: 700 31px/1.1 var(--font-display); text-wrap: balance; text-shadow: 0 0 28px rgba(255,217,160,.35); }

.tabs { display: flex; gap: 8px; padding: 4px; background: rgba(23,19,15,.85); border: 1px solid var(--line); border-radius: 999px; }
.tabs[hidden] { display: none; }
.tabs button { flex: 1; min-height: 48px; border: 0; border-radius: 999px; background: none; font-weight: 600; color: var(--text-dim); }
.tabs button[aria-selected="true"] { background: var(--beam); color: #1a1208; }

main { padding-top: 20px; padding-bottom: 24px; }

/* ----- Rating card ----- */
.rate {
  margin-bottom: 24px; padding: 18px; border-radius: var(--radius);
  background: linear-gradient(160deg, #2a2014, var(--bg-raised) 70%);
  border: 1px solid rgba(245,184,90,.45); box-shadow: 0 0 40px rgba(245,184,90,.10);
}
.rate .label { margin: 0; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.rate h2 { margin: 4px 0 12px; font: 600 24px/1.2 var(--font-display); }
.stars { display: flex; gap: 4px; }
.stars button { flex: 1; min-height: 56px; border: 0; background: none; font-size: 38px; line-height: 1; color: #5a4c3a; padding: 0; }
.stars button.on { color: var(--amber); text-shadow: 0 0 18px rgba(245,184,90,.6); }
.btn {
  display: block; width: 100%; min-height: 54px; margin-top: 12px; border: 0; border-radius: 12px;
  background: var(--amber); color: #1a1208; font-weight: 700; font-size: 18px;
}
.btn[hidden] { display: none; }
.btn.ghost { background: none; border: 1px solid var(--line); color: var(--text); }
.thanks { margin: 0; font-size: 20px; }

/* ----- Program ----- */
.day { margin: 26px 0 10px; font: 600 22px/1.2 var(--font-display); color: var(--beam); display: flex; align-items: baseline; gap: 10px; }
.day:first-child { margin-top: 0; }
.day .chip { font: 700 12px var(--font-body); letter-spacing: .1em; text-transform: uppercase; background: var(--pink); color: #fff; padding: 4px 9px; border-radius: 999px; }

.row {
  display: grid; grid-template-columns: 62px 1fr 64px; gap: 12px; align-items: center;
  width: 100%; margin-bottom: 10px; padding: 12px; text-align: left;
  background: rgba(23,19,15,.88); border: 1px solid var(--line); border-radius: var(--radius);
}
.row:active { background: var(--bg-raised-2); }
.row .time { font: 700 24px/1 var(--font-display); color: var(--beam); font-variant-numeric: tabular-nums; }
.row .title { display: block; font-weight: 700; font-size: 19px; line-height: 1.2; }
.row .meta { display: block; margin-top: 3px; font-size: 15px; color: var(--text-dim); }
.row .note { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--amber); border: 1px solid rgba(245,184,90,.4); border-radius: 999px; padding: 2px 9px; }
.row img, .card img { width: 64px; aspect-ratio: 2/3; object-fit: cover; border-radius: 6px; background: var(--bg-raised-2); box-shadow: 0 4px 14px rgba(0,0,0,.6); }
.done { font-size: 13px; color: var(--text-dim); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; margin-left: 6px; font-weight: 400; white-space: nowrap; }
.empty { text-align: center; padding: 60px 0; font: 600 24px var(--font-display); color: var(--beam); }

/* ----- Film grid ----- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.card { padding: 0; border: 0; background: none; text-align: left; }
.card img { width: 100%; border-radius: 10px; }
.card .title { display: block; margin-top: 8px; font-weight: 700; font-size: 17px; line-height: 1.2; }
.card .meta { display: block; font-size: 14px; color: var(--text-dim); }
.card .done { margin: 6px 0 0; display: inline-block; }

/* ----- Film detail ----- */
.back { min-height: 54px; padding: 0 22px; margin-bottom: 18px; border-radius: 999px; border: 1px solid var(--beam); background: rgba(23,19,15,.9); color: var(--beam); font-weight: 700; font-size: 19px; }
.zoom { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(0,0,0,.92); cursor: zoom-out; }
.zoom img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 0 60px rgba(255,217,160,.18); }
.detail .poster { display: block; cursor: zoom-in; width: min(70%, 300px); margin: 0 auto 20px; border-radius: 10px; box-shadow: 0 0 60px rgba(255,217,160,.18), 0 12px 30px rgba(0,0,0,.7); }
.detail h2 { margin: 0 0 4px; font: 600 30px/1.1 var(--font-display); text-wrap: balance; }
.detail .sub { margin: 0 0 16px; color: var(--text-dim); }
.detail dl { margin: 0 0 18px; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 16px; }
.detail dt { color: var(--amber); }
.detail dd { margin: 0; }
.detail .syn { margin: 0 0 18px; }
.detail h3 { margin: 22px 0 10px; font: 600 20px var(--font-display); color: var(--beam); }
.detail .scr { padding: 12px 14px; margin-bottom: 8px; background: rgba(23,19,15,.88); border: 1px solid var(--line); border-radius: 12px; }
a.btn { display: flex; align-items: center; justify-content: center; text-decoration: none; }

/* ----- Footer ----- */
.foot { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; padding-top: 18px; padding-bottom: 40px; border-top: 1px solid var(--line); }
.foot a { font-size: 15px; color: var(--text-dim); padding: 10px 0; }

/* ----- Forms, prompts, pages ----- */
.field {
  display: block; width: 100%; min-height: 54px; margin: 12px 0; padding: 0 14px;
  font: inherit; color: var(--text); background: #0f0c09; border: 1px solid #5a4c3a; border-radius: 12px;
}
.field:focus { outline: 2px solid var(--amber); outline-offset: 1px; }
.check { display: flex; gap: 12px; align-items: center; min-height: 48px; font-size: 16px; }
.check input { width: 26px; height: 26px; flex: none; accent-color: var(--amber); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn.alt { background: var(--bg-raised-2); color: var(--text); border: 1px solid #5a4c3a; }   /* equal weight to .btn */
.btn.danger { background: none; border: 1px solid var(--pink); color: #ff7aa5; }
.btn:disabled { opacity: .5; }
.msg { margin: 10px 0 0; color: #ffb38a; font-size: 16px; }
.sub { margin: 6px 0 0; color: var(--text-dim); font-size: 16px; }
.ask { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 16px; }
.ask p { margin: 0 0 10px; }
.prompt { margin-bottom: 24px; padding: 16px; border-radius: var(--radius); background: rgba(23,19,15,.9); border: 1px solid var(--line); }
.prompt p { margin: 0; }
.page h2 { margin: 0 0 14px; font: 600 28px/1.15 var(--font-display); }
.page h3 { margin: 22px 0 8px; font: 600 20px var(--font-display); color: var(--beam); }
.page p { margin: 0 0 14px; }
.page .state { font-size: 20px; font-weight: 700; }
.page .state.on { color: var(--amber); }
.page .confirm { margin-top: 14px; padding: 14px; border: 1px solid var(--pink); border-radius: 12px; }
.confirm[hidden] { display: none; }
.steps { margin: 0 0 14px; padding-left: 26px; }
.steps li { margin-bottom: 10px; padding-left: 4px; }
.ios-share { display: inline-block; padding: 0 7px; border: 1px solid var(--blue); border-radius: 6px; color: var(--blue); }
.testbadge { display: none; position: fixed; top: 8px; right: 8px; z-index: 9; padding: 6px 12px; border-radius: 999px; background: #e0182d; color: #fff; font: 800 13px var(--font-body); letter-spacing: .1em; text-decoration: none; }
.is-test .testbadge { display: block; }

/* ----- Caps: festival name and every film title ----- */
h1, .row .title, .card .title, .detail h2, .rate h2 { text-transform: uppercase; letter-spacing: .02em; }
h1 { font-size: 28px; }
.row .title { font-size: 18px; }
.card .title { font-size: 16px; }
.detail h2 { font-size: 28px; }
.rate h2 { font-size: 23px; }

/* ----- 10-star rating with half points ----- */
.stars10 { display: flex; padding: 6px 0; touch-action: pan-y; cursor: pointer; user-select: none; -webkit-user-select: none; border-radius: 10px; }
.stars10:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.st { flex: 1; position: relative; text-align: center; font-size: min(8vw, 46px); line-height: 1.2; color: #5a4c3a; pointer-events: none; }
.st::after { content: "★"; position: absolute; inset: 0 auto 0 0; width: var(--f, 0%); overflow: hidden; color: var(--amber); text-shadow: 0 0 14px rgba(245,184,90,.55); }
.scorebar { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; gap: 10px; margin-top: 6px; }
.scorebar button { min-height: 54px; border-radius: 12px; border: 1px solid #5a4c3a; background: var(--bg-raised-2); font-size: 28px; font-weight: 700; line-height: 1; }
.score { text-align: center; color: var(--text-dim); font-size: 17px; }
.score b { font: 700 34px/1 var(--font-display); color: var(--amber); }

/* ----- Welcome popup ----- */
.modal-open { overflow: hidden; }
.welcome { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: max(16px, env(safe-area-inset-top)) var(--gutter) max(16px, env(safe-area-inset-bottom)); background: rgba(0,0,0,.82); }
.welcome-box { width: 100%; max-width: 440px; max-height: 100%; overflow-y: auto; padding: 22px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); box-shadow: 0 0 60px rgba(255,217,160,.15); outline: none; }
.welcome-box h2 { margin: 0 0 14px; font: 600 28px/1.15 var(--font-display); color: var(--beam); }
.welcome-box p { margin: 0 0 14px; }
.welcome-actions { display: grid; gap: 10px; margin: 18px 0 14px; }
.welcome-box .sub { margin: 0; }
.welcome-actions .btn { margin-top: 0; }

/* Raspored + O festivalu tabs */
.tabs { gap: 4px; }
.tabs button { padding: 0 4px; font-size: 14px; white-space: nowrap; }
.sched { margin: 0 -16px; }
.sched .poster-full { display: block; width: 100%; height: auto; cursor: zoom-in; }
.sched .sub { text-align: center; margin: 10px 16px 0; }
.zoom.tall { align-items: flex-start; justify-content: flex-start; overflow: auto; padding: 0; cursor: zoom-out; -webkit-overflow-scrolling: touch; }
.zoom.tall img { max-width: none; max-height: none; width: 220vw; height: auto; border-radius: 0; box-shadow: none; }
