/* A two-seat cinema.
   Brass marks anything you share; dust-grey marks anything that stays yours. */

:root {
  --house:  #0A0607;
  --velvet: #2B1016;
  --brass:  #B98A3C;
  --gilt:   #EAD2A2;
  --ivory:  #EFE6D9;
  --dust:   #8A7C72;

  --display: "Bodoni Moda", Didot, "Times New Roman", serif;
  --ui: Archivo, ui-sans-serif, system-ui, "Helvetica Neue", sans-serif;

  --hush: 420ms cubic-bezier(.4, 0, .2, 1);
  --dim: 1600ms cubic-bezier(.33, 0, .18, 1);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--house);
}

body {
  font-family: var(--ui);
  color: var(--ivory);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- the stage ---------- */

.stage {
  position: relative;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: #000;
}

.film {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  object-fit: contain;
  background: #000;
  /* Dim behind the title card, full brightness once the lights drop. */
  opacity: .28;
  transition: opacity var(--dim);
}

.stage[data-lights="down"] .film { opacity: 1; }

/* House lights: an oxblood wash over the room that drains away on play. */
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 42%, rgba(43, 16, 22, .34) 0%, rgba(10, 6, 7, .82) 58%, #060304 100%),
    linear-gradient(180deg, rgba(43, 16, 22, .5), transparent 30%);
  transition: opacity var(--dim);
}

.stage[data-lights="down"] .vignette { opacity: .35; }

/* ---------- chrome that fades with the pointer ---------- */

.house, .bar {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  transition: opacity var(--hush), transform var(--hush);
}

.house { top: 0; padding: 20px 26px; }
.bar { bottom: 0; }

.stage[data-lights="up"] .bar { opacity: 0; transform: translateY(14px); pointer-events: none; }

.stage[data-hushed="true"] .house { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.stage[data-hushed="true"] .bar { opacity: 0; transform: translateY(14px); pointer-events: none; visibility: hidden; }
.stage[data-hushed="true"] { cursor: none; }

/* ---------- presence ---------- */

.house { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }

.seats {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  letter-spacing: .01em;
  color: var(--dust);
}

.seats-text { transition: color var(--hush); }
.seats[data-full="true"] .seats-text { color: var(--ivory); }

.dots { display: inline-flex; gap: 5px; }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid var(--dust);
  transition: background-color var(--hush), border-color var(--hush), box-shadow var(--hush);
}

.dot[data-taken="true"] {
  background: var(--brass);
  border-color: var(--brass);
  box-shadow: 0 0 9px rgba(185, 138, 60, .55);
}

.wire { margin: 0; font-size: 12px; color: var(--dust); }

/* ---------- title card ---------- */

.card {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 32px;
  text-align: center;
  transition: opacity var(--dim), transform var(--dim), visibility var(--dim);
}

.stage[data-lights="down"] .card {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-22px) scale(.985);
  pointer-events: none;
}

.card-title {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: clamp(2.6rem, 8.5vw, 6.2rem);
  line-height: .95;
  letter-spacing: -.015em;
  margin: 0;
  max-width: 18ch;
  color: var(--ivory);
  text-wrap: balance;
}

.card-rule {
  width: 74px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
}

.card-runtime {
  margin: -6px 0 0;
  font-size: 13px;
  color: var(--dust);
  font-variant-numeric: tabular-nums;
}

.start {
  font-family: var(--ui);
  font-size: 15px;
  font-weight: 500;
  color: var(--gilt);
  background: rgba(185, 138, 60, .07);
  border: 1px solid rgba(185, 138, 60, .45);
  border-radius: 2px;
  padding: 14px 34px;
  cursor: pointer;
  transition: background-color var(--hush), border-color var(--hush), color var(--hush);
}

.start:hover { background: rgba(185, 138, 60, .16); border-color: var(--brass); color: var(--ivory); }

.card-terms {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--dust);
  max-width: 42ch;
}

/* ---------- the autoplay rescue ---------- */

/* display:flex would otherwise beat the hidden attribute. */
.blocked[hidden] { display: none; }

.blocked {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: rgba(6, 3, 4, .74);
  color: var(--ivory);
  font-family: var(--ui);
  cursor: pointer;
}

.blocked-title { font-family: var(--display); font-size: clamp(1.6rem, 4vw, 2.4rem); }
.blocked-more { font-size: 13px; color: var(--dust); }

