:root {
  --pink: #ff4fa7;
  --hot: #ff1f86;
  --cyan: #42d9ff;
  --mint: #69ffc8;
  --yellow: #ffd75a;
  --ink: #121018;
  --panel: rgba(14, 13, 24, 0.86);
  --line: rgba(255, 255, 255, 0.78);
  --white: #fff;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  height: 100svh;
  height: var(--app-h, 100svh);
  margin: 0;
  overflow: hidden;
  background: #07050b;
  color: var(--white);
  font-family:
    "Pretendard",
    "Noto Sans KR",
    "Apple SD Gothic Neo",
    system-ui,
    sans-serif;
}

body {
  display: grid;
  place-items: center;
}

button {
  font: inherit;
}

.app {
  width: min(100vw, calc(var(--app-h, 100svh) * 16 / 9));
  height: min(var(--app-h, 100svh), calc(100vw * 9 / 16));
  min-width: 0;
  min-height: 0;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(circle at 72% 22%, rgba(255, 215, 90, 0.22), transparent 28%),
    radial-gradient(circle at 18% 18%, rgba(255, 79, 167, 0.28), transparent 30%),
    #07050b;
}

.stage {
  position: relative;
  width: 100%;
  height: 100%;
  isolation: isolate;
  overflow: hidden;
}

.bg {
  position: absolute;
  inset: 0;
  transition:
    opacity 580ms ease,
    filter 580ms ease,
    transform 580ms ease;
}

.opening-consent {
  position: absolute;
  inset: 0;
  z-index: 120;
  overflow: hidden;
  background: #07050b;
  transition:
    opacity 420ms ease,
    transform 420ms ease,
    filter 420ms ease;
}

.opening-consent.done {
  opacity: 0;
  transform: scale(1.03);
  filter: blur(8px);
  pointer-events: none;
}

.opening-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.opening-panel {
  position: absolute;
  right: 5vw;
  bottom: 7vh;
  display: flex;
  flex-direction: column;
  width: min(430px, 31vw);
  max-height: 84%;
  padding: 20px 22px 22px;
  border: 4px solid rgba(255, 255, 255, 0.88);
  border-radius: 22px;
  color: #fff;
  background: rgba(9, 8, 18, 0.76);
  box-shadow:
    10px 10px 0 rgba(255, 31, 134, 0.75),
    -8px -8px 0 rgba(66, 217, 255, 0.45),
    0 28px 80px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(10px);
  transform: rotate(1deg);
}

/* Terms text scrolls; the consent checkbox + start button stay pinned and always visible. */
.opening-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.opening-mascot {
  position: absolute;
  left: 7vw;
  top: 14vh;
  z-index: 2;
  width: clamp(72px, 8vw, 132px);
  height: auto;
  filter:
    drop-shadow(0 0 18px rgba(66, 217, 255, 0.7))
    drop-shadow(0 14px 12px rgba(0, 0, 0, 0.35));
  animation: mascotFloat 3.2s ease-in-out infinite;
}

.opening-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 1000;
}

.opening-logo img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.opening-panel h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(30px, 3.3vw, 50px);
  line-height: 1;
  font-weight: 1000;
  text-shadow: 5px 5px 0 #111018;
}

.opening-panel p {
  margin: 14px 0 16px;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(14px, 1.18vw, 18px);
  line-height: 1.35;
  font-weight: 850;
}

.opening-panel ul {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.opening-panel li {
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 800;
}

.terms-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.terms-check input {
  width: 22px;
  height: 22px;
  accent-color: var(--pink);
}

.opening-guide {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: -6px 0 12px 34px;
  padding: 8px 13px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  color: #111018;
  background: linear-gradient(135deg, #fff7a8, #ffffff);
  box-shadow: 4px 4px 0 var(--pink);
  font-size: 13px;
  font-weight: 1000;
  animation: guidePulse 1.1s ease-in-out infinite;
}

.opening-guide::before {
  content: "";
  position: absolute;
  left: 18px;
  top: -9px;
  width: 14px;
  height: 14px;
  border-left: 2px solid rgba(255, 255, 255, 0.9);
  border-top: 2px solid rgba(255, 255, 255, 0.9);
  background: #fff7a8;
  transform: rotate(45deg);
}

.opening-guide.start-step {
  margin: 0 auto 12px;
  background: linear-gradient(135deg, #dffcff, #ffffff);
  box-shadow: 4px 4px 0 var(--cyan);
}

.opening-guide.start-step::before {
  left: 50%;
  top: auto;
  bottom: -9px;
  background: #ffffff;
  transform: translateX(-50%) rotate(225deg);
}

.start-button {
  width: 100%;
  padding: 15px 20px;
  border: 3px solid #fff;
  border-radius: 999px;
  color: #111018;
  background: linear-gradient(135deg, #fff, #dffcff);
  box-shadow: 6px 6px 0 var(--pink);
  font-size: clamp(20px, 2vw, 30px);
  font-weight: 1000;
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    filter 140ms ease,
    opacity 140ms ease;
}

.start-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.7);
}

.start-button:not(:disabled):hover,
.start-button:not(:disabled):focus-visible {
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0 var(--pink);
}

.bg-room {
  opacity: 1;
  background:
    linear-gradient(90deg, rgba(8, 7, 15, 0.32), rgba(8, 7, 15, 0.02), rgba(8, 7, 15, 0.5)),
    radial-gradient(circle at 72% 38%, rgba(255, 79, 167, 0.26), transparent 22%),
    linear-gradient(135deg, rgba(255, 160, 205, 0.8), rgba(88, 42, 89, 0.94));
}

.bg-room::before {
  content: "";
  position: absolute;
  left: 8%;
  top: 16%;
  width: 52%;
  height: 52%;
  border: 4px solid rgba(255, 255, 255, 0.32);
  border-radius: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.08) 0 0) 0 32% / 100% 3px no-repeat,
    linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.28);
  transform: skewX(-6deg);
}

.bg-room::after {
  content: "";
  position: absolute;
  right: 9%;
  bottom: 28%;
  width: 20%;
  height: 36%;
  border-radius: 18px 18px 4px 4px;
  background:
    linear-gradient(90deg, transparent 0 44%, rgba(255, 255, 255, 0.12) 45% 56%, transparent 57%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(16, 13, 24, 0.42));
  border: 3px solid rgba(255, 255, 255, 0.22);
}

.bg-backroom {
  opacity: 0;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.18) 0 2px, transparent 2px 120px),
    linear-gradient(180deg, rgba(255, 236, 139, 0.26), rgba(93, 66, 24, 0.6)),
    repeating-linear-gradient(0deg, #cfa941 0 36px, #dcbc52 36px 72px);
  filter: saturate(1.1) contrast(1.12);
}

.bg-backroom::before {
  content: "";
  position: absolute;
  left: 34%;
  top: 12%;
  width: 34%;
  height: 78%;
  background:
    linear-gradient(90deg, transparent, rgba(255, 248, 180, 0.74), transparent),
    repeating-linear-gradient(0deg, rgba(88, 56, 22, 0.42) 0 4px, transparent 4px 58px);
  clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%);
  opacity: 0.76;
}

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.28), transparent 22%, rgba(0, 0, 0, 0.42)),
    radial-gradient(circle at center, transparent 48%, rgba(0, 0, 0, 0.54));
  z-index: 3;
}

