:root {
  --bg-primary: #36393f;
  --bg-secondary: #2f3136;
  --text-primary: #dcddde;
  --text-muted: #aeb2b8;
  --accent: #7289da;
  --accent-strong: #5865f2;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #000;
  color: var(--text-primary);
  font-family: "Helvetica Neue", Arial, sans-serif;
}

.cinema-background-video {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  background: #000;
  filter: brightness(80%);
  object-fit: cover;
  object-position: center;
}

.cinema-sound-prompt {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 4;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(32, 34, 37, 0.9);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.38);
  color: #fff;
  padding: 0 16px;
  font-weight: 800;
}

.cinema-sound-prompt:hover {
  background: rgba(47, 49, 54, 0.96);
}

.cinema-back-link {
  position: fixed;
  top: 34px;
  left: 34px;
  z-index: 4;
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(32, 34, 37, 0.9);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.38);
  color: #fff;
  padding: 0 18px;
  font-weight: 800;
  text-decoration: none;
  transition: background 160ms ease, transform 160ms ease;
}

.cinema-back-link:hover,
.cinema-back-link:focus-visible {
  background: rgba(47, 49, 54, 0.98);
  outline: none;
  transform: translateY(-1px);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.cinema-shell,
.cinema-gate,
.viewer-shell {
  min-height: 100vh;
}

.cinema-shell {
  position: relative;
  z-index: 1;
  background: transparent;
}

.cinema-title-mark {
  position: fixed;
  top: 34px;
  left: 50%;
  z-index: 2;
  display: grid;
  width: min(440px, calc(100% - 48px));
  min-height: 58px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #f6f8fb;
  background: linear-gradient(145deg, rgba(47, 49, 54, 0.96), rgba(32, 34, 37, 0.94));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
  padding: 0 28px;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  transform: translateX(-50%);
}

.cinema-title-mark::after {
  position: absolute;
  right: 28px;
  bottom: 0;
  left: 28px;
  height: 2px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, transparent, rgba(114, 137, 218, 0.72), transparent);
  content: "";
}

.cinema-gate {
  position: relative;
  display: grid;
  overflow: hidden;
  place-items: center;
  background: transparent;
  padding: 24px;
}

#loginGate::after,
#profileGate::after {
  display: none;
}

#loginGate::after {
  position: fixed;
  right: -78px;
  bottom: -92px;
  width: min(320px, 34vw);
  aspect-ratio: 638 / 710;
  background: url("/program_icons/hidden-corner.png") center / contain no-repeat;
  content: "";
  opacity: 0.42;
  pointer-events: none;
  z-index: 0;
}

#profileGate::after {
  position: fixed;
  bottom: -78px;
  left: -42px;
  width: min(360px, 32vw);
  aspect-ratio: 447 / 558;
  background: url("/program_icons/profile-corner.png") center / contain no-repeat;
  content: "";
  opacity: 0.56;
  pointer-events: none;
  z-index: 0;
}

.cinema-gate[hidden],
.viewer-shell[hidden] {
  display: none;
}

.cinema-card {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(440px, 100%);
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(47, 49, 54, 0.96), rgba(32, 34, 37, 0.94));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
  padding: 28px;
  text-align: left;
}

.cinema-eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #fff;
  font-size: 2rem;
  line-height: 1.1;
}

label {
  display: grid;
  gap: 8px;
  color: var(--text-muted);
  font-weight: 700;
}

input {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  outline: none;
  background: #202225;
  color: #fff;
  padding: 0 12px;
}

input:focus {
  border-color: rgba(114, 137, 218, 0.75);
  box-shadow: 0 0 0 3px rgba(114, 137, 218, 0.12);
}

.cinema-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(32, 34, 37, 0.68);
  padding: 10px 14px 10px 10px;
}

.cinema-profile img {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: #202225;
  object-fit: cover;
}

.cinema-profile strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 1.15rem;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 800;
}

.primary-button {
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(114, 137, 218, 0.1);
  color: var(--text-primary);
}

.cinema-error {
  min-height: 20px;
  margin: 0;
  color: #ffb4b4;
}

.viewer-shell {
  background: #111418;
}

.cinema-viewer-open .cinema-title-mark {
  display: none;
}

.viewer-shell iframe {
  display: block;
  width: 100%;
  height: 100vh;
  border: 0;
  background: #111418;
}

@media (max-width: 900px) {
  .cinema-back-link {
    top: 106px;
    left: 24px;
  }
}

@media (max-width: 560px) {
  .cinema-title-mark {
    top: 24px;
    min-height: 54px;
    padding: 0 24px;
    font-size: 22px;
  }

  .cinema-back-link {
    top: 92px;
    left: 50%;
    min-height: 42px;
    transform: translateX(-50%);
    white-space: nowrap;
  }

  .cinema-back-link:hover,
  .cinema-back-link:focus-visible {
    transform: translateX(-50%) translateY(-1px);
  }

  #loginGate::after {
    right: -92px;
    bottom: -104px;
    width: 260px;
    opacity: 0.34;
  }

  #profileGate::after {
    bottom: -86px;
    left: -88px;
    width: 280px;
    opacity: 0.42;
  }

  .cinema-card {
    padding: 22px;
  }

  h1 {
    font-size: 1.65rem;
  }
}
