:root {
  --ink: #161720;
  --muted: #6e7282;
  --paper: #fbfbff;
  --panel: rgba(255, 255, 255, 0.88);
  --navy: #101f57;
  --pink: #ff4fa3;
  --hot: #ff2f96;
  --line: rgba(16, 31, 87, 0.18);
  --shadow: rgba(13, 16, 32, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100svh;
  margin: 0;
}

body {
  overflow: hidden;
  background: #0d1020;
  color: var(--ink);
  font-family:
    "Pretendard",
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    system-ui,
    sans-serif;
}

button {
  font: inherit;
}

.game {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  min-width: 320px;
  background: #f7f7fb;
  overflow: hidden;
  cursor: none;
  --mx: 50%;
  --my: 50%;
}

.game.is-pointer-active,
.game.is-pointer-active * {
  cursor: none;
}

.hidden {
  display: none !important;
}

.title-screen,
.stage {
  position: absolute;
  inset: 0;
}

.title-screen {
  position: absolute;
  inset: 0;
  display: block;
  padding: clamp(18px, 3vw, 44px);
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0.08) 0 30px, transparent 92px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.015) 0 44%, rgba(18, 20, 38, 0.12) 100%),
    url("./assets/ui/title_main_visual_classroom_4girls_v2.png"),
    radial-gradient(circle at 30% 12%, #fff5c8 0, #bde3ff 48%, #f6edff 100%);
  background-position: center;
  background-size: cover;
  overflow: hidden;
}

.title-light-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: soft-light;
  opacity: 0.34;
  z-index: 1;
}

.title-screen::before,
.title-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.title-screen::before {
  background:
    radial-gradient(circle at 82% 28%, rgba(255, 79, 163, 0.08) 0 1px, transparent 3px),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 9px);
  mix-blend-mode: soft-light;
  opacity: 0.18;
  animation: titleScan 5.6s linear infinite;
}

.title-screen::after {
  background:
    radial-gradient(circle at 86% 21%, rgba(255, 255, 255, 0.18) 0 1px, transparent 3px),
    radial-gradient(circle at 62% 78%, rgba(255, 255, 255, 0.14) 0 1px, transparent 3px),
    linear-gradient(90deg, rgba(4, 8, 22, 0.14) 0, transparent 18%, transparent 78%, rgba(4, 8, 22, 0.14) 100%),
    linear-gradient(180deg, transparent 0 78%, rgba(6, 8, 18, 0.2) 100%);
  background-size: 190px 160px, 260px 210px, 100% 100%, 100% 100%;
  opacity: 0.24;
  animation: titleSpark 7s ease-in-out infinite alternate;
}

.title-screen > * {
  position: relative;
  z-index: 1;
}

.title-layout {
  position: absolute;
  left: clamp(16px, 3vw, 48px);
  right: clamp(16px, 3vw, 48px);
  bottom: clamp(16px, 3vh, 34px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 350px);
  align-items: end;
  gap: 28px;
  z-index: 2;
}

.title-brand-logo {
  position: absolute;
  top: clamp(14px, 3vw, 34px);
  right: clamp(16px, 3vw, 48px);
  width: clamp(118px, 16vw, 220px);
  height: auto;
  z-index: 2;
  filter: drop-shadow(0 8px 18px rgba(32, 18, 45, 0.28));
}

.title-license-button {
  position: absolute;
  top: clamp(14px, 2.4vw, 30px);
  left: clamp(16px, 3vw, 48px);
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--hot);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 12px 32px rgba(12, 16, 28, 0.14);
  backdrop-filter: blur(4px) saturate(1.08);
  cursor: none;
  z-index: 2;
  transition: transform 120ms ease, filter 120ms ease;
}

.title-license-button:hover {
  filter: brightness(1.05);
}

.title-license-button:active,
.title-license-button.is-pressed {
  transform: translateY(2px);
}

.title-mark {
  width: min(780px, 54vw);
  padding: 0;
  filter: drop-shadow(0 18px 28px rgba(64, 40, 86, 0.18));
}

.title-kicker {
  display: inline-flex;
  color: var(--navy);
  font-size: 15px;
  font-weight: 800;
  border-bottom: 3px solid var(--pink);
  padding-bottom: 5px;
}

.title-logo {
  display: block;
  margin: 0;
  line-height: 0;
}

.title-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.title-mark p {
  max-width: 620px;
  margin: 0;
  color: #3a3d4a;
  font-size: clamp(15px, 1.8vw, 19px);
  font-weight: 700;
}

.title-action-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.42));
  box-shadow: 0 18px 50px rgba(12, 16, 28, 0.18);
  backdrop-filter: blur(4px) saturate(1.08);
}

.title-button {
  position: relative;
  display: grid;
  justify-items: start;
  gap: 2px;
  min-height: 62px;
  padding: 11px 18px;
  border: 1px solid rgba(16, 31, 87, 0.18);
  border-radius: 9px;
  background:
    linear-gradient(120deg, transparent 0 40%, rgba(255, 255, 255, 0.86) 48%, transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(235, 241, 255, 0.94));
  background-position: -220px 0, 0 0;
  background-size: 180px 100%, 100% 100%;
  color: var(--navy);
  font-weight: 900;
  cursor: none;
  box-shadow: 0 7px 0 #b8c2df, 0 18px 32px rgba(12, 16, 28, 0.18);
  transform: translateY(0);
  transition: transform 120ms ease, box-shadow 120ms ease, background-position 360ms ease, filter 120ms ease;
}

.title-button strong {
  font-size: 20px;
  letter-spacing: 0;
}

.title-button small {
  color: #6a7082;
  font-size: 12px;
  font-weight: 800;
}

.title-button:hover {
  background-position: 130% 0, 0 0;
  filter: brightness(1.04);
}

.title-button:active,
.title-button.is-pressed {
  transform: translateY(6px) scale(0.992);
  box-shadow: 0 1px 0 #b8c2df, 0 8px 18px rgba(12, 16, 28, 0.16);
}

.title-button.primary {
  border-color: rgba(255, 79, 163, 0.35);
  background:
    linear-gradient(120deg, transparent 0 40%, rgba(255, 255, 255, 0.9) 48%, transparent 58%),
    linear-gradient(90deg, rgba(255, 79, 163, 0.18), transparent 30%),
    linear-gradient(180deg, #ffffff, #f5f7ff);
  background-position: -220px 0, 0 0, 0 0;
  background-size: 180px 100%, 100% 100%, 100% 100%;
  box-shadow: 0 7px 0 #ff9bcf, 0 0 26px rgba(255, 79, 163, 0.24);
}

.title-button.primary:active,
.title-button.primary.is-pressed {
  box-shadow: 0 1px 0 #ff9bcf, 0 8px 18px rgba(255, 79, 163, 0.18);
}

.title-sunbeam {
  position: absolute;
  left: -12vw;
  top: -28vh;
  width: 58vw;
  height: 82vh;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(255, 246, 194, 0.16) 0, rgba(255, 255, 255, 0.06) 30%, transparent 66%);
  mix-blend-mode: soft-light;
  opacity: 0.75;
  animation: sunPulse 4.5s ease-in-out infinite alternate;
  z-index: 1;
}

.title-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.title-particles span,
.spark-trail {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 14px rgba(255, 246, 194, 0.85), 0 0 22px rgba(255, 79, 163, 0.24);
  animation: moteFloat 4.8s ease-in-out var(--d) infinite;
}

.spark-trail {
  z-index: 4;
  pointer-events: none;
  animation: sparkTrail 620ms ease-out forwards;
}

.title-cursor {
  position: fixed;
  left: var(--mx);
  top: var(--my);
  width: 19px;
  height: 23px;
  z-index: 2147483647;
  pointer-events: none;
  opacity: 0;
  transform: translate(2px, 3px);
  isolation: isolate;
  filter:
    drop-shadow(0 2px 0 rgba(16, 31, 87, 0.84))
    drop-shadow(0 0 6px rgba(255, 79, 163, 0.82))
    drop-shadow(0 0 11px rgba(255, 246, 194, 0.72));
  transition: opacity 120ms ease;
}

.game.is-pointer-active .title-cursor {
  opacity: 1;
}

.title-cursor::before,
.title-cursor::after {
  content: "";
  position: absolute;
  z-index: 1;
  clip-path: polygon(0 0, 0 82%, 22% 64%, 37% 100%, 56% 91%, 41% 57%, 73% 57%);
}