.glitch-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 7px),
    linear-gradient(90deg, rgba(255, 35, 134, 0.2), transparent, rgba(64, 217, 255, 0.16));
  mix-blend-mode: screen;
}

.topbar {
  position: absolute;
  left: 2.2vw;
  right: 2.2vw;
  top: max(16px, env(safe-area-inset-top));
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  background: rgba(3, 3, 8, 0.92);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #05050a;
  border: 2px solid rgba(255, 255, 255, 0.72);
  font-weight: 1000;
  color: #fff;
  text-shadow: 2px 2px 0 #111;
}

.brand-mark img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.sound-toggle {
  position: absolute;
  right: 2.2vw;
  top: max(16px, env(safe-area-inset-top));
  z-index: 24;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-radius: 14px;
  color: #fff;
  background: rgba(3, 3, 8, 0.92);
  box-shadow:
    5px 5px 0 rgba(255, 31, 134, 0.76),
    0 12px 32px rgba(0, 0, 0, 0.28);
  font-weight: 1000;
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    filter 140ms ease;
}

.sound-toggle:hover,
.sound-toggle:focus-visible {
  transform: translate(-3px, -3px);
  box-shadow:
    8px 8px 0 rgba(255, 31, 134, 0.82),
    0 12px 32px rgba(0, 0, 0, 0.28);
}

.sound-toggle[aria-pressed="true"] {
  color: #111018;
  background: linear-gradient(135deg, #fff, #dffcff);
}

.sound-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  color: #111018;
  background: var(--cyan);
}

.fullscreen-toggle {
  position: absolute;
  right: 2.2vw;
  top: calc(max(16px, env(safe-area-inset-top)) + 58px);
  z-index: 24;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 13px;
  color: #fff;
  background: rgba(3, 3, 8, 0.88);
  box-shadow: 4px 4px 0 rgba(66, 217, 255, 0.62);
  font-size: 13px;
  font-weight: 1000;
  cursor: pointer;
}

.fullscreen-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 7px;
  color: #111018;
  background: var(--yellow);
}

