:root {
  color-scheme: dark;
  --bg: #100b10;
  --panel: rgba(31, 22, 29, 0.86);
  --panel-solid: #21171f;
  --ink: #f4ebe5;
  --muted: #aa9a9f;
  --line: rgba(255, 255, 255, 0.09);
  --red: #d45757;
  --red-deep: #8f303b;
  --gold: #d5ad72;
  --green: #76b18b;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.44);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 50% -20%, rgba(145, 52, 64, 0.28), transparent 42%),
    linear-gradient(160deg, #120c12 0%, #0b090c 100%);
  overflow-x: hidden;
}

button, input { font: inherit; }
button, .upload-button { -webkit-tap-highlight-color: transparent; }
.ambient { position: fixed; pointer-events: none; filter: blur(60px); opacity: .25; border-radius: 999px; }
.ambient-one { width: 28rem; height: 28rem; background: #8a2f3a; top: -18rem; right: -10rem; }
.ambient-two { width: 22rem; height: 22rem; background: #715034; bottom: -16rem; left: -12rem; }
.shell { width: min(1440px, 100%); margin: 0 auto; padding: 0 28px 54px; position: relative; }

.topbar { min-height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(213,173,114,.5); border-radius: 50%; color: var(--gold); box-shadow: inset 0 0 0 6px rgba(213,173,114,.06); }
.brand strong { display: block; font-family: Georgia, "Noto Serif SC", serif; letter-spacing: .05em; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; letter-spacing: .2em; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.ghost { border: 1px solid var(--line); color: var(--ink); background: transparent; border-radius: 999px; padding: 9px 14px; cursor: pointer; }
.connection { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 7px; }
.connection i { width: 7px; height: 7px; border-radius: 50%; background: #b77b55; box-shadow: 0 0 10px currentColor; }
.connection.online i { background: var(--green); }
.avatar { width: 34px; height: 34px; border: 0; border-radius: 50%; background: linear-gradient(135deg, #b94f58, #6e2834); color: white; cursor: pointer; font-weight: 700; }

.hero { padding: 52px 0 40px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.eyebrow, .now-label { margin: 0 0 10px; color: var(--gold); letter-spacing: .22em; font-size: 10px; font-weight: 700; }
.hero h1 { font: 500 clamp(34px, 5vw, 66px)/1.04 Georgia, "Noto Serif SC", serif; letter-spacing: -.035em; margin: 0; }
.hero-copy { color: var(--muted); max-width: 600px; margin: 16px 0 0; }
.presence-card { min-width: 205px; display: flex; gap: 13px; align-items: center; border: 1px solid var(--line); background: rgba(255,255,255,.025); padding: 14px 16px; border-radius: 16px; }
.presence-count { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: #160e13; background: var(--gold); font-weight: 800; }
.presence-card strong, .presence-card small { display: block; }
.presence-card strong { font-size: 13px; }
.presence-card small { color: var(--muted); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; font-size: 11px; }

.stage { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(320px, .78fr); gap: 24px; }
.screen-wrap, .library { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.screen-wrap { padding: 22px; min-width: 0; }
.screen-head, .library-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.screen-head h2, .library-head h2 { margin: 0; font: 500 22px/1.2 Georgia, "Noto Serif SC", serif; }
.sync-badge { border: 1px solid rgba(118,177,139,.3); background: rgba(118,177,139,.08); color: #9ac6aa; border-radius: 999px; padding: 7px 11px; font-size: 11px; }
.player-frame { position: relative; overflow: hidden; aspect-ratio: 16/9; background: #030303; border-radius: 13px; box-shadow: 0 18px 50px rgba(0,0,0,.45); }
video { width: 100%; height: 100%; display: block; object-fit: contain; background: black; }
.empty-screen { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; color: #6f6267; background: radial-gradient(circle, #181217 0%, #050405 70%); }
.empty-screen .projector { font-size: 46px; color: #6f4a4e; }
.empty-screen p { margin: 12px 0 0; font-size: 13px; letter-spacing: .12em; }
.catchup { position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%); border: 0; border-radius: 999px; background: var(--ink); color: #1a1117; font-weight: 750; padding: 11px 18px; box-shadow: 0 10px 30px rgba(0,0,0,.5); cursor: pointer; }
.sync-note { margin: 13px 2px 0; color: #81747a; font-size: 11px; }

.library { padding: 22px; min-height: 440px; display: flex; flex-direction: column; }
.upload-button { white-space: nowrap; border: 1px solid rgba(212,87,87,.35); background: rgba(212,87,87,.1); color: #eea1a1; border-radius: 999px; padding: 9px 13px; cursor: pointer; font-size: 12px; }
.upload-button:hover { background: rgba(212,87,87,.18); }
.upload-progress { background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: 13px; padding: 12px; margin-bottom: 12px; }
.upload-progress div { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.upload-progress small { color: var(--muted); }
progress { width: 100%; height: 5px; border: 0; margin: 9px 0 5px; accent-color: var(--red); }
.movie-list { display: grid; gap: 8px; overflow: auto; max-height: 460px; padding-right: 3px; }
.movie { width: 100%; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 10px; color: var(--ink); text-align: left; border: 1px solid transparent; background: transparent; border-radius: 12px; cursor: pointer; }
.movie:hover { background: rgba(255,255,255,.035); border-color: var(--line); }
.movie.active { background: rgba(212,87,87,.1); border-color: rgba(212,87,87,.3); }
.poster-mini { width: 42px; height: 52px; border-radius: 7px; display: grid; place-items: center; background: linear-gradient(145deg, #64303a, #21141d); color: #d9a6a4; font-family: Georgia, serif; }
.movie strong, .movie small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.movie strong { font-size: 13px; font-weight: 650; }
.movie small { color: var(--muted); margin-top: 5px; font-size: 10px; }
.movie .play { color: var(--gold); font-size: 18px; }
.library-empty { margin: auto; text-align: center; color: var(--muted); padding: 34px 12px; }
.library-empty span { color: var(--ink); font: 22px Georgia, serif; }
.library-empty p { font-size: 12px; line-height: 1.7; }
.storage { margin-top: auto; padding-top: 14px; color: #756970; font-size: 10px; border-top: 1px solid var(--line); }

.login { min-height: 100vh; display: grid; place-content: center; padding: 28px; position: relative; }
.ticket { width: min(720px, 92vw); display: grid; grid-template-columns: 135px 1fr; background: #e8ddcf; color: #24191d; border-radius: 20px; overflow: hidden; box-shadow: 0 35px 100px rgba(0,0,0,.58); transform: rotate(-1deg); }
.ticket-stub { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 20px; color: #f3e6db; background: linear-gradient(160deg, #8b3340, #4d202c); border-right: 2px dashed rgba(255,255,255,.3); }
.ticket-stub span { font-size: 48px; color: #d4a975; }
.ticket-stub small { writing-mode: vertical-rl; letter-spacing: .24em; }
.ticket-body { padding: clamp(34px, 6vw, 58px); }
.ticket-body h1 { margin: 0; font: 500 clamp(36px, 6vw, 58px)/1 Georgia, "Noto Serif SC", serif; }
.ticket-body > p:not(.eyebrow) { color: #69575d; }
.ticket form { margin-top: 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.ticket label { color: #5d4c52; font-size: 11px; font-weight: 700; }
.ticket input { width: 100%; margin-top: 7px; border: 1px solid #c9bab0; border-radius: 10px; background: rgba(255,255,255,.55); color: #24191d; outline: none; padding: 12px 13px; }
.ticket input:focus { border-color: #8f303b; box-shadow: 0 0 0 3px rgba(143,48,59,.12); }
.ticket form button { grid-column: 1/-1; border: 0; border-radius: 10px; padding: 13px; background: #722b37; color: white; font-weight: 750; cursor: pointer; }
.form-error { grid-column: 1/-1; min-height: 18px; margin: 0; color: #9e2936; font-size: 12px; }
.login-foot { text-align: center; color: #675861; font-size: 9px; letter-spacing: .24em; margin-top: 24px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 130%); background: #eee4dc; color: #24191d; border-radius: 999px; padding: 11px 18px; box-shadow: var(--shadow); transition: transform .25s ease; z-index: 20; font-size: 12px; }
.toast.show { transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .stage { grid-template-columns: 1fr; }
  .movie-list { max-height: none; }
  .presence-card { min-width: auto; }
}

@media (max-width: 620px) {
  .shell { padding: 0 14px 30px; }
  .topbar { min-height: 68px; }
  .connection { display: none; }
  .ghost { font-size: 10px; padding: 7px 10px; }
  .hero { padding: 36px 2px 28px; display: block; }
  .hero-copy { font-size: 13px; }
  .presence-card { margin-top: 24px; width: fit-content; }
  .screen-wrap, .library { border-radius: 17px; padding: 14px; }
  .screen-head h2, .library-head h2 { font-size: 18px; }
  .player-frame { margin-inline: -6px; border-radius: 10px; }
  .ticket { grid-template-columns: 1fr; transform: none; }
  .ticket-stub { min-height: 76px; flex-direction: row; border-right: 0; border-bottom: 2px dashed rgba(255,255,255,.3); }
  .ticket-stub span { font-size: 30px; }
  .ticket-stub small { writing-mode: initial; }
  .ticket-body { padding: 32px 24px 25px; }
  .ticket form { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