/* ---------- centre keys, for thumbs ---------- */

/* Only a touch screen gets these; a mouse has the bar and needs no thumb targets. */
.touch-keys {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 34px;
  /* The blank area between the keys stays tappable, so a tap there still
     dismisses the chrome. */
  pointer-events: none;
  transition: opacity var(--hush), visibility var(--hush);
}

@media (pointer: coarse) {
  .touch-keys { display: flex; }
  .bar .transport { display: none; }
}

.stage[data-lights="up"] .touch-keys,
.stage[data-hushed="true"] .touch-keys {
  opacity: 0;
  visibility: hidden;
}

.touch-key {
  pointer-events: auto;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(10, 6, 7, .55);
  backdrop-filter: blur(3px);
  color: var(--ivory);
  cursor: pointer;
}

.touch-key svg { width: 26px; height: 26px; fill: currentColor; }

.touch-key .glyph {
  font-family: var(--ui);
  font-size: 8.5px;
  font-weight: 600;
  fill: currentColor;
  text-anchor: middle;
  stroke: none;
}

.touch-play {
  width: 78px;
  height: 78px;
  color: var(--gilt);
  background: rgba(10, 6, 7, .68);
}

.touch-play svg { width: 34px; height: 34px; }

.touch-key:active { background: rgba(185, 138, 60, .3); }

.touch-play .icon-pause,
.stage[data-playing="true"] .touch-play .icon-play { display: none; }
.stage[data-playing="true"] .touch-play .icon-pause { display: block; }

/* ---------- something is wrong ---------- */

.trouble[hidden] { display: none; }

.trouble {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px;
  text-align: center;
  background: rgba(6, 3, 4, .88);
}

.trouble-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  color: var(--ivory);
}

.trouble-more {
  margin: 0;
  max-width: 44ch;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--dust);
}

/* ---------- toasts ---------- */

.toasts {
  position: absolute;
  z-index: 5;
  left: 26px;
  bottom: 108px;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  font-size: 13px;
  color: var(--ivory);
  background: rgba(10, 6, 7, .72);
  border-left: 2px solid var(--brass);
  padding: 9px 14px;
  backdrop-filter: blur(6px);
  animation: rise 260ms cubic-bezier(.2, .8, .2, 1);
}

.toast[data-fading="true"] { opacity: 0; transition: opacity 420ms linear; }

.toast b { font-weight: 600; color: var(--gilt); }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- control bar ---------- */

.bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 46px 26px 20px;
  background: linear-gradient(180deg, transparent, rgba(4, 2, 3, .86) 62%);
}

.ours, .mine, .transport { display: flex; align-items: center; }
.transport { gap: 14px; }
.ours { flex: 1; gap: 14px; min-width: 0; }

/* The hairline is the boundary between what you share and what is yours. */
.mine {
  gap: 10px;
  padding-left: 20px;
  border-left: 1px solid rgba(138, 124, 114, .28);
}

.key {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: none;
  color: var(--ivory);
  cursor: pointer;
  transition: color var(--hush), background-color var(--hush);
}

.key svg { width: 21px; height: 21px; fill: currentColor; }
.key:hover { color: var(--gilt); background: rgba(233, 210, 162, .08); }

.key .glyph {
  font-family: var(--ui);
  font-size: 8.5px;
  font-weight: 600;
  fill: currentColor;
  text-anchor: middle;
  stroke: none;
}

.play { width: 44px; height: 44px; color: var(--gilt); }
.play svg { width: 25px; height: 25px; }

/* Anything in the personal group sits back a shade. */
.quiet { color: var(--dust); }
.quiet:hover { color: var(--ivory); }

.icon-pause, .stage[data-playing="true"] .icon-play { display: none; }
.stage[data-playing="true"] .icon-pause { display: block; }

.icon-muted, .stage[data-muted="true"] .icon-loud { display: none; }
.stage[data-muted="true"] .icon-muted { display: block; }

/* ---------- scrubber ---------- */

.scrub { position: relative; flex: 1; min-width: 80px; height: 38px; display: flex; align-items: center; }

.track {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 2px;
  background: rgba(239, 230, 217, .16);
  overflow: hidden;
  transition: height var(--hush);
}

.scrub:hover .track, .scrub:focus-within .track { height: 5px; }