.fullscreen-icon::before,
.fullscreen-icon::after {
  content: "";
  position: absolute;
  inset: 4px;
  background:
    linear-gradient(#111018 0 0) left top / 7px 2px no-repeat,
    linear-gradient(#111018 0 0) left top / 2px 7px no-repeat,
    linear-gradient(#111018 0 0) right top / 7px 2px no-repeat,
    linear-gradient(#111018 0 0) right top / 2px 7px no-repeat,
    linear-gradient(#111018 0 0) left bottom / 7px 2px no-repeat,
    linear-gradient(#111018 0 0) left bottom / 2px 7px no-repeat,
    linear-gradient(#111018 0 0) right bottom / 7px 2px no-repeat,
    linear-gradient(#111018 0 0) right bottom / 2px 7px no-repeat;
}

.fullscreen-toggle.is-active .fullscreen-icon::before,
.fullscreen-toggle.is-active .fullscreen-icon::after {
  inset: 5px;
  background:
    linear-gradient(#111018 0 0) center top / 8px 2px no-repeat,
    linear-gradient(#111018 0 0) left center / 2px 8px no-repeat,
    linear-gradient(#111018 0 0) right center / 2px 8px no-repeat,
    linear-gradient(#111018 0 0) center bottom / 8px 2px no-repeat;
}

.fullscreen-toggle.is-active {
  color: #111018;
  background: linear-gradient(135deg, #fff, #fff7a8);
}

.brand strong,
.brand em {
  display: block;
  line-height: 1;
}

.brand strong {
  font-size: 18px;
}

.brand em {
  margin-top: 3px;
  color: var(--cyan);
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.08em;
}

.stream-status {
  min-width: 0;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 42vw;
  padding: 9px 18px;
  border-radius: 999px;
  color: #151018;
  background: rgba(255, 255, 255, 0.88);
  border: 3px solid #111018;
  box-shadow: 6px 6px 0 rgba(255, 31, 134, 0.88);
  font-weight: 900;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff225c;
  box-shadow: 0 0 0 5px rgba(255, 34, 92, 0.22);
}

.hud {
  position: absolute;
  z-index: 18;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.42);
  background: rgba(14, 13, 24, 0.72);
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.26);
}

.follower-hud {
  left: 3vw;
  top: 116px;
  min-width: 210px;
  padding: 12px 16px;
  border-radius: 14px;
  transform: rotate(-1.5deg);
}

.follower-hud span {
  display: block;
  color: var(--mint);
  font-size: 13px;
  font-weight: 900;
}

.follower-hud strong {
  display: block;
  margin-top: 2px;
  font-size: clamp(20px, 2.4vw, 34px);
  text-shadow: 3px 3px 0 #000;
}

.chat-hud {
  right: 3vw;
  top: 116px;
  width: min(300px, 24vw);
  border-radius: 16px;
  overflow: hidden;
}

.chat-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: linear-gradient(90deg, rgba(255, 31, 134, 0.9), rgba(66, 217, 255, 0.8));
  font-weight: 1000;
}

.chat-head b {
  color: #111018;
  font-size: 13px;
}

.chat-hud ul {
  min-height: 128px;
  max-height: 28vh;
  margin: 0;
  padding: 10px 12px 14px;
  list-style: none;
  display: grid;
  align-content: start;
  gap: 8px;
}

.chat-hud li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: center;
  min-width: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  animation: chatIn 260ms ease both;
}

.chat-hud i {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--pink);
}

.chat-hud li.anon i {
  background: transparent;
  border: 2px solid var(--yellow);
}

.chat-hud li.anon span {
  color: var(--yellow);
}

.choice-board {
  position: absolute;
  left: 50%;
  top: 48%;
  z-index: 46;
  width: min(760px, 64vw);
  max-width: 92%;
  max-height: 86%;
  overflow-y: auto;
  transform: translate(-50%, -54%);
  padding: 18px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(221, 248, 255, 0.9)),
    #fff;
  box-shadow:
    10px 10px 0 rgba(255, 31, 134, 0.9),
    -10px -10px 0 rgba(66, 217, 255, 0.72),
    0 30px 80px rgba(0, 0, 0, 0.42);
  color: var(--ink);
  animation: panelDrop 260ms cubic-bezier(0.2, 1.16, 0.34, 1) both;
}

.choice-board.final-board {
  top: 67%;
  width: min(720px, 60vw);
}

.choice-title {
  display: inline-block;
  margin-bottom: 14px;
  padding: 8px 14px;
  color: #fff;
  background: var(--ink);
  border-radius: 999px;
  font-weight: 1000;
  box-shadow: 4px 4px 0 var(--pink);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.choice {
  position: relative;
  min-height: 74px;
  padding: 14px 16px 14px 54px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  text-align: left;
  color: var(--ink);
  background: #fff;
  box-shadow: 5px 5px 0 rgba(18, 16, 24, 0.28);
  font-weight: 1000;
  cursor: pointer;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    filter 150ms ease;
  animation: choiceIn 220ms ease both;
}

.choice::before {
  content: attr(data-icon);
  position: absolute;
  left: 12px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: #fff;
  background: var(--pink);
  transform: translateY(-50%) rotate(-8deg);
}

.choice:hover,
.choice:focus-visible {
  transform: translate(-3px, -3px);
  box-shadow: 8px 8px 0 rgba(18, 16, 24, 0.34);
}

.choice.done {
  filter: grayscale(1);
  opacity: 0.58;
}

.choice.backroom {
  color: #231704;
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.7), transparent 24%),
    linear-gradient(135deg, #ffe98d, #ffbc37);
  box-shadow:
    0 0 28px rgba(255, 215, 90, 0.72),
    5px 5px 0 rgba(18, 16, 24, 0.38);
  animation: pulseYellow 1.6s ease-in-out infinite;
}

.choice small {
  display: block;
  margin-top: 3px;
  color: rgba(18, 16, 24, 0.58);
  font-size: 12px;
  font-weight: 900;
}

.content-visual {
  position: absolute;
  left: 18vw;
  top: 28vh;
  z-index: 11;
  display: grid;
  place-items: center;
  width: min(310px, 24vw);
  aspect-ratio: 1;
  border: 5px solid #111018;
  border-radius: 28px;
  color: #111018;
  background:
    radial-gradient(circle at 68% 22%, rgba(255, 255, 255, 0.82), transparent 24%),
    linear-gradient(135deg, #fff, #ffd7ec);
  box-shadow:
    10px 10px 0 rgba(255, 31, 134, 0.78),
    -8px -8px 0 rgba(66, 217, 255, 0.62),
    0 22px 60px rgba(0, 0, 0, 0.32);
  transform: rotate(-4deg);
  animation: popFloat 2.8s ease-in-out infinite;
}

.content-visual::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 3px dashed rgba(18, 16, 24, 0.22);
  border-radius: 20px;
}

.visual-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 46%;
  aspect-ratio: 1;
  border: 5px solid #111018;
  border-radius: 26px;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), #7f5cff);
  box-shadow: 6px 6px 0 rgba(18, 16, 24, 0.42);
  font-size: clamp(34px, 5vw, 82px);
  font-weight: 1000;
}

.visual-icon img {
  width: 120%;
  height: 120%;
  object-fit: contain;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.22));
}

.visual-icon:has(img:not([hidden])) {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.content-visual strong {
  position: relative;
  z-index: 1;
  margin-top: -8%;
  padding: 8px 16px;
  border: 3px solid #111018;
  border-radius: 999px;
  color: #fff;
  background: #111018;
  font-size: clamp(16px, 1.7vw, 26px);
  box-shadow: 4px 4px 0 var(--pink);
}

.content-visual.sardine .visual-icon {
  background: linear-gradient(135deg, #6fd4ff, #3265a8);
}

.content-visual.gta .visual-icon {
  background: linear-gradient(135deg, #5cff97, #1b7e47);
}

.content-visual.sing .visual-icon {
  background: linear-gradient(135deg, #ff78c8, #7a4cff);
}

.content-visual.talk .visual-icon {
  background: linear-gradient(135deg, #fff06a, #ff884a);
}

.content-visual.roulette .visual-icon {
  background: conic-gradient(from 20deg, #ff4fa7, #ffd75a, #42d9ff, #111018, #ff4fa7);
}

.sia-character {
  position: absolute;
  z-index: 12;
  left: 49%;
  bottom: 9.5vh;
  width: clamp(360px, 35vw, 760px);
  max-height: 80vh;
  object-fit: contain;
  transform: translateX(-50%) rotate(1deg);
  filter: drop-shadow(0 26px 24px rgba(0, 0, 0, 0.34));
  animation: idleFloat 3.4s ease-in-out infinite;
  transition:
    transform 420ms ease,
    left 420ms ease,
    bottom 420ms ease,
    width 420ms ease,
    filter 420ms ease,
    opacity 240ms ease;
}

.sia-character.tense {
  transform: translateX(-50%) rotate(-4deg) scale(1.04);
  animation: idleFloat 2.4s ease-in-out infinite;
}

.sia-character.fail {
  transform: translateX(-50%) rotate(7deg) scale(0.96);
  filter: drop-shadow(0 18px 20px rgba(0, 0, 0, 0.36)) saturate(0.95);
  animation: failWobble 520ms ease-in-out infinite;
}

.sia-character.fear {
  transform: translateX(-50%) rotate(-7deg) scale(1.08);
  filter: drop-shadow(0 26px 24px rgba(0, 0, 0, 0.38)) drop-shadow(0 0 24px rgba(255, 215, 90, 0.34));
  animation: fearTremble 360ms steps(2, end) infinite;
}

.sia-character.pull {
  left: 56%;
  bottom: 13vh;
  transform: translateX(-50%) rotate(-18deg) scale(0.98);
  animation: shake 280ms steps(2, end) infinite;
}

.sia-character.vortex {
  z-index: 42;
  animation: suckedIntoBackroom 1350ms cubic-bezier(0.45, 0, 0.2, 1) forwards;
}

.dialogue {
  position: absolute;
  left: 3vw;
  right: 3vw;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 40;
  min-height: 140px;
  padding: 24px 130px 24px 28px;
  border: 4px solid #111018;
  border-radius: 18px;
  color: #151018;
  background:
    linear-gradient(90deg, rgba(255, 79, 167, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(232, 250, 255, 0.98));
  box-shadow:
    8px 8px 0 rgba(255, 31, 134, 0.88),
    -8px -8px 0 rgba(66, 217, 255, 0.62);
}

.dialogue::before {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  top: 12px;
  height: 7px;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, var(--pink) 0 18px, #fff 18px 28px, var(--cyan) 28px 46px, #fff 46px 56px);
}

.speaker {
  position: absolute;
  left: 24px;
  top: -36px;
  padding: 10px 22px;
  border: 4px solid #111018;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), #744cff);
  box-shadow: 5px 5px 0 #111018;
  font-size: clamp(18px, 2vw, 28px);
  font-weight: 1000;
}

.dialogue p {
  margin: 16px 0 0;
  max-width: 78%;
  font-size: clamp(24px, 2.8vw, 42px);
  line-height: 1.18;
  font-weight: 950;
  word-break: keep-all;
}

.dialogue p.text-pop {
  animation: textPop 220ms ease both;
}

.dialogue.system-mode {
  border-color: rgba(255, 215, 90, 0.86);
  background:
    linear-gradient(90deg, rgba(255, 215, 90, 0.28), transparent 26%),
    linear-gradient(180deg, rgba(22, 15, 4, 0.96), rgba(48, 32, 8, 0.96));
  box-shadow:
    8px 8px 0 rgba(0, 0, 0, 0.86),
    -8px -8px 0 rgba(255, 215, 90, 0.52);
}

.dialogue.system-mode .speaker {
  display: none;
}

.dialogue.system-mode p {
  color: var(--yellow);
  font-family: Consolas, "Courier New", monospace;
  font-size: clamp(18px, 2vw, 30px);
}

.next-button {
  position: absolute;
  right: 28px;
  bottom: 26px;
  min-width: 92px;
  padding: 13px 18px;
  border: 3px solid #111018;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #111018, #3c2648);
  box-shadow: 5px 5px 0 var(--pink);
  font-weight: 1000;
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    filter 140ms ease;
  animation: nextPulse 1.8s ease-in-out infinite;
}

.next-button:hover,
.next-button:focus-visible {
  transform: translate(-3px, -3px);
  box-shadow: 8px 8px 0 var(--pink);
  filter: brightness(1.08);
}

.next-button:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--pink);
}

.next-button.floating-next {
  position: fixed;
  z-index: 70;
  right: 4vw;
  bottom: 6vh;
}

.next-button.narration-next {
  position: fixed;
  left: 50%;
  right: auto;
  top: 31vh;
  bottom: auto;
  z-index: 80;
  min-width: 160px;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #fff, #dffcff);
  color: #111018;
  box-shadow: 6px 6px 0 var(--pink);
}

.next-button.narration-next:hover,
.next-button.narration-next:focus-visible {
  transform: translateX(-50%) translate(-3px, -3px);
}

.clip-pop,
.system-pop {
  position: absolute;
  z-index: 32;
  border: 3px solid var(--ink);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    8px 8px 0 rgba(255, 31, 134, 0.86),
    0 26px 60px rgba(0, 0, 0, 0.35);
  animation: popIn 300ms cubic-bezier(0.2, 1.22, 0.34, 1) both;
}

.result-pop {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 45;
  width: min(520px, 44vw);
  padding: 24px 28px 26px;
  border: 4px solid #111018;
  border-radius: 18px;
  color: #111018;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(232, 250, 255, 0.98));
  box-shadow:
    10px 10px 0 rgba(255, 31, 134, 0.88),
    -8px -8px 0 rgba(66, 217, 255, 0.62),
    0 26px 70px rgba(0, 0, 0, 0.36);
  transform: translate(-50%, -50%) rotate(-2deg);
  text-align: center;
  animation: resultIn 360ms cubic-bezier(0.2, 1.18, 0.34, 1) both;
}

.result-pop span {
  display: inline-block;
  margin-bottom: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  color: #fff;
  background: #111018;
  font-size: 12px;
  font-weight: 1000;
}

.result-pop strong {
  display: block;
  font-size: clamp(28px, 3.2vw, 48px);
  line-height: 1.05;
  font-weight: 1000;
}

.result-pop p {
  margin: 12px 0 14px;
  color: #2a2430;
  font-size: clamp(20px, 2.1vw, 30px);
  font-weight: 1000;
}

.result-delta {
  display: inline-grid;
  place-items: center;
  min-width: 156px;
  margin: 0 auto 22px;
  padding: 9px 18px;
  border: 3px solid #111018;
  border-radius: 14px;
  color: #111018;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), transparent 44%),
    linear-gradient(135deg, #ffe7f3, #dffcff);
  box-shadow:
    4px 4px 0 rgba(255, 31, 134, 0.9),
    0 0 18px rgba(66, 217, 255, 0.18);
  font-size: clamp(21px, 2.4vw, 34px);
  font-weight: 1000;
  text-shadow: none;
  transform: rotate(-1deg);
}

.result-pop button {
  min-width: 110px;
  padding: 12px 18px;
  border: 3px solid #111018;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #111018, #3c2648);
  box-shadow: 5px 5px 0 var(--pink);
  font-weight: 1000;
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    filter 140ms ease;
}

.result-pop button:hover,
.result-pop button:focus-visible {
  transform: translate(-3px, -3px);
  box-shadow: 8px 8px 0 var(--pink);
  filter: brightness(1.06);
}

.result-pop button:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--pink);
}

.narration-screen {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: center;
  align-items: center;
  justify-items: center;
  padding: 0 5vw;
  background: rgba(0, 0, 0, 0.92);
}

.narration-screen.follow-only {
  grid-template-rows: 1fr;
  padding: 0;
}

.narration-screen p {
  margin: 0;
  width: min(900px, 78vw);
  padding: 20px 26px;
  border-left: 8px solid var(--pink);
  border-bottom: 3px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: clamp(28px, 4vw, 62px);
  line-height: 1.12;
  font-weight: 1000;
  text-shadow: 4px 4px 0 #000;
  text-align: center;
  transform: translateY(5vh);
}

.narration-screen.follow-only p {
  display: none;
}

.follow-dev {
  width: min(720px, 78vw);
  margin-top: 8vh;
  padding: 18px 22px 22px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow:
    8px 8px 0 rgba(255, 31, 134, 0.42),
    0 24px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(8px);
  text-align: center;
  animation: textPop 260ms ease both;
}

.narration-screen.follow-only .follow-dev {
  margin-top: 0;
  transform: translateY(0);
}

.follow-dev span {
  display: block;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.14em;
}

.follow-dev strong {
  display: block;
  margin-top: 8px;
  color: #fff;
  font-size: clamp(20px, 2.4vw, 34px);
  line-height: 1.18;
  font-weight: 1000;
}

.follow-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.follow-links a {
  min-width: 128px;
  padding: 11px 15px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  color: #111018;
  background: linear-gradient(135deg, #fff, #dffcff);
  box-shadow: 4px 4px 0 var(--pink);
  font-weight: 1000;
  text-decoration: none;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    filter 140ms ease;
}

.follow-links a:hover,
.follow-links a:focus-visible {
  transform: translate(-3px, -3px);
  box-shadow: 7px 7px 0 var(--pink);
  filter: brightness(1.08);
}

.clip-pop {
  left: 8vw;
  top: 22vh;
  width: min(360px, 28vw);
  padding: 12px;
  border-radius: 16px;
  transform: rotate(-3deg);
}

.clip-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 1000;
}

.clip-top button {
  border: 0;
  color: #fff;
  background: var(--ink);
  border-radius: 50%;
  width: 24px;
  height: 24px;
}

.clip-thumb {
  overflow: hidden;
  height: 130px;
  margin: 10px 0;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: #111;
}

.clip-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 80%;
  filter: saturate(1.15) contrast(1.08);
}

.clip-pop strong {
  display: block;
  font-size: 18px;
  line-height: 1.15;
}

.system-pop {
  right: 8vw;
  top: 34vh;
  width: min(440px, 34vw);
  padding: 18px 20px;
  border-radius: 4px 18px 4px 18px;
  background:
    linear-gradient(135deg, rgba(255, 216, 90, 0.96), rgba(255, 255, 255, 0.94));
  transform: skewX(-4deg);
  transform-origin: center;
}

.system-pop:not([hidden]) {
  animation: routeAlert 520ms cubic-bezier(0.2, 1.2, 0.34, 1) both;
}

.system-pop span {
  display: block;
  color: #5f2b00;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.08em;
}

.system-pop p {
  margin: 8px 0 0;
  font-size: clamp(18px, 2vw, 28px);
  line-height: 1.16;
  font-weight: 1000;
}

.backroom-mode .bg-room {
  opacity: 0.28;
  filter: hue-rotate(18deg) saturate(0.72) brightness(0.66);
  transform: scale(1.04);
}

.backroom-mode .bg-backroom {
  opacity: 0.82;
}

.backroom-mode .glitch-layer {
  opacity: 0.46;
  animation: glitchBlink 1.1s steps(2, end) infinite;
}

.backroom-mode .stream-status {
  color: #261700;
  background: #ffd75a;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.88);
}

.backroom-mode .follower-hud {
  border-color: rgba(255, 215, 90, 0.78);
  background: rgba(42, 25, 5, 0.82);
}

.stage.vortex-mode .bg-backroom {
  opacity: 1;
  animation: tunnelPulse 1350ms cubic-bezier(0.45, 0, 0.2, 1) forwards;
}

.stage.vortex-mode .glitch-layer {
  opacity: 0.78;
  animation: vortexGlitch 150ms steps(2, end) infinite;
}

.stage.vortex-mode .dialogue,
.stage.vortex-mode .choice-board,
.stage.vortex-mode .clip-pop,
.stage.vortex-mode .system-pop,
.stage.vortex-mode .chat-hud,
.stage.vortex-mode .follower-hud {
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.stage.deny-mode .system-pop {
  animation: denyAlert 360ms cubic-bezier(0.2, 1.4, 0.34, 1) both;
  background:
    linear-gradient(135deg, rgba(255, 77, 117, 0.98), rgba(255, 231, 243, 0.98));
}

@keyframes pulseYellow {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.18);
  }
}

@keyframes shake {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 6px -2px;
  }
}

@keyframes suckedIntoBackroom {
  0% {
    left: 56%;
    bottom: 13vh;
    opacity: 1;
    transform: translateX(-50%) rotate(-18deg) scale(0.98);
    filter: drop-shadow(0 0 20px rgba(255, 215, 90, 0.2));
  }
  32% {
    left: 54%;
    bottom: 24vh;
    opacity: 1;
    transform: translateX(-50%) rotate(110deg) scale(0.8);
    filter: drop-shadow(0 0 34px rgba(255, 215, 90, 0.6));
  }
  68% {
    left: 50%;
    bottom: 39vh;
    opacity: 0.86;
    transform: translateX(-50%) rotate(420deg) scale(0.38);
    filter: drop-shadow(0 0 48px rgba(255, 215, 90, 0.9));
  }
  100% {
    left: 50%;
    bottom: 48vh;
    opacity: 0;
    transform: translateX(-50%) rotate(760deg) scale(0.04);
    filter: blur(5px) drop-shadow(0 0 60px rgba(255, 215, 90, 1));
  }
}

@keyframes tunnelPulse {
  0% {
    transform: scale(1);
    filter: saturate(1.1) contrast(1.12);
  }
  100% {
    transform: scale(1.24) rotate(2deg);
    filter: saturate(1.6) contrast(1.28) brightness(1.18);
  }
}

@keyframes vortexGlitch {
  0%,
  100% {
    transform: translate(0, 0) skewX(0deg);
  }
  50% {
    transform: translate(10px, -3px) skewX(-6deg);
  }
}

@keyframes idleFloat {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -8px;
  }
}

@keyframes popFloat {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -10px;
  }
}

@keyframes failWobble {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: -7px 3px;
  }
}

@keyframes fearTremble {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 4px -2px;
  }
}

