:root {
  --red: #e50914;
  --red-bright: #ff1f2d;
  --ink: #070709;
  --panel: #111115;
  --panel-soft: #18181d;
  --white: #f7f7f8;
  --muted: #a2a2aa;
  --line: rgba(255, 255, 255, 0.11);
  --success: #38d996;
  --warning: #ffbd3e;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  background: var(--ink);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--white);
  background:
    radial-gradient(circle at 82% 12%, rgba(229, 9, 20, 0.14), transparent 25%),
    linear-gradient(180deg, #0b0b0e 0%, var(--ink) 58%);
  font-family: Inter, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: 20;
  inset: 0;
  pointer-events: none;
  opacity: 0.045;
  content: "";
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
}

.ambient-one {
  top: -310px;
  right: -100px;
  background: rgba(229, 9, 20, 0.2);
}

.ambient-two {
  bottom: -400px;
  left: -250px;
  background: rgba(92, 42, 173, 0.12);
}

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  width: min(1400px, calc(100% - 64px));
  height: 90px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--red-bright);
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
}

.brand-mark {
  display: grid;
  width: 31px;
  height: 38px;
  border-radius: 4px 4px 7px 4px;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, #ff2432, #a90009);
  box-shadow: 7px 0 18px rgba(229, 9, 20, 0.28);
  font-size: 1.45rem;
  font-style: italic;
}

.topbar-actions,
.hero-actions,
.result-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.78rem;
  font-weight: 650;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6c6c73;
}

.status-pill.live .status-dot {
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(56, 217, 150, 0.12);
}

.view {
  display: none;
  width: min(1400px, calc(100% - 64px));
  min-height: calc(100vh - 90px);
  margin: 0 auto;
  animation: view-in 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.view-active {
  display: block;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.hero {
  position: relative;
  display: flex;
  overflow: hidden;
  min-height: calc(100vh - 90px);
  padding: 70px 3vw 110px;
  align-items: center;
  justify-content: center;
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 1050px;
  text-align: center;
}

.hero-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(76vw, 960px);
  aspect-ratio: 1;
  border: 1px solid rgba(229, 9, 20, 0.18);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(229, 9, 20, 0.15), transparent 58%),
    conic-gradient(from 90deg, transparent, rgba(229, 9, 20, 0.12), transparent 35%);
  filter: blur(0.2px);
  transform: translate(-50%, -48%);
  animation: halo-turn 18s linear infinite;
}

.hero-halo::before,
.hero-halo::after {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 50%;
  content: "";
}

.hero-halo::before {
  inset: 9%;
}

.hero-halo::after {
  inset: 24%;
}

@keyframes halo-turn {
  to {
    transform: translate(-50%, -48%) rotate(360deg);
  }
}

.hero-word-cloud {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}

.hero-word-cloud span {
  position: absolute;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  backdrop-filter: blur(10px);
  animation: word-float 6s ease-in-out infinite alternate;
}

.hero-word-cloud span:nth-child(1) { display: none; }
.hero-word-cloud span:nth-child(2) { top: 24%; right: 9%; animation-delay: -3.5s; }
.hero-word-cloud span:nth-child(3) { bottom: 23%; left: 5%; animation-delay: -4s; }
.hero-word-cloud span:nth-child(4) { right: 5%; bottom: 18%; animation-delay: -2s; }
.hero-word-cloud span:nth-child(5) { top: 11%; left: 43%; animation-delay: -5s; }
.hero-word-cloud span:nth-child(6) { right: 20%; bottom: 9%; animation-delay: -0.5s; }

@keyframes word-float {
  to {
    transform: translateY(-14px) rotate(1deg);
    color: rgba(255, 255, 255, 0.43);
  }
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--red-bright);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  text-wrap: balance;
}

h1 {
  max-width: 1100px;
  margin: 0;
  font-size: clamp(4rem, 8.3vw, 8.5rem);
  font-weight: 850;
  letter-spacing: -0.065em;
  line-height: 0.89;
}

