:root,
[data-theme="ocean"] {
  --font: "Space Grotesk", "Segoe UI", sans-serif;
  --accent: #0d9488;
  --accent-hover: #14b8a6;
  --accent-press: #0f766e;
  --accent-text: #ffffff;
  --accent-border: rgba(255, 255, 255, 0.5);
  --btn-shadow: 0 12px 32px rgba(0, 0, 0, 0.42);
  --btn-shadow-hover: 0 18px 40px rgba(13, 148, 136, 0.45), 0 10px 24px rgba(0, 0, 0, 0.35);
  --overlay: rgba(0, 0, 0, 0.55);
  --btn-radius: 999px;
  --btn-min: 6.25rem;
  --btn-font: 1.75rem;
  
  --choice-lock-ms: 250ms;
  --choice-lock-anim-ms: 250ms;
  --choice-dismiss-ms: 170ms;
  
  --choice-enter-ms: 1.35s;
  --choice-enter-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --choice-enter-slide: 4.5rem;
  
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

[data-theme="soft"] {
  --accent: rgba(255, 255, 255, 0.22);
  --accent-hover: rgba(255, 255, 255, 0.38);
  --accent-press: rgba(255, 255, 255, 0.28);
  --accent-text: #f8fafc;
  --accent-border: rgba(255, 255, 255, 0.55);
  --btn-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  --btn-shadow-hover: 0 14px 36px rgba(0, 0, 0, 0.3);
  --btn-radius: 18px;
  --overlay: rgba(15, 23, 42, 0.45);
}

[data-theme="bold"] {
  --accent: #facc15;
  --accent-hover: #fde047;
  --accent-press: #eab308;
  --accent-text: #111827;
  --accent-border: #111827;
  --btn-shadow: 0 0 0 3px rgba(250, 204, 21, 0.35), 0 12px 28px rgba(0, 0, 0, 0.45);
  --btn-shadow-hover: 0 0 0 4px rgba(250, 204, 21, 0.55), 0 16px 34px rgba(0, 0, 0, 0.5);
  --btn-radius: 12px;
  --overlay: rgba(0, 0, 0, 0.65);
}

[data-theme="warm"] {
  --accent: #e11d48;
  --accent-hover: #fb7185;
  --accent-press: #be123c;
  --accent-text: #fff7ed;
  --accent-border: rgba(255, 237, 213, 0.5);
  --btn-shadow: 0 12px 30px rgba(127, 29, 29, 0.45);
  --btn-shadow-hover: 0 18px 36px rgba(225, 29, 72, 0.4);
  --btn-radius: 16px;
  --overlay: rgba(28, 10, 8, 0.55);
}

[data-font="default"] { --font: "Space Grotesk", "Segoe UI", sans-serif; }
[data-font="display"] { --font: "Syne", "Space Grotesk", sans-serif; }
[data-font="rounded"] { --font: "Fredoka", "Segoe UI", sans-serif; }
[data-font="mono"] { --font: "JetBrains Mono", ui-monospace, monospace; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: var(--font);
  background: #000;
  color: #fff;
}

.app {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: 100%;
  max-height: 100%;
}

.status {
  position: absolute;
  z-index: 3;
  top: max(0.75rem, var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  max-width: min(90vw, 40rem);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
}

.status[hidden] {
  display: none;
}

.subtitles-toggle,
.music-toggle {
  position: absolute;
  z-index: 4;
  top: max(0.7rem, var(--safe-top));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  height: 2.65rem;
  padding: 0;
  margin: 0;
  appearance: none;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.78);
  opacity: 0.58;
  cursor: pointer;
  transition: opacity 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.music-toggle {
  right: max(0.7rem, var(--safe-right));
}

.subtitles-toggle {
  right: calc(max(0.7rem, var(--safe-right)) + 2.85rem);
}

.subtitles-toggle:hover,
.subtitles-toggle:focus-visible,
.music-toggle:hover,
.music-toggle:focus-visible {
  opacity: 0.88;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(0, 0, 0, 0.28);
  outline: none;
}

.subtitles-toggle:active,
.music-toggle:active {
  transform: scale(0.94);
}

.subtitles-toggle.is-off,
.music-toggle.is-muted {
  opacity: 0.48;
  color: rgba(255, 255, 255, 0.58);
}

.subtitles-toggle.is-off:hover,
.subtitles-toggle.is-off:focus-visible,
.music-toggle.is-muted:hover,
.music-toggle.is-muted:focus-visible {
  opacity: 0.78;
  color: rgba(255, 255, 255, 0.82);
}

.stage.is-choosing .subtitles-toggle,
.stage.is-choosing .music-toggle {
  opacity: 0.82;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.38);
}

.stage.is-choosing .subtitles-toggle:hover,
.stage.is-choosing .subtitles-toggle:focus-visible,
.stage.is-choosing .music-toggle:hover,
.stage.is-choosing .music-toggle:focus-visible {
  opacity: 0.95;
  color: #fff;
  background: rgba(0, 0, 0, 0.48);
}

.stage.is-choosing .subtitles-toggle.is-off,
.stage.is-choosing .music-toggle.is-muted {
  opacity: 0.72;
  color: rgba(255, 255, 255, 0.72);
}

.subtitles-toggle .cc-slash,
.music-toggle .music-slash {
  display: none;
}

.subtitles-toggle.is-off .cc-slash,
.music-toggle.is-muted .music-slash {
  display: block;
}

.subtitles-toggle-icon,
.music-toggle-icon {
  display: block;
  width: 1.4rem;
  height: 1.4rem;
  pointer-events: none;
}

.play-pause {
  position: absolute;
  z-index: 4;
  left: max(0.55rem, var(--safe-left));
  bottom: max(0.55rem, var(--safe-bottom));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.05rem;
  height: 3.05rem;
  padding: 0;
  margin: 0;
  appearance: none;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  color: rgba(255, 255, 255, 0.92);
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transition: opacity 0.5s ease, color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.play-pause-icon {
  display: block;
  width: 1.45rem;
  height: 1.45rem;
  pointer-events: none;
}

.play-pause .icon-play {
  display: none;
}

.play-pause.is-paused .icon-pause {
  display: none;
}

.play-pause.is-paused .icon-play {
  display: block;
}

.play-pause.is-revealed {
  opacity: 0.72;
  pointer-events: auto;
}

.play-pause.is-revealed:hover,
.play-pause.is-revealed:focus-visible {
  opacity: 0.95;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  outline: none;
}

.play-pause.is-revealed:active {
  transform: scale(0.94);
}

.play-pause[hidden] {
  display: none;
}

.stage.is-choosing .play-pause {
  opacity: 0;
  pointer-events: none;
}

.skip-video {
  position: absolute;
  z-index: 4;
  right: max(0.55rem, var(--safe-right));
  bottom: max(0.55rem, var(--safe-bottom));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.05rem;
  height: 3.05rem;
  padding: 0;
  margin: 0;
  appearance: none;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  color: rgba(255, 255, 255, 0.92);
  opacity: 0;
  pointer-events: none;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.06em;
  cursor: pointer;
  transition: opacity 0.5s ease, color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.skip-video.is-revealed {
  opacity: 0.72;
  pointer-events: auto;
}

.skip-video.is-revealed:hover,
.skip-video.is-revealed:focus-visible {
  opacity: 0.95;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  outline: none;
}

.skip-video.is-revealed:active {
  transform: scale(0.94);
}

.skip-video[hidden] {
  display: none;
}

.stage.is-choosing .skip-video {
  opacity: 0;
  pointer-events: none;
}

.subtitle-display {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 5.5rem;
  transform: translateX(-50%);
  max-width: min(92vw, 42rem);
  margin: 0;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  white-space: pre-line;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.subtitle-display[hidden] {
  display: none !important;
}

.stage.is-choosing .subtitle-display {
  display: none !important;
}

.stage {
  position: absolute;
  inset: 0;
  background: #000;
  overflow: hidden;
}

video,
.video-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  pointer-events: none;
}

.video-layer {
  opacity: 0;
  z-index: 0;
  transition: opacity 0.9s ease, filter 1s ease;
}

.video-layer.is-active {
  opacity: 1;
  z-index: 1;
}

.start-actions {
  position: absolute;
  z-index: 4;
  inset: 0;
  margin: auto;
  width: max-content;
  max-width: calc(100% - 2rem);
  height: max-content;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.7rem;
  padding: 0 0.75rem;
  box-sizing: border-box;
}

.start-actions[hidden] {
  display: none !important;
}

.linkedin-actions {
  position: absolute;
  z-index: 4;
  inset: 0;
  margin: auto;
  width: max-content;
  max-width: calc(100% - 2rem);
  height: max-content;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0 0.75rem;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}

.linkedin-actions[hidden] {
  display: none !important;
}

.stage.is-choosing .linkedin-actions:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}

.linkedin-end {
  --li-blue: #0a66c2;
  --li-blue-hover: #004182;
  --li-blue-press: #003060;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.05rem;
  text-align: left;
  width: 100%;
  min-width: 24rem;
  min-height: 6.25rem;
  height: auto;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 0.55rem 1.75rem 0.55rem 0.55rem;
  font: inherit;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  color: #fff;
  background: var(--li-blue);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(10, 102, 194, 0.35);
  transition: background 0.2s ease, transform 0.18s ease, box-shadow 0.2s ease,
    border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
  transform: translateY(var(--choice-enter-slide)) scale(0.94);
}

.linkedin-end-avatar {
  flex: 0 0 auto;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  background: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.linkedin-end-label {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.linkedin-end-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #fff;
  opacity: 0.95;
}

.linkedin-end-brand svg {
  display: block;
  width: 2rem;
  height: 2rem;
}

.linkedin-end-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 1.05em;
}

.linkedin-end[hidden] {
  display: none !important;
}

.stage.is-choosing .linkedin-actions:not([hidden]) .linkedin-end:not([hidden]) {
  animation: choice-in var(--choice-enter-ms) var(--choice-enter-ease) forwards;
}

.linkedin-end:hover:not(:disabled),
.linkedin-end:focus-visible:not(:disabled) {
  background: var(--li-blue-hover);
  box-shadow: 0 18px 40px rgba(10, 102, 194, 0.45), 0 10px 24px rgba(0, 0, 0, 0.35);
  outline: none;
}

.linkedin-end:active:not(:disabled) {
  background: var(--li-blue-press);
  transform: translateY(0) scale(0.98);
}

.linkedin-end:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.lancer {
  width: 100%;
  min-width: 16rem;
  height: var(--btn-min);
  appearance: none;
  border: 2px solid var(--accent-border);
  border-radius: var(--btn-radius);
  padding: 0 3rem;
  font: inherit;
  font-size: calc(var(--btn-font) + 0.15rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  color: var(--accent-text);
  background: var(--accent);
  box-shadow: var(--btn-shadow);
  transition: background 0.2s ease, transform 0.18s ease, box-shadow 0.2s ease,
    border-color 0.2s ease, color 0.2s ease;
}

.lancer-subtitles {
  min-width: 0;
  height: auto;
  min-height: calc(var(--btn-min) * 0.78);
  padding: 0.65rem 1.5rem;
  font-size: calc(var(--btn-font) - 0.05rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent-text);
  background: color-mix(in srgb, var(--accent) 38%, transparent);
  border-color: color-mix(in srgb, var(--accent-border) 75%, transparent);
  box-shadow: none;
}

.lancer-subtitles:hover,
.lancer-subtitles:focus-visible {
  background: color-mix(in srgb, var(--accent-hover) 55%, transparent);
  border-color: var(--accent-border);
  box-shadow: var(--btn-shadow);
}

.lancer-subtitles:active {
  background: color-mix(in srgb, var(--accent-press) 50%, transparent);
}

.lancer:hover,
.lancer:focus-visible,
.relancer:hover,
.relancer:focus-visible,
.choices button:hover,
.choices button:focus-visible {
  background: var(--accent-hover);
  transform: translateY(-4px) scale(1.06);
  box-shadow: var(--btn-shadow-hover);
  outline: none;
}

.lancer:active,
.relancer:active,
.choices button:active {
  background: var(--accent-press);
  transform: translateY(0) scale(0.98);
}

.choices[hidden],
.choices-row[hidden],
.choice-back[hidden],
.end-panel[hidden] {
  display: none !important;
}

.overlay-bottom {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  
  padding-top: 1.75rem;
  padding-right: max(1.25rem, var(--safe-right));
  padding-bottom: max(2.25rem, calc(1.15rem + var(--safe-bottom)));
  padding-left: max(1.25rem, var(--safe-left));
  background: linear-gradient(transparent, var(--overlay));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  box-sizing: border-box;
}

.choices-row {
  position: relative;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.choices-main {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: center;
  gap: 1.1rem;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

.choices {
  display: grid;
  gap: 1.1rem;
  width: min(100%, 58rem);
  flex: 0 1 auto;
  min-width: 0;
  justify-content: center;
  align-items: stretch;
}

.choices-conditional {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: center;
  gap: 1.1rem;
  position: absolute;
  left: 0; 
  top: 0;
  bottom: 0;
  margin-block: auto;
  height: fit-content;
  z-index: 2;
  min-width: 0;
  transition: left 0.15s ease;
}

.choices-conditional[hidden] {
  display: none !important;
}

.choices-conditional button.choice-conditional {
  appearance: none;
  border: 2px solid #fcd34d !important;
  border-radius: var(--btn-radius);
  background: #92400e !important;
  color: #fffbeb !important;
  opacity: 1;
  padding: 1.35rem 1.6rem;
  font: inherit;
  font-size: var(--btn-font);
  font-weight: 700;
  letter-spacing: 0.02em;
  min-height: var(--btn-min);
  min-width: 12rem;
  max-width: 18rem;
  white-space: normal;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4) !important;
  filter: none !important;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.choices-conditional button.choice-conditional:hover,
.choices-conditional button.choice-conditional:focus-visible {
  background: #b45309 !important;
  border-color: #fde68a !important;
  color: #ffffff !important;
  transform: translateY(-2px);
}

.choices-conditional button.choice-conditional:active {
  background: #78350f !important;
  transform: translateY(0) scale(0.98);
}

[data-theme] .choices-conditional button.choice-conditional,
[data-theme] .choices-conditional button.choice-conditional:hover,
[data-theme] .choices-conditional button.choice-conditional:focus-visible,
[data-theme] .choices-conditional button.choice-conditional:active {
  background: #92400e !important;
  color: #fffbeb !important;
  border-color: #fcd34d !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4) !important;
  filter: none !important;
  opacity: 1;
}

[data-theme] .choices-conditional button.choice-conditional:hover,
[data-theme] .choices-conditional button.choice-conditional:focus-visible {
  background: #b45309 !important;
  border-color: #fde68a !important;
  color: #ffffff !important;
}

.choice-back {
  appearance: none;
  position: absolute;
  left: 0; 
  top: 0;
  bottom: 0;
  margin-block: auto;
  height: fit-content;
  z-index: 2;
  border: 2px solid #9ca3af !important;
  border-radius: var(--btn-radius);
  background: #6b7280 !important;
  color: #f3f4f6 !important;
  padding: 1.1rem 1.35rem;
  font: inherit;
  font-size: calc(var(--btn-font) * 0.85);
  font-weight: 650;
  letter-spacing: 0.02em;
  min-height: calc(var(--btn-min) * 0.85);
  width: auto;
  max-width: 11rem;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35) !important;
  filter: none !important;
  opacity: 1 !important;
  transition: background 0.2s ease, left 0.15s ease, border-color 0.2s ease;
}

.choice-back:hover,
.choice-back:focus-visible {
  background: #4b5563 !important;
  color: #ffffff !important;
  border-color: #d1d5db !important;
  transform: translateY(-2px);
}

.choice-back:active {
  background: #374151 !important;
  transform: translateY(0);
}

[data-theme] .choice-back,
[data-theme] .choice-back:hover,
[data-theme] .choice-back:focus-visible,
[data-theme] .choice-back:active {
  background: #6b7280 !important;
  color: #f3f4f6 !important;
  border-color: #9ca3af !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35) !important;
  filter: none !important;
}

[data-theme] .choice-back:hover,
[data-theme] .choice-back:focus-visible {
  background: #4b5563 !important;
  color: #ffffff !important;
  border-color: #d1d5db !important;
}

.choices[data-count="1"] {
  grid-template-columns: minmax(16rem, 22rem);
  justify-content: center;
}

.choices[data-count="2"] {
  grid-template-columns: 1fr 1fr;
  max-width: 46rem;
}

.choices[data-count="3"] {
  grid-template-columns: 1fr 1fr 1fr;
  max-width: 58rem;
}

.choices[data-count="4"] {
  grid-template-columns: 1fr 1fr;
  max-width: 46rem;
}

.choices[data-count="5"],
.choices[data-count="6"] {
  grid-template-columns: 1fr 1fr 1fr;
  max-width: 58rem;
}

.choices button,
.relancer {
  appearance: none;
  border: 2px solid var(--accent-border);
  border-radius: var(--btn-radius);
  background: var(--accent);
  color: var(--accent-text);
  padding: 1.35rem 1.6rem;
  font: inherit;
  font-size: var(--btn-font);
  font-weight: 700;
  letter-spacing: 0.02em;
  min-height: var(--btn-min);
  width: 100%;
  cursor: pointer;
  box-shadow: var(--btn-shadow);
  transition: background 0.2s ease, transform 0.18s ease, box-shadow 0.2s ease;
}

.relancer {
  width: auto;
  min-width: 16rem;
}

.end-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}

.end-message {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 650;
  text-align: center;
}

.filming-note {
  position: absolute;
  z-index: 3;
  right: max(0.65rem, var(--safe-right));
  bottom: max(0.55rem, var(--safe-bottom));
  margin: 0;
  max-width: min(70vw, 16rem);
  text-align: right;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.55);
  pointer-events: none;
  user-select: none;
}

.filming-note[hidden] {
  display: none !important;
}

.stage .video-layer {
  filter: none;
}

.stage.no-veil-transition .video-layer {
  transition: none !important;
}

.stage.is-choosing .video-layer {
  filter: blur(10px) brightness(0.42);
}

.stage.is-crossfading .video-layer {
  
  transition: opacity 0.9s ease, filter 1s ease;
}

.stage.is-hard-cutting .video-layer {
  
  transition: none !important;
}

.overlay-bottom .choices-row,
.overlay-bottom .end-panel {
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}

.stage.is-choosing .choices-row:not([hidden]),
.stage.is-choosing .end-panel:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}

.stage.is-choosing .choices-row:not([hidden]) .choice-back:not([hidden]) {
  
  animation: choice-back-in var(--choice-enter-ms) var(--choice-enter-ease) both;
}

@keyframes choice-back-in {
  from {
    opacity: 0;
    transform: translate(calc(-1 * var(--choice-enter-slide)), var(--choice-enter-slide)) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

.stage.is-choosing .choices:not([hidden]) button {
  animation: choice-in var(--choice-enter-ms) var(--choice-enter-ease) both;
}

.stage.is-choosing .choices-conditional:not([hidden]) button {
  animation: choice-conditional-in var(--choice-enter-ms) var(--choice-enter-ease) both;
}

.stage.is-choosing .end-panel:not([hidden]) .end-message,
.stage.is-choosing .end-panel:not([hidden]) .relancer {
  animation: choice-in var(--choice-enter-ms) var(--choice-enter-ease) both;
}

@keyframes choice-in {
  from {
    opacity: 0;
    transform: translateY(var(--choice-enter-slide)) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes choice-conditional-in {
  from {
    opacity: 0;
    transform: translate(var(--choice-enter-slide), var(--choice-enter-slide)) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

[data-theme="soft"] .lancer,
[data-theme="soft"] .lancer-subtitles,
[data-theme="soft"] .choices button,
[data-theme="soft"] .relancer {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

[data-theme="ocean"] .lancer:hover,
[data-theme="ocean"] .lancer:focus-visible,
[data-theme="ocean"] .relancer:hover,
[data-theme="ocean"] .relancer:focus-visible,
[data-theme="ocean"] .choices button:hover,
[data-theme="ocean"] .choices button:focus-visible {
  transform: translateY(-5px) scale(1.08);
  filter: brightness(1.08);
}

[data-theme="ocean"] .linkedin-end:hover:not(:disabled),
[data-theme="ocean"] .linkedin-end:focus-visible:not(:disabled) {
  transform: translateY(-5px) scale(1.04);
  filter: none;
}

@media (max-width: 640px) {
  :root,
  [data-theme="ocean"],
  [data-theme="soft"],
  [data-theme="bold"],
  [data-theme="warm"] {
    --btn-min: 3.5rem; 
    --btn-font: 1.1rem;
    --choice-enter-slide: 2.75rem;
  }

  .overlay-bottom {
    padding-top: 0.85rem;
    padding-right: max(0.75rem, var(--safe-right));
    
    padding-bottom: max(1.65rem, calc(1.15rem + var(--safe-bottom)));
    padding-left: max(0.75rem, var(--safe-left));
    gap: 0.65rem;
    max-height: min(78dvh, 100%);
  }

  
  .choices-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "main main";
    align-items: center;
    column-gap: 0.55rem;
    row-gap: 0.55rem;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
  }

  .choices-row.has-back.has-conditional {
    grid-template-areas:
      "back cond"
      "main main";
  }

  .choices-row.has-back:not(.has-conditional) {
    grid-template-areas:
      "back back"
      "main main";
  }

  .choices-row.has-conditional:not(.has-back) {
    grid-template-areas:
      "cond cond"
      "main main";
  }

  .choices-main {
    grid-area: main;
    width: 100%;
    max-width: 100%;
  }

  .choice-back {
    grid-area: back;
    position: static;
    left: auto !important;
    top: auto;
    bottom: auto;
    margin: 0;
    height: auto;
    width: auto;
    max-width: none;
    justify-self: start;
    padding: 0.5rem 0.85rem;
    font-size: 0.92rem;
    min-height: 2.5rem;
    transition: background 0.2s ease, border-color 0.2s ease;
  }

  .choices-conditional {
    grid-area: cond;
    position: static;
    left: auto !important;
    top: auto;
    bottom: auto;
    margin: 0;
    height: auto;
    width: auto;
    max-width: 100%;
    justify-self: end;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.45rem;
    transition: none;
  }

  .choices-row.has-back:not(.has-conditional) .choice-back,
  .choices-row.has-conditional:not(.has-back) .choices-conditional {
    justify-self: center;
  }

  .choices {
    gap: 0.55rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .choices[data-count="1"] {
    grid-template-columns: minmax(0, 1fr);
    max-width: 100%;
  }

  .choices[data-count="2"] {
    grid-template-columns: 1fr 1fr;
    max-width: 100%;
  }

  .choices[data-count="3"] {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .choices[data-count="4"] {
    grid-template-columns: 1fr 1fr;
    max-width: 100%;
  }

  .choices[data-count="5"],
  .choices[data-count="6"] {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .start-actions,
  .linkedin-actions {
    width: min(24rem, 100%);
    max-width: calc(100% - 1.5rem);
  }

  .lancer,
  .relancer {
    min-width: min(16rem, 100%);
    width: min(20rem, 100%);
  }

  .linkedin-end {
    min-width: 0;
    width: 100%;
    min-height: 5rem;
    padding: 0.4rem 1.1rem 0.4rem 0.4rem;
    font-size: 1.3rem;
    gap: 0.75rem;
  }

  .linkedin-end-brand svg {
    width: 1.55rem;
    height: 1.55rem;
  }

  .linkedin-end-avatar {
    width: 3.4rem;
    height: 3.4rem;
  }

  .start-actions .lancer,
  .linkedin-actions .linkedin-end {
    width: 100%;
    min-width: 0;
  }

  .choices button,
  .choices-conditional button.choice-conditional,
  .relancer,
  .lancer {
    min-width: 0;
    min-height: var(--btn-min);
    padding: 0.75rem 0.95rem;
  }

  .choices-main {
    gap: 0.55rem;
    width: 100%;
    min-width: 0;
  }

  .choices-conditional button.choice-conditional {
    min-width: 0;
    max-width: none;
    width: auto;
    padding: 0.5rem 0.85rem;
    font-size: 0.92rem;
    min-height: 2.5rem;
  }

  .lancer-subtitles {
    min-height: calc(var(--btn-min) * 0.78);
    padding: 0.75rem 1rem;
  }

  .subtitle-display {
    bottom: max(4.75rem, calc(3.5rem + var(--safe-bottom)));
    max-width: min(92vw, 36rem);
    font-size: clamp(0.95rem, 3.6vw, 1.15rem);
  }

  .end-panel {
    gap: 0.75rem;
    width: 100%;
  }
}

@media (max-height: 480px) and (max-width: 960px) {
  :root,
  [data-theme="ocean"],
  [data-theme="soft"],
  [data-theme="bold"],
  [data-theme="warm"] {
    --btn-min: 2.85rem;
    --btn-font: 0.98rem;
    --choice-enter-slide: 1.75rem;
  }

  .overlay-bottom {
    padding-top: 0.45rem;
    padding-right: max(0.55rem, var(--safe-right));
    padding-bottom: max(0.85rem, calc(0.55rem + var(--safe-bottom)));
    padding-left: max(0.55rem, var(--safe-left));
    gap: 0.4rem;
    max-height: min(88dvh, 100%);
  }

  
  .choices-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "main main";
    column-gap: 0.4rem;
    row-gap: 0.4rem;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
  }

  .choices-row.has-back.has-conditional {
    grid-template-areas:
      "back cond"
      "main main";
  }

  .choices-row.has-back:not(.has-conditional) {
    grid-template-areas:
      "back back"
      "main main";
  }

  .choices-row.has-conditional:not(.has-back) {
    grid-template-areas:
      "cond cond"
      "main main";
  }

  .choices-main {
    grid-area: main;
    width: 100%;
    max-width: 100%;
  }

  .choice-back {
    grid-area: back;
    position: static;
    left: auto !important;
    top: auto;
    bottom: auto;
    margin: 0;
    height: auto;
    max-width: none;
    justify-self: start;
    padding: 0.4rem 0.7rem;
    font-size: 0.82rem;
    min-height: 2.25rem;
  }

  .choices-conditional {
    grid-area: cond;
    position: static;
    left: auto !important;
    top: auto;
    bottom: auto;
    margin: 0;
    height: auto;
    max-width: 100%;
    justify-self: end;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
    transition: none;
  }

  .choices {
    gap: 0.4rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .choices[data-count="3"],
  .choices[data-count="5"],
  .choices[data-count="6"] {
    grid-template-columns: 1fr 1fr;
    max-width: 100%;
  }

  .choices button,
  .relancer,
  .lancer {
    padding: 0.45rem 0.75rem;
    min-height: var(--btn-min);
  }

  .choices-conditional button.choice-conditional {
    padding: 0.4rem 0.7rem;
    font-size: 0.82rem;
    min-height: 2.25rem;
    max-width: none;
  }

  .linkedin-end {
    min-height: 3.75rem;
    font-size: 1.1rem;
    padding: 0.3rem 0.9rem 0.3rem 0.3rem;
  }

  .linkedin-end-avatar {
    width: 2.75rem;
    height: 2.75rem;
  }

  .status {
    font-size: 0.82rem;
    padding: 0.3rem 0.7rem;
  }

  .subtitle-display {
    bottom: max(3.25rem, calc(2.25rem + var(--safe-bottom)));
    padding: 0.3rem 0.65rem;
    font-size: 0.9rem;
  }
}

.fade-black {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}

.stage.is-fading-out .fade-black {
  opacity: 1;
  pointer-events: auto;
}

.stage.is-cut-fading .fade-black {
  transition: opacity 0.4s ease;
  opacity: 1;
  pointer-events: none;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  pointer-events: none;
  background: transparent;
}

.stage.is-choosing .loading-overlay:not([hidden]) .loading-text {
  color: rgba(255, 255, 255, 0.88);
}

.loading-overlay[hidden] {
  display: none !important;
}

.loading-spinner {
  width: 1.75rem;
  height: 1.75rem;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  animation: loading-spin 0.7s linear infinite;
}

.loading-text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.error-panel {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 26rem);
  padding: 1.35rem 1.4rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.error-panel[hidden] {
  display: none !important;
}

.error-message {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.94);
}

.error-retry {
  appearance: none;
  border: 2px solid var(--accent-border);
  border-radius: var(--btn-radius);
  background: var(--accent);
  color: var(--accent-text);
  padding: 0.85rem 1.4rem;
  min-height: 3rem;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--btn-shadow);
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.error-retry:hover,
.error-retry:focus-visible {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--btn-shadow-hover);
  outline: none;
}

.error-retry:active {
  background: var(--accent-press);
  transform: translateY(0);
}

@media (max-width: 640px) {
  .loading-spinner {
    width: 1.5rem;
    height: 1.5rem;
  }

  .loading-text {
    font-size: 0.88rem;
  }

  .error-panel {
    padding: 1.15rem 1.1rem 1.05rem;
    gap: 0.85rem;
  }

  .error-message {
    font-size: 0.98rem;
  }

  .error-retry {
    width: 100%;
    min-height: 3.1rem;
  }
}

.choices button.choice-visited {
  background: color-mix(in srgb, var(--accent) 55%, #6b7280) !important;
  color: rgba(255, 255, 255, 0.88) !important;
  border: 2px dashed rgba(255, 255, 255, 0.45) !important;
  box-shadow: none !important;
  filter: grayscale(0.35) brightness(0.92);
  opacity: 0.82;
}

.choices button.choice-visited:hover,
.choices button.choice-visited:focus-visible {
  background: color-mix(in srgb, var(--accent-hover) 65%, #6b7280) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.65) !important;
  filter: grayscale(0.15) brightness(1);
  opacity: 0.95;
  transform: translateY(-2px) scale(1.03);
}

.repeater {
  position: absolute;
  left: 1rem;
  bottom: 1.85rem;
  z-index: 4;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.35);
  color: rgba(255, 255, 255, 0.88);
  padding: 0.55rem 1rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  min-height: 2.75rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: none;
  transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

.repeater:hover,
.repeater:focus-visible {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(255, 255, 255, 0.55);
  transform: translateY(-1px);
  outline: none;
}

.repeater[hidden] {
  display: none !important;
}

.stage.is-choosing .repeater:not([hidden]) {
  opacity: 1;
  animation: choice-in var(--choice-enter-ms) var(--choice-enter-ease) forwards;
  transform: translateY(calc(var(--choice-enter-slide) * 0.7)) scale(0.96);
}

@media (max-width: 640px), ((max-height: 480px) and (max-width: 960px)) {
  .repeater {
    position: relative;
    left: auto;
    bottom: auto;
    z-index: 1;
    align-self: flex-start;
    flex: 0 0 auto;
    min-height: 2.5rem;
    font-size: 0.88rem;
    padding: 0.45rem 0.85rem;
  }

  .stage.is-choosing .repeater:not([hidden]) {
    animation: choice-in var(--choice-enter-ms) var(--choice-enter-ease) both;
    transform: none;
  }
}

@media (max-height: 480px) and (max-width: 960px) {
  .repeater {
    min-height: 2.15rem;
    font-size: 0.82rem;
    padding: 0.3rem 0.7rem;
  }
}

.choices button.is-chosen,
.choices-conditional button.is-chosen {
  position: relative;
  z-index: 3;
  overflow: visible;
  transform-style: preserve-3d;
  animation: choice-lock-elastic var(--choice-lock-anim-ms) cubic-bezier(0.22, 1.35, 0.36, 1) forwards !important;
  border-color: rgba(255, 255, 255, 0.95) !important;
  filter: brightness(1.12) !important;
}

.choices button.is-chosen::before,
.choices-conditional button.is-chosen::before,
.choice-back.is-chosen::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 0 0 1px rgba(45, 212, 191, 0.35),
    inset 0 0 12px rgba(255, 255, 255, 0.15);
  pointer-events: none;
  animation: choice-ring-burst var(--choice-lock-anim-ms) cubic-bezier(0.15, 0.85, 0.25, 1) forwards;
}

.choices button.is-chosen::after,
.choices-conditional button.is-chosen::after,
.choice-back.is-chosen::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(
      118deg,
      transparent 36%,
      rgba(255, 255, 255, 0.55) 48%,
      transparent 58%
    ),
    linear-gradient(
      62deg,
      transparent 42%,
      rgba(165, 243, 252, 0.45) 51%,
      transparent 60%
    ),
    radial-gradient(
      circle at 78% 28%,
      rgba(255, 255, 255, 0.7) 0 1.5px,
      transparent 2.5px
    ),
    radial-gradient(
      circle at 22% 62%,
      rgba(153, 246, 228, 0.65) 0 1px,
      transparent 2px
    );
  background-size: 220% 100%, 220% 100%, 100% 100%, 100% 100%;
  background-repeat: no-repeat;
  mix-blend-mode: soft-light;
  animation: choice-sparkle-sweep var(--choice-lock-anim-ms) ease-out forwards;
}

.choices button.choice-visited.is-chosen {
  background-color: color-mix(in srgb, var(--accent) 55%, #6b7280) !important;
  color: rgba(255, 255, 255, 0.95) !important;
  border-style: solid !important;
  filter: grayscale(0.08) brightness(1.08) !important;
  opacity: 1 !important;
}

.choice-back.is-chosen,
.choice-back.is-chosen:hover,
.choice-back.is-chosen:focus-visible,
.choice-back.is-chosen:active,
[data-theme] .choice-back.is-chosen,
[data-theme] .choice-back.is-chosen:hover,
[data-theme] .choice-back.is-chosen:focus-visible,
[data-theme] .choice-back.is-chosen:active {
  z-index: 3;
  overflow: visible;
  transform: none !important;
  animation: choice-lock-back-stationary var(--choice-lock-anim-ms) ease-out forwards !important;
  background-color: #4b5563 !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.85) !important;
  opacity: 1 !important;
  filter: brightness(1.1) !important;
  
  transition: background 0.2s ease, border-color 0.2s ease !important;
}

@keyframes choice-lock-elastic {
  0% {
    transform: translateY(0) scale(1) rotateX(0deg) rotateY(0deg);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45), var(--btn-shadow);
  }
  16% {
    transform: translateY(2px) scale(0.93) rotateX(5deg) rotateY(-1deg);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35), 0 8px 18px rgba(0, 0, 0, 0.35);
  }
  48% {
    transform: translateY(-3px) scale(1.11) rotateX(-4deg) rotateY(2deg);
    box-shadow:
      0 0 0 8px rgba(255, 255, 255, 0.2),
      0 0 22px rgba(45, 212, 191, 0.35),
      0 18px 36px rgba(0, 0, 0, 0.35);
  }
  72% {
    transform: translateY(0) scale(1.02) rotateX(2deg) rotateY(-0.5deg);
    box-shadow:
      0 0 0 4px rgba(255, 255, 255, 0.12),
      0 0 14px rgba(45, 212, 191, 0.2),
      var(--btn-shadow);
  }
  100% {
    transform: translateY(-1px) scale(1.05) rotateX(0deg) rotateY(0deg);
    box-shadow:
      0 0 0 0 rgba(255, 255, 255, 0),
      0 0 16px rgba(45, 212, 191, 0.15),
      0 14px 30px rgba(0, 0, 0, 0.4);
  }
}

@keyframes choice-lock-back-stationary {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45), 0 8px 20px rgba(0, 0, 0, 0.35);
    filter: brightness(1);
  }
  40% {
    box-shadow:
      0 0 0 8px rgba(255, 255, 255, 0.2),
      0 0 20px rgba(45, 212, 191, 0.3),
      0 8px 20px rgba(0, 0, 0, 0.35);
    filter: brightness(1.12);
  }
  100% {
    box-shadow:
      0 0 0 0 rgba(255, 255, 255, 0),
      0 0 12px rgba(45, 212, 191, 0.12),
      0 8px 20px rgba(0, 0, 0, 0.35);
    filter: brightness(1.08);
  }
}

@keyframes choice-ring-burst {
  0% {
    transform: scale(0.88);
    opacity: 0.95;
    border-color: rgba(255, 255, 255, 0.95);
  }
  55% {
    opacity: 0.55;
    border-color: rgba(165, 243, 252, 0.55);
  }
  100% {
    transform: scale(1.42);
    opacity: 0;
    border-color: rgba(45, 212, 191, 0.05);
  }
}

@keyframes choice-sparkle-sweep {
  0% {
    opacity: 0;
    background-position: 140% 0, -40% 0, 0 0, 0 0;
  }
  28% {
    opacity: 1;
  }
  100% {
    opacity: 0.15;
    background-position: -50% 0, 140% 0, 0 0, 0 0;
  }
}

.choices button.is-dismissing,
.choices-conditional button.is-dismissing,
.choice-back.is-dismissing,
[data-theme] .choice-back.is-dismissing {
  animation: choice-dismiss-out var(--choice-dismiss-ms) cubic-bezier(0.4, 0, 0.7, 0.2) forwards !important;
  pointer-events: none;
  box-shadow: none !important;
}

.choices button.is-dismissing:nth-child(1) { animation-delay: 0ms !important; }
.choices button.is-dismissing:nth-child(2) { animation-delay: 18ms !important; }
.choices button.is-dismissing:nth-child(3) { animation-delay: 32ms !important; }
.choices button.is-dismissing:nth-child(4) { animation-delay: 42ms !important; }
.choices button.is-dismissing:nth-child(5) { animation-delay: 50ms !important; }
.choices button.is-dismissing:nth-child(6) { animation-delay: 56ms !important; }

@keyframes choice-dismiss-out {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
    filter: blur(0) brightness(1);
  }
  100% {
    transform: translateY(8px) scale(0.86) rotateX(6deg);
    opacity: 0;
    filter: blur(6px) brightness(0.6);
  }
}

[data-theme="ocean"] .choices button.is-chosen {
  filter: brightness(1.14) !important;
}

.choices-row.is-navigating {
  pointer-events: none;
}

.choices-row.is-navigating .choice-back,
.choices-row.is-navigating .choice-back.is-chosen,
.choices-row.is-navigating .choice-back.is-dismissing {
  transition: background 0.2s ease, border-color 0.2s ease !important;
}

.choices-row.is-navigating .choices-conditional {
  transition: none !important;
}

.choices-row.is-navigating .choices {
  perspective: 820px;
}

.choices-conditional button.choice-visited {
  filter: grayscale(0.25) brightness(0.92) !important;
  opacity: 0.85;
  border-style: dashed !important;
}

.choices-conditional button.choice-visited:hover,
.choices-conditional button.choice-visited:focus-visible {
  filter: grayscale(0.1) brightness(1) !important;
  opacity: 0.95;
}