@keyframes glitchBlink {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(7px);
  }
}

@keyframes textPop {
  from {
    opacity: 0;
    transform: translateY(5px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes chatIn {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes nextPulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.12);
  }
}

@keyframes mascotFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg) scale(1);
  }
  50% {
    transform: translateY(-14px) rotate(4deg) scale(1.04);
  }
}

@keyframes denyAlert {
  0% {
    transform: translateX(0) skewX(-4deg) scale(1);
    filter: brightness(1);
  }
  25% {
    transform: translateX(-16px) skewX(-9deg) scale(1.04);
    filter: brightness(1.2);
  }
  50% {
    transform: translateX(12px) skewX(2deg) scale(1.02);
  }
  100% {
    transform: translateX(0) skewX(-4deg) scale(1);
    filter: brightness(1);
  }
}

@keyframes panelDrop {
  from {
    opacity: 0;
    transform: translate(-50%, -60%) rotate(-1deg) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -54%) rotate(0) scale(1);
  }
}

@keyframes choiceIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(14px) rotate(-5deg) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(-3deg) scale(1);
  }
}

@keyframes resultIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -44%) rotate(3deg) scale(0.9);
  }
  70% {
    transform: translate(-50%, -51%) rotate(-3deg) scale(1.03);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-2deg) scale(1);
  }
}