h1 span,
.result-copy h2 span {
  color: transparent;
  background: linear-gradient(95deg, #fff 12%, #72727b 72%);
  background-clip: text;
}

h1 span {
  word-spacing: 0.08em;
}

.hero-copy {
  max-width: 610px;
  margin: 32px auto 36px;
  color: #c2c2c8;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.6;
}

.button {
  display: inline-flex;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 760;
  transition: 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.button:active {
  transform: translateY(0);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.button-primary {
  color: white;
  background: linear-gradient(135deg, var(--red-bright), #c9000b);
  box-shadow: 0 12px 30px rgba(229, 9, 20, 0.23);
}

.button-secondary {
  color: #f7f7f8;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
}

.button-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.button-large {
  min-height: 58px;
  padding: 0 26px;
  font-size: 0.95rem;
}

.button-small {
  min-height: 39px;
  padding: 0 14px;
  font-size: 0.78rem;
}

.play-icon {
  font-size: 0.75rem;
}

.youtube-icon {
  color: var(--red-bright);
}

.info-icon {
  display: grid;
  width: 20px;
  height: 20px;
  border: 1px solid currentColor;
  border-radius: 50%;
  place-items: center;
  font-family: Georgia, serif;
  font-size: 0.8rem;
}

.permission-note {
  margin: 16px 0 0;
  color: #717178;
  font-size: 0.75rem;
}

.hero-actions {
  justify-content: center;
}

.hero-format {
  position: absolute;
  z-index: 3;
  bottom: 28px;
  left: 50%;
  display: flex;
  padding: 13px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  align-items: center;
  gap: 14px;
  color: #85858d;
  background: rgba(10, 10, 13, 0.66);
  font-size: 0.68rem;
  backdrop-filter: blur(16px);
  transform: translateX(-50%);
}

.hero-format span {
  white-space: nowrap;
}

.hero-format b {
  margin-right: 5px;
  color: white;
  font-variant-numeric: tabular-nums;
}

.hero-format i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--red);
}

.feature-card {
  position: relative;
  overflow: hidden;
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    #101014;
  box-shadow: var(--shadow);
}

.feature-card::after {
  position: absolute;
  top: -60%;
  left: -20%;
  width: 40%;
  height: 200%;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.045), transparent);
  transform: rotate(20deg);
}

.feature-glow {
  position: absolute;
  top: -90px;
  right: -90px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: rgba(229, 9, 20, 0.23);
  filter: blur(70px);
}

.card-kicker {
  color: #777780;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.feature-time {
  margin: 13px 0 20px;
  font-variant-numeric: tabular-nums;
  font-size: clamp(3.6rem, 5.5vw, 5.4rem);
  font-weight: 250;
  letter-spacing: -0.06em;
}

.mini-timeline {
  display: flex;
  height: 4px;
  margin-bottom: 28px;
  gap: 4px;
}

.mini-timeline span {
  flex: var(--weight);
  border-radius: 99px;
  background: var(--red);
}

.mini-timeline span:nth-child(2) {
  background: #ef745e;
}

.mini-timeline span:nth-child(3) {
  background: #f5f5f5;
}

.feature-card ol,
.phase-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.feature-card li {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
  gap: 22px;
}

.feature-card li b {
  color: #777780;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.feature-card li span {
  font-size: 0.9rem;
  font-weight: 700;
}

.quality-badge {
  display: inline-block;
  margin-top: 24px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: #717178;
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.topics-section {
  padding: 32px 0 80px;
}

.section-heading {
  display: flex;
  margin-bottom: 22px;
  align-items: end;
  justify-content: space-between;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.4vw, 2.3rem);
  letter-spacing: -0.035em;
}

.muted {
  color: var(--muted);
  font-size: 0.78rem;
}

.topics-rail {
  display: grid;
  overflow-x: auto;
  padding: 4px 2px 24px;
  grid-auto-columns: minmax(210px, 1fr);
  grid-auto-flow: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: #3b3b42 transparent;
}

