/* Letterboxd-ish: slate night background, blue-grey type, green/orange/blue accents */
:root {
  --bg: #14181c; --bg-2: #1c2228; --panel: #2c3440; --line: #384250; --glyph: #456;
  --text: #9ab; --text-hi: #def; --white: #fff; --muted: #678;
  --green: #00e054; --star: #00c030; --orange: #ff8000; --blue: #40bcf4;
  --thermal: #fbfaf6; --thermal-ink: #35353d;
  --sans: "Inter", "Graphik", system-ui, sans-serif;
  --serif: "Source Serif 4", "Tiempos Headline", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 400 13px/1.45 var(--sans); }
body { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--blue); }

/* ---------- header ---------- */
header {
  position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 20px; background: linear-gradient(var(--bg) 40%, rgba(20,24,28,0)); pointer-events: none;
}
header > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; }
.dots { display: flex; }
.dots i { width: 14px; height: 14px; border-radius: 50%; mix-blend-mode: screen; }
.dots i + i { margin-left: -4px; }
.dots i:nth-child(1) { background: var(--orange); } .dots i:nth-child(2) { background: var(--green); } .dots i:nth-child(3) { background: var(--blue); }
header h1 { margin: 0; font: 700 22px/1 var(--sans); letter-spacing: -.02em; color: var(--white); }
header h1 small { display: block; font: 500 11px/1 var(--sans); letter-spacing: .08em; color: var(--muted); text-transform: uppercase; margin-top: 4px; }
header h1 small b { color: var(--orange); font-weight: 500; }
.count { color: var(--muted); font-size: 12px; }
.controls { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.chip, .switch { background: var(--panel); border-radius: 4px; font-size: 12px; font-weight: 500; letter-spacing: .02em; }
.chip { padding: 7px 11px; color: var(--text-hi); }
.chip:hover { color: var(--white); }
.chip[aria-pressed="true"] { background: var(--green); color: var(--bg); }
.switch { display: flex; gap: 2px; padding: 3px; }
.switch button { padding: 4px 11px; border-radius: 3px; text-transform: uppercase; font-size: 11px; letter-spacing: .08em; }
.switch button:hover { color: var(--text-hi); }
.switch button[aria-pressed="true"] { background: var(--glyph); color: var(--white); }
.tki { width: 14px; height: 10px; vertical-align: -1px; margin-right: 6px; }

main { position: fixed; inset: 0; }
.view { position: absolute; inset: 0; display: none; }
.view.on { display: block; }
.hint { position: fixed; bottom: 14px; left: 20px; color: var(--text); font-size: 11px; z-index: 20; pointer-events: none; background: rgba(20,24,28,.85); padding: 4px 9px; border-radius: 4px; }

/* posters get Letterboxd's hairline inner frame and the green hover ring */
.pf { position: relative; display: block; border-radius: 4px; }
.pf::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(221,238,255,.25); pointer-events: none; transition: box-shadow .12s; }
.pf .poster { display: block; width: 100%; aspect-ratio: 2/3; object-fit: cover; background: var(--panel); border-radius: inherit; }
button:hover > .pf::after, button:focus-visible > .pf::after, .pf.hot::after { box-shadow: inset 0 0 0 3px var(--green); }
button:focus-visible { outline: none; }
.dim { opacity: .12; filter: grayscale(1); pointer-events: none; }

/* ---------- Letterboxd diary month glyph ---------- */
.mglyph { position: relative; width: 63px; height: 54px; flex: none; color: var(--glyph); }
.mglyph svg { position: absolute; inset: 0; fill: currentColor; }
.mglyph b, .mglyph span { position: absolute; left: 0; right: 0; text-align: center; color: var(--text-hi); }
.mglyph b { top: 14px; font: 600 15px/1 var(--sans); letter-spacing: .06em; }
.mglyph span { top: 32px; font: 400 10px/1 var(--sans); color: var(--text); letter-spacing: .04em; }

/* ---------- mesa (table) ---------- */
#table { cursor: grab; touch-action: none; overflow: hidden;
  background-image: radial-gradient(rgba(153,170,187,.09) 1px, transparent 1px); background-size: 24px 24px; }