@keyframes routeAlert {
  0% {
    opacity: 0;
    transform: translateX(28px) skewX(-4deg) scale(0.94);
    filter: hue-rotate(40deg) brightness(1.25);
  }
  18% {
    transform: translateX(-8px) skewX(-7deg) scale(1.02);
  }
  38% {
    transform: translateX(6px) skewX(-2deg) scale(1);
  }
  100% {
    opacity: 1;
    transform: translateX(0) skewX(-4deg) scale(1);
    filter: hue-rotate(0) brightness(1);
  }
}

@media (max-width: 980px) and (orientation: landscape) {
  .app {
    min-width: 0;
    min-height: 0;
  }

  .topbar {
    top: 10px;
    gap: 10px;
  }

  .sound-toggle {
    top: 10px;
    right: 2vw;
    padding: 7px 10px;
    font-size: 12px;
  }

  .fullscreen-toggle {
    top: 50px;
    right: 2vw;
    padding: 6px 9px;
    font-size: 11px;
  }

  .brand {
    padding: 6px 10px 6px 6px;
  }

  .opening-panel {
    right: 3vw;
    bottom: 4vh;
    width: min(360px, 40vw);
    padding: 14px 16px 16px;
  }

  .opening-panel li {
    font-size: 11px;
    padding: 7px 10px;
  }

  .brand strong {
    font-size: 15px;
  }

  .brand em {
    display: none;
  }

  .follower-hud {
    top: 92px;
    min-width: 168px;
  }

  .chat-hud {
    top: 92px;
    width: 230px;
  }

  .chat-hud ul {
    min-height: 92px;
    max-height: 22vh;
  }

  .sia-character {
    width: clamp(260px, 34vw, 360px);
    bottom: 10vh;
  }

  .dialogue {
    min-height: 108px;
    padding: 19px 112px 18px 22px;
  }

  .dialogue p {
    margin-top: 12px;
    font-size: clamp(20px, 2.8vw, 26px);
  }

  .speaker {
    top: -27px;
    font-size: 18px;
    padding: 7px 16px;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .app {
    min-width: 0;
    min-height: 0;
  }

  .opening-mascot {
    left: 4vw;
    top: 9vh;
    width: clamp(52px, 8vw, 84px);
  }

  .opening-panel {
    right: 2.4vw;
    top: 4%;
    bottom: 4%;
    width: min(380px, 46vw);
    padding: 10px 12px 12px;
    border-width: 3px;
    border-radius: 16px;
    overflow: hidden;
    max-height: 92%;
    transform: rotate(0.5deg);
  }

  .opening-logo {
    gap: 7px;
    margin-bottom: 6px;
    font-size: 14px;
  }

  .opening-logo img {
    width: 28px;
    height: 28px;
  }

  .opening-panel h1 {
    font-size: clamp(22px, 4.2vh, 30px);
  }

  .opening-panel p {
    margin: 8px 0 9px;
    font-size: clamp(11px, 2.6vh, 13px);
    line-height: 1.25;
  }

  .opening-panel ul {
    gap: 5px;
    margin-bottom: 10px;
  }

  .opening-panel li {
    padding: 5px 7px;
    border-radius: 8px;
    font-size: clamp(9px, 2.25vh, 11px);
    line-height: 1.22;
  }

  .terms-check {
    gap: 7px;
    margin-bottom: 10px;
    font-size: clamp(10px, 2.5vh, 12px);
    line-height: 1.25;
  }

  .terms-check input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
  }

  .opening-guide {
    margin: -4px 0 8px 27px;
    padding: 6px 10px;
    font-size: 11px;
  }

  .opening-guide.start-step {
    display: none;
  }

  .start-button {
    padding: 10px 14px;
    border-width: 2px;
    font-size: clamp(16px, 3.7vh, 22px);
    line-height: 1;
    box-shadow: 4px 4px 0 var(--pink);
  }

  .topbar {
    left: 1.5vw;
    right: 1.5vw;
    top: max(7px, env(safe-area-inset-top));
  }

  .brand {
    gap: 7px;
    padding: 5px 9px 5px 5px;
    border-radius: 10px;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }

  .brand-mark img {
    width: 22px;
    height: 22px;
  }

  .brand strong {
    font-size: 13px;
  }

  .stream-status {
    max-width: 38vw;
    padding: 6px 12px;
    border-width: 2px;
    box-shadow: 4px 4px 0 rgba(255, 31, 134, 0.88);
    font-size: 12px;
  }

  .sound-toggle {
    top: max(7px, env(safe-area-inset-top));
    right: 1.5vw;
    gap: 5px;
    padding: 6px 8px;
    border-width: 2px;
    border-radius: 10px;
    font-size: 11px;
    box-shadow: 3px 3px 0 rgba(255, 31, 134, 0.76);
  }

  .fullscreen-toggle {
    top: calc(max(7px, env(safe-area-inset-top)) + 39px);
    right: 1.5vw;
    gap: 4px;
    padding: 5px 7px;
    border-width: 2px;
    border-radius: 9px;
    font-size: 10px;
    box-shadow: 3px 3px 0 rgba(66, 217, 255, 0.62);
  }

  .fullscreen-icon {
    width: 16px;
    height: 16px;
    border-radius: 5px;
  }

  .sound-icon {
    width: 18px;
    height: 18px;
    border-radius: 6px;
  }

  .follower-hud {
    left: 2vw;
    top: 82px;
    min-width: 132px;
    padding: 8px 10px;
    border-radius: 11px;
  }

  .follower-hud span {
    font-size: 10px;
  }

  .follower-hud strong {
    font-size: clamp(15px, 4vh, 20px);
  }

  .chat-hud {
    right: 2vw;
    top: 82px;
    width: min(210px, 27vw);
    border-radius: 12px;
  }

  .chat-head {
    padding: 6px 8px;
    font-size: 11px;
  }

  .chat-head b {
    font-size: 10px;
  }

  .chat-hud ul {
    min-height: 64px;
    max-height: 18vh;
    gap: 5px;
    padding: 7px 8px 9px;
  }

  .chat-hud li {
    grid-template-columns: 12px 1fr;
    gap: 5px;
    font-size: 10px;
  }

  .chat-hud i {
    width: 11px;
    height: 11px;
  }

  .content-visual {
    left: 4vw;
    top: 38%;
    transform: rotate(-3deg) scale(0.78);
    transform-origin: left center;
  }

  .choice-board {
    top: 49%;
    width: min(620px, 70vw);
    padding: 12px;
    border-radius: 14px;
    max-height: 58dvh;
    overflow: auto;
  }

  .choice-board.final-board {
    top: 62%;
    width: min(640px, 70vw);
  }

  .choice-board.final-board .choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .choice-title {
    margin-bottom: 9px;
    padding: 6px 10px;
    font-size: 12px;
  }

  .choice-grid {
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .choice {
    min-height: 58px;
    padding: 9px 8px 9px 38px;
    border-width: 2px;
    border-radius: 12px;
    font-size: 13px;
    box-shadow: 4px 4px 0 rgba(255, 31, 134, 0.82);
  }

  .choice::before {
    left: 10px;
    width: 22px;
    height: 22px;
    font-size: 13px;
  }

  .choice small {
    margin-top: 2px;
    font-size: 10px;
  }

  .sia-character {
    width: clamp(210px, 31vw, 320px);
    bottom: 13vh;
    max-height: 64vh;
  }

  .dialogue {
    left: 2vw;
    right: 2vw;
    bottom: max(10px, env(safe-area-inset-bottom));
    min-height: 88px;
    padding: 17px 94px 14px 18px;
    border-width: 3px;
    border-radius: 14px;
    box-shadow:
      5px 5px 0 rgba(255, 31, 134, 0.88),
      -5px -5px 0 rgba(66, 217, 255, 0.62);
  }

  .dialogue::before {
    left: 14px;
    right: 14px;
    top: 9px;
    height: 5px;
  }

  .speaker {
    left: 18px;
    top: -23px;
    padding: 6px 13px;
    border-width: 3px;
    font-size: 15px;
  }

  .dialogue p {
    margin-top: 9px;
    max-width: 80%;
    font-size: clamp(17px, 5.2vh, 24px);
    line-height: 1.12;
  }

  .dialogue.system-mode p {
    font-size: clamp(14px, 4vh, 20px);
  }

  .next-button {
    right: 18px;
    bottom: 17px;
    min-width: 70px;
    padding: 9px 12px;
    border-width: 2px;
    font-size: 13px;
    box-shadow: 3px 3px 0 var(--pink);
  }

  .result-pop {
    top: 47%;
    width: min(420px, 58vw);
    padding: 16px 18px 18px;
    border-width: 3px;
  }

  .result-pop strong {
    font-size: clamp(22px, 5.5vh, 32px);
  }

  .result-pop p {
    font-size: clamp(15px, 4.2vh, 22px);
  }

  .system-pop {
    max-width: 42vw;
  }
}

@media (orientation: landscape) and (max-height: 430px) {
  .opening-panel {
    top: 3%;
    bottom: 3%;
    width: min(360px, 52vw);
    padding: 7px 9px 9px;
  }

  .opening-mascot {
    width: clamp(44px, 7vw, 68px);
  }

  .opening-panel h1 {
    font-size: clamp(19px, 5vh, 25px);
  }

  .opening-panel p {
    margin: 6px 0;
    font-size: 10px;
  }

  .opening-panel ul {
    gap: 4px;
    margin-bottom: 5px;
  }

  .opening-panel li {
    padding: 3px 6px;
    font-size: 9px;
    line-height: 1.15;
  }

  .terms-check {
    margin-bottom: 5px;
    font-size: 10px;
  }

  .opening-guide {
    margin: -2px 0 5px 24px;
    padding: 4px 8px;
    font-size: 10px;
  }

  .start-button {
    padding: 8px 10px;
    font-size: 14px;
  }

  .topbar {
    top: max(5px, env(safe-area-inset-top));
  }

  .brand {
    padding: 4px 8px 4px 4px;
  }

  .brand-mark {
    width: 24px;
    height: 24px;
  }

  .brand-mark img {
    width: 19px;
    height: 19px;
  }

  .brand strong {
    font-size: 12px;
  }

  .stream-status {
    max-width: 34vw;
    padding: 5px 9px;
    font-size: 11px;
  }

  .sound-toggle {
    top: max(5px, env(safe-area-inset-top));
    padding: 5px 7px;
  }

  .fullscreen-toggle {
    top: calc(max(5px, env(safe-area-inset-top)) + 34px);
  }

  .follower-hud {
    top: 72px;
    min-width: 118px;
    padding: 6px 8px;
  }

  .follower-hud strong {
    font-size: 15px;
  }

  .chat-hud {
    top: 72px;
    width: min(190px, 25vw);
  }

  .chat-hud ul {
    min-height: 50px;
    max-height: 15vh;
    padding: 5px 7px 7px;
  }

  .chat-hud li {
    font-size: 9px;
  }

  .content-visual {
    top: 35%;
    transform: rotate(-3deg) scale(0.68);
  }

  .choice-board {
    top: 46%;
    width: min(590px, 76vw);
    padding: 8px;
    max-height: 54dvh;
  }

  .choice-board.final-board {
    top: 58%;
    width: min(590px, 76vw);
  }

  .choice-board.final-board .choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .choice-grid {
    gap: 6px;
  }

  .choice {
    min-height: 42px;
    padding: 6px 7px 6px 32px;
    font-size: 11px;
  }

  .choice::before {
    left: 8px;
    width: 18px;
    height: 18px;
    font-size: 11px;
  }

  .choice small {
    font-size: 8px;
  }

  .sia-character {
    width: clamp(175px, 29vw, 260px);
    bottom: 15vh;
    max-height: 58vh;
  }

  .dialogue {
    bottom: max(7px, env(safe-area-inset-bottom));
    min-height: 72px;
    padding: 14px 78px 10px 14px;
    border-radius: 12px;
  }

  .dialogue::before {
    top: 7px;
    height: 4px;
  }

  .speaker {
    top: -19px;
    padding: 5px 11px;
    font-size: 13px;
  }

  .dialogue p {
    margin-top: 7px;
    max-width: 82%;
    font-size: clamp(14px, 5.1vh, 19px);
    line-height: 1.08;
  }

  .next-button {
    right: 13px;
    bottom: 12px;
    min-width: 58px;
    padding: 7px 10px;
    font-size: 11px;
  }

  .result-pop {
    width: min(360px, 58vw);
    padding: 12px 14px 14px;
  }

  .result-pop strong {
    font-size: clamp(18px, 5vh, 26px);
  }

  .result-pop p {
    font-size: clamp(13px, 3.8vh, 18px);
  }

  .follow-dev {
    width: min(620px, 82vw);
    padding: 14px 16px 17px;
  }

  .follow-dev strong {
    font-size: clamp(17px, 5vh, 26px);
  }
}

@media (orientation: landscape) and (max-height: 360px) {
  .opening-panel {
    width: min(340px, 54vw);
  }

  .opening-logo,
  .opening-panel p {
    display: none;
  }

  .opening-panel li:nth-child(n + 3) {
    display: none;
  }

  .chat-hud {
    display: none;
  }

  .follower-hud {
    top: 42px;
  }

  .choice-board {
    width: min(560px, 82vw);
    max-height: 50dvh;
  }

  .choice-grid {
    gap: 5px;
  }

  .choice {
    min-height: 38px;
    padding: 5px 6px 5px 29px;
    font-size: 10px;
  }

  .sia-character {
    width: clamp(150px, 26vw, 220px);
  }

  .dialogue {
    min-height: 64px;
    padding: 13px 68px 8px 12px;
  }

  .dialogue p {
    font-size: clamp(13px, 5vh, 16px);
  }
}

@media (orientation: portrait) {
  .opening-panel {
    right: 2.5vw;
    top: 5%;
    bottom: 5%;
    width: 48vw;
    padding: 7px 9px 9px;
    border-width: 2px;
    border-radius: 13px;
    overflow: auto;
    transform: rotate(0.5deg);
  }

  .opening-mascot {
    left: 5vw;
    top: 15%;
    width: 11vw;
  }

  .opening-logo {
    gap: 5px;
    margin-bottom: 4px;
    font-size: 11px;
  }

  .opening-logo img {
    width: 20px;
    height: 20px;
  }

  .opening-panel h1 {
    font-size: clamp(16px, 5vw, 26px);
  }

  .opening-panel p {
    margin: 5px 0;
    font-size: clamp(8px, 2.5vw, 11px);
    line-height: 1.18;
  }

  .opening-panel ul {
    gap: 3px;
    margin-bottom: 5px;
  }

  .opening-panel li {
    padding: 3px 5px;
    border-radius: 6px;
    font-size: clamp(7px, 2.1vw, 9px);
    line-height: 1.15;
  }

  .terms-check {
    gap: 5px;
    margin-bottom: 5px;
    font-size: clamp(8px, 2.2vw, 10px);
    line-height: 1.15;
  }

  .terms-check input {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
  }

  .opening-guide {
    margin: -2px 0 5px 20px;
    padding: 3px 7px;
    font-size: 8px;
    box-shadow: 2px 2px 0 var(--pink);
  }

  .opening-guide.start-step {
    display: none;
  }

  .start-button {
    padding: 7px 10px;
    border-width: 2px;
    font-size: clamp(12px, 3.4vw, 18px);
    line-height: 1;
    box-shadow: 3px 3px 0 var(--pink);
  }

  .topbar {
    left: 1.4vw;
    right: 1.4vw;
    top: 1.5vw;
  }

  .brand {
    gap: 5px;
    padding: 4px 7px 4px 4px;
    border-radius: 9px;
  }

  .brand-mark {
    width: 22px;
    height: 22px;
  }

  .brand-mark img {
    width: 17px;
    height: 17px;
  }

  .brand strong {
    font-size: 11px;
  }

  .brand em {
    display: none;
  }

  .stream-status {
    max-width: 35vw;
    padding: 5px 9px;
    border-width: 2px;
    font-size: 10px;
    box-shadow: 3px 3px 0 rgba(255, 31, 134, 0.88);
  }

  .sound-toggle {
    top: 1.5vw;
    right: 1.4vw;
    gap: 4px;
    padding: 5px 7px;
    border-width: 2px;
    border-radius: 9px;
    font-size: 9px;
    box-shadow: 2px 2px 0 rgba(255, 31, 134, 0.76);
  }

  .fullscreen-toggle {
    top: 32px;
    right: 1.4vw;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 8px;
    font-size: 8px;
    box-shadow: 2px 2px 0 rgba(66, 217, 255, 0.62);
  }

  .sound-icon,
  .fullscreen-icon {
    width: 15px;
    height: 15px;
    border-radius: 5px;
  }

  .follower-hud {
    left: 2vw;
    top: 43px;
    min-width: 98px;
    padding: 5px 7px;
    border-radius: 9px;
  }

  .follower-hud span {
    font-size: 8px;
  }

  .follower-hud strong {
    font-size: 13px;
  }

  .chat-hud {
    display: none;
  }

  .content-visual {
    left: 3vw;
    top: 36%;
    transform: rotate(-3deg) scale(0.6);
    transform-origin: left center;
  }

  .choice-board {
    top: 47%;
    width: 74vw;
    max-height: 52%;
    padding: 7px;
    border-width: 2px;
    border-radius: 12px;
    overflow: auto;
  }

  .choice-board.final-board {
    top: 59%;
    width: 72vw;
  }

  .choice-title {
    margin-bottom: 6px;
    padding: 4px 8px;
    font-size: 10px;
  }

  .choice-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .choice-board.final-board .choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .choice {
    min-height: 36px;
    padding: 5px 5px 5px 27px;
    border-width: 2px;
    border-radius: 9px;
    font-size: 9px;
    box-shadow: 3px 3px 0 rgba(255, 31, 134, 0.82);
  }

  .choice::before {
    left: 7px;
    width: 16px;
    height: 16px;
    font-size: 9px;
  }

  .choice small {
    margin-top: 1px;
    font-size: 7px;
  }

  .sia-character {
    width: 28vw;
    max-height: 58%;
    bottom: 14%;
  }

  .dialogue {
    left: 2vw;
    right: 2vw;
    bottom: 2vw;
    min-height: 58px;
    padding: 12px 62px 8px 11px;
    border-width: 2px;
    border-radius: 12px;
    box-shadow:
      3px 3px 0 rgba(255, 31, 134, 0.88),
      -3px -3px 0 rgba(66, 217, 255, 0.62);
  }

  .dialogue::before {
    left: 10px;
    right: 10px;
    top: 6px;
    height: 3px;
  }

  .speaker {
    left: 14px;
    top: -17px;
    padding: 4px 9px;
    border-width: 2px;
    font-size: 11px;
  }

  .dialogue p {
    margin-top: 6px;
    max-width: 82%;
    font-size: clamp(11px, 3.8vw, 15px);
    line-height: 1.08;
  }

  .next-button {
    right: 10px;
    bottom: 10px;
    min-width: 50px;
    padding: 6px 8px;
    border-width: 2px;
    font-size: 10px;
    box-shadow: 2px 2px 0 var(--pink);
  }

  .result-pop {
    width: 60vw;
    padding: 10px 12px 12px;
    border-width: 2px;
  }

  .result-pop strong {
    font-size: clamp(16px, 5vw, 24px);
  }

  .result-pop p {
    font-size: clamp(11px, 3.4vw, 16px);
  }

  .follow-dev {
    width: 78vw;
    padding: 12px 14px;
  }

  .follow-dev strong {
    font-size: clamp(15px, 4.5vw, 22px);
  }
}

/* ───────── 공유하기 ───────── */
.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 16px;
  padding: 12px 22px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  color: #111018;
  background: linear-gradient(135deg, #ffd75a, #ff8fc4);
  box-shadow: 5px 5px 0 rgba(66, 217, 255, 0.72);
  font-weight: 1000;
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    filter 140ms ease;
}

.share-button svg {
  width: 20px;
  height: 20px;
}

.share-button:hover,
.share-button:focus-visible {
  transform: translate(-3px, -3px);
  box-shadow: 8px 8px 0 rgba(66, 217, 255, 0.8);
  filter: brightness(1.05);
}

.share-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 3, 10, 0.62);
  backdrop-filter: blur(4px);
  animation: shareFade 180ms ease both;
}