.topic-card {
  position: relative;
  display: flex;
  overflow: hidden;
  min-height: 270px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(180deg, transparent 10%, rgba(0, 0, 0, 0.88) 100%),
    radial-gradient(circle at 70% 18%, var(--card-color), #17171c 68%);
  transition: 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.topic-card::before {
  position: absolute;
  top: 18px;
  right: 18px;
  color: rgba(255, 255, 255, 0.1);
  content: attr(data-index);
  font-size: 3rem;
  font-weight: 900;
}

.topic-card:hover {
  z-index: 2;
  border-color: rgba(255, 255, 255, 0.25);
  transform: scale(1.04) translateY(-5px);
  box-shadow: var(--shadow);
}

.topic-card small {
  color: #bbbcc2;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topic-card h3 {
  margin: 8px 0 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.roulette-view {
  place-items: center;
}

.roulette-view.view-active {
  display: grid;
}

.roulette-stage {
  width: min(920px, 100%);
  text-align: center;
}

.roulette-stage h2 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  letter-spacing: -0.055em;
}

.roulette-window {
  position: relative;
  overflow: hidden;
  height: 310px;
  margin: 42px auto 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(12, 12, 15, 0.84);
  box-shadow: var(--shadow);
}

.roulette-track {
  position: absolute;
  top: 105px;
  right: 0;
  left: 0;
  transition: transform 80ms linear;
}

.roulette-item {
  display: flex;
  height: 100px;
  padding: 0 90px;
  align-items: center;
  justify-content: center;
  color: #5e5e66;
  font-size: clamp(1.25rem, 3.2vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.roulette-item.current {
  color: white;
  text-shadow: 0 0 35px rgba(229, 9, 20, 0.45);
}

.roulette-selector {
  position: absolute;
  z-index: 2;
  top: 105px;
  right: 18px;
  left: 18px;
  height: 100px;
  border: 1px solid rgba(229, 9, 20, 0.65);
  border-right: 4px solid var(--red);
  border-left: 4px solid var(--red);
  border-radius: 10px;
  pointer-events: none;
}

.roulette-fade {
  position: absolute;
  z-index: 3;
  right: 0;
  left: 0;
  height: 90px;
  pointer-events: none;
}

.roulette-fade-top {
  top: 0;
  background: linear-gradient(#0d0d10, transparent);
}

.roulette-fade-bottom {
  bottom: 0;
  background: linear-gradient(transparent, #0d0d10);
}

.roulette-hint {
  color: var(--muted);
  font-size: 0.85rem;
}

.roulette-hint.selected {
  color: var(--success);
}

.session-view {
  padding: 28px 0 70px;
}

.session-header {
  display: flex;
  margin-bottom: 24px;
  align-items: end;
  justify-content: space-between;
}

.session-header h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4.2rem);
  letter-spacing: -0.055em;
}

.recording-badge {
  display: flex;
  padding: 9px 12px;
  border: 1px solid rgba(229, 9, 20, 0.35);
  border-radius: 5px;
  align-items: center;
  gap: 8px;
  color: #ff8d94;
  background: rgba(229, 9, 20, 0.08);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.recording-badge span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  animation: blink 1.1s infinite;
}

@keyframes blink {
  50% {
    opacity: 0.25;
  }
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(310px, 0.65fr);
  gap: 20px;
}

.camera-shell {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #030304;
  box-shadow: var(--shadow);
}

.camera-shell video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.camera-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.42), transparent 25%, transparent 75%, rgba(0, 0, 0, 0.55)),
    radial-gradient(circle, transparent 45%, rgba(0, 0, 0, 0.34));
}

.camera-overlay {
  position: absolute;
  right: 22px;
  bottom: 18px;
  left: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  color: var(--muted);
  text-align: center;
  background: #07070a;
}

.camera-placeholder.hidden {
  display: none;
}

.camera-loader {
  width: 34px;
  height: 34px;
  margin: 0 auto;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.timer-panel {
  display: flex;
  padding: clamp(26px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  flex-direction: column;
  background: linear-gradient(160deg, #17171c, #0e0e12);
}

.timer-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.timer {
  margin: 22px 0 12px;
  font-size: clamp(4.3rem, 8vw, 7rem);
  font-weight: 220;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.08em;
  line-height: 1;
}

.timer.ending {
  color: #ff515c;
  animation: timer-pulse 1s infinite;
}

@keyframes timer-pulse {
  50% {
    opacity: 0.65;
  }
}

.timer-track,
.processing-track {
  overflow: hidden;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.09);
}

.timer-track span,
.processing-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a90009, var(--red-bright));
  transition: width 200ms linear;
}

.phase-instruction {
  min-height: 72px;
  margin: 26px 0 30px;
  color: #b4b4bc;
  font-size: 0.92rem;
  line-height: 1.55;
}

.phase-list {
  margin-top: auto;
}

.phase-list li {
  display: grid;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  opacity: 0.38;
  transition: 220ms;
}

.phase-list li.active,
.phase-list li.complete {
  opacity: 1;
}

.phase-number {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.phase-list b,
.phase-list small {
  display: block;
}

.phase-list b {
  font-size: 0.84rem;
}

.phase-list small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.65rem;
}

.phase-check {
  display: none;
  color: var(--success);
}

.phase-list li.complete .phase-check {
  display: block;
}

.processing-view {
  place-items: center;
}

.processing-view.view-active {
  display: grid;
}

.processing-card {
  width: min(690px, 100%);
  padding: 52px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(15, 15, 18, 0.84);
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(20px);
}

.processing-visual {
  position: relative;
  display: grid;
  width: 128px;
  height: 128px;
  margin: 0 auto 38px;
  place-items: center;
}

.processing-visual > span {
  font-size: 1.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.film-ring {
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-top-color: var(--red);
  border-right-color: rgba(229, 9, 20, 0.35);
  border-radius: 50%;
  animation: spin 1.8s linear infinite;
}

.ring-two {
  inset: 10px;
  border-top-color: white;
  border-right-color: transparent;
  animation-duration: 2.8s;
  animation-direction: reverse;
}

.processing-card h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.3rem);
  letter-spacing: -0.05em;
}