.title-cursor::before {
  inset: 0;
  background: linear-gradient(145deg, #101f57 0 42%, #ff4fa3 100%);
}

.title-cursor::after {
  inset: 3px 4px 4px 4px;
  background:
    radial-gradient(circle at 34% 24%, #fffbe2 0 16%, transparent 18%),
    linear-gradient(145deg, #ffffff 0 58%, #ffd8ec 100%);
  box-shadow: inset -2px -3px 0 rgba(255, 79, 163, 0.28);
}

.hidden-character-hint {
  position: absolute;
  left: 50%;
  top: 29%;
  transform: translateX(-50%);
  z-index: 2;
  opacity: 0;
  color: rgba(16, 31, 87, 0.68);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 900;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
  animation: hiddenHint 7s steps(2, end) infinite;
}

.title-screen:has(.title-button:hover) .hidden-character-hint {
  opacity: 0.58;
}

.title-guide-panel {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 10, 18, 0.46);
  z-index: 6;
}

.title-guide-panel section {
  position: relative;
  width: min(720px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 248, 255, 0.9));
  box-shadow: 0 24px 70px rgba(6, 8, 18, 0.36);
}

.title-guide-panel h2 {
  margin: 0 0 14px;
  color: var(--navy);
  font-size: 28px;
}

.title-guide-panel p {
  margin: 8px 0;
  color: #303546;
  line-height: 1.7;
}

.name-input-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 14px;
}

#playerNameInput {
  width: 100%;
  max-width: 240px;
  padding: 12px;
  font-size: 18px;
  text-align: center;
  border: 2px solid var(--gray100);
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  margin-bottom: 24px;
  transition: border-color 0.2s;
}

#playerNameInput:focus {
  border-color: var(--primary);
}

.name-input-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  width: 100%;
}

.title-guide-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.title-guide-list div {
  padding: 12px 14px;
  border: 1px solid rgba(16, 31, 87, 0.12);
  border-radius: 8px;
  background: #fff;
}

.title-guide-list strong {
  color: var(--pink);
}

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

.character-profile-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 118px;
  padding: 10px;
  border: 1px solid rgba(16, 31, 87, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.character-profile-card img {
  display: block;
  width: 84px;
  height: 98px;
  object-fit: contain;
  object-position: center bottom;
  align-self: end;
  filter: drop-shadow(0 8px 12px rgba(16, 31, 87, 0.16));
}

.character-profile-card.is-secret {
  border-color: rgba(255, 79, 163, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 79, 163, 0.16), rgba(255, 255, 255, 0.78) 58%),
    rgba(255, 255, 255, 0.72);
}

.character-profile-card.is-secret strong {
  color: var(--hot);
}

.character-secret-portrait {
  display: grid;
  place-items: center;
  width: 84px;
  height: 98px;
  align-self: end;
  border: 1px solid rgba(255, 79, 163, 0.34);
  border-radius: 8px;
  background:
    radial-gradient(circle at 52% 28%, rgba(255, 255, 255, 0.9) 0 14px, transparent 15px),
    linear-gradient(180deg, rgba(255, 79, 163, 0.62), rgba(255, 183, 220, 0.82));
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 17px;
  font-weight: 900;
  text-shadow: 0 2px 10px rgba(143, 14, 83, 0.35);
  box-shadow: 0 8px 12px rgba(255, 79, 163, 0.18);
}

.character-profile-card strong,
.character-profile-card span {
  display: block;
}

.character-profile-card strong {
  margin-bottom: 6px;
  color: var(--navy);
  font-size: 17px;
}

.character-profile-card span {
  color: #4c5263;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.5;
}

.title-guide-close {
  position: absolute;
  right: 16px;
  top: 16px;
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: var(--navy);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--pink);
}

.title-hero-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 52px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 10px 26px rgba(13, 16, 32, 0.14);
  backdrop-filter: blur(8px);
  animation: titleFloat 3.8s ease-in-out infinite;
}

