html.decision-first-signal-active,
body.decision-first-signal-active {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #0d111c;
}

.decision-first-signal-active #app { width: 100%; height: 100%; min-height: 0; }
.dfs-shell,
.dfs-shell * { box-sizing: border-box; }
.dfs-shell {
  --dfs-safe-top: env(safe-area-inset-top, 0px);
  --dfs-safe-right: env(safe-area-inset-right, 0px);
  --dfs-safe-bottom: env(safe-area-inset-bottom, 0px);
  --dfs-safe-left: env(safe-area-inset-left, 0px);
  width: 100%;
  height: 100svh;
  min-height: 0;
  display: grid;
  grid-template-rows: calc(48px + var(--dfs-safe-top)) 18px minmax(0, 1fr);
  color: #f7f5fb;
  background-color: #0d111c;
  background-image:
    linear-gradient(rgba(13, 17, 28, .68), rgba(13, 17, 28, .8)),
    url("/assets/images/mini-games/decision-first-signal/play-background-desktop.png"),
    radial-gradient(circle at 50% 38%, rgba(138, 128, 163, .12), transparent 34%),
    linear-gradient(180deg, #111624, #0b0e17);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  overflow: hidden;
}

.dfs-header {
  z-index: 4;
  min-width: 0;
  padding: var(--dfs-safe-top) max(12px, var(--dfs-safe-right)) 0 max(12px, var(--dfs-safe-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dfs-close,
.dfs-count {
  position: relative;
  z-index: 1;
}
.dfs-close {
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .83);
  font: 650 12px/1 Pretendard, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}
.dfs-close > * { pointer-events: none; }
.dfs-count { color: rgba(255, 255, 255, .66); font: 700 12px/1 Pretendard, sans-serif; letter-spacing: .04em; }
.dfs-close:focus-visible,
.dfs-option:focus-visible { outline: 3px solid #fff; outline-offset: -4px; }

.dfs-progress {
  z-index: 4;
  padding: 0 max(16px, var(--dfs-safe-right)) 4px max(16px, var(--dfs-safe-left));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  pointer-events: none;
}
.dfs-progress i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  transition: background 160ms ease, box-shadow 160ms ease;
}
.dfs-progress i.is-done { background: rgba(255, 255, 255, .58); }
.dfs-progress i.is-current { background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .12); }
.dfs-progress i.is-just-done,
.dfs-progress i.is-next { animation: dfs-progress-confirm 220ms ease-out both; }
.dfs-sr-progress { position: fixed; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); }

.dfs-question {
  min-height: 0;
  padding: 0 max(8px, var(--dfs-safe-right)) max(8px, var(--dfs-safe-bottom)) max(8px, var(--dfs-safe-left));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}
.dfs-question-copy {
  min-height: 82px;
  padding: clamp(5px, 1.5vh, 15px) 10px clamp(9px, 2vh, 18px);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  text-align: center;
}
.dfs-question-copy p { margin: 0; color: rgba(255, 255, 255, .74); font-size: clamp(14px, 1.25vw, 17px); font-weight: 500; line-height: 1.42; }
.dfs-question-copy h1 { margin: 0; color: #fff; font-size: clamp(24px, 2.4vw, 36px); line-height: 1.25; letter-spacing: -.02em; }
.dfs-question-copy h1:focus { outline: 0; }
.dfs-question-copy,
.dfs-split { animation: dfs-content-enter 180ms ease-out both; }
.dfs-shell.is-advancing .dfs-question-copy { opacity: .7; transform: translateY(-3px); transition: opacity 180ms ease, transform 180ms ease; }

.dfs-split {
  min-width: 0;
  min-height: 0;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: clamp(6px, 1.8vw, 14px);
}
.dfs-split::before {
  content: '';
  width: 1px;
  position: absolute;
  z-index: 3;
  top: 7%;
  bottom: 7%;
  left: 50%;
  background: linear-gradient(transparent, rgba(255, 255, 255, .34), transparent);
  transform: translateX(-50%);
  pointer-events: none;
}
.dfs-split::after {
  content: '';
  width: clamp(28px, 8vw, 58px);
  aspect-ratio: 1;
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.25);
  pointer-events: none;
}
.dfs-split.is-transitioning::after { animation: dfs-boundary-wave 220ms ease-out; }
.dfs-option {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: clamp(16px, 5vw, 46px);
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 2px;
  background:
    radial-gradient(circle at 50% 45%, rgba(143, 149, 175, .13), transparent 48%),
    rgba(255, 255, 255, .045);
  color: #fff;
  font: inherit;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, opacity 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}
.dfs-option > * { pointer-events: none; }
.dfs-option span {
  max-width: 13em;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #f9f7fc;
  font-size: clamp(17px, 4.5vw, 27px);
  font-weight: 730;
  line-height: 1.42;
  text-wrap: balance;
  word-break: keep-all;
  transition: transform 180ms ease;
}
.dfs-option:hover { border-color: rgba(255, 255, 255, .34); background-color: rgba(255, 255, 255, .085); }
.dfs-option:active,
.dfs-option.is-selected { transform: scale(.985); border-color: rgba(255, 255, 255, .86); background-color: rgba(255, 255, 255, .24); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .16), 0 0 22px rgba(184, 211, 255, .18); filter: brightness(1.12); }
.dfs-option.is-selected span { transform: translateY(1px); }
.dfs-option:disabled { cursor: default; }
.dfs-split.has-selection .dfs-option:not(.is-selected) { opacity: .46; filter: brightness(.8); }
.dfs-transition-copy {
  min-height: 0;
  margin: 0;
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: max(20px, calc(var(--dfs-safe-bottom) + 12px));
  color: rgba(255, 255, 255, .8);
  font-size: 11px;
  transform: translateX(-50%);
  pointer-events: none;
}

