{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "cinema-now-showing",
  "type": "registry:component",
  "title": "Cinema Now Showing",
  "description": "A now-showing section with a poster, film facts and a paper ticket where the visitor picks a date, a showtime and the number of seats. Booking tears the stub off and prints the row, seats and a barcode.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "cinematic",
    "cinematic",
    "tickets",
    "showtimes",
    "booking",
    "theater",
    "ecommerce"
  ],
  "docs": "https://hyperblur.dev/effects/cinema-now-showing",
  "files": [
    {
      "path": "registry/hyperblur/cinema-now-showing.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/cinema-now-showing.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface CinemaShowtime {\n  time: string;\n  format: string;\n  seatsLeft: number;\n}\n\nexport interface CinemaNowShowingFilm {\n  title: string;\n  rating: string;\n  runtime: string;\n  genres: string;\n  director: string;\n  synopsis: string;\n}\n\nexport interface CinemaBooking {\n  date: string;\n  time: string;\n  format: string;\n  quantity: number;\n  total: number;\n}\n\nexport interface CinemaNowShowingProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  film?: CinemaNowShowingFilm;\n  venue?: string;\n  dates?: string[];\n  showtimes?: CinemaShowtime[];\n  price?: number;\n  currency?: string;\n  locale?: string;\n  maxTickets?: number;\n  accent?: string;\n  onBook?: (booking: CinemaBooking) => void;\n  headingAs?: \"h1\" | \"h2\";\n}\n\nconst defaultFilm: CinemaNowShowingFilm = {\n  title: \"Salt & Static\",\n  rating: \"PG-13\",\n  runtime: \"2h 08m\",\n  genres: \"Mystery · Drama\",\n  director: \"Mira Okafor\",\n  synopsis: \"A radio engineer on a storm-cut island hears her own voice on a frequency that went dark in 1986.\",\n};\n\nconst css = `\n.hb-vc13 {\n  --hb-vc13-accent: #ff5a36;\n  position: relative;\n  box-sizing: border-box;\n  display: grid;\n  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);\n  align-items: center;\n  gap: clamp(24px, 5cqi, 64px);\n  width: 100%;\n  min-height: 580px;\n  padding: clamp(24px, 5cqi, 60px);\n  overflow: hidden;\n  isolation: isolate;\n  container-type: inline-size;\n  background: radial-gradient(70% 60% at 20% 30%, color-mix(in srgb, var(--hb-vc13-accent) 16%, transparent), transparent 70%), #08070a;\n  color: #f4f1ec;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-vc13 *, .hb-vc13 *::before, .hb-vc13 *::after { box-sizing: border-box; }\n.hb-vc13-film { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr); gap: 22px; align-items: start; }\n.hb-vc13-poster {\n  position: relative;\n  aspect-ratio: 2 / 3;\n  overflow: hidden;\n  border-radius: 10px;\n  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 30px 60px -30px color-mix(in srgb, var(--hb-vc13-accent) 70%, #000);\n  transform: rotate(-2deg);\n}\n.hb-vc13-poster svg { display: block; width: 100%; height: 100%; }\n.hb-vc13-poster-t {\n  position: absolute;\n  left: 10px;\n  right: 10px;\n  bottom: 12px;\n  color: #fff;\n  font-family: var(--font-grotesk, var(--font-sans, ui-sans-serif, system-ui, sans-serif));\n  font-size: 15px;\n  font-weight: 700;\n  line-height: .95;\n  letter-spacing: -.01em;\n  text-transform: uppercase;\n}\n.hb-vc13-now {\n  display: inline-flex;\n  align-items: center;\n  gap: 8px;\n  margin: 0 0 12px;\n  color: var(--hb-vc13-accent);\n  font-family: var(--font-mono, ui-monospace, monospace);\n  font-size: 11px;\n  letter-spacing: .24em;\n  text-transform: uppercase;\n}\n.hb-vc13-now::before {\n  content: \"\";\n  width: 7px;\n  height: 7px;\n  border-radius: 50%;\n  background: currentColor;\n  box-shadow: 0 0 10px currentColor;\n  animation: hb-vc13-live 1.6s ease-in-out infinite;\n}\n@keyframes hb-vc13-live {\n  50% { opacity: .3; }\n}\n.hb-vc13-title {\n  margin: 0;\n  font-family: var(--font-grotesk, var(--font-sans, ui-sans-serif, system-ui, sans-serif));\n  font-size: clamp(30px, 5.2cqi, 58px);\n  font-weight: 700;\n  line-height: .95;\n  letter-spacing: -.035em;\n}\n.hb-vc13-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }\n.hb-vc13-chip {\n  padding: 4px 8px;\n  border: 1px solid rgba(244, 241, 236, .16);\n  border-radius: 6px;\n  color: rgba(244, 241, 236, .75);\n  font-size: 11.5px;\n  white-space: nowrap;\n}\n.hb-vc13-syn { margin: 14px 0 0; color: rgba(244, 241, 236, .7); font-size: 14px; line-height: 1.55; }\n.hb-vc13-dir { margin: 10px 0 0; color: rgba(244, 241, 236, .5); font-size: 12.5px; }\n.hb-vc13-ticket {\n  position: relative;\n  display: grid;\n  grid-template-columns: minmax(0, 1fr) 96px;\n  filter: drop-shadow(0 30px 50px rgba(0, 0, 0, .55));\n}\n.hb-vc13-body, .hb-vc13-stub {\n  position: relative;\n  background: linear-gradient(180deg, #f6f1e7, #ebe3d3);\n  color: #1a1612;\n}\n.hb-vc13-body {\n  padding: 22px 22px 20px;\n  border-radius: 16px 0 0 16px;\n  -webkit-mask: radial-gradient(circle 10px at 100% 0, transparent 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle 10px at 100% 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;\n  mask: radial-gradient(circle 10px at 100% 0, transparent 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle 10px at 100% 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;\n}\n.hb-vc13-stub {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: space-between;\n  padding: 20px 10px;\n  border-radius: 0 16px 16px 0;\n  border-left: 2px dashed rgba(26, 22, 18, .28);\n  -webkit-mask: radial-gradient(circle 10px at 0 0, transparent 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle 10px at 0 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;\n  mask: radial-gradient(circle 10px at 0 0, transparent 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle 10px at 0 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;\n  transform-origin: 0 100%;\n}\n.hb-vc13[data-phase=\"torn\"] .hb-vc13-stub { animation: hb-vc13-tear .9s cubic-bezier(.5, 0, .3, 1) both; }\n@keyframes hb-vc13-tear {\n  0% { transform: none; }\n  25% { transform: rotate(4deg) translate3d(2px, 0, 0); }\n  100% { transform: rotate(18deg) translate3d(30px, 60px, 0); opacity: 0; }\n}\n.hb-vc13-label {\n  margin: 0 0 8px;\n  color: rgba(26, 22, 18, .55);\n  font-family: var(--font-mono, ui-monospace, monospace);\n  font-size: 10px;\n  font-weight: 600;\n  letter-spacing: .18em;\n  text-transform: uppercase;\n}\n.hb-vc13-group + .hb-vc13-group { margin-top: 16px; }\n.hb-vc13-opts { display: flex; flex-wrap: wrap; gap: 6px; }\n.hb-vc13-opt {\n  display: inline-flex;\n  flex-direction: column;\n  align-items: flex-start;\n  gap: 2px;\n  min-width: 0;\n  padding: 7px 10px;\n  border: 1px solid rgba(26, 22, 18, .16);\n  border-radius: 9px;\n  background: rgba(255, 255, 255, .5);\n  color: #1a1612;\n  font: inherit;\n  font-size: 13px;\n  font-weight: 600;\n  cursor: pointer;\n  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .15s ease;\n}\n.hb-vc13-opt small { color: rgba(26, 22, 18, .55); font-size: 10px; font-weight: 500; letter-spacing: .04em; }\n.hb-vc13-opt:hover { border-color: rgba(26, 22, 18, .4); }\n.hb-vc13-opt:active { transform: scale(.97); }\n.hb-vc13-opt[aria-checked=\"true\"] { border-color: #1a1612; background: #1a1612; color: #f6f1e7; }\n.hb-vc13-opt[aria-checked=\"true\"] small { color: rgba(246, 241, 231, .65); }\n.hb-vc13-opt:disabled { opacity: .4; cursor: not-allowed; text-decoration: line-through; }\n.hb-vc13-opt:focus-visible, .hb-vc13-step:focus-visible, .hb-vc13-book:focus-visible { outline: 2px solid var(--hb-vc13-accent); outline-offset: 2px; }\n.hb-vc13-foot {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 12px;\n  margin-top: 18px;\n  padding-top: 16px;\n  border-top: 1px dashed rgba(26, 22, 18, .2);\n}\n.hb-vc13-qty { display: inline-flex; align-items: center; gap: 6px; }\n.hb-vc13-step {\n  display: grid;\n  place-items: center;\n  width: 30px;\n  height: 30px;\n  border: 1px solid rgba(26, 22, 18, .2);\n  border-radius: 50%;\n  background: transparent;\n  color: #1a1612;\n  font: inherit;\n  font-size: 16px;\n  cursor: pointer;\n}\n.hb-vc13-step:disabled { opacity: .35; cursor: not-allowed; }\n.hb-vc13-n { min-width: 3.2ch; font-size: 14px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }\n.hb-vc13-total { font-size: 20px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }\n.hb-vc13-book {\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  gap: 8px;\n  width: 100%;\n  height: 46px;\n  margin-top: 14px;\n  border: 0;\n  border-radius: 11px;\n  background: var(--hb-vc13-accent);\n  color: #fff;\n  font: inherit;\n  font-size: 14.5px;\n  font-weight: 650;\n  cursor: pointer;\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 10px 24px -12px var(--hb-vc13-accent);\n  transition: transform .15s ease, filter .2s ease;\n}\n.hb-vc13-book:hover { filter: brightness(1.06); }\n.hb-vc13-book:active { transform: scale(.98); }\n.hb-vc13-admit {\n  writing-mode: vertical-rl;\n  transform: rotate(180deg);\n  font-family: var(--font-grotesk, var(--font-sans, ui-sans-serif, system-ui, sans-serif));\n  font-size: 18px;\n  font-weight: 700;\n  letter-spacing: .18em;\n  text-transform: uppercase;\n}\n.hb-vc13-stubno { color: rgba(26, 22, 18, .5); font-family: var(--font-mono, ui-monospace, monospace); font-size: 10px; letter-spacing: .1em; }\n.hb-vc13-done { animation: hb-vc13-done .6s .5s cubic-bezier(.2, .8, .2, 1) both; }\n@keyframes hb-vc13-done {\n  from { opacity: 0; transform: translate3d(0, 8px, 0); }\n  to { opacity: 1; transform: none; }\n}\n.hb-vc13-seat { margin: 0; font-family: var(--font-grotesk, var(--font-sans, ui-sans-serif, system-ui, sans-serif)); font-size: 26px; font-weight: 700; letter-spacing: -.02em; }\n.hb-vc13-seatsub { margin: 6px 0 0; color: rgba(26, 22, 18, .65); font-size: 13px; }\n.hb-vc13-bars { display: flex; align-items: stretch; gap: 2px; height: 46px; margin-top: 16px; }\n.hb-vc13-bars span { background: #1a1612; }\n.hb-vc13-again {\n  margin-top: 14px;\n  padding: 0;\n  border: 0;\n  background: none;\n  color: #1a1612;\n  font: inherit;\n  font-size: 13px;\n  font-weight: 600;\n  text-decoration: underline;\n  text-underline-offset: 3px;\n  cursor: pointer;\n}\n.hb-vc13-again:focus-visible { outline: 2px solid var(--hb-vc13-accent); outline-offset: 2px; }\n@container (max-width: 700px) {\n  .hb-vc13 { grid-template-columns: minmax(0, 1fr); }\n  .hb-vc13-film { grid-template-columns: minmax(0, 96px) minmax(0, 1fr); }\n  .hb-vc13-syn { display: none; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-vc13-now::before, .hb-vc13-done { animation: none; }\n  .hb-vc13[data-phase=\"torn\"] .hb-vc13-stub { animation: none; opacity: 0; }\n}\n`;\n\nexport function CinemaNowShowing({\n  film = defaultFilm,\n  venue = \"Rialto Hall · Screen 4\",\n  dates = [\"Fri 14\", \"Sat 15\", \"Sun 16\", \"Mon 17\"],\n  showtimes = [\n    { time: \"4:10 PM\", format: \"35mm\", seatsLeft: 22 },\n    { time: \"7:15 PM\", format: \"Dolby Atmos\", seatsLeft: 9 },\n    { time: \"9:40 PM\", format: \"Laser\", seatsLeft: 41 },\n    { time: \"11:55 PM\", format: \"35mm\", seatsLeft: 0 },\n  ],\n  price = 14.5,\n  currency = \"USD\",\n  locale = \"en-US\",\n  maxTickets = 8,\n  accent = \"#ff5a36\",\n  onBook,\n  headingAs = \"h2\",\n  className,\n  style,\n  ...rest\n}: CinemaNowShowingProps) {\n  const Heading = headingAs;\n  const [day, setDay] = React.useState(0);\n  const [slot, setSlot] = React.useState(Math.max(0, showtimes.findIndex((s) => s.seatsLeft > 0)));\n  const [qty, setQty] = React.useState(2);\n  const [phase, setPhase] = React.useState<\"select\" | \"torn\">(\"select\");\n  const money = React.useMemo(() => new Intl.NumberFormat(locale, { style: \"currency\", currency }), [locale, currency]);\n  const show = showtimes[slot];\n  const cap = Math.min(maxTickets, show?.seatsLeft ?? 0);\n  const total = qty * price;\n\n  const book = () => {\n    if (!show || qty < 1) return;\n    setPhase(\"torn\");\n    onBook?.({ date: dates[day] ?? \"\", time: show.time, format: show.format, quantity: qty, total });\n  };\n\n  const seed = (Math.imul(day * 31 + slot * 7 + qty + 1, 2654435761) >>> 0);\n  const row = \"CDEFGH\"[seed % 6];\n  const firstSeat = 3 + ((seed >>> 4) % 9);\n  const bars = Array.from({ length: 38 }, (_, i) => 1 + ((Math.imul(seed + i * 13, 2246822519) >>> 0) % 4));\n  const ticketNo = String(seed % 1000000).padStart(6, \"0\");\n\n  const radioKeys = (e: React.KeyboardEvent, count: number, cur: number, set: (i: number) => void, ok: (i: number) => boolean) => {\n    const dir = e.key === \"ArrowRight\" || e.key === \"ArrowDown\" ? 1 : e.key === \"ArrowLeft\" || e.key === \"ArrowUp\" ? -1 : 0;\n    if (!dir) return;\n    e.preventDefault();\n    let i = cur;\n    for (let k = 0; k < count; k++) {\n      i = (i + dir + count) % count;\n      if (ok(i)) break;\n    }\n    set(i);\n    const group = e.currentTarget as HTMLElement;\n    (group.querySelectorAll(\"[role=radio]\")[i] as HTMLElement | undefined)?.focus();\n  };\n\n  const vars = { \"--hb-vc13-accent\": accent, ...style } as React.CSSProperties;\n\n  return (\n    <section className={[\"hb-vc13\", className].filter(Boolean).join(\" \")} style={vars} data-phase={phase} {...rest}>\n      <style href=\"hb-cinema-now-showing\" precedence=\"default\">{css}</style>\n      <div className=\"hb-vc13-film\">\n        <div className=\"hb-vc13-poster\" aria-hidden=\"true\">\n          <svg viewBox=\"0 0 200 300\" preserveAspectRatio=\"xMidYMid slice\">\n            <rect width=\"200\" height=\"300\" fill=\"#141022\" />\n            <circle cx=\"100\" cy=\"120\" r=\"70\" fill={accent} opacity=\".85\" />\n            {Array.from({ length: 9 }, (_, i) => (\n              <rect key={i} x=\"0\" y={92 + i * 9} width=\"200\" height={1 + i * 0.5} fill=\"#141022\" />\n            ))}\n            <path d=\"M0 210 Q50 190 100 206 T200 200 L200 300 L0 300Z\" fill=\"#0a0814\" />\n            <rect x=\"96\" y=\"150\" width=\"4\" height=\"62\" fill=\"#0a0814\" />\n            <path d=\"M84 150 L112 150 M88 160 L108 160\" stroke=\"#0a0814\" strokeWidth=\"3\" />\n          </svg>\n          <span className=\"hb-vc13-poster-t\">{film.title}</span>\n        </div>\n        <div>\n          <p className=\"hb-vc13-now\">Now showing</p>\n          <Heading className=\"hb-vc13-title\">{film.title}</Heading>\n          <div className=\"hb-vc13-chips\">\n            <span className=\"hb-vc13-chip\">{film.rating}</span>\n            <span className=\"hb-vc13-chip\">{film.runtime}</span>\n            <span className=\"hb-vc13-chip\">{film.genres}</span>\n          </div>\n          <p className=\"hb-vc13-syn\">{film.synopsis}</p>\n          <p className=\"hb-vc13-dir\">Directed by {film.director} · {venue}</p>\n        </div>\n      </div>\n      <div className=\"hb-vc13-ticket\">\n        <div className=\"hb-vc13-body\">\n          {phase === \"select\" ? (\n            <>\n              <div className=\"hb-vc13-group\">\n                <p className=\"hb-vc13-label\">Date</p>\n                <div className=\"hb-vc13-opts\" role=\"radiogroup\" aria-label=\"Date\" onKeyDown={(e) => radioKeys(e, dates.length, day, setDay, () => true)}>\n                  {dates.map((d, i) => (\n                    <button key={d} type=\"button\" role=\"radio\" aria-checked={i === day} tabIndex={i === day ? 0 : -1} className=\"hb-vc13-opt\" onClick={() => setDay(i)}>\n                      {d}\n                    </button>\n                  ))}\n                </div>\n              </div>\n              <div className=\"hb-vc13-group\">\n                <p className=\"hb-vc13-label\">Showtime</p>\n                <div\n                  className=\"hb-vc13-opts\"\n                  role=\"radiogroup\"\n                  aria-label=\"Showtime\"\n                  onKeyDown={(e) => radioKeys(e, showtimes.length, slot, (i) => { setSlot(i); setQty((q) => Math.max(1, Math.min(q, Math.min(maxTickets, showtimes[i].seatsLeft)))); }, (i) => showtimes[i].seatsLeft > 0)}\n                >\n                  {showtimes.map((s, i) => (\n                    <button\n                      key={s.time}\n                      type=\"button\"\n                      role=\"radio\"\n                      aria-checked={i === slot}\n                      tabIndex={i === slot ? 0 : -1}\n                      disabled={s.seatsLeft <= 0}\n                      className=\"hb-vc13-opt\"\n                      onClick={() => {\n                        setSlot(i);\n                        setQty((q) => Math.max(1, Math.min(q, Math.min(maxTickets, s.seatsLeft))));\n                      }}\n                    >\n                      {s.time}\n                      <small>{s.seatsLeft > 0 ? `${s.format} · ${s.seatsLeft} left` : \"Sold out\"}</small>\n                    </button>\n                  ))}\n                </div>\n              </div>\n              <div className=\"hb-vc13-foot\">\n                <div className=\"hb-vc13-qty\">\n                  <button type=\"button\" className=\"hb-vc13-step\" aria-label=\"Fewer tickets\" disabled={qty <= 1} onClick={() => setQty((q) => Math.max(1, q - 1))}>−</button>\n                  <span className=\"hb-vc13-n\" aria-live=\"polite\">{qty}×</span>\n                  <button type=\"button\" className=\"hb-vc13-step\" aria-label=\"More tickets\" disabled={qty >= cap} onClick={() => setQty((q) => Math.min(cap, q + 1))}>+</button>\n                </div>\n                <span className=\"hb-vc13-total\">{money.format(total)}</span>\n              </div>\n              <button type=\"button\" className=\"hb-vc13-book\" onClick={book} disabled={!show || cap < 1}>\n                Get tickets\n                <svg width=\"14\" height=\"14\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\"><path d=\"M3 8h10M9 4l4 4-4 4\" stroke=\"currentColor\" strokeWidth=\"1.7\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg>\n              </button>\n            </>\n          ) : (\n            <div className=\"hb-vc13-done\" role=\"status\">\n              <p className=\"hb-vc13-label\">Admit {qty} · {dates[day]} · {show?.time}</p>\n              <p className=\"hb-vc13-seat\">Row {row}, seats {firstSeat}–{firstSeat + qty - 1}</p>\n              <p className=\"hb-vc13-seatsub\">{venue} · {show?.format} · {money.format(total)} paid</p>\n              <div className=\"hb-vc13-bars\" aria-hidden=\"true\">\n                {bars.map((w, i) => (\n                  <span key={i} style={{ width: `${w}px`, opacity: i % 7 === 3 ? 0 : 1 }} />\n                ))}\n              </div>\n              <button type=\"button\" className=\"hb-vc13-again\" onClick={() => setPhase(\"select\")}>Change showtime</button>\n            </div>\n          )}\n        </div>\n        <div className=\"hb-vc13-stub\" aria-hidden=\"true\">\n          <span className=\"hb-vc13-stubno\">No. {ticketNo}</span>\n          <span className=\"hb-vc13-admit\">Admit {qty}</span>\n          <span className=\"hb-vc13-stubno\">{show?.time}</span>\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}