.title-hero-row span,
.title-hero-row i {
  width: 34px;
  height: 46px;
  border: 3px solid rgba(16, 31, 87, 0.18);
  border-radius: 20px 20px 14px 14px;
  background:
    radial-gradient(circle at 50% 28%, #ffece6 0 12px, transparent 13px),
    linear-gradient(180deg, var(--c) 0 42%, #fff 42% 100%);
  box-shadow: 0 7px 0 rgba(16, 31, 87, 0.15);
}

.title-hero-row i {
  position: relative;
  background:
    radial-gradient(circle at 50% 28%, #fff1eb 0 12px, transparent 13px),
    linear-gradient(180deg, #101018 0 42%, #fff 42% 100%);
  box-shadow: 0 7px 0 rgba(255, 79, 163, 0.45), 0 0 22px rgba(255, 79, 163, 0.25);
  opacity: 0.55;
  animation: microJitter 900ms steps(2, end) infinite;
}

.title-hero-row i::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 3px;
  width: 8px;
  height: 25px;
  border-radius: 999px;
  background: #f7f7f7;
}

.title-log {
  position: absolute;
  right: 22px;
  bottom: 18px;
  color: rgba(255, 255, 255, 0.62);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

.press-button,
.icon-button,
.dialogue-box {
  border: 0;
  cursor: pointer;
  user-select: none;
}

.press-button {
  min-width: 180px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(238, 242, 255, 0.98)),
    #ffffff;
  color: var(--navy);
  font-weight: 900;
  border: 2px solid rgba(16, 31, 87, 0.16);
  box-shadow: 0 7px 0 #bdc5df, 0 18px 36px rgba(14, 20, 44, 0.18);
  transform: translateY(0);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.press-button:hover {
  filter: brightness(1.02);
}

.press-button:active,
.press-button.is-pressed {
  transform: translateY(5px);
  box-shadow: 0 2px 0 #bdc5df, 0 10px 22px rgba(14, 20, 44, 0.15);
}

.press-button.primary {
  background:
    linear-gradient(90deg, rgba(255, 79, 163, 0.14), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f1f5ff 100%);
  border: 2px solid rgba(16, 31, 87, 0.16);
}

.stage {
  background: #111421;
}

.background {
  position: absolute;
  inset: 0;
  background-color: #08090f;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transition: opacity 320ms ease, filter 320ms ease;
}

.background.has-asset {
  background-position: center center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-attachment: scroll !important;
}

.background::before,
.background::after {
  content: none;
  display: none;
}

.bg-classroom {
  background: linear-gradient(180deg, #bfe5ff 0 38%, #f9e8c8 38% 40%, #fdf7ef 40% 100%);
}

.bg-classroomMorning,
.bg-classroomBreak {
  background: linear-gradient(180deg, #bfe5ff 0 38%, #f9e8c8 38% 40%, #fdf7ef 40% 100%);
}

.bg-classroom::before {
  background:
    linear-gradient(90deg, transparent 0 11%, rgba(255, 255, 255, 0.86) 11% 32%, transparent 32% 40%, rgba(255, 255, 255, 0.86) 40% 61%, transparent 61% 100%),
    linear-gradient(180deg, transparent 0 18%, rgba(16, 31, 87, 0.13) 18% 19%, transparent 19% 100%);
  top: 9%;
  bottom: 42%;
}

.bg-classroomMorning::before,
.bg-classroomBreak::before {
  background:
    linear-gradient(90deg, transparent 0 11%, rgba(255, 255, 255, 0.86) 11% 32%, transparent 32% 40%, rgba(255, 255, 255, 0.86) 40% 61%, transparent 61% 100%),
    linear-gradient(180deg, transparent 0 18%, rgba(16, 31, 87, 0.13) 18% 19%, transparent 19% 100%);
  top: 9%;
  bottom: 42%;
}

.bg-classroomBreak {
  filter: saturate(0.98) brightness(0.98);
}

.bg-clubroom {
  background: linear-gradient(180deg, #fff3fa 0 42%, #efe6d6 42% 44%, #e8d9bf 44% 100%);
}

.bg-clubroom::before {
  background:
    linear-gradient(90deg, rgba(16, 31, 87, 0.16) 0 2px, transparent 2px 100%),
    linear-gradient(0deg, rgba(16, 31, 87, 0.1) 0 2px, transparent 2px 100%);
  background-size: 84px 84px;
  opacity: 0.7;
}

.bg-hallway {
  background: linear-gradient(90deg, #fff9ea 0 28%, #d4ecff 28% 72%, #fff9ea 72% 100%);
}

.bg-hallway::before {
  background: linear-gradient(180deg, transparent 0 62%, rgba(16, 31, 87, 0.16) 62% 63%, rgba(230, 221, 204, 0.95) 63% 100%);
}

.bg-bench {
  background: linear-gradient(180deg, #ffcedf 0 28%, #bcd7ff 28% 56%, #61716e 56% 57%, #466456 57% 100%);
}

.bg-benchDay,
.bg-benchGlitch {
  background: linear-gradient(180deg, #ffd5de 0 30%, #bfdfff 30% 56%, #7aa86d 56% 100%);
}

.bg-bench::before {
  top: 50%;
  left: 18%;
  right: 18%;
  bottom: 34%;
  border-radius: 8px;
  background: linear-gradient(180deg, #5d371e, #36200f);
  box-shadow: 0 24px 0 #2a241e;
}

.bg-benchDay::before,
.bg-benchGlitch::before {
  top: 50%;
  left: 18%;
  right: 18%;
  bottom: 34%;
  border-radius: 8px;
  background: linear-gradient(180deg, #73502d, #3e2815);
  box-shadow: 0 24px 0 #2a241e;
}

.bg-benchGlitch {
  filter: saturate(1.1) contrast(1.06);
}

.bg-escapeExterior {
  background: linear-gradient(180deg, #ffe5d6 0 46%, #d1eef8 46% 100%);
}

.bg-escapeExterior::before {
  left: 18%;
  right: 18%;
  top: 22%;
  bottom: 18%;
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(16, 31, 87, 0.18) 0 2px, transparent 2px 100%),
    linear-gradient(180deg, #f7f2ea 0 24%, #362a3d 24% 100%);
  box-shadow: 0 26px 60px rgba(16, 20, 45, 0.22);
}

.bg-escapeRoom {
  background: radial-gradient(circle at 50% 28%, #596072, #151a24 70%);
}

.bg-streetAfternoon {
  background: linear-gradient(180deg, #ffd6aa 0 40%, #d2efff 40% 68%, #7d8f85 68% 100%);
}

.bg-streetAfternoon::before {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.72) 0 12%, transparent 12% 19%, rgba(255, 255, 255, 0.7) 19% 31%, transparent 31% 100%),
    linear-gradient(180deg, transparent 0 62%, rgba(44, 62, 72, 0.7) 62% 64%, transparent 64% 100%);
}

.bg-arcade {
  background:
    radial-gradient(circle at 20% 25%, rgba(255, 47, 150, 0.42), transparent 24%),
    radial-gradient(circle at 78% 34%, rgba(58, 185, 255, 0.42), transparent 26%),
    linear-gradient(180deg, #2b2144 0 58%, #131621 58% 100%);
}

.bg-messenger {
  background: linear-gradient(180deg, #dcecff, #fff5fb);
}

.bg-secondYear {
  background: linear-gradient(180deg, #cde9ff 0 48%, #eef5f2 48% 100%);
}

.bg-secondYear::before {
  left: 11%;
  right: 11%;
  top: 12%;
  bottom: 24%;
  background:
    repeating-linear-gradient(90deg, rgba(16, 31, 87, 0.15) 0 2px, transparent 2px 82px),
    linear-gradient(180deg, #f4f4ec 0 72%, #ccd1d8 72% 100%);
  border-radius: 8px;
}

.bg-reality {
  background: linear-gradient(180deg, #10131f 0 48%, #2c2d38 48% 100%);
}

.bg-reality::before {
  left: 12%;
  right: 12%;
  top: 50%;
  bottom: 26%;
  border-radius: 6px;
  background: linear-gradient(180deg, #f6f0e7, #c9bda8);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.background.fade {
  opacity: 0;
}

.background:not(.has-asset) {
  background: #08090f;
  filter: none;
}

.background.has-asset::before,
.background.has-asset::after {
  display: none;
}

.character-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 7;
}

.character-slot {
  position: absolute;
  bottom: 0;
  width: min(40vw, 560px);
  height: 100%;
  min-width: 280px;
  overflow: visible;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 260ms ease, transform 260ms ease, filter 220ms ease;
  filter: drop-shadow(0 24px 28px rgba(11, 13, 22, 0.24));
}

.character-slot.entering {
  animation: characterEnter 360ms ease both;
}

.character-slot.exiting {
  opacity: 0;
  transform: translateY(18px) translateX(24px) scale(0.985);
}

.character-slot.is-active {
  opacity: 1;
  filter: drop-shadow(0 24px 28px rgba(11, 13, 22, 0.24));
  z-index: 8;
}

.character-slot.is-inactive {
  opacity: 0.82;
  filter: brightness(0.9) saturate(0.94) drop-shadow(0 20px 22px rgba(11, 13, 22, 0.18));
  z-index: 6;
}

.character-slot.is-mystery {
  opacity: 0.56;
  filter: brightness(0.42) saturate(0.72) contrast(1.06) blur(0.35px)
    drop-shadow(0 26px 34px rgba(3, 6, 16, 0.48));
}

.character-slot.is-mystery .character-sprite {
  mix-blend-mode: multiply;
}

.character-slot[data-character="unknown"] {
  filter:
    drop-shadow(0 0 14px rgba(255, 40, 166, 0.54))
    drop-shadow(0 0 32px rgba(255, 63, 190, 0.28));
  animation: unknownSignalJitter 1.05s steps(2, end) infinite;
}

.character-slot[data-character="unknown"]::before,
.character-slot[data-character="unknown"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 12dvh;
  width: min(32vw, 450px);
  height: min(72dvh, 760px);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 7;
  opacity: 0.72;
  mix-blend-mode: screen;
}

.character-slot[data-character="unknown"]::before {
  background:
    linear-gradient(90deg, transparent 0 13%, rgba(255, 35, 168, 0.72) 13% 18%, transparent 18% 100%),
    linear-gradient(90deg, transparent 0 64%, rgba(255, 82, 203, 0.62) 64% 70%, transparent 70% 100%),
    repeating-linear-gradient(0deg, transparent 0 24px, rgba(255, 46, 180, 0.58) 24px 27px, transparent 27px 92px);
  clip-path: polygon(31% 6%, 70% 6%, 83% 38%, 74% 95%, 31% 95%, 17% 38%);
  animation: unknownArtifactSweep 0.78s steps(4, end) infinite;
}

.character-slot[data-character="unknown"]::after {
  background:
    repeating-linear-gradient(0deg, transparent 0 13px, rgba(255, 108, 214, 0.34) 13px 15px, transparent 15px 42px),
    radial-gradient(circle at 34% 22%, rgba(255, 39, 171, 0.78) 0 2px, transparent 3px),
    radial-gradient(circle at 68% 62%, rgba(255, 39, 171, 0.66) 0 2px, transparent 3px),
    radial-gradient(circle at 49% 79%, rgba(255, 39, 171, 0.62) 0 2px, transparent 3px);
  clip-path: polygon(25% 4%, 74% 4%, 90% 42%, 78% 98%, 23% 98%, 10% 42%);
  animation: unknownArtifactBlink 1.34s steps(3, end) infinite;
}

.character-slot[data-character="unknown"] .character-sprite {
  filter:
    drop-shadow(5px 0 0 rgba(255, 43, 174, 0.36))
    drop-shadow(-4px 0 0 rgba(255, 119, 217, 0.2));
  animation: unknownSpriteGlitch 0.86s steps(2, end) infinite;
}

.slot-left {
  left: 2vw;
}

.slot-right {
  right: 2vw;
}

.slot-center {
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
}

.slot-center.entering {
  animation: characterEnterCenter 360ms ease both;
}

.character-art {
  position: absolute;
  inset: 0;
  display: none;
  filter: drop-shadow(0 24px 28px rgba(11, 13, 22, 0.24));
}

.character.use-css-fallback .character-art {
  display: block;
}

.character-sprite {
  position: absolute;
  left: 50%;
  bottom: -28dvh;
  width: auto;
  height: min(122dvh, 1480px);
  object-fit: contain;
  object-position: center bottom;
  transform: translateX(-50%);
  z-index: 5;
}

.character-layer.has-multiple .character-sprite {
  bottom: -26dvh;
  height: min(120dvh, 1440px);
}

.character.has-sprite .character-art {
  display: none;
}

.hair {
  position: absolute;
  top: 14%;
  width: 23%;
  height: 70%;
  background: linear-gradient(90deg, #06070a, #171824 48%, #07080b);
  border-radius: 48% 48% 42% 42%;
  z-index: 1;
}

.hair.left {
  left: 16%;
  transform: rotate(4deg);
}

.hair.right {
  right: 16%;
  transform: rotate(-4deg);
}

.head {
  position: absolute;
  left: 33%;
  top: 8%;
  width: 34%;
  aspect-ratio: 0.82;
  border-radius: 46% 46% 42% 42%;
  background: #fff1eb;
  border: 2px solid rgba(16, 31, 87, 0.22);
  z-index: 4;
}

.bangs {
  position: absolute;
  inset: -10% 2% auto;
  height: 38%;
  display: grid;
  grid-template-columns: 2fr 0.7fr 2fr;
  z-index: 2;
}

.bangs span,
.bangs i {
  border-radius: 0 0 52% 52%;
}

.bangs span {
  background: #090a10;
}

.bangs i {
  background: #f7f7f7;
  transform: skewX(-4deg);
}

.eyes {
  position: absolute;
  left: 17%;
  right: 17%;
  top: 48%;
  display: flex;
  justify-content: space-between;
}

.eyes b {
  width: 24%;
  aspect-ratio: 1.18;
  border-radius: 50%;
  background: #050509;
  box-shadow: inset 5px 0 0 rgba(255, 255, 255, 0.18);
}

.eyes b:last-child {
  background: #3b3d46;
}

.mouth {
  position: absolute;
  left: 45%;
  top: 72%;
  width: 11%;
  height: 3px;
  border-radius: 999px;
  background: #4c2c32;
  transition: width 180ms ease, height 180ms ease, border-radius 180ms ease;
}

.character[data-expression="smile"] .mouth {
  width: 16%;
  height: 7px;
  background: transparent;
  border-bottom: 3px solid #4c2c32;
}

.character[data-expression="surprise"] .mouth {
  width: 9%;
  height: 12px;
  border-radius: 50%;
}

.character[data-expression="glitch"] .mouth {
  width: 18%;
  height: 4px;
  background: var(--hot);
}

.jacket {
  position: absolute;
  left: 25%;
  top: 34%;
  width: 50%;
  height: 34%;
  border-radius: 20% 20% 10% 10%;
  background: linear-gradient(90deg, #fff, #f3f4fb);
  border: 3px solid rgba(16, 31, 87, 0.16);
  z-index: 3;
}

.tie {
  position: absolute;
  left: 46%;
  top: 0;
  width: 8%;
  height: 58%;
  background: var(--navy);
  clip-path: polygon(50% 0, 100% 20%, 72% 100%, 28% 100%, 0 20%);
}

.pink-line {
  position: absolute;
  top: 8%;
  width: 3px;
  height: 82%;
  background: var(--pink);
}

.pink-line.left {
  left: 34%;
}

.pink-line.right {
  right: 34%;
}

.xmark {
  position: absolute;
  left: 29%;
  top: 36%;
  color: var(--pink);
  font-size: 20px;
  font-weight: 900;
}

.skirt {
  position: absolute;
  left: 34%;
  top: 65%;
  width: 32%;
  height: 14%;
  z-index: 2;
}

.hline {
  position: absolute;
  left: 0;
  top: 0;
  width: 54%;
  height: 100%;
  background: #3d3e46;
  border-radius: 2px 2px 8px 8px;
}

.pleats {
  position: absolute;
  right: 0;
  top: 8%;
  width: 58%;
  height: 84%;
  background:
    repeating-linear-gradient(90deg, #101f57 0 11px, #24377e 11px 19px),
    #101f57;
  clip-path: polygon(0 0, 100% 0, 92% 100%, 6% 100%);
}

.arm {
  position: absolute;
  top: 40%;
  width: 10%;
  height: 31%;
  border-radius: 999px;
  z-index: 2;
}

.arm.normal {
  left: 21%;
  background: #fff1eb;
  transform: rotate(8deg);
}

.arm.cursed {
  right: 19%;
  background:
    linear-gradient(0deg, rgba(255, 79, 163, 0.34), transparent 36%),
    linear-gradient(90deg, #030305, #171219);
  transform: rotate(-10deg);
  box-shadow: 0 0 18px rgba(255, 47, 150, 0.35);
}

.character[data-character="seoyeon"] .hair,
.character[data-character="daon"] .hair,
.character[data-character="harin"] .hair,
.character[data-character="chaeyul"] .hair {
  display: none;
}

.character[data-character="seoyeon"] .head,
.character[data-character="daon"] .head,
.character[data-character="harin"] .head,
.character[data-character="chaeyul"] .head {
  background: #fff0e8;
}

.character[data-character="seoyeon"] .bangs span,
.character[data-character="seoyeon"] .bangs i {
  background: #4a2a24;
}

.character[data-character="daon"] .bangs span,
.character[data-character="daon"] .bangs i {
  background: #a86d35;
}

.character[data-character="harin"] .bangs span,
.character[data-character="harin"] .bangs i {
  background: #3c3146;
}

.character[data-character="chaeyul"] .bangs span,
.character[data-character="chaeyul"] .bangs i {
  background: #1d2636;
}

.character[data-character="seoyeon"] .jacket,
.character[data-character="daon"] .jacket,
.character[data-character="harin"] .jacket,
.character[data-character="chaeyul"] .jacket {
  background: #f7f3ff;
}

.character[data-character="seoyeon"] .arm.cursed,
.character[data-character="daon"] .arm.cursed,
.character[data-character="harin"] .arm.cursed,
.character[data-character="chaeyul"] .arm.cursed {
  background: #fff1eb;
  box-shadow: none;
}

.quick-menu {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 8;
}

.icon-button {
  height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(235, 240, 255, 0.88)),
    rgba(255, 255, 255, 0.78);
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
  border: 1px solid rgba(16, 31, 87, 0.14);
  box-shadow: 0 3px 0 rgba(16, 31, 87, 0.22);
  transition: transform 90ms ease, box-shadow 90ms ease, background 120ms ease;
}

.icon-button:hover {
  background: #fff;
}

.icon-button:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 rgba(16, 31, 87, 0.22);
}

.icon-button.is-active {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 3px 0 var(--pink);
}

.bgm-toggle {
  min-width: 74px;
}

.volume-control {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(16, 31, 87, 0.14);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(235, 240, 255, 0.88)),
    rgba(255, 255, 255, 0.78);
  box-shadow: 0 3px 0 rgba(16, 31, 87, 0.22);
  color: var(--navy);
  font-size: 11px;
  font-weight: 900;
}

.volume-control input {
  width: 86px;
  accent-color: var(--pink);
  cursor: pointer;
}

.volume-control input:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.dialogue-box {
  position: absolute;
  left: 50%;
  bottom: 28px;
  width: min(1040px, calc(100vw - 32px));
  min-height: 152px;
  transform: translateX(-50%);
  padding: 42px 34px 28px;
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(255, 79, 163, 0.12), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 248, 255, 0.94)),
    var(--panel);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 10px 0 rgba(16, 31, 87, 0.18), 0 22px 50px var(--shadow);
  border: 2px solid rgba(255, 255, 255, 0.86);
  z-index: 9;
}

.dialogue-box:active {
  transform: translateX(-50%) translateY(3px);
  box-shadow: 0 7px 0 rgba(16, 31, 87, 0.18), 0 18px 38px var(--shadow);
}

.dialogue-box.is-ending {
  pointer-events: none;
}

.name-plate {
  position: absolute;
  left: 28px;
  top: -20px;
  min-width: 132px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 5px 0 rgba(255, 79, 163, 0.75);
}

.name-plate.speaker-seoyeon {
  background: #244b8f;
  box-shadow: 0 5px 0 #6ca7ff;
}

.name-plate.speaker-daon {
  background: #8a4a19;
  box-shadow: 0 5px 0 #ffad3b;
}

.name-plate.speaker-harin {
  background: #5b3b79;
  box-shadow: 0 5px 0 #f28bc6;
}

.name-plate.speaker-chaeyul {
  background: #1f5b4b;
  box-shadow: 0 5px 0 #58d49b;
}

.name-plate.speaker-narrator {
  background: #2f3442;
  box-shadow: 0 5px 0 #9aa6c8;
}

.name-plate.speaker-teacher {
  background: #4b5266;
  box-shadow: 0 5px 0 #c9d2e7;
}

.name-plate.speaker-mystery {
  background: #62758a;
  color: #f6f8ff;
  box-shadow: 0 5px 0 #b7c8da, 0 12px 26px rgba(20, 27, 42, 0.22);
}

.name-plate.speaker-error,
.name-plate.speaker-system {
  background: #0c0d13;
  box-shadow: 0 5px 0 var(--hot), 0 0 20px rgba(255, 47, 150, 0.32);
}

.dialogue-text {
  display: block;
  min-height: 56px;
  color: #1b1d28;
  font-size: clamp(18px, 2.2vw, 25px);
  line-height: 1.65;
  font-weight: 700;
  word-break: keep-all;
}

.dialogue-text.monologue-text {
  color: #8c90a3;
  font-weight: 500;
  font-style: italic;
}

.next-hint {
  position: absolute;
  right: 28px;
  bottom: 18px;
  width: 16px;
  height: 16px;
  border-right: 3px solid var(--pink);
  border-bottom: 3px solid var(--pink);
  transform: rotate(45deg);
  animation: hintBlink 900ms ease infinite;
}

.choice-panel {
  position: absolute;
  left: 50%;
  top: 48%;
  width: min(720px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  display: grid;
  gap: 14px;
  z-index: 10;
  animation: choicesIn 180ms ease both;
}

.choice-button {
  min-height: 58px;
  border: 0;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 79, 163, 0.1), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 243, 255, 0.96));
  color: var(--navy);
  font-size: 19px;
  font-weight: 900;
  box-shadow: 0 6px 0 #b9c0db, 0 16px 28px rgba(9, 12, 24, 0.2);
  cursor: pointer;
  transition: transform 100ms ease, box-shadow 100ms ease, filter 120ms ease;
}

.choice-button:hover {
  filter: brightness(1.03);
}

.choice-button:active {
  transform: translateY(5px);
  box-shadow: 0 1px 0 #b9c0db, 0 9px 20px rgba(9, 12, 24, 0.18);
}

.choice-button.error {
  color: #fff;
  background:
    linear-gradient(90deg, rgba(255, 47, 150, 0.38), transparent 28%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 9px),
    #171721;
  box-shadow: 0 6px 0 #550d33, 0 0 24px rgba(255, 47, 150, 0.28);
  animation: microJitter 650ms steps(2, end) infinite;
}

.choice-panel.is-forcing .choice-button {
  /* Allow clicks to trigger glitch */
}

.choice-button.is-disabled {
  opacity: 0;
  transform: scale(0.9) translateY(10px);
  filter: blur(4px) grayscale(1);
  pointer-events: none;
  transition: all 0.3s ease;
}

.choice-button.is-forced {
  color: #fff;
  background: rgba(255, 0, 50, 0.9);
  border: 2px solid #ff2f96;
  box-shadow: 0 0 40px rgba(255, 47, 150, 0.8), 0 0 80px rgba(255, 0, 50, 0.5);
  transform: scale(1.1) !important;
  z-index: 10;
  opacity: 1;
  animation: forcedSlam 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes forcedSlam {
  0% { transform: scale(1); }
  40% { transform: scale(1.15); background: #fff; color: #ff2f96; }
  100% { transform: scale(1.1); }
}

.choice-button.force-target {
  position: relative;
  overflow: hidden;
  border-color: rgba(255, 47, 150, 0.3);
}

.choice-button.force-target::after {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 47, 150, 0.3), transparent);
  animation: targetScanLine 2s infinite linear;
  pointer-events: none;
}

@keyframes targetScanLine {
  0% { left: -100%; }
  100% { left: 200%; }
}

.scene-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 76px 18px 28px;
  z-index: 14;
  background: rgba(8, 10, 18, 0.18);
}

.forced-line-overlay {
  z-index: 22;
  padding: 20px;
  align-items: center;
  background: linear-gradient(180deg, rgba(6, 7, 12, 0.02), rgba(6, 7, 12, 0.18));
  pointer-events: none;
}

.forced-line-panel {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(520px, calc(100vw - 42px));
  transform: translateY(-40px);
  pointer-events: auto;
  animation: choicesIn 160ms ease both;
}

.forced-line-panel span {
  min-width: 104px;
  padding: 10px 22px;
  border-radius: 8px;
  background: rgba(5, 6, 12, 0.94);
  color: #fff;
  font-size: 18px;
  font-weight: 950;
  text-align: center;
  box-shadow: 0 5px 0 var(--hot), 0 0 24px rgba(255, 47, 150, 0.42);
}

.forced-line-button {
  width: 100%;
  min-height: 62px;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 247, 255, 0.96)),
    #fff;
  color: var(--ink);
  box-shadow: 0 7px 0 rgba(16, 31, 87, 0.26), 0 18px 44px rgba(5, 8, 18, 0.24);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: none;
}

.forced-line-button.force-target::after {
  display: none;
}

.forced-line-button:hover,
.forced-line-button:focus-visible {
  border-color: var(--hot);
  outline: none;
  box-shadow: 0 7px 0 rgba(16, 31, 87, 0.26), 0 0 0 4px rgba(255, 47, 150, 0.18), 0 18px 44px rgba(5, 8, 18, 0.24);
}

.forced-line-button.is-forced {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 247, 255, 0.96)),
    #fff;
  border-color: rgba(255, 255, 255, 0.96);
  animation: none;
  transform: translateY(3px) !important;
  box-shadow: 0 4px 0 rgba(16, 31, 87, 0.22), 0 12px 32px rgba(5, 8, 18, 0.22);
}

.forced-line-panel small {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(5, 6, 12, 0.74);
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 900;
}

.scene-transition-card {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 8px;
  align-content: center;
  padding: 32px;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 5px),
    #02030a;
  color: #f7f8ff;
  text-align: center;
  pointer-events: all;
  z-index: 58;
  animation: sceneTransitionIn 240ms ease both;
}

.scene-transition-card span {
  color: var(--pink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: 2px 0 rgba(34, 208, 255, 0.36);
}

.scene-transition-card strong {
  max-width: min(720px, calc(100vw - 48px));
  font-size: clamp(22px, 3.2vw, 36px);
  font-weight: 950;
  line-height: 1.45;
  word-break: keep-all;
  text-shadow: 0 0 28px rgba(255, 79, 163, 0.28);
}

.scene-transition-card small {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(247, 248, 255, 0.86);
  font-size: 13px;
  font-weight: 900;
  animation: sceneClickHint 1s ease-in-out infinite alternate;
}

.scene-transition-card:focus-visible {
  outline: 2px solid rgba(255, 79, 163, 0.85);
  outline-offset: -8px;
}

.scene-transition-card.is-leaving {
  animation: sceneTransitionOut 260ms ease both;
}

.mini-panel {
  width: min(560px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(8, 10, 18, 0.34);
}

.mini-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.mini-header span {
  color: var(--pink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 950;
}

.mini-header strong {
  color: var(--navy);
  font-size: 20px;
}

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

.escape-grid button {
  aspect-ratio: 1;
  border: 2px solid rgba(16, 31, 87, 0.16);
  border-radius: 8px;
  background: #2b3042;
  color: transparent;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08), 0 4px 0 rgba(16, 31, 87, 0.22);
  transition: transform 100ms ease, background 140ms ease, box-shadow 140ms ease;
}

.escape-grid button.is-on {
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.92), rgba(255, 234, 142, 0.86) 42%, rgba(255, 79, 163, 0.64));
  box-shadow: 0 0 18px rgba(255, 79, 163, 0.38), 0 4px 0 rgba(16, 31, 87, 0.14);
}

.escape-grid button.is-hint {
  border-color: var(--pink);
  animation: tileHintPulse 820ms ease-in-out infinite;
}

.escape-grid button:active {
  transform: translateY(3px);
}

.mini-status {
  min-height: 28px;
  margin: 14px 0;
  color: #3c4050;
  font-weight: 800;
  line-height: 1.5;
}

.mini-action,
.mini-skip {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--pink);
}

.basket-machine {
  display: grid;
  gap: 18px;
  padding: 20px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 79, 163, 0.24), transparent 30%),
    linear-gradient(180deg, #18213a, #0d101b);
}

.basket-hoop {
  width: 126px;
  height: 74px;
  margin: 0 auto;
  border: 7px solid #ff8f3d;
  border-top: 0;
  border-radius: 0 0 999px 999px;
  box-shadow: 0 -16px 0 rgba(255, 255, 255, 0.18), 0 0 22px rgba(255, 143, 61, 0.42);
}

.basket-machine.is-hit .basket-hoop {
  animation: hoopHit 260ms ease;
}

.basket-machine.is-miss {
  animation: basketMissShake 260ms ease;
}

.basket-machine.is-miss .basket-hoop {
  border-color: #ff4f6d;
  box-shadow: 0 -16px 0 rgba(255, 255, 255, 0.18), 0 0 28px rgba(255, 79, 109, 0.62);
}

.power-track {
  position: relative;
  height: 30px;
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}

.power-track .hit-zone {
  position: absolute;
  left: 38%;
  top: 0;
  bottom: 0;
  width: 24%;
  background: rgba(88, 212, 155, 0.5);
}

.power-track i {
  position: absolute;
  left: 0;
  top: 3px;
  width: 8px;
  height: 24px;
  border-radius: 999px;
  background: var(--hot);
  box-shadow: 0 0 18px rgba(255, 47, 150, 0.8);
}

.phone-frame {
  width: min(430px, calc(100vw - 28px));
  height: min(820px, calc(100vh - 48px));
  max-height: min(820px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 10px solid #151722;
  border-radius: 32px;
  background: #f4f6fb;
  box-shadow: 0 24px 70px rgba(8, 10, 18, 0.38);
  overflow: hidden;
}

.messenger-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: #fff35d;
  color: #312a11;
  font-weight: 950;
}

.messenger-header button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(49, 42, 17, 0.12);
  color: #312a11;
  font-size: 30px;
  font-weight: 950;
  line-height: 24px;
  cursor: pointer;
}

.messenger-header button.hidden {
  visibility: hidden;
  display: inline-grid !important;
}

.messenger-header span {
  flex: 1;
  font-size: 20px;
}

.messenger-room-list {
  display: grid;
  align-content: start;
  overflow: auto;
  background: #f4f6fb;
}

.messenger-room {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid rgba(16, 31, 87, 0.08);
  background: #fff;
  color: #232631;
  text-align: left;
  cursor: pointer;
}

.messenger-room:hover,
.messenger-room.is-selected {
  background: #fff8c9;
}

.room-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  aspect-ratio: 1;
  border-radius: 16px;
  background: #17245d;
  color: #fff;
  font-size: 18px;
  font-weight: 950;
  box-shadow: inset 0 -4px 0 rgba(255, 47, 150, 0.24);
}

.room-meta {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.room-meta strong {
  font-size: 17px;
  font-weight: 950;
}

.room-meta small {
  overflow: hidden;
  color: #777d8d;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messenger-room i {
  display: grid;
  place-items: center;
  min-width: 25px;
  height: 25px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
}

.messenger-chat {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
}

.message-list {
  display: grid;
  gap: 9px;
  align-content: start;
  padding: 14px;
  overflow: auto;
}

.message-row {
  display: grid;
  justify-items: start;
  gap: 4px;
  max-width: 82%;
  animation: messageIn 220ms ease both;
}

.message-row.is-me {
  justify-self: end;
  justify-items: end;
}

.message-row span {
  color: #767b89;
  font-size: 11px;
  font-weight: 800;
}

.message-row p,
.message-row em {
  margin: 0;
  padding: 9px 11px;
  border-radius: 13px;
  background: #fff;
  color: #232631;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.48;
  word-break: keep-all;
  box-shadow: 0 2px 0 rgba(16, 31, 87, 0.08);
}

.message-row.is-me p {
  background: #ffe765;
}

.message-row em {
  display: inline-flex;
  color: var(--navy);
  font-style: normal;
  border: 1px solid rgba(16, 31, 87, 0.12);
}

.messenger-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(16, 31, 87, 0.08);
  background: #fff;
}

.messenger-compose input {
  min-width: 0;
  height: 44px;
  border: 1px solid rgba(16, 31, 87, 0.12);
  border-radius: 999px;
  padding: 0 15px;
  background: #f4f6fb;
  color: #232631;
  font-size: 15px;
  font-weight: 800;
  outline: none;
}

.messenger-compose input:focus {
  border-color: rgba(255, 47, 150, 0.58);
  box-shadow: 0 0 0 3px rgba(255, 47, 150, 0.14);
}

.messenger-compose button {
  min-width: 62px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: #ffe765;
  color: #312a11;
  font-size: 14px;
  font-weight: 950;
  cursor: pointer;
}

.messenger-next {
  width: auto;
  margin: 12px 14px 14px;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 12, 22, 0.48);
  z-index: 30;
}

.modal-panel {
  width: min(720px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 48px));
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.32);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: var(--navy);
  color: #fff;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.modal-close {
  min-width: 70px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: var(--navy);
  font-weight: 900;
  box-shadow: 0 3px 0 rgba(255, 79, 163, 0.85);
  cursor: pointer;
}

.modal-close:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(255, 79, 163, 0.85);
}

.modal-body {
  max-height: 520px;
  overflow: auto;
  padding: 18px;
  color: #202330;
  font-size: 15px;
  line-height: 1.75;
}

.log-line {
  padding: 10px 0;
  border-bottom: 1px solid rgba(16, 31, 87, 0.12);
}

.log-name {
  display: inline-flex;
  margin-right: 8px;
  color: var(--navy);
  font-weight: 900;
}

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

.setting-card,
.save-slot {
  border: 1px solid rgba(16, 31, 87, 0.14);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f6f8ff);
  padding: 14px;
  box-shadow: 0 4px 0 rgba(16, 31, 87, 0.08);
}