html.decision-first-signal-result-active,
body.decision-first-signal-result-active { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; overscroll-behavior: auto; }
.dfs-result-shell { --mini-accent: #d7c5df; background: linear-gradient(180deg, #101522, #17101b); }
.dfs-result-card { width: min(100%, 820px); margin: 3vh auto 24px; }
.dfs-result-image {
  width: min(66vw, 320px);
  max-height: none;
  margin: 0 auto;
  aspect-ratio: 4 / 5;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, .12);
  background: #151a29;
}
.dfs-result-image[hidden] { display: none; }
.dfs-result-image--fallback {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 50%, rgba(205, 188, 215, .22), transparent 24%),
    linear-gradient(135deg, rgba(86, 105, 137, .28), rgba(122, 78, 110, .25));
}
.dfs-result-image--fallback span { color: rgba(255, 255, 255, .84); font-size: clamp(62px, 14vw, 110px); line-height: 1; }
.dfs-result-intro { padding: clamp(24px, 5vw, 42px) 0 18px; }
.dfs-result-intro h1 { margin: 0 0 10px; font-size: clamp(30px, 7vw, 50px); line-height: 1.12; }
.dfs-result-intro h1:focus { outline: 0; }
.dfs-result-intro p { margin: 0; color: rgba(255, 255, 255, .73); font-size: clamp(15px, 3.8vw, 19px); line-height: 1.55; }
.dfs-result-body { margin: 0 0 22px; color: rgba(255, 255, 255, .86); font-size: 15px; line-height: 1.78; }
.dfs-result-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dfs-result-details section { padding: 18px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .045); }
.dfs-result-details h2 { margin: 0 0 9px; color: #d7c5df; font-size: 12px; letter-spacing: .04em; }
.dfs-result-details p { margin: 0; color: rgba(255, 255, 255, .76); font-size: 13px; line-height: 1.65; }

@keyframes dfs-boundary-wave {
  0% { opacity: .72; transform: translate(-50%, -50%) scale(.25); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.35); }
}

@keyframes dfs-content-enter {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes dfs-progress-confirm {
  0% { transform: scale(.75); }
  60% { transform: scale(1.55); }
  100% { transform: scale(1.3); }
}

@media (max-width: 600px) {
  .dfs-close span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .dfs-question-copy { min-height: 76px; }
  .dfs-result-details { grid-template-columns: 1fr; }
}

@media (orientation: portrait) and (max-width: 1024px) {
  .dfs-shell {
    background-image:
      linear-gradient(rgba(13, 17, 28, .66), rgba(13, 17, 28, .78)),
      url("/assets/images/mini-games/decision-first-signal/play-background-mobile.png"),
      radial-gradient(circle at 50% 38%, rgba(138, 128, 163, .12), transparent 34%),
      linear-gradient(180deg, #111624, #0b0e17);
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .dfs-shell { grid-template-rows: calc(42px + var(--dfs-safe-top)) 12px minmax(0, 1fr); }
  .dfs-header { padding-left: max(8px, var(--dfs-safe-left)); padding-right: max(8px, var(--dfs-safe-right)); }
  .dfs-close { min-height: 40px; }
  .dfs-progress { padding-bottom: 1px; }
  .dfs-progress i { width: 5px; height: 5px; }
  .dfs-question { padding-left: max(6px, var(--dfs-safe-left)); padding-right: max(6px, var(--dfs-safe-right)); padding-bottom: max(5px, var(--dfs-safe-bottom)); grid-template-rows: 55px minmax(0, 1fr); }
  .dfs-question-copy { min-height: 0; padding: 2px 8px 7px; gap: 2px; }
  .dfs-question-copy p { font-size: 12px; font-weight: 500; line-height: 1.4; }
  .dfs-question-copy h1 { font-size: clamp(18px, 4.7vh, 22px); }
  .dfs-option { padding: 10px 26px; }
  .dfs-option span { font-size: clamp(15px, 4.4vh, 20px); line-height: 1.3; }
  .dfs-transition-copy { bottom: max(9px, var(--dfs-safe-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .dfs-shell *,
  .dfs-shell *::before,
  .dfs-shell *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