.share-sheet {
  width: min(420px, 92%);
  max-height: 86%;
  overflow-y: auto;
  padding: 18px 18px 20px;
  border: 3px solid var(--ink);
  border-radius: 20px;
  color: var(--ink);
  background: linear-gradient(135deg, #fff, #eafcff);
  box-shadow:
    10px 10px 0 rgba(255, 31, 134, 0.85),
    0 30px 80px rgba(0, 0, 0, 0.45);
  animation: shareDrop 240ms cubic-bezier(0.2, 1.16, 0.34, 1) both;
}

@keyframes shareDrop {
  from {
    opacity: 0;
    transform: rotate(-1deg) scale(0.95);
  }
  to {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
}

.share-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 18px;
  font-weight: 1000;
}

.share-close {
  width: 32px;
  height: 32px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  font-weight: 1000;
  cursor: pointer;
}

.share-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.share-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  box-shadow: 4px 4px 0 rgba(18, 16, 24, 0.2);
  font-weight: 900;
  cursor: pointer;
  transition:
    transform 130ms ease,
    box-shadow 130ms ease;
}

.share-opt:hover,
.share-opt:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 rgba(18, 16, 24, 0.28);
}

.share-opt[data-share="copy"] {
  grid-column: 1 / -1;
}

.share-opt-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
}