.setting-card.wide {
  grid-column: 1 / -1;
}

.setting-card h3 {
  margin: 0 0 10px;
  color: var(--navy);
  font-size: 15px;
}

.setting-card p {
  margin: 4px 0;
}

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

.segmented button {
  height: 38px;
  border: 1px solid rgba(16, 31, 87, 0.16);
  border-radius: 7px;
  background: #fff;
  color: var(--navy);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(16, 31, 87, 0.12);
}

.segmented button.is-selected {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 3px 0 var(--pink);
}

.save-slot {
  display: grid;
  gap: 8px;
}

.save-slot span,
.save-slot small {
  color: #6f7486;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.save-slot strong {
  color: var(--navy);
  font-size: 17px;
}

.save-slot p {
  margin: 0;
}

.save-slot.empty {
  color: #7b8092;
  text-align: center;
}

.status-toast {
  position: absolute;
  left: 50%;
  top: 72px;
  transform: translateX(-50%);
  min-width: 220px;
  padding: 12px 18px;
  border-radius: 8px;
  background: rgba(16, 31, 87, 0.94);
  color: #fff;
  font-weight: 900;
  text-align: center;
  z-index: 35;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  animation: toastIn 1.3s ease both;
}

.restart-button {
  position: absolute;
  right: 24px;
  bottom: 206px;
  min-width: 120px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 5px 0 #bdc5df, 0 14px 24px rgba(0, 0, 0, 0.18);
  z-index: 12;
}