.processing-message {
  min-height: 26px;
  margin: 18px 0 30px;
  color: var(--muted);
}

.processing-track {
  height: 6px;
}

.processing-steps {
  display: flex;
  margin-top: 15px;
  justify-content: space-between;
  color: #5d5d64;
  font-size: 0.63rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.processing-steps span.active {
  color: white;
}

.result-view {
  padding: 45px 0 80px;
  align-items: center;
  grid-template-columns: minmax(0, 0.7fr) minmax(500px, 1.3fr);
  gap: clamp(35px, 6vw, 90px);
}

.result-view.view-active {
  display: grid;
}

.result-copy h2 {
  margin: 0;
  font-size: clamp(2.6rem, 5vw, 5.2rem);
  letter-spacing: -0.06em;
  line-height: 0.98;
}

.result-description {
  margin: 26px 0 32px;
  color: var(--muted);
  line-height: 1.6;
}

.result-player-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: black;
  box-shadow: var(--shadow);
}

.result-player-shell video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.remote-result {
  display: none;
  min-height: 420px;
  padding: 40px;
  aspect-ratio: 16 / 9;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  text-align: center;
  background:
    radial-gradient(circle at center, rgba(229, 9, 20, 0.22), transparent 38%),
    linear-gradient(145deg, #17171c, #08080a);
}

.remote-result.visible {
  display: flex;
}

.remote-play {
  display: grid;
  width: 74px;
  height: 74px;
  margin-bottom: 12px;
  border-radius: 50%;
  place-items: center;
  color: white;
  background: var(--red);
  box-shadow: 0 15px 45px rgba(229, 9, 20, 0.35);
  font-size: 1.3rem;
  text-indent: 4px;
}

.remote-result b {
  font-size: 1.2rem;
}

.remote-result small {
  color: var(--muted);
  line-height: 1.5;
}

.result-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 7px 9px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.7);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.how-dialog {
  width: min(860px, calc(100% - 34px));
  padding: 48px;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--white);
  background: #141418;
  box-shadow: var(--shadow);
}

.password-dialog {
  width: min(470px, calc(100% - 30px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--white);
  background:
    radial-gradient(circle at 50% 0, rgba(229, 9, 20, 0.15), transparent 42%),
    #121216;
  box-shadow: var(--shadow);
}

.password-dialog::backdrop {
  background: rgba(0, 0, 0, 0.84);
  backdrop-filter: blur(12px);
}

.password-dialog form {
  position: relative;
  display: flex;
  padding: 44px;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
}

.password-dialog h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.05em;
}

.password-copy {
  margin: 14px 0 26px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.55;
}

.password-dialog label {
  margin-bottom: 8px;
  color: #909098;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
}

.password-dialog input {
  width: 100%;
  height: 56px;
  padding: 0 17px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 9px;
  outline: none;
  color: white;
  background: rgba(255, 255, 255, 0.055);
  font: inherit;
  letter-spacing: 0.08em;
  transition: 180ms;
}

.password-dialog input:focus {
  border-color: rgba(229, 9, 20, 0.85);
  box-shadow: 0 0 0 4px rgba(229, 9, 20, 0.1);
}