.track-buffered, .track-played { position: absolute; inset: 0 auto 0 0; width: 0; }
.track-buffered { background: rgba(239, 230, 217, .2); }
.track-played { background: var(--brass); }

.range {
  position: relative;
  width: 100%;
  margin: 0;
  height: 38px;
  background: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.range::-webkit-slider-runnable-track { height: 38px; background: none; }
.range::-moz-range-track { height: 38px; background: none; }

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 0;
  background: var(--gilt);
  box-shadow: 0 0 10px rgba(185, 138, 60, .5);
  transform: scale(0);
  transition: transform 160ms ease;
}

.range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 0;
  background: var(--gilt);
  transform: scale(0);
  transition: transform 160ms ease;
}

.scrub:hover .range::-webkit-slider-thumb,
.range:focus-visible::-webkit-slider-thumb { transform: scale(1); }
.scrub:hover .range::-moz-range-thumb,
.range:focus-visible::-moz-range-thumb { transform: scale(1); }

/* Volume is a personal control, so it reads in dust rather than brass. */
.volume { width: 84px; height: 38px; }

.volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dust);
  transform: scale(1);
  box-shadow: none;
}

.volume::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dust);
  transform: scale(1);
}

.volume:hover::-webkit-slider-thumb { background: var(--ivory); }
.volume:hover::-moz-range-thumb { background: var(--ivory); }

.volume {
  background: linear-gradient(90deg, var(--dust) var(--filled, 100%), rgba(138, 124, 114, .25) var(--filled, 100%));
  background-size: 100% 2px;
  background-position: 0 50%;
  background-repeat: no-repeat;
}

/* ---------- subtitles ---------- */

/* Warm ivory on a soft shadow, so the words sit in the film rather than on it. */
.film::cue {
  color: var(--ivory);
  background: rgba(6, 3, 4, .66);
  font-family: var(--ui);
  font-size: .92em;
  line-height: 1.4;
}

/* The on state is brass, matching every other "this is on" in the room. */
#cc[aria-pressed="true"] { color: var(--gilt); background: rgba(233, 210, 162, .1); }

/* ---------- timecode ---------- */

.clock {
  margin: 0;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  color: var(--ivory);
  white-space: nowrap;
}

.clock-sep { margin: 0 6px; color: rgba(138, 124, 114, .7); }
.clock-total { color: var(--dust); }

/* ---------- box office ---------- */

.box-office {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(90% 70% at 50% 38%, #240E13, #070405 70%);
  transition: opacity var(--hush), visibility var(--hush);
}

.box-office[data-open="false"] { opacity: 0; visibility: hidden; pointer-events: none; }

.ticket {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(340px, 100%);
  text-align: center;
}

.ticket-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: 2rem;
  margin: 0 0 4px;
  color: var(--ivory);
}

.ticket-name {
  font-family: var(--ui);
  font-size: 15px;
  color: var(--ivory);
  text-align: center;
  background: rgba(239, 230, 217, .04);
  border: 0;
  border-bottom: 1px solid rgba(185, 138, 60, .45);
  padding: 12px 10px;
  transition: border-color var(--hush);
}

.ticket-name::placeholder { color: rgba(138, 124, 114, .8); }
.ticket-name:focus { outline: none; border-bottom-color: var(--brass); }

.ticket-go {
  font-family: var(--ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--gilt);
  background: rgba(185, 138, 60, .1);
  border: 1px solid rgba(185, 138, 60, .45);
  border-radius: 2px;
  padding: 12px;
  cursor: pointer;
  transition: background-color var(--hush), color var(--hush);
}

.ticket-go:hover { background: rgba(185, 138, 60, .2); color: var(--ivory); }

.ticket-note { margin: 2px 0 0; font-size: 12px; color: var(--dust); }

/* ---------- shared quality floor ---------- */

:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

@media (max-width: 620px) {
  .bar { gap: 12px; padding: 40px 14px 14px; flex-wrap: wrap; }
  .ours { gap: 6px; order: 2; flex: 1 1 100%; }
  .mine { order: 1; margin-left: auto; padding-left: 14px; }
  .clock { font-size: 11.5px; }
  .house { padding: 14px 16px; }
  .toasts { left: 16px; bottom: 120px; }
  .key { width: 34px; height: 34px; }
  .volume { width: 62px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