.ending-actions {
  position: absolute;
  left: 50%;
  bottom: 206px;
  display: grid;
  grid-template-columns: repeat(4, minmax(112px, 1fr));
  gap: 10px;
  width: min(720px, calc(100vw - 32px));
  transform: translateX(-50%);
  z-index: 13;
}

.ending-actions button {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 47, 150, 0.18), transparent 36%),
    rgba(255, 255, 255, 0.9);
  color: var(--navy);
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(255, 79, 163, 0.72), 0 14px 28px rgba(8, 10, 18, 0.2);
  backdrop-filter: blur(6px);
  transition: transform 100ms ease, box-shadow 100ms ease, filter 120ms ease;
}

.ending-actions button:hover {
  filter: brightness(1.04);
}

.ending-actions button:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 rgba(255, 79, 163, 0.72), 0 8px 18px rgba(8, 10, 18, 0.18);
}

.restart-button:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #bdc5df, 0 8px 16px rgba(0, 0, 0, 0.16);
}

.system-log {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: max-content;
  max-width: 90vw;
  padding: 30px 40px;
  border: 4px solid var(--hot);
  background: rgba(15, 0, 5, 0.95);
  color: var(--hot);
  font-family: ui-monospace, "Courier New", Courier, monospace;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  line-height: 1.4;
  white-space: pre-line;
  z-index: 1000;
  box-shadow: 0 0 40px rgba(255, 47, 150, 0.6), inset 0 0 20px rgba(255, 47, 150, 0.3);
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.9);
  animation: systemLogGlitch 0.15s steps(2) infinite alternate;
}