.share-opt-icon svg {
  width: 20px;
  height: 20px;
}

.so-kakao {
  background: #fee500;
  color: #3c1e1e;
}

.so-insta {
  background: linear-gradient(135deg, #feda75, #d62976, #4f5bd5);
}

.so-x,
.so-threads {
  background: #111018;
}

.so-copy {
  background: var(--cyan);
  color: #06222b;
}

.share-toast {
  position: fixed;
  left: 50%;
  bottom: 9%;
  z-index: 210;
  padding: 11px 18px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: rgba(10, 8, 18, 0.95);
  color: #fff;
  font-weight: 900;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition:
    opacity 240ms ease,
    transform 240ms ease;
  pointer-events: none;
}

.share-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes shareFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Landscape-only game: in portrait, cover everything and ask to rotate. */
.rotate-gate {
  display: none;
}

@media (orientation: portrait) {
  .rotate-gate {
    display: grid;
    place-items: center;
    position: fixed;
    inset: 0;
    z-index: 9999;
    padding: max(24px, env(safe-area-inset-top)) 28px;
    text-align: center;
    background:
      radial-gradient(circle at 50% 28%, rgba(255, 79, 167, 0.22), transparent 62%),
      radial-gradient(circle at 50% 80%, rgba(66, 217, 255, 0.16), transparent 60%),
      #07050b;
  }

  .rotate-gate-inner {
    display: grid;
    justify-items: center;
    gap: 12px;
    max-width: 320px;
  }

  .rotate-phone {
    position: relative;
    width: 62px;
    height: 104px;
    margin-bottom: 18px;
    border: 5px solid #fff;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 6px 6px 0 var(--pink);
    transform-origin: 50% 50%;
    animation: rotateHint 2.4s ease-in-out infinite;
  }

  .rotate-phone::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 9px;
    width: 22px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    transform: translateX(-50%);
  }

  .rotate-gate strong {
    color: #fff;
    font-size: clamp(20px, 6vw, 28px);
    font-weight: 1000;
    text-shadow: 3px 3px 0 #111018;
  }

  .rotate-gate span {
    color: rgba(255, 255, 255, 0.78);
    font-size: clamp(12px, 3.6vw, 15px);
    font-weight: 800;
  }
}

@keyframes rotateHint {
  0%,
  28% {
    transform: rotate(0deg);
  }

  62%,
  100% {
    transform: rotate(-90deg);
  }
}

@keyframes guidePulse {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}