#table.drag { cursor: grabbing; }
#board { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.card { position: absolute; width: 150px; transition: transform .25s cubic-bezier(.2,.8,.2,1); text-align: left; }
.card .pf { box-shadow: 0 10px 22px -8px rgba(0,0,0,.7); }
.card:hover, .card:focus-visible { transform: rotate(0deg) scale(1.06) !important; z-index: 5; }
.card .stub { position: absolute; width: 72px; right: -30px; bottom: -14px; transform: rotate(9deg); z-index: -1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.6)); transition: transform .25s; }
.card:hover .stub { transform: rotate(16deg) translate(12px, -8px); }
.card .lbl { margin-top: 7px; font-size: 11px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .lbl em { font-style: normal; color: var(--star); letter-spacing: 1px; }
.card .lbl .h { color: var(--orange); }
.month-tag { position: absolute; display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; pointer-events: none; transform: scale(1.5); transform-origin: left top; }
.month-tag small { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; line-height: 1.5; }

/* ---------- rolo (film strip) ---------- */
#strip { overflow-x: auto; overflow-y: hidden; align-items: center; scrollbar-color: var(--glyph) transparent; }
#strip.on { display: flex; }
.reel { display: flex; align-items: stretch; padding: 0 40px; background: #0b0d0f; position: relative; border-block: 1px solid var(--line); }
.reel::before, .reel::after { content: ""; position: absolute; left: 0; right: 0; height: 10px;
  background: repeating-linear-gradient(90deg, transparent 0 9px, var(--bg-2) 9px 21px, transparent 21px 30px); }
.reel::before { top: 10px; } .reel::after { bottom: 10px; }
.frame { width: 168px; margin: 36px 6px; flex: none; text-align: left; }
.frame .pf { transition: transform .2s; }
.frame:hover .pf { transform: translateY(-3px); }
.frame .meta { margin-top: 8px; font-size: 11px; display: flex; justify-content: space-between; color: var(--muted); }
.frame .meta b { color: var(--green); font-weight: 500; }
.gap { flex: none; width: 90px; display: grid; place-items: center; }

/* ---------- calendário ---------- */
#cal { overflow: auto; padding: 90px 20px 40px; scrollbar-color: var(--glyph) transparent; }
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 40px 30px; max-width: 1260px; margin: 0 auto; }
.month header { position: static; padding: 0 0 12px; background: none; gap: 12px; pointer-events: auto; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.month header .n { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.grid7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dow { font-size: 10px; color: var(--muted); text-align: center; padding-bottom: 3px; }
.day { aspect-ratio: 2/3; border-radius: 3px; background: var(--bg-2); position: relative; font-size: 9px; color: var(--muted); padding: 2px 4px; overflow: visible; }
.day.empty { background: none; }
.day.film { padding: 0; }
.day.film .pf { position: absolute; inset: 0; border-radius: 3px; }
.day.film .poster { height: 100%; }
.day .n2 { position: absolute; right: -5px; top: -5px; z-index: 2; background: var(--orange); color: var(--white); border-radius: 99px; padding: 0 5px; font-size: 9px; font-weight: 600; z-index: 1; }
.day .tk { position: absolute; left: 3px; bottom: 3px; margin: 0; color: var(--green); filter: drop-shadow(0 0 2px #000); z-index: 1; }

/* ---------- detail sheet ---------- */
dialog { border: 0; padding: 0; background: transparent; max-width: min(1000px, calc(100vw - 24px)); width: 100%; max-height: calc(100dvh - 24px); overflow: visible; color: var(--text); }
dialog::backdrop { background: rgba(8,10,12,.75); backdrop-filter: blur(4px); }
dialog[open] .sheet { animation: pop .3s cubic-bezier(.2,.9,.25,1.1); }
@keyframes pop { from { transform: translateY(16px) scale(.98); opacity: 0; } }
.sheet { background: var(--bg); border-radius: 8px; max-height: calc(100dvh - 24px); overflow: auto; position: relative; overscroll-behavior: contain; box-shadow: 0 0 0 1px var(--line), 0 30px 60px -20px #000; scrollbar-color: var(--glyph) transparent; }
.sheet .hero { height: 300px; background: var(--panel) center 25%/cover; position: relative; }
/* Letterboxd's backdrop vignette */
.sheet .hero::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--bg) 0, rgba(20,24,28,0) 22%, rgba(20,24,28,0) 78%, var(--bg)), linear-gradient(rgba(20,24,28,0) 35%, var(--bg)); }
.sheet .body { display: grid; grid-template-columns: 200px 1fr; gap: 32px; padding: 0 32px 32px; margin-top: -130px; position: relative; z-index: 1; }
.sheet .body > .pf { align-self: start; box-shadow: 0 14px 30px -10px #000; }
.close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 32px; height: 32px; border-radius: 99px; background: rgba(20,24,28,.75); color: var(--text-hi); font-size: 20px; line-height: 1; }
.close:hover { background: var(--panel); color: var(--white); }
.sheet h2 { margin: 86px 0 0; font: 700 40px/1.05 var(--serif); color: var(--white); letter-spacing: -.01em; }
.sheet h2 .y { font: 400 20px var(--sans); color: var(--text); margin-left: 10px; letter-spacing: 0; }
.sheet .sub { color: var(--text); margin: 8px 0 18px; }
.sheet .sub a { color: var(--text-hi); }
.sheet .when { display: flex; align-items: center; gap: 14px; margin: 0 0 22px; padding: 12px 0; border-block: 1px solid var(--line); color: var(--text-hi); font-size: 14px; }
.sheet .when .mglyph { transform: scale(.85); transform-origin: left center; margin-right: -8px; }
.sheet .when small { display: block; color: var(--muted); font-size: 12px; }
.sheet .when .day-n { font: 700 32px/1 var(--sans); color: var(--white); min-width: 1.4em; }
.sheet .when .event { margin-left: auto; align-self: center; background: #ff4f8b1f; color: #ff7aa8; border: 1px solid #ff7aa855; border-radius: 99px; padding: 4px 11px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.ratings { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; align-items: baseline; margin-bottom: 24px; }
.ratings .who { font-weight: 600; color: var(--text-hi); text-transform: lowercase; }
.stars { color: var(--star); font-size: 16px; letter-spacing: 1px; }
.stars .none { color: var(--muted); font-size: 12px; letter-spacing: 0; }
.stars .heart { color: var(--orange); margin-left: 8px; letter-spacing: 0; }
.stars .rw { color: var(--muted); font-size: 11px; margin-left: 8px; letter-spacing: 0; }
.stars a { color: var(--muted); font-size: 11px; margin-left: 12px; letter-spacing: .02em; }
.stars a:hover { color: var(--blue); }
.review { grid-column: 2; margin: -4px 0 4px; font: 400 15px/1.5 var(--serif); color: var(--text-hi); max-width: 56ch; }

.tickets h3, .other h3 { font: 500 11px var(--sans); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 14px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.tickets .note { color: var(--text); font-style: italic; margin: -4px 0 14px; }
.tickets .row, .other .row { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.ticket { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ticket .stage { position: relative; perspective: 1000px; }
.ticket .inner { display: grid; transition: transform .7s cubic-bezier(.3,.7,.2,1); transform-style: preserve-3d; }
.ticket .inner > * { grid-area: 1/1; backface-visibility: hidden; display: grid; place-items: center; }
.ticket .inner > .back { transform: rotateY(180deg); }
.ticket.flipped .inner { transform: rotateY(180deg); }
.ticket .photo { display: block; max-width: 250px; max-height: 380px; width: auto; height: auto; filter: drop-shadow(0 12px 16px rgba(0,0,0,.55)); }
.ticket .tabs { display: flex; gap: 2px; background: var(--panel); border-radius: 4px; padding: 2px; font-size: 11px; }
.ticket .tabs button { padding: 3px 10px; border-radius: 3px; }
.ticket .tabs button:hover { color: var(--text-hi); }
.ticket .tabs button[aria-pressed="true"] { background: var(--glyph); color: var(--white); }
.ticket .tabs .flip { color: var(--blue); }

.other .what { font-size: 12px; color: var(--text-hi); text-align: center; max-width: 250px; }
.other .what small { display: block; color: var(--muted); }

@media (max-width: 720px) {
  header { padding: 10px 14px; gap: 8px 12px; }
  .count { display: none; }
  .controls { margin-left: 0; width: 100%; }
  .switch { margin-left: auto; }
  .switch button { padding: 4px 7px; letter-spacing: .04em; }
  .chip { padding: 6px 9px; }
  .chip .long { display: none; }
  #cal { padding-top: 110px; }
  .sheet .hero { height: 180px; }
  .sheet .body { grid-template-columns: 1fr; margin-top: -100px; padding: 0 18px 22px; gap: 14px; }
  .sheet .body > .pf { width: 120px; }
  .sheet h2 { margin-top: 0; font-size: 30px; }
  .review { grid-column: 1 / -1; }
  .ticket .photo { max-width: 100%; }
}

/* ---------- reimpressões (receipts.js) ---------- */
.receipt { position: relative; width: 268px; background: var(--thermal); color: var(--thermal-ink); padding: 20px 14px 18px;
  font: 400 10px/1.4 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; letter-spacing: -.03em; overflow: hidden; text-align: left;
  box-shadow: 0 12px 20px -10px rgba(0,0,0,.7);
  background-image: linear-gradient(transparent 0 60%, rgba(0,0,0,.025));
  -webkit-mask: linear-gradient(#000 0 0) top/100% calc(100% - 6px) no-repeat, radial-gradient(4px at 50% 100%, #0000 97%, #000) bottom/8px 6px repeat-x;
          mask: linear-gradient(#000 0 0) top/100% calc(100% - 6px) no-repeat, radial-gradient(4px at 50% 100%, #0000 97%, #000) bottom/8px 6px repeat-x; }
.receipt .c { display: block; text-align: center; }
.receipt .b { font-weight: 600; }
.receipt .sm { font-size: 8.6px; }
.receipt .wrap { display: block; font-size: 11px; }
.receipt .rule { display: block; border-top: 1px dashed currentColor; opacity: .5; margin: 6px 0; }
.receipt svg { display: block; margin: 8px auto 6px; fill: currentColor; color: #222; }
.r-cinesystem, .r-kinoplex { font-stretch: condensed; letter-spacing: -.06em; }
.r-cinesystem .c.b, .r-kinoplex .c.b { font-size: 11.5px; }
.r-kinoplex { width: 300px; }
.r-cinemark { background-color: #fdf6f4; }
.r-ccbb { width: 230px; font-size: 10.5px; }
.stamp { position: absolute; font: 700 22px/1 "Courier New", monospace; color: #2a2f6e; opacity: .72; letter-spacing: .02em; mix-blend-mode: multiply; text-shadow: 0 0 1px currentColor; }
.stamp.s0 { top: 26px; right: 18px; transform: rotate(-38deg); }
.stamp.s1 { top: 120px; left: 8px; transform: rotate(-80deg); font-size: 18px; }
.stamp.s2 { bottom: 34px; left: 72px; transform: rotate(88deg); font-size: 18px; }

/* the zoo ticket: yellow card stock, not thermal */
.r-zoo { width: 330px; height: 112px; padding: 10px 14px; background: #f7e34a; color: #1d1d1b; font-family: var(--sans); white-space: normal; letter-spacing: 0;
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr auto; column-gap: 12px;
  -webkit-mask: radial-gradient(3px at 100% 50%, #0000 97%, #000) right/100% 7px repeat-y; mask: radial-gradient(3px at 100% 50%, #0000 97%, #000) right/100% 7px repeat-y; }
.r-zoo .zt { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; }
.r-zoo .zt b { font: 900 21px/1 var(--sans); letter-spacing: -.02em; }
.r-zoo .zt small { font-size: 8px; font-weight: 700; }
.r-zoo svg { margin: 4px 0 0; width: 46px; height: 46px; }
.r-zoo .zm { align-self: center; display: flex; justify-content: space-between; align-items: center; }
.r-zoo .zm span { font: 400 15px var(--sans); color: #6b6420; letter-spacing: .04em; }
.r-zoo .zm em { font: 700 13px var(--sans); font-style: normal; }
.r-zoo .zm .price { background: #1d1d1b; color: #f7e34a; font: 800 19px/1 var(--sans); padding: 4px 8px 4px 16px; clip-path: polygon(12px 0, 100% 0, 100% 100%, 12px 100%, 0 50%); }
.r-zoo .zf { grid-column: 1 / -1; font-size: 8px; font-weight: 800; display: flex; justify-content: space-between; }

/* ---------- calendário: dias com mais de um filme ---------- */
.day.multi .pf:first-child { transform: rotate(7deg) translate(3px, -1px); opacity: .85; }
.day.multi .pf:nth-child(2) { transform: rotate(-3deg); }
.day.multi.open .pf:nth-child(2)::after { box-shadow: inset 0 0 0 3px var(--green); }
.daypop { position: fixed; z-index: 30; width: 270px; background: var(--panel); border-radius: 6px; padding: 6px;
  box-shadow: 0 0 0 1px var(--line), 0 18px 40px -12px #000; animation: pop .18s ease-out; }
.daypop p { margin: 4px 8px 8px; font-size: 11px; color: var(--muted); text-transform: lowercase; }
.daypop button { display: flex; gap: 10px; width: 100%; padding: 6px; border-radius: 4px; text-align: left; align-items: center; }
.daypop button:hover, .daypop button:focus-visible { background: var(--glyph); }
.daypop img { width: 36px; aspect-ratio: 2/3; object-fit: cover; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(221,238,255,.25); flex: none; }
.daypop b { display: block; color: var(--white); font-weight: 600; font-size: 13px; line-height: 1.25; }
.daypop small { display: block; color: var(--text); font-size: 11px; }
.daypop em { font-style: normal; color: var(--star); font-size: 11px; letter-spacing: 1px; }
.daypop em i { font-style: normal; color: var(--muted); letter-spacing: 0; margin-left: 2px; }