.system-log::before {
  content: "404 ERROR";
  position: absolute;
  top: -14px;
  left: -4px;
  background: var(--hot);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  padding: 4px 10px;
  letter-spacing: 1px;
  text-shadow: none;
  box-shadow: 0 0 10px rgba(255, 47, 150, 0.8);
}

@keyframes systemLogGlitch {
  0% { transform: translate(-50%, -50%) skewX(0deg); }
  100% { transform: translate(-50.5%, -49.5%) skewX(-2deg); filter: contrast(1.2); }
}

.stream-pixels {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 7;
  mix-blend-mode: screen;
}

.stream-pixels span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  background: #ff4fa3;
  box-shadow:
    0 0 8px rgba(255, 79, 163, 0.9),
    10px -8px 0 rgba(255, 137, 205, 0.36),
    -12px 11px 0 rgba(255, 47, 150, 0.24);
  opacity: 0;
  image-rendering: pixelated;
  animation:
    streamPixelDrift var(--t) linear var(--d) infinite,
    streamPixelBlink 1.4s steps(2, end) var(--d) infinite;
}

.stream-bubble {
  position: absolute;
  right: min(8vw, 112px);
  top: min(12vh, 112px);
  display: grid;
  gap: 4px;
  min-width: 220px;
  padding: 14px 18px 16px;
  border: 2px solid rgba(255, 137, 205, 0.78);
  border-radius: 18px 18px 18px 6px;
  background:
    linear-gradient(90deg, rgba(255, 47, 150, 0.18), transparent 42%),
    rgba(255, 236, 248, 0.88);
  color: #5c1740;
  font-weight: 950;
  z-index: 8;
  box-shadow:
    0 0 24px rgba(255, 47, 150, 0.34),
    0 12px 28px rgba(8, 10, 18, 0.22);
  backdrop-filter: blur(6px);
  animation: streamBubbleFloat 2.4s ease-in-out infinite, streamBubbleGlitch 1.6s steps(2, end) infinite;
}

