:root {
  --ink: #f3ead7;
  --bg: #141019;
  --panel: #1f1a26;
  --panel-2: #221b29;
  --line: #3a3144;
  --muted: #8d8399;
  --soft: #c9bfa9;
  --gold: #ffd23f;
  --teal: #7ee8e0;
  --orange: #ff7a1a;
  --pumpkin: #ff7518;
  --card: #ffa903;
  --navy: #0b2a6f;
  --blood: #b3000c;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { overflow-x: hidden; }
a { color: var(--teal); }
a:hover { color: #b8fff9; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
button { font: inherit; }

/* The layout is designed at 1280px and scaled down to fit smaller screens (see app.js). */
#fit { overflow: hidden; }
#stage { width: 1280px; margin: 0 auto; transform-origin: top left; }
.page {
  width: 1280px;
  background-color: var(--bg);
  background-image: radial-gradient(rgba(255,255,255,.035) 1px, transparent 1.5px);
  background-size: 7px 7px;
  color: var(--ink);
  font-family: 'Space Mono', monospace;
  padding: 44px 56px 36px;
}

.top { display: flex; gap: 40px; align-items: stretch; }
.left { width: 568px; flex-shrink: 0; display: flex; flex-direction: column; gap: 28px; }
.right { flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 8px 0 30px; }

.web { position: absolute; pointer-events: none; }
.flip { transform: scaleX(-1); }

/* Special screenings */
.screenings { position: relative; background: var(--panel-2); border: 2px solid var(--line); border-radius: 12px; padding: 20px 28px 26px; display: flex; flex-direction: column; gap: 16px; overflow: hidden; }
.screenings h2 { margin: 0; font-family: Anton, sans-serif; font-weight: 400; font-size: 30px; letter-spacing: 3px; color: var(--gold); }
.picks { display: flex; gap: 44px; justify-content: center; }
.pick { display: flex; flex-direction: column; align-items: center; }
.pick-btn { position: relative; width: 214px; height: 318px; padding: 8px; border: 0; border-radius: 6px; background: #0d0b10; cursor: pointer; transition: transform .25s ease, box-shadow .25s ease; box-shadow: 0 10px 18px rgba(0,0,0,.55), inset 0 0 0 2px var(--line); }
.pick-btn.sel { transform: translateY(-12px); box-shadow: 0 24px 26px rgba(0,0,0,.7), 0 0 34px rgba(255,226,160,.4), inset 0 0 0 2px var(--gold); }
.pick-btn img { width: 198px; height: 297px; object-fit: cover; border-radius: 3px; display: block; }
.pick-btn.watched img { opacity: .4; }
.night { position: absolute; top: -8px; left: -8px; background: var(--gold); color: var(--bg); font-weight: 700; font-size: 12px; letter-spacing: 2px; padding: 4px 10px; transform: rotate(-6deg); box-shadow: 0 2px 0 rgba(0,0,0,.4); }
.date { margin-top: -12px; background: var(--gold); color: var(--bg); padding: 7px 18px; border-radius: 3px; transform: rotate(-3deg); box-shadow: 0 4px 0 rgba(0,0,0,.35); font-family: Anton, sans-serif; font-size: 22px; letter-spacing: 2px; line-height: 1.1; }
.sticker { position: absolute; z-index: 3; border-radius: 50%; background: var(--orange); color: var(--bg); display: none; align-items: center; justify-content: center; text-align: center; font-weight: 700; line-height: 1.1; transform: rotate(-14deg); box-shadow: 0 2px 0 rgba(0,0,0,.4); }
.watched > .sticker { display: flex; }
.pick-btn .sticker { top: 110px; left: 50%; margin-left: -50px; width: 100px; height: 100px; font-size: 14px; line-height: 1.15; box-shadow: 0 3px 0 rgba(0,0,0,.4); }

/* Wood and shelves */
.wood { position: relative; background-color: #3b2718; background-image: repeating-linear-gradient(90deg, rgba(0,0,0,.14) 0 2px, transparent 2px 7px, rgba(255,255,255,.03) 7px 8px, transparent 8px 19px); }
.hutch { border-radius: 8px 8px 0 0; padding: 24px 20px 0 32px; }
.unit { border-radius: 0 8px 4px 4px; padding: 30px 32px 22px; box-shadow: 0 20px 40px rgba(0,0,0,.6); }
.bay { height: 330px; background-color: #1a120c; background-image: radial-gradient(ellipse at 50% 0%, rgba(220,205,180,.07), transparent 70%), repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 132px); display: flex; align-items: flex-end; overflow: hidden; padding: 0 16px; }
.hutch .bay { gap: 8px; }
.unit .bay { gap: 5px; }
.plank { height: 26px; background-color: #6e4a2c; background-image: linear-gradient(rgba(220,205,180,.45), rgba(220,205,180,.45)), repeating-linear-gradient(0deg, rgba(0,0,0,.12) 0 1px, transparent 1px 5px); background-size: 100% 3px, 100% 100%; background-repeat: no-repeat, repeat; box-shadow: 0 10px 14px rgba(0,0,0,.55); border-radius: 2px; }
.gap { height: 18px; }
.jack { margin-left: auto; margin-right: 6px; flex-shrink: 0; filter: drop-shadow(0 6px 6px rgba(0,0,0,.55)) drop-shadow(0 0 14px rgba(255,150,40,.35)); }

/* Tapes */
.tape { position: relative; flex-shrink: 0; padding: 0; border: 0; border-radius: 3px; background: transparent; cursor: pointer; overflow: visible; transition: transform .25s ease, filter .25s ease, box-shadow .25s ease; box-shadow: inset -6px 0 0 rgba(0,0,0,.25), inset 5px 0 0 rgba(255,255,255,.07), 4px 0 8px rgba(0,0,0,.45); }
.tape img { display: block; border-radius: 3px; }
.tape.watched img { opacity: .35; }
.tape .sticker { top: 118px; width: 56px; height: 56px; font-size: 9px; }
.has-sel .tape { filter: brightness(.62) saturate(.85); }
/* Raising the selected tape above its neighbours lets its light cone (z-index -1 inside it) fall across the tapes on both sides while staying behind the lit tape itself. */
.has-sel .tape.sel { z-index: 1; filter: brightness(1.12); transform: translateY(-18px); box-shadow: 0 22px 18px rgba(0,0,0,.65), 0 0 26px rgba(255,226,160,.35); }
.cone { display: none; position: absolute; bottom: -4px; left: 50%; width: 190px; margin-left: -95px; height: 360px; z-index: -1; pointer-events: none; background: linear-gradient(to bottom, rgba(255,226,160,.34), rgba(255,226,160,.08)); clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%); }
.tape.sel .cone { display: block; }

/* Title, logo, member card */
.title { margin: 0; align-self: stretch; text-align: center; font-family: Creepster, cursive; font-weight: 400; font-size: 64px; line-height: 1; letter-spacing: 2px; color: var(--pumpkin); text-shadow: 0 0 14px rgba(255,117,24,.55), 0 4px 0 #3a1406; }
.logo { width: 560px; height: auto; display: block; filter: drop-shadow(0 10px 18px rgba(0,0,0,.45)); }
.card { width: 500px; height: 312px; border-radius: 18px; background-color: var(--card); background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.14) 0 10px, transparent 10px 20px); box-shadow: 0 16px 30px rgba(0,0,0,.6), inset 0 0 0 3px rgba(255,255,255,.12); padding: 22px 26px; display: flex; flex-direction: column; gap: 12px; transform: rotate(-2deg); color: var(--navy); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card-head img { width: 140px; height: auto; display: block; margin: -8px 0 -8px -8px; }
.card-head .label { flex-grow: 1; text-align: center; font-family: Anton, sans-serif; font-size: 22px; letter-spacing: 3px; line-height: 1; }
.count { background: var(--navy); color: var(--card); font-family: Anton, sans-serif; font-size: 22px; padding: 4px 10px; border-radius: 6px; line-height: 1; }
.cult { font-size: 13px; letter-spacing: 5px; font-weight: 700; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; font-size: 13px; }
.fields .k { opacity: .8; }
.fields b { letter-spacing: 1px; }
.member { display: flex; align-items: center; gap: 6px; white-space: nowrap; min-height: 28px; }
.member b { text-transform: uppercase; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 28px; height: 28px; flex-shrink: 0; padding: 0; border: 0; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.edit-btn { background: rgba(11,42,111,.14); color: var(--navy); }
.save-btn { background: var(--navy); color: var(--card); }
.member input { width: 118px; height: 26px; padding: 0 6px; border: 2px solid var(--navy); border-radius: 5px; background: #fff4e6; color: var(--navy); font-family: 'Space Mono', monospace; font-weight: 700; font-size: 12px; text-transform: uppercase; }
.punch { background: var(--ink); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.punch .cap { color: var(--bg); font-size: 11px; font-weight: 700; letter-spacing: 2px; }
.punch-row { display: flex; align-items: center; gap: 10px; }
.holes { flex-grow: 1; display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 5px; }
.hole, .last { aspect-ratio: 1; border-radius: 50%; border: 1.5px solid var(--navy); }
.hole.on, .last.on { background: var(--bg); box-shadow: inset 0 2px 2px rgba(0,0,0,.6); }
.last { width: 24px; height: 24px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #767676; }
.last.on { color: #8d8d8d; }

/* Details panel */
.details { position: relative; margin-top: 40px; background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 28px 36px 32px; display: flex; gap: 32px; align-items: flex-start; overflow: hidden; }
.round { flex-shrink: 0; width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--line); background: #0d0b10; color: var(--gold); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; box-shadow: 0 4px 0 rgba(0,0,0,.4); align-self: flex-start; margin-top: 176px; }
.close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: #0d0b10; color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.poster-col { width: 270px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.poster-col img { width: 270px; height: 405px; object-fit: cover; display: block; border-radius: 4px; box-shadow: 0 14px 26px rgba(0,0,0,.6), 0 0 0 2px var(--line); }
.film-title { font-family: Anton, sans-serif; line-height: 1.05; letter-spacing: 1px; text-transform: uppercase; color: var(--ink); white-space: pre-line; text-align: center; margin: 0; font-weight: 400; }
.film-year { font-size: 16px; font-weight: 700; letter-spacing: 3px; color: var(--gold); text-align: center; margin-top: 4px; }
.info { flex-grow: 1; display: flex; flex-direction: column; gap: 22px; padding-top: 6px; }
.synopsis { margin: 0; max-width: 680px; font-size: 17px; line-height: 1.65; color: #e8dcc2; }
.stream h3 { margin: 0 0 12px; font-family: Anton, sans-serif; font-weight: 400; font-size: 22px; letter-spacing: 3px; color: var(--teal); }
.groups { display: flex; flex-direction: column; gap: 14px; }
.glabel { font-size: 12px; font-weight: 700; letter-spacing: 3px; color: var(--soft); margin-bottom: 8px; }
.tiles { display: flex; flex-wrap: wrap; gap: 10px; }
.tile { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 14px 6px 8px; background: #0d0b10; border: 2px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); }
.tile:hover { border-color: var(--teal); color: var(--ink); }
.mono { width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-family: Anton, sans-serif; font-size: 16px; }
.mono.logo { display: block; object-fit: cover; box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.tname { display: block; font-size: 14px; font-weight: 700; letter-spacing: .5px; }
.tprice { display: block; font-size: 12px; color: var(--soft); }
.note { font-size: 12px; color: var(--muted); }
.note a { color: var(--soft); }
.empty-msg { font-size: 14px; color: var(--muted); }
.watch-btn { align-self: flex-start; margin-top: 4px; min-height: 48px; padding: 10px 22px; border: 0; border-radius: 8px; background: var(--orange); color: var(--bg); font-family: 'Space Mono', monospace; font-weight: 700; font-size: 14px; letter-spacing: 2px; cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,.4); }
.watch-btn.done { background: var(--teal); }
.prompt { flex-grow: 1; min-height: 405px; display: flex; align-items: center; justify-content: center; text-align: center; font-family: Anton, sans-serif; font-size: 44px; line-height: 1.2; letter-spacing: 2px; color: var(--ink); }
.prompt span { font-family: Creepster, cursive; font-size: 58px; letter-spacing: 3px; color: var(--blood); text-shadow: 0 0 12px rgba(179,0,12,.55), 0 3px 0 #3a0004; }

footer { margin-top: 22px; text-align: center; font-size: 13px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) {
  .tape, .pick-btn { transition: none; }
}

/* ---------- Comments ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 4px; }
.actions .watch-btn { margin-top: 0; }
.comments-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 20px; border: 2px solid var(--line); border-radius: 8px; background: #0d0b10; color: var(--ink); font-family: 'Space Mono', monospace; font-weight: 700; font-size: 14px; letter-spacing: 2px; cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,.4); }
.comments-btn svg { color: var(--teal); }
.comments-btn:hover { border-color: var(--teal); }

body.drawer-open { overflow: hidden; }
.drawer[hidden], .scrim[hidden] { display: none; }
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(8,6,12,.62); opacity: 0; transition: opacity .25s ease; }
.scrim.open { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(460px, 100vw); display: flex; flex-direction: column; background: var(--panel); border-left: 2px solid var(--line); box-shadow: -18px 0 40px rgba(0,0,0,.6); color: var(--ink); font-family: 'Space Mono', monospace; transform: translateX(100%); transition: transform .25s ease; }
.drawer.open { transform: translateX(0); }
.dr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 22px 22px 14px; border-bottom: 2px solid var(--line); background-image: radial-gradient(rgba(255,255,255,.035) 1px, transparent 1.5px); background-size: 7px 7px; }
.dr-kicker { font-size: 12px; font-weight: 700; letter-spacing: 3px; color: var(--teal); }
.dr-title { margin: 4px 0 0; font-family: Anton, sans-serif; font-weight: 400; font-size: 28px; line-height: 1.05; letter-spacing: 1px; text-transform: uppercase; }
.dr-close { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: #0d0b10; color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.dr-toggle, .cm-spoil { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--soft); cursor: pointer; }
.dr-toggle { padding: 10px 22px; border-bottom: 1px solid var(--line); }
.dr-toggle input, .cm-spoil input { width: 18px; height: 18px; accent-color: var(--orange); }
.dr-body { flex: 1; overflow-y: auto; padding: 18px 22px 8px; }
.cm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.cm-empty { color: var(--muted); font-size: 14px; line-height: 1.6; padding: 12px 0; }

/* Each comment is a hand-lettered "shelf talker" card, like a staff pick taped to the shelf. */
.cm-card { position: relative; background: var(--ink); color: var(--bg); border-radius: 4px; padding: 14px 16px 12px; box-shadow: 0 6px 0 rgba(0,0,0,.35); transform: rotate(-.6deg); }
.cm-card:focus { outline: 3px solid var(--teal); outline-offset: 3px; }
.cm-card.tilt-b { transform: rotate(.5deg); }
.cm-card::before { content: ""; position: absolute; top: -8px; left: 50%; width: 64px; height: 16px; margin-left: -32px; background: rgba(255,210,63,.55); transform: rotate(-3deg); }
.cm-meta { display: flex; align-items: baseline; gap: 8px; }
.cm-who { font-family: 'Permanent Marker', cursive; font-size: 19px; line-height: 1.1; color: var(--blood); overflow-wrap: anywhere; }
.cm-you { font-size: 10px; font-weight: 700; letter-spacing: 2px; background: var(--navy); color: var(--card); padding: 2px 6px; border-radius: 3px; }
.cm-meta time { margin-left: auto; font-size: 12px; color: #5c5566; white-space: nowrap; }
.cm-tag { display: inline-block; margin-top: 6px; font-size: 10px; font-weight: 700; letter-spacing: 2px; background: var(--blood); color: #fff; padding: 2px 6px; border-radius: 3px; }
.cm-textwrap { position: relative; margin-top: 6px; }
.cm-body { margin: 0; font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.cm-textwrap.blurred .cm-body { filter: blur(6px); user-select: none; }
.cm-reveal { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(243,234,215,.35); color: var(--bg); font-family: 'Space Mono', monospace; font-weight: 700; font-size: 13px; letter-spacing: 1px; cursor: pointer; }
.cm-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.cm-del, .cm-confirm button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 10px; border: 1.5px solid #b9ae98; border-radius: 6px; background: transparent; color: #5c5566; font-family: 'Space Mono', monospace; font-size: 12px; font-weight: 700; cursor: pointer; }
.cm-del:hover, .cm-confirm button:hover { border-color: var(--blood); color: var(--blood); }
.cm-confirm { font-size: 12px; font-weight: 700; color: var(--blood); display: inline-flex; align-items: center; gap: 6px; }

.cm-form { border-top: 2px solid var(--line); padding: 14px 22px 20px; display: flex; flex-direction: column; gap: 6px; background: #1a1520; }
.cm-label { font-size: 11px; font-weight: 700; letter-spacing: 3px; color: var(--soft); margin-top: 4px; }
.cm-input { width: 100%; padding: 10px 12px; border: 2px solid var(--line); border-radius: 6px; background: #0d0b10; color: var(--ink); font-family: 'Space Mono', monospace; font-size: 14px; }
.cm-input:focus { border-color: var(--teal); outline: none; }
.cm-text { resize: vertical; min-height: 72px; line-height: 1.5; }
.cm-row { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.cm-count { font-size: 12px; color: var(--muted); }
.cm-error { margin: 0; min-height: 1em; font-size: 13px; color: #ff8a80; }
.cm-post { align-self: flex-start; min-height: 46px; padding: 10px 22px; border: 0; border-radius: 8px; background: var(--orange); color: var(--bg); font-family: 'Space Mono', monospace; font-weight: 700; font-size: 14px; letter-spacing: 2px; cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,.4); }
.cm-post:disabled { opacity: .6; cursor: default; }
.cm-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .drawer, .scrim { transition: none; }
}

/* ---------- Skull ratings ---------- */
.rating { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 4px; }
.skulls { display: flex; gap: 4px; }
.skull { position: relative; width: 36px; height: 36px; padding: 4px; border: 0; background: transparent; display: inline-block; line-height: 0; }
button.skull { cursor: pointer; border-radius: 6px; }
.sk-base, .sk-fill { position: absolute; top: 4px; left: 4px; height: 28px; overflow: hidden; }
.sk-base { width: 28px; color: #3a3144; }
.sk-fill { color: #e8dcc2; }
.skull svg { display: block; width: 28px; height: 28px; }
.skull .eye { fill: var(--panel); }
.skull .teeth { stroke: var(--panel); stroke-width: 1.4; stroke-linecap: round; }
.rating.mine .sk-fill { color: var(--orange); }
/* Hover/focus preview: light the skulls up to the one under the pointer. */
.can-rate .skull.hot .sk-fill { width: 100% !important; color: var(--orange); }
.can-rate .skulls:has(.hot) .skull:not(.hot) .sk-fill { width: 0 !important; }
.rt-note { font-size: 13px; line-height: 1.4; color: var(--soft); text-align: center; }
.rt-note b { color: var(--ink); }
.rt-hint { font-size: 12px; color: var(--muted); }
.rt-err { color: #ff8a80; }