.password-dialog input.invalid {
  border-color: var(--red);
  animation: input-shake 280ms ease;
}

@keyframes input-shake {
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.password-error {
  min-height: 19px;
  margin: 8px 0 10px;
  color: #ff7079;
  font-size: 0.75rem;
}

.password-lock {
  width: 58px;
  height: 65px;
  margin: 0 auto 24px;
  filter: drop-shadow(0 12px 18px rgba(229, 9, 20, 0.28));
}

.password-lock svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.password-lock .lock-shackle {
  fill: none;
  stroke: #f5f5f6;
  stroke-linecap: round;
  stroke-width: 6;
}

.password-lock .lock-body {
  fill: url("#passwordLockGradient");
}

.password-lock .lock-keyhole {
  fill: none;
  stroke: white;
  stroke-linecap: round;
  stroke-width: 7;
}

.flash-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: white;
  transition: opacity 180ms ease-out;
}

.flash-overlay.active {
  opacity: 1;
}

body.presentation-mode #sessionView {
  position: relative;
  z-index: 1001;
}

body.presentation-mode .session-header h2 {
  color: #09090b;
}

body.presentation-mode .recording-badge {
  color: #a60009;
  background: rgba(255, 255, 255, 0.8);
}

body.presentation-mode .camera-shell {
  border-color: rgba(9, 9, 11, 0.22);
  box-shadow:
    0 22px 70px rgba(9, 9, 11, 0.2),
    var(--shadow);
}

.how-dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
}

.how-dialog h2 {
  margin: 0 0 32px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: -0.05em;
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 18px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  place-items: center;
  color: #f5f5f6;
  background: rgba(255, 255, 255, 0.08);
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.dialog-close svg {
  display: block;
  width: 18px;
  height: 18px;
}

.dialog-close path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.2;
}

.dialog-close:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: rotate(5deg);
}

.dialog-close:focus-visible {
  outline: 2px solid var(--red-bright);
  outline-offset: 3px;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.how-grid article {
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.how-grid article > span {
  color: var(--red);
  font-size: 0.7rem;
  font-weight: 900;
}

.how-grid h3 {
  margin: 24px 0 8px;
}

.how-grid p,
.dialog-note {
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.55;
}

.dialog-note {
  margin: 25px 0 0;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  max-width: 410px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  color: white;
  background: #24242a;
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  transform: translateY(12px);
  transition: 220ms;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-color: rgba(229, 9, 20, 0.55);
}

@media (max-width: 980px) {
  .hero,
  .studio-grid,
  .result-view.view-active {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 80px;
  }

  .feature-card {
    max-width: 520px;
  }

  .camera-shell {
    min-height: auto;
    aspect-ratio: 16 / 10;
  }

  .result-view {
    padding-top: 70px;
  }

  .result-player-shell {
    order: -1;
  }
}

@media (max-width: 680px) {
  .topbar,
  .view {
    width: min(100% - 30px, 1400px);
  }

  .topbar {
    height: 74px;
  }

  .status-pill {
    display: none;
  }

  .brand {
    font-size: 1rem;
  }

  .hero {
    min-height: calc(100vh - 74px);
    padding: 70px 0 105px;
  }

  h1 {
    font-size: clamp(3.2rem, 17vw, 5rem);
  }

  .hero-actions,
  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions .button,
  .result-actions .button {
    width: 100%;
  }

  .hero-word-cloud span:nth-child(1),
  .hero-word-cloud span:nth-child(4),
  .hero-word-cloud span:nth-child(5) {
    display: none;
  }

  .hero-format {
    width: max-content;
    max-width: 100%;
    padding: 11px 13px;
    gap: 8px;
    font-size: 0.57rem;
  }

  .feature-card {
    padding: 28px;
  }

  .roulette-item {
    padding: 0 35px;
  }

  .session-header {
    align-items: start;
  }

  .camera-shell {
    aspect-ratio: 3 / 4;
  }

  .camera-overlay {
    align-items: start;
    flex-direction: column;
    gap: 5px;
  }

  .timer-panel,
  .processing-card,
  .how-dialog,
  .password-dialog form {
    padding: 28px 22px;
  }

  .how-grid {
    grid-template-columns: 1fr;
  }

  .processing-steps {
    font-size: 0.52rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