.stream-bubble::after {
  content: "";
  position: absolute;
  left: 24px;
  bottom: -14px;
  width: 26px;
  height: 22px;
  background: rgba(255, 236, 248, 0.88);
  border-left: 2px solid rgba(255, 137, 205, 0.78);
  border-bottom: 2px solid rgba(255, 137, 205, 0.78);
  transform: skewY(-28deg);
}

.stream-bubble span {
  color: var(--hot);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  text-shadow: 2px 0 rgba(77, 179, 255, 0.28);
}

.stream-bubble b {
  font-size: 17px;
}

.stage.error-mode .dialogue-box {
  background:
    linear-gradient(90deg, rgba(255, 47, 150, 0.14), transparent 24%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 5px),
    rgba(10, 12, 19, 0.9);
  color: #fff;
  border-color: rgba(255, 79, 163, 0.56);
}

.stage.error-mode .dialogue-text {
  color: #fff;
  text-shadow: 2px 0 rgba(255, 79, 163, 0.45);
}

.stage.error-mode .name-plate {
  background: #0c0d13;
  color: #fff;
  box-shadow: 0 5px 0 var(--hot), 0 0 20px rgba(255, 47, 150, 0.32);
  animation: microJitter 500ms steps(2, end) infinite;
}

.stage.corrupt-mode .background {
  filter: saturate(1.35) contrast(1.12) hue-rotate(12deg);
}

.stage.corrupt-mode .character-sprite {
  filter:
    drop-shadow(10px 0 0 rgba(255, 47, 150, 0.24))
    drop-shadow(-8px 0 0 rgba(77, 179, 255, 0.18))
    saturate(1.16);
}

.stage.corrupt-mode .character-slot {
  filter:
    drop-shadow(10px 0 0 rgba(255, 47, 150, 0.18))
    drop-shadow(-8px 0 0 rgba(77, 179, 255, 0.14))
    saturate(1.16);
}

.stage.error-mode .glitch-layer {
  opacity: 1;
}

.glitch-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 0 9%, rgba(255, 47, 150, 0.18) 9% 9.4%, transparent 9.4% 18%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 4px);
  mix-blend-mode: screen;
  z-index: 7;
  animation: glitchSweep 1.2s steps(3, end) infinite;
}

.ending-countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 5px),
    rgba(3, 3, 8, 0.72);
  color: #ff4fa3;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(58px, 12vw, 168px);
  font-weight: 950;
  letter-spacing: 0;
  text-shadow:
    5px 0 0 rgba(34, 208, 255, 0.42),
    -5px 0 0 rgba(255, 255, 255, 0.18),
    0 0 34px rgba(255, 47, 150, 0.76);
  opacity: 0;
  pointer-events: none;
  z-index: 60;
  transform: scale(1.04);
  animation: endingCountPulse 860ms steps(2, end) infinite;
}

.ending-countdown.is-visible {
  opacity: 1;
}

.ending-countdown.is-blackout {
  background: #000;
  color: transparent;
  opacity: 1;
  text-shadow: none;
  animation: endingBlackout 420ms ease both;
}

.stage.flash::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #fff;
  z-index: 20;
  animation: flash 260ms ease both;
  pointer-events: none;
}

.stage.shake {
  animation: screenShake 260ms linear;
}

@keyframes titleScan {
  from {
    background-position: 0 0, 0 0;
  }

  to {
    background-position: 34px 0, 0 56px;
  }
}

@keyframes titleSpark {
  from {
    opacity: 0.18;
    transform: translateY(-4px);
  }

  to {
    opacity: 0.28;
    transform: translateY(4px);
  }
}

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

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

@keyframes streamBubbleFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }

  50% {
    transform: translateY(-8px) rotate(1deg);
  }
}

@keyframes streamBubbleGlitch {
  0%,
  88%,
  100% {
    filter: none;
  }

  90% {
    filter: hue-rotate(18deg) contrast(1.25);
  }

  92% {
    transform: translate(3px, -7px) rotate(1deg);
  }
}

@keyframes sunPulse {
  from {
    opacity: 0.64;
    transform: scale(0.98);
  }

  to {
    opacity: 0.92;
    transform: scale(1.04);
  }
}

@keyframes moteFloat {
  0%,
  100% {
    opacity: 0.28;
    transform: translate3d(0, 0, 0) scale(0.8);
  }

  45% {
    opacity: 1;
    transform: translate3d(20px, -32px, 0) scale(1.18);
  }
}

@keyframes sparkTrail {
  from {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(1);
  }

  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.1);
  }
}

@keyframes hiddenHint {
  0%,
  78%,
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(0);
  }

  80%,
  82% {
    opacity: 0.72;
    transform: translateX(calc(-50% + 2px)) translateY(-1px);
  }

  84% {
    opacity: 0.18;
  }
}

@keyframes streamPixelDrift {
  0% {
    opacity: 0;
    transform: translate3d(0, 22px, 0) scale(0.8);
  }

  12% {
    opacity: 0.88;
  }

  45% {
    transform: translate3d(18px, -24px, 0) scale(1);
  }

  72% {
    opacity: 0.72;
    transform: translate3d(-14px, -74px, 0) scale(1.12);
  }

  86% {
    transform: translate3d(28px, -92px, 0) scale(0.96);
  }

  100% {
    opacity: 0;
    transform: translate3d(8px, -132px, 0) scale(0.72);
  }
}

@keyframes streamPixelBlink {
  0%,
  76%,
  100% {
    filter: none;
  }

  78% {
    filter: hue-rotate(28deg) brightness(1.4);
  }

  80% {
    filter: contrast(1.5);
  }
}

@keyframes characterEnter {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.985);
    filter: blur(2px);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes characterEnterCenter {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(24px) scale(0.985);
    filter: blur(2px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes unknownSignalJitter {
  0%,
  100% {
    opacity: 0.92;
    transform: translateY(0) scale(1);
  }

  19% {
    opacity: 0.76;
    transform: translate(-2px, 1px) scale(1.002);
  }

  21% {
    opacity: 0.98;
    transform: translate(3px, -1px) scale(0.998);
  }

  48% {
    filter:
      drop-shadow(8px 0 0 rgba(255, 40, 166, 0.22))
      drop-shadow(-5px 0 0 rgba(255, 126, 220, 0.16))
      drop-shadow(0 0 30px rgba(255, 63, 190, 0.34));
  }

  53% {
    transform: translate(-1px, -2px) scale(1.004);
  }
}

@keyframes unknownSpriteGlitch {
  0%,
  100% {
    transform: translateX(-50%);
  }

  18% {
    transform: translateX(calc(-50% - 4px));
  }

  20% {
    transform: translateX(calc(-50% + 5px));
  }

  57% {
    transform: translateX(calc(-50% + 2px));
  }

  60% {
    transform: translateX(calc(-50% - 3px));
  }
}

@keyframes unknownArtifactSweep {
  0%,
  100% {
    opacity: 0.32;
    transform: translateX(-50%) translateY(0);
  }

  23% {
    opacity: 0.88;
    transform: translateX(calc(-50% + 12px)) translateY(-8px);
  }

  24% {
    opacity: 0.18;
  }

  62% {
    opacity: 0.72;
    transform: translateX(calc(-50% - 10px)) translateY(10px);
  }
}

@keyframes unknownArtifactBlink {
  0%,
  74%,
  100% {
    opacity: 0.18;
  }

  18%,
  20% {
    opacity: 0.74;
    transform: translateX(calc(-50% - 6px));
  }

  76%,
  79% {
    opacity: 0.86;
    transform: translateX(calc(-50% + 8px));
  }
}

@keyframes endingCountPulse {
  0%,
  100% {
    filter: none;
    transform: scale(1);
  }

  18% {
    filter: hue-rotate(18deg) contrast(1.35);
    transform: translateX(-5px) scale(1.02);
  }

  21% {
    transform: translateX(6px) scale(0.99);
  }

  62% {
    filter: brightness(1.35);
  }
}

@keyframes endingBlackout {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes sceneTransitionIn {
  from {
    opacity: 0;
    filter: blur(8px);
  }

  to {
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes sceneTransitionOut {
  from {
    opacity: 1;
    filter: blur(0);
  }

  to {
    opacity: 0;
    filter: blur(6px);
  }
}

@keyframes sceneClickHint {
  from {
    opacity: 0.58;
    transform: translateY(0);
  }

  to {
    opacity: 1;
    transform: translateY(2px);
  }
}

@keyframes hintBlink {
  50% {
    opacity: 0.22;
    transform: translateY(4px) rotate(45deg);
  }
}

@keyframes microJitter {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(1px);
  }

  50% {
    transform: translateX(-1px);
  }
}

@keyframes glitchSweep {
  0% {
    transform: translateY(-2%);
  }

  100% {
    transform: translateY(2%);
  }
}

@keyframes screenShake {
  0%,
  100% {
    transform: translate(0, 0);
  }

  20% {
    transform: translate(-8px, 3px);
  }

  40% {
    transform: translate(6px, -2px);
  }

  60% {
    transform: translate(-4px, 2px);
  }

  80% {
    transform: translate(3px, -1px);
  }
}

@keyframes flash {
  from {
    opacity: 0.9;
  }

  to {
    opacity: 0;
  }
}

@keyframes toastIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -8px);
  }

  15%,
  78% {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -8px);
  }
}

@keyframes choicesIn {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 12px));
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@keyframes forcedChoice {
  0% {
    transform: translate(0, 0);
  }

  35% {
    transform: translate(7px, -2px);
  }

  70% {
    transform: translate(-5px, 2px);
  }

  100% {
    transform: translate(0, 0);
  }
}

@keyframes hoopHit {
  50% {
    transform: scale(1.08);
    filter: brightness(1.35);
  }
}

@keyframes basketMissShake {
  0%,
  100% {
    transform: translateX(0);
    filter: none;
  }

  25% {
    transform: translateX(-8px);
    filter: saturate(1.4);
  }

  55% {
    transform: translateX(7px);
  }

  75% {
    transform: translateX(-4px);
  }
}

@keyframes tileHintPulse {
  0%,
  100% {
    transform: translateY(0);
    box-shadow: 0 0 0 rgba(255, 79, 163, 0), 0 4px 0 rgba(16, 31, 87, 0.14);
  }

  50% {
    transform: translateY(-3px);
    box-shadow: 0 0 26px rgba(255, 79, 163, 0.72), 0 7px 0 rgba(16, 31, 87, 0.12);
  }
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .bg-daonEyeContact,
  .bg-daonFamiliarGlance,
  .bg-daonSmilingRecognition {
    background-position: 69% center;
  }

  .bg-chaeyulFirstAppearance {
    background-position: 70% center;
  }

  .bg-chaeyulArcadeAftergame {
    background-position: 43% center;
  }

  .bg-chaeyulEmbarrassedOppa {
    background-position: 58% center;
  }

  .bg-harinSharedNotebook,
  .bg-harinNotebookPromise {
    background-position: 56% center;
  }

  .bg-studyNoteCloseup {
    background-position: 69% center;
  }

  .bg-benchUnknownSitting,
  .bg-benchGlitchFirst {
    background-position: 82% center;
  }

  .title-screen {
    padding: 16px;
  }

  .title-layout {
    left: 14px;
    right: 14px;
    bottom: 14px;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .title-mark {
    width: min(92vw, 560px);
  }

  .title-action-panel {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .title-button {
    min-height: 54px;
    cursor: pointer;
  }

  .title-hero-row {
    height: 52px;
    gap: 8px;
  }

  .title-hero-row span,
  .title-hero-row i {
    width: 34px;
    height: 48px;
  }

  .title-brand-logo {
    width: clamp(92px, 24vw, 150px);
    top: 12px;
    right: 14px;
  }

  .title-license-button {
    top: 12px;
    left: 14px;
    min-height: 32px;
    padding: 0 10px;
    font-size: 10px;
  }

  .title-log {
    left: 16px;
    right: auto;
    bottom: 12px;
    font-size: 11px;
  }

  .quick-menu {
    left: 8px;
    right: 8px;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
  }

  .icon-button {
    height: 30px;
    padding: 0 7px;
    font-size: 10px;
  }

  .bgm-toggle {
    min-width: 64px;
  }

  .volume-control {
    height: 30px;
    padding: 0 7px;
    gap: 5px;
    font-size: 10px;
  }

  .volume-control input {
    width: 64px;
  }

  .character-layer {
    inset: 0;
  }

  .character-slot {
    width: min(78vw, 330px);
    min-width: 220px;
    height: 100%;
    bottom: 0;
  }

  .character-slot.is-inactive {
    opacity: 0;
  }

  .character-slot:not(.is-active) {
    display: none;
  }

  .character-slot.is-active {
    display: block;
    right: -6vw;
    left: auto;
  }

  .character-slot.is-active.slot-center,
  .character-slot.is-active.slot-left {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .character-slot.is-active.slot-center.entering,
  .character-slot.is-active.slot-left.entering {
    animation: characterEnterCenter 360ms ease both;
  }

  .character-sprite {
    bottom: -20dvh;
    height: min(110dvh, 980px);
    transform: translateX(-50%);
  }

  .character-layer.has-multiple .character-sprite {
    bottom: -20dvh;
    height: min(110dvh, 980px);
  }

  .dialogue-box {
    bottom: 12px;
    min-height: 132px;
    padding: 38px 18px 24px;
    border-radius: 10px;
  }

  .name-plate {
    left: 16px;
    min-width: 96px;
    font-size: 15px;
  }

  .dialogue-text {
    font-size: 16px;
    line-height: 1.58;
  }

  .choice-panel {
    top: 43%;
    gap: 10px;
  }

  .choice-button {
    min-height: 52px;
    font-size: 16px;
    padding: 0 12px;
  }

  .scene-overlay {
    padding: 56px 12px 12px;
  }

  .mini-panel {
    padding: 14px;
  }

  .phone-frame {
    border-width: 8px;
    border-radius: 24px;
  }

  .message-row {
    max-width: 88%;
  }

  .message-row p,
  .message-row em {
    font-size: 13px;
    line-height: 1.42;
  }

  .modal-overlay {
    padding: 12px;
  }

  .modal-panel {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .modal-body {
    max-height: calc(100vh - 120px);
    font-size: 14px;
  }

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

  .restart-button {
    right: 12px;
    bottom: 158px;
  }

  .ending-actions {
    bottom: 152px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: calc(100vw - 24px);
  }

  .ending-actions button {
    min-height: 40px;
    font-size: 13px;
  }
}

@media (max-width: 430px) {
  .title-mark {
    width: min(94vw, 390px);
  }

  .title-brand-logo {
    width: 96px;
  }

  .title-license-button {
    font-size: 9px;
  }

  .character-profile-grid {
    grid-template-columns: 1fr;
  }

  .character-profile-card {
    grid-template-columns: 74px minmax(0, 1fr);
    min-height: 104px;
    gap: 10px;
  }

  .character-profile-card img,
  .character-secret-portrait {
    width: 74px;
    height: 88px;
  }

  .title-button strong {
    font-size: 17px;
  }

  .title-guide-panel {
    padding: 12px;
  }

  .title-guide-panel section {
    padding: 18px 14px;
  }

  .character-layer {
    inset: 0;
  }

  .character-slot {
    width: min(80vw, 310px);
    height: 100%;
  }

  .dialogue-box {
    width: calc(100vw - 16px);
    min-height: 126px;
    padding: 34px 14px 22px;
  }

  .dialogue-text {
    font-size: 15px;
  }

  .icon-button {
    height: 28px;
    padding: 0 6px;
    font-size: 9px;
  }

  .ending-actions {
    bottom: 142px;
  }

  .ending-actions button {
    min-height: 38px;
    padding: 0 6px;
    font-size: 12px;
  }

  .mini-header strong {
    font-size: 17px;
  }

  .escape-grid {
    gap: 8px;
  }
}
