@charset "UTF-8";

:root {
  color-scheme: dark;
  --ink: #101521;
  --ink-2: #1b2333;
  --paper: #fff8e9;
  --cream: #f1e3c3;
  --coral: #ff604f;
  --coral-dark: #ce3542;
  --yellow: #ffc94f;
  --teal: #3bd0bd;
  --blue: #5f8dff;
  --danger: #ff3757;
  --white: #fffdf7;
  --muted: rgba(255, 255, 255, 0.66);
  --edge: clamp(16px, 5vw, 24px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #080b12;
  overscroll-behavior: none;
}

body {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  color: var(--white);
  -webkit-font-smoothing: antialiased;
}

button,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  touch-action: manipulation;
}

button:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.is-hidden {
  display: none !important;
}

.game-shell {
  display: contents;
}

.desktop-controls,
.rhythm-help--keyboard,
.beat-target__core small,
.anchor-button__desktop-help {
  display: none;
}

.game {
  position: relative;
  isolation: isolate;
  width: min(100vw, 480px);
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: var(--ink);
  touch-action: none;
  user-select: none;
  container-type: inline-size;
}

.game__canvas,
.game__halftone,
.game__vignette {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.game__canvas {
  z-index: 0;
  display: block;
}

.game__halftone {
  z-index: 1;
  pointer-events: none;
  opacity: 0.2;
  mix-blend-mode: soft-light;
  background-image: radial-gradient(circle, #fff 0 0.65px, transparent 0.8px);
  background-size: 5px 5px;
}

.game__vignette {
  z-index: 2;
  pointer-events: none;
  box-shadow: inset 0 0 95px rgba(0, 0, 0, 0.48);
  background: linear-gradient(180deg, rgba(4, 8, 18, 0.16), transparent 24%, transparent 70%, rgba(4, 8, 18, 0.34));
}

.topbar {
  position: absolute;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(58px + env(safe-area-inset-top));
  padding: calc(10px + env(safe-area-inset-top)) var(--edge) 8px;
  pointer-events: none;
  visibility: visible;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.game[data-state="preload"] .topbar,
.game[data-state="opening"] .topbar,
.game[data-state="ending"] .topbar,
.game[data-state="share"] .topbar,
.game[data-state="fail"] .topbar {
  opacity: 0;
  visibility: hidden;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--white);
  text-decoration: none;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.55));
  pointer-events: auto;
}

.brand-lockup__six {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--ink);
  border-radius: 11px 11px 11px 3px;
  background: var(--yellow);
  color: var(--ink);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 24px;
  transform: rotate(-4deg);
}

.brand-lockup > span:last-child {
  display: grid;
  line-height: 1;
}

.brand-lockup b {
  font-size: 13px;
  letter-spacing: -0.04em;
}

.brand-lockup small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.topbar__actions {
  display: flex;
  gap: 7px;
  pointer-events: auto;
}

.round-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(12, 17, 29, 0.62);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  font-weight: 900;
}

.hud {
  position: absolute;
  z-index: 25;
  top: calc(62px + env(safe-area-inset-top));
  left: var(--edge);
  right: var(--edge);
  pointer-events: none;
  filter: drop-shadow(0 7px 14px rgba(0, 0, 0, 0.3));
}

.hud__upper,
.hud__lower {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mission-chip {
  display: flex;
  align-items: center;
  min-width: 0;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 12px 12px 12px 3px;
  background: rgba(16, 21, 33, 0.84);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.mission-chip__number {
  align-self: stretch;
  display: grid;
  place-items: center;
  min-width: 38px;
  padding: 0 7px;
  background: var(--yellow);
  color: var(--ink);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 20px;
}

.mission-chip__copy {
  display: grid;
  min-width: 0;
  padding: 6px 10px 5px;
  line-height: 1;
}

.mission-chip__copy strong {
  max-width: 112px;
  overflow: hidden;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mission-chip__copy small {
  margin-top: 4px;
  color: var(--yellow);
  font-family: "SFMono-Regular", Menlo, monospace;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.timer-stack {
  display: grid;
  justify-items: end;
  line-height: 1;
}

.timer-stack__time {
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: clamp(23px, 7vw, 32px);
  font-weight: 950;
  letter-spacing: -0.08em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), 0 0 18px rgba(0, 0, 0, 0.55);
}

.timer-stack__delta {
  margin-top: 5px;
  color: var(--teal);
  font-family: "SFMono-Regular", Menlo, monospace;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.timer-stack__delta.is-behind {
  color: #ff9a73;
}

.hud__lower {
  align-items: end;
  margin-top: 9px;
}

.risk-meter {
  flex: 1;
  max-width: 210px;
}

.risk-meter__copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 5px #000;
}

.risk-meter__copy b {
  color: var(--yellow);
  font-family: "SFMono-Regular", Menlo, monospace;
  font-size: 14px;
}

.risk-meter__track {
  height: 8px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(8, 12, 22, 0.72);
}

.risk-meter__track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--yellow), var(--coral), var(--danger));
  box-shadow: 0 0 10px rgba(255, 55, 87, 0.7);
  transition: width 170ms var(--ease-out);
}

.clock-chip {
  display: grid;
  justify-items: end;
  line-height: 1;
}

.clock-chip small {
  padding: 3px 5px;
  border-radius: 3px;
  background: var(--teal);
  color: var(--ink);
  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0.11em;
}

.clock-chip small.is-unranked {
  background: var(--coral);
}

.clock-chip b {
  margin-top: 4px;
  font-family: "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
}

.route-track {
  height: 5px;
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: rgba(5, 9, 17, 0.7);
  overflow: hidden;
}

.route-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--yellow);
  box-shadow: 0 0 9px rgba(255, 201, 79, 0.85);
  transition: width 130ms linear;
}

.screen {
  position: absolute;
  z-index: 40;
  inset: 0;
  display: none;
  overflow-x: hidden;
  overflow-y: auto;
  opacity: 0;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.screen::-webkit-scrollbar {
  display: none;
}

.screen.is-active {
  display: block;
  opacity: 1;
  animation: screen-in 420ms var(--ease-out) both;
}

.preload-screen {
  z-index: 100;
  display: none;
  place-content: center;
  justify-items: center;
  background: var(--ink);
}

.preload-screen.is-active {
  display: grid;
}

.preload-screen__mark {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border: 4px solid var(--ink);
  border-radius: 24px 24px 24px 7px;
  background: var(--yellow);
  box-shadow: 8px 8px 0 var(--coral);
  color: var(--ink);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 56px;
  transform: rotate(-5deg);
  animation: preload-bob 900ms var(--ease-pop) infinite alternate;
}

.preload-screen p {
  margin: 28px 0 12px;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.05em;
}

.preload-screen__line {
  width: 148px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.preload-screen__line i {
  display: block;
  width: 48%;
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
  animation: preload-line 850ms ease-in-out infinite alternate;
}

.opening-screen {
  z-index: 50;
  overflow: hidden;
  background: var(--ink);
}

.opening-screen__art,
.opening-screen__shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.opening-screen__art {
  bottom: auto;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  object-position: top center;
}

.opening-screen__shade {
  pointer-events: none;
  background: linear-gradient(180deg, transparent 68%, rgba(7, 10, 18, 0.16) 75%, rgba(7, 10, 18, 0.94) 86%, var(--ink) 100%);
}

.opening-screen__bubble {
  position: absolute;
  z-index: 2;
  margin: 0;
  border: 2px solid rgba(16, 21, 33, 0.96);
  background: rgba(255, 253, 247, 0.98);
  box-shadow: 4px 5px 0 rgba(16, 21, 33, 0.88), 0 12px 26px rgba(0, 0, 0, 0.2);
  color: #141622;
  font-weight: 950;
  line-height: 1.28;
  letter-spacing: -0.07em;
  text-align: center;
  text-wrap: balance;
  opacity: 0;
  animation: bubble-in 470ms var(--ease-pop) forwards;
}

.opening-screen__bubble--one {
  top: 5cqw;
  left: 3.5cqw;
  display: grid;
  place-content: center;
  width: 43cqw;
  height: 30cqw;
  border-radius: 52% 48% 49% 51% / 48% 51% 49% 52%;
  font-size: clamp(14px, 4.7cqw, 22px);
  animation-delay: 250ms;
}

.opening-screen__bubble--two {
  top: 90cqw;
  left: 0;
  display: grid;
  place-content: center;
  width: 43cqw;
  height: 43cqw;
  padding: 0 2.5%;
  font-size: clamp(15px, 4.4cqw, 21px);
  line-height: 1.18;
  border-radius: 54% 46% 50% 50% / 49% 51% 47% 53%;
  animation-delay: 800ms;
}

.opening-screen__bubble::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 22px;
  height: 22px;
  background: var(--white);
  transform: rotate(45deg);
}

.opening-screen__bubble--one::after {
  right: -8px;
  bottom: 16%;
  border-top: 2px solid var(--ink);
  border-right: 2px solid var(--ink);
}

.opening-screen__bubble--two::after {
  right: -7px;
  bottom: 17%;
  border-top: 2px solid var(--ink);
  border-right: 2px solid var(--ink);
}

.opening-screen__bubble--two > span {
  display: block;
  white-space: nowrap;
}

.opening-screen__bubble em {
  color: var(--coral-dark);
  font-style: normal;
}

.opening-screen__masthead {
  position: absolute;
  z-index: 4;
  left: var(--edge);
  right: var(--edge);
  bottom: calc(14px + env(safe-area-inset-bottom));
}

.opening-screen__masthead > p {
  display: grid;
  gap: 3px;
  margin: 0 0 8px;
  filter: drop-shadow(0 2px 8px #000);
}

.opening-screen__masthead > p span {
  color: var(--yellow);
  font-family: "SFMono-Regular", Menlo, monospace;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.opening-screen__masthead > p b {
  font-size: clamp(17px, 5.6cqw, 25px);
  letter-spacing: -0.06em;
}

.opening-screen__records {
  display: flex;
  gap: 14px;
  margin-bottom: 9px;
  color: rgba(255, 255, 255, 0.62);
  font-family: "SFMono-Regular", Menlo, monospace;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.opening-screen__records b {
  color: var(--white);
  font-size: 11px;
}

.start-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 61px;
  padding: 9px 10px 9px 18px;
  border: 3px solid var(--ink);
  border-radius: 17px 17px 17px 5px;
  background: var(--yellow);
  box-shadow: 5px 6px 0 var(--coral), 0 14px 35px rgba(0, 0, 0, 0.33);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.start-button span {
  display: grid;
  gap: 2px;
}

.start-button small {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.start-button b {
  font-size: 17px;
  letter-spacing: -0.05em;
}

.start-button i {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px 13px 13px 4px;
  background: var(--ink);
  color: var(--yellow);
  font-size: 15px;
  font-style: normal;
}

.start-button:active,
.primary-button:active,
.secondary-button:active {
  transform: translateY(3px) scale(0.99);
}

.countdown {
  position: absolute;
  z-index: 60;
  inset: 0;
  display: none;
  place-content: center;
  justify-items: center;
  pointer-events: none;
  background: rgba(11, 15, 25, 0.45);
  backdrop-filter: blur(2px);
}

.countdown.is-active {
  display: grid;
}

.countdown span {
  padding: 5px 9px;
  border-radius: 4px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.14em;
}

.countdown strong {
  margin-top: -3px;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: min(40vw, 178px);
  line-height: 1;
  -webkit-text-stroke: 4px var(--ink);
  text-shadow: 9px 10px 0 var(--coral);
  animation: countdown-pop 720ms var(--ease-pop) both;
}

.mission-flash {
  position: absolute;
  z-index: 45;
  top: calc(166px + env(safe-area-inset-top));
  left: var(--edge);
  right: auto;
  display: none;
  width: min(76%, 294px);
  padding: 10px 13px 11px;
  border: 3px solid var(--ink);
  border-radius: 13px 13px 13px 3px;
  background: rgba(255, 248, 233, 0.97);
  box-shadow: 5px 6px 0 var(--coral), 0 12px 28px rgba(3, 7, 15, 0.34);
  color: var(--ink);
  text-align: left;
  pointer-events: none;
}

.mission-flash.is-active {
  display: block;
  animation: mission-caption 920ms var(--ease-out) both;
}

.mission-flash p {
  margin: 0;
}

.mission-flash > p:first-child {
  color: var(--coral-dark);
  font-family: "SFMono-Regular", Menlo, monospace;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.14em;
}

.mission-flash h2 {
  margin: 3px 0 5px;
  font-size: clamp(18px, 5.6cqw, 25px);
  line-height: 1.08;
  letter-spacing: -0.065em;
}

.mission-flash > span {
  display: block;
  width: 38px;
  height: 3px;
  margin: 0 0 5px;
  background: var(--yellow);
  transform: rotate(-2deg);
}

.mission-flash > p:last-child {
  max-width: 34ch;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
}

.tap-hint {
  position: absolute;
  z-index: 22;
  left: auto;
  right: var(--edge);
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(244px, calc(100% - (var(--edge) * 2)));
  min-height: 58px;
  padding: 8px 14px 8px 8px;
  border: 3px solid rgba(255, 255, 255, 0.94);
  border-radius: 17px 17px 17px 5px;
  background: rgba(10, 15, 26, 0.92);
  box-shadow: 5px 6px 0 rgba(16, 21, 33, 0.72), 0 12px 28px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.tap-hint__icon {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  border-radius: 12px 12px 12px 4px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 22px;
  font-weight: 950;
  animation: tap-pulse 540ms ease-in-out infinite alternate;
}

.tap-hint > span:last-child {
  display: grid;
  gap: 3px;
}

.tap-hint strong {
  font-size: 14px;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.tap-hint small {
  color: rgba(255, 255, 255, 0.82);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.25;
}

.rhythm-layer {
  position: absolute;
  z-index: 32;
  inset: 0;
}

.rhythm-layer__instruction {
  position: absolute;
  top: calc(166px + env(safe-area-inset-top));
  left: 50%;
  display: grid;
  justify-items: center;
  width: min(88%, 350px);
  padding: 10px 14px;
  border: 2px solid rgba(255, 255, 255, 0.84);
  border-radius: 14px 14px 14px 4px;
  background: rgba(12, 17, 29, 0.77);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(12px);
  transform: translateX(-50%);
  transition: border-color 180ms ease, box-shadow 180ms ease;
  pointer-events: none;
}

.rhythm-layer[data-armed="false"] .rhythm-layer__instruction {
  border-color: rgba(255, 211, 78, 0.92);
  box-shadow: 0 0 0 3px rgba(255, 211, 78, 0.12), 0 10px 24px rgba(0, 0, 0, 0.26);
}

.rhythm-layer[data-armed="true"] .rhythm-layer__instruction {
  border-color: rgba(101, 229, 181, 0.94);
  box-shadow: 0 0 0 3px rgba(101, 229, 181, 0.12), 0 10px 24px rgba(0, 0, 0, 0.26);
}

.rhythm-layer__instruction span {
  margin-bottom: 3px;
  color: var(--yellow);
  font-family: "SFMono-Regular", Menlo, monospace;
  font-size: 10px;
  font-weight: 950;
}

.rhythm-layer__instruction strong {
  font-size: 13px;
}

.rhythm-layer__instruction small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 9px;
}

.rhythm-help {
  text-align: center;
}

.beat-target {
  position: absolute;
  top: 56%;
  display: grid;
  place-items: center;
  width: clamp(76px, 24vw, 104px);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  transition: opacity 150ms ease, transform 150ms var(--ease-pop);
}

.rhythm-layer[data-armed="false"] .beat-target {
  opacity: 0.64;
  transform: scale(0.92);
}

.rhythm-layer[data-armed="true"] .beat-target:not(.is-next) {
  opacity: 0.56;
  transform: scale(0.9);
}

.beat-target.is-next {
  z-index: 3;
  opacity: 1;
  transform: scale(1.06);
}

.beat-target--left {
  left: 7%;
}

.beat-target--right {
  right: 7%;
}

.beat-target__core {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 66%;
  aspect-ratio: 1;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 5px 6px 0 var(--coral), 0 10px 25px rgba(0, 0, 0, 0.3);
  color: var(--ink);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 25px;
  transition: background 140ms ease, box-shadow 140ms ease;
}

.beat-target.is-next .beat-target__core {
  background: var(--yellow);
  box-shadow: 5px 6px 0 var(--teal), 0 0 0 6px rgba(255, 211, 78, 0.18), 0 12px 28px rgba(0, 0, 0, 0.34);
}

.beat-target__core small {
  font-family: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
}

.beat-target__approach {
  position: absolute;
  inset: 0;
  border: 4px solid var(--yellow);
  border-radius: 50%;
  opacity: 0;
}

.rhythm-layer[data-side="L"] .beat-target--left .beat-target__approach,
.rhythm-layer[data-side="R"] .beat-target--right .beat-target__approach {
  opacity: 1;
  animation: approach-ring 620ms linear both;
}

.beat-target.is-hit .beat-target__core {
  animation: target-hit 240ms var(--ease-pop);
}

.beat-target.is-miss .beat-target__core {
  background: var(--danger);
  animation: target-miss 300ms ease;
}

.anchor-button {
  position: absolute;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 174px;
  padding: 10px 15px;
  border: 3px solid var(--ink);
  border-radius: 18px 18px 18px 5px;
  background: var(--yellow);
  box-shadow: 5px 6px 0 var(--coral), 0 12px 28px rgba(0, 0, 0, 0.32);
  color: var(--ink);
  transform: translateX(-50%);
}

.anchor-button__finger {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  font-size: 12px;
}

.anchor-button > span:last-child {
  display: grid;
  gap: 2px;
  text-align: left;
}

.anchor-button strong {
  font-size: 12px;
}

.anchor-button small {
  font-size: 8px;
}

.anchor-button[aria-pressed="true"] {
  background: var(--teal);
  transform: translateX(-50%) translateY(3px);
}

.anchor-button.needs-attention {
  animation: anchor-nudge 480ms var(--ease-pop);
}

.boss-overlay {
  position: absolute;
  z-index: 70;
  inset: 0;
  display: grid;
  align-items: end;
  padding: 20px var(--edge) calc(20px + env(safe-area-inset-bottom));
  background: rgba(5, 8, 16, 0.66);
  backdrop-filter: blur(8px) saturate(0.72);
}

.phone-card {
  position: relative;
  overflow: hidden;
  padding: 22px 18px 17px;
  border: 3px solid var(--ink);
  border-radius: 24px 24px 24px 7px;
  background: var(--paper);
  box-shadow: 8px 9px 0 var(--coral-dark), 0 28px 70px rgba(0, 0, 0, 0.42);
  color: var(--ink);
  animation: phone-up 420ms var(--ease-pop) both;
}

.phone-card__timer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 7px;
  background: #d9d0bd;
}

.phone-card__timer span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--yellow), var(--danger));
  transform-origin: left;
}

.phone-card__top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.boss-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--ink);
  color: var(--yellow);
  font-size: 15px;
  font-weight: 950;
}

.phone-card__top > div:nth-child(2) {
  display: grid;
  gap: 2px;
}

.phone-card__top strong {
  font-size: 14px;
}

.phone-card__top small,
.phone-card__top > span {
  color: #706b61;
  font-size: 8px;
  font-weight: 800;
}

.phone-card__message {
  display: grid;
  gap: 6px;
  margin: 14px 0 9px;
  padding: 14px;
  border: 2px solid var(--ink);
  border-radius: 13px 13px 13px 3px;
  background: var(--white);
}

.phone-card__message small {
  color: var(--coral-dark);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.phone-card__message strong {
  font-size: clamp(15px, 4.7vw, 19px);
  line-height: 1.35;
  letter-spacing: -0.045em;
}

.phone-card > p {
  margin: 0 0 10px;
  color: #6c675d;
  font-size: 9px;
  font-weight: 750;
}

.phone-card__choices {
  display: grid;
  gap: 7px;
}

.phone-card__choices button {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: 11px 11px 11px 3px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease;
}

.phone-card__choices button:active {
  transform: translateX(3px);
  background: var(--yellow);
}

.phone-card__choices b {
  font-size: 11px;
}

.phone-card__choices small {
  color: #767065;
  font-size: 9px;
}

.phone-card__choices button:disabled {
  opacity: 0.45;
}

.phone-card__result {
  min-height: 0;
  margin-top: 0;
  font-size: 11px;
  font-weight: 900;
}

.phone-card__result:not(:empty) {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  background: var(--yellow);
}

.section-label {
  margin: 0;
  color: rgba(255, 255, 255, 0.66);
  font-family: "SFMono-Regular", Menlo, monospace;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.section-label span {
  display: inline-block;
  margin-right: 5px;
  padding: 4px 6px;
  border-radius: 3px;
  background: var(--yellow);
  color: var(--ink);
}

.ending-screen {
  background: url("./assets/v2/backgrounds/home.webp") center / cover no-repeat;
}

.ending-screen::before {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 0;
  width: min(100vw, 480px);
  margin-inline: auto;
  background: linear-gradient(180deg, rgba(16, 21, 33, 0.05) 22%, rgba(16, 21, 33, 0.18) 44%, rgba(16, 21, 33, 0.96) 65%);
  pointer-events: none;
}

.ending-screen__visual {
  position: relative;
  z-index: 1;
  height: clamp(220px, 38vh, 360px);
  pointer-events: none;
}

.ending-screen__visual::after {
  content: "";
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: -46px;
  width: clamp(190px, 62cqw, 285px);
  aspect-ratio: 384 / 448;
  background-image: url("./assets/v3/sprites/monggeul-idol-anime-atlas.png");
  background-repeat: no-repeat;
  background-size: 400% 400%;
  background-position: 100% 100%;
  filter: drop-shadow(0 18px 16px rgba(4, 8, 16, 0.34));
  transform: translateX(-50%);
  animation: victory-pop 720ms var(--ease-pop) both;
}

.ending-screen__sun {
  position: absolute;
  top: 22%;
  right: 12%;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: rgba(255, 201, 79, 0.3);
  filter: blur(2px);
  animation: home-glow 1.8s ease-in-out infinite alternate;
}

.ending-sheet {
  position: relative;
  z-index: 2;
  min-height: 62vh;
  padding: 4px var(--edge) calc(24px + env(safe-area-inset-bottom));
}

.ending-sheet h2,
.share-screen h2,
.fail-sheet h2 {
  margin: 10px 0 12px;
  font-size: clamp(34px, 10vw, 48px);
  line-height: 0.98;
  letter-spacing: -0.085em;
}

.ending-sheet h2 em,
.fail-sheet h2 em {
  color: var(--yellow);
  font-style: normal;
}

.result-time {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 3px 12px;
  padding: 11px 13px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 13px 13px 13px 4px;
  background: rgba(10, 15, 25, 0.69);
  backdrop-filter: blur(12px);
}

.result-time span {
  color: var(--yellow);
  font-family: "SFMono-Regular", Menlo, monospace;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.result-time strong {
  justify-self: end;
  font-family: "SFMono-Regular", Menlo, monospace;
  font-size: clamp(27px, 8vw, 38px);
  letter-spacing: -0.07em;
}

.result-time small {
  grid-column: 1 / -1;
  color: rgba(255, 255, 255, 0.58);
  font-size: 8px;
  font-weight: 750;
}

.compact-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 9px 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(11, 16, 27, 0.72);
  overflow: hidden;
}

.compact-stats div {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 10px 4px;
}

.compact-stats div + div {
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.compact-stats strong {
  font-family: "SFMono-Regular", Menlo, monospace;
  font-size: 15px;
}

.compact-stats span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
  font-weight: 750;
}

.message-field {
  display: block;
  padding: 11px 12px;
  border: 2px solid var(--ink);
  border-radius: 14px 14px 14px 4px;
  background: var(--paper);
  color: var(--ink);
}

.message-field > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.message-field strong {
  font-size: 10px;
}

.message-field small {
  color: #81796b;
  font-family: "SFMono-Regular", Menlo, monospace;
  font-size: 8px;
}

.message-field textarea {
  display: block;
  width: 100%;
  min-height: 64px;
  margin-top: 6px;
  padding: 0;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.45;
  letter-spacing: -0.04em;
  user-select: text;
}

.primary-button,
.secondary-button,
.text-button {
  width: 100%;
  cursor: pointer;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  margin-top: 10px;
  padding: 10px 12px 10px 17px;
  border: 3px solid var(--ink);
  border-radius: 15px 15px 15px 4px;
  background: var(--yellow);
  box-shadow: 4px 5px 0 var(--coral-dark);
  color: var(--ink);
  font-weight: 950;
}

.primary-button i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px 10px 10px 3px;
  background: var(--ink);
  color: var(--yellow);
  font-style: normal;
}

.share-screen {
  padding: calc(25px + env(safe-area-inset-top)) var(--edge) calc(28px + env(safe-area-inset-bottom));
  background:
    linear-gradient(rgba(16, 21, 33, 0.82), rgba(16, 21, 33, 0.96)),
    url("./assets/v2/backgrounds/home.webp") center / cover fixed;
}

.share-screen__header {
  margin-bottom: 14px;
}

.share-screen h2 {
  margin-bottom: 0;
  font-size: clamp(31px, 9vw, 43px);
}

.share-card-preview {
  width: min(100%, 320px, calc(54dvh * 0.5625));
  margin: 0 auto;
  padding: 5px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 23px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.38);
  overflow: hidden;
}

.share-card-preview canvas {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 17px;
  background: var(--ink);
}

.share-screen__actions {
  display: grid;
  gap: 9px;
  width: min(100%, 320px);
  margin: 12px auto 0;
}

.share-screen__actions .primary-button {
  margin: 0;
}

.secondary-button {
  min-height: 46px;
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 13px 13px 13px 4px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 12px;
  font-weight: 850;
}

.text-button {
  padding: 9px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.66);
  font-size: 11px;
  font-weight: 750;
}

.fail-screen {
  overflow: hidden;
  background: #7c1730;
}

.fail-screen::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: repeating-conic-gradient(from -8deg, rgba(255, 255, 255, 0.1) 0 4deg, transparent 4deg 13deg);
  animation: danger-spin 20s linear infinite;
}

.fail-screen__impact {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  height: 47%;
}

.fail-screen__impact::after {
  content: "";
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: -35px;
  width: clamp(190px, 64cqw, 285px);
  aspect-ratio: 384 / 448;
  background-image: url("./assets/v3/sprites/monggeul-idol-anime-atlas.png");
  background-repeat: no-repeat;
  background-size: 400% 400%;
  background-position: 66.666% 100%;
  filter: drop-shadow(10px 16px 0 rgba(16, 21, 33, 0.55));
  transform: translateX(-50%);
  animation: caught-dog 560ms var(--ease-pop) both;
}

.fail-screen__impact span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: min(45vw, 190px);
  aspect-ratio: 1;
  border: 7px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 14px 15px 0 var(--ink);
  color: var(--coral-dark);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: min(34vw, 145px);
  transform: rotate(-8deg);
  animation: caught-pop 550ms var(--ease-pop) both;
}

.fail-sheet {
  position: relative;
  z-index: 2;
  min-height: 53%;
  padding: 12px var(--edge) calc(25px + env(safe-area-inset-bottom));
  border-top: 5px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
}

.fail-sheet .section-label {
  color: #70695d;
}

.fail-sheet .section-label span {
  background: var(--coral);
}

.fail-sheet h2 {
  margin-top: 12px;
  white-space: pre-line;
}

.fail-sheet h2 em {
  color: var(--coral-dark);
}

.fail-sheet > p:not(.section-label) {
  margin: 0 0 12px;
  color: #6c6559;
  font-size: 12px;
  font-weight: 750;
}

.fail-time {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 9px 11px;
  border: 2px solid var(--ink);
  border-radius: 10px;
}

.fail-time span {
  font-size: 9px;
  font-weight: 850;
}

.fail-time strong {
  font-family: "SFMono-Regular", Menlo, monospace;
  font-size: 20px;
}

.toast {
  position: absolute;
  z-index: 120;
  left: var(--edge);
  bottom: calc(96px + env(safe-area-inset-bottom));
  max-width: min(190px, calc(60% - var(--edge)));
  padding: 9px 13px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 12px 12px 12px 4px;
  background: rgba(12, 17, 29, 0.9);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  font-size: 10px;
  font-weight: 800;
  text-align: left;
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 220ms var(--ease-out);
}

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

@keyframes screen-in {
  from { opacity: 0; transform: scale(1.025); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes preload-bob {
  to { transform: translateY(-7px) rotate(2deg); }
}

@keyframes preload-line {
  from { transform: translateX(-100%); }
  to { transform: translateX(210%); }
}

@keyframes bubble-in {
  from { opacity: 0; transform: scale(0.76) rotate(-3deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes countdown-pop {
  0% { opacity: 0; transform: scale(1.65) rotate(-6deg); }
  42% { opacity: 1; transform: scale(0.9) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes mission-caption {
  0% { opacity: 0; transform: translate(-22px, -5px) rotate(-2deg) scale(0.92); }
  18%, 68% { opacity: 1; transform: translate(0, 0) rotate(-1deg) scale(1); }
  100% { opacity: 0; transform: translate(13px, -4px) rotate(1deg) scale(0.98); }
}

@keyframes tap-pulse {
  to { transform: rotate(-9deg) scale(1.08); box-shadow: 0 0 18px rgba(255, 201, 79, 0.5); }
}

@keyframes approach-ring {
  from { opacity: 0.25; transform: scale(1.7); }
  to { opacity: 1; transform: scale(0.67); }
}

@keyframes target-hit {
  50% { transform: scale(1.24) rotate(8deg); background: var(--teal); }
}

@keyframes target-miss {
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@keyframes anchor-nudge {
  0%, 100% { transform: translateX(-50%); }
  35% { transform: translateX(-50%) translateY(-8px) scale(1.05); box-shadow: 5px 8px 0 var(--coral), 0 0 0 10px rgba(255, 211, 78, 0.2); }
  65% { transform: translateX(-50%) translateY(2px) scale(0.98); }
}

@keyframes phone-up {
  from { opacity: 0; transform: translateY(70px) rotate(2deg); }
  to { opacity: 1; transform: translateY(0) rotate(0); }
}

@keyframes home-glow {
  to { transform: scale(1.2); opacity: 0.55; }
}

@keyframes victory-pop {
  from { opacity: 0; transform: translateX(-50%) translateY(70px) scale(0.72) rotate(-6deg); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1) rotate(0); }
}

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

@keyframes caught-pop {
  from { opacity: 0; transform: scale(2.4) rotate(18deg); }
  to { opacity: 1; transform: scale(1) rotate(-8deg); }
}

@keyframes caught-dog {
  from { opacity: 0; transform: translateX(-50%) scale(1.55) rotate(10deg); }
  to { opacity: 1; transform: translateX(-50%) scale(1) rotate(-2deg); }
}

@media (hover: hover) and (pointer: fine) {
  body {
    padding: 16px;
    background:
      radial-gradient(circle at 50% 20%, #202b42 0, transparent 40%),
      #080b12;
  }

  .game {
    width: min(calc(100vw - 32px), calc(56.25dvh - 18px), 480px);
    height: auto;
    min-height: 0;
    aspect-ratio: 9 / 16;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 30px;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55);
  }
}

@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .game-shell {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: clamp(18px, 2.4vw, 30px);
    width: min(100%, 854px);
    max-width: calc(100vw - 32px);
    max-height: calc(100dvh - 32px);
  }

  .game-shell > .game {
    flex: 0 0 auto;
  }

  .desktop-controls {
    position: relative;
    isolation: isolate;
    display: flex;
    flex: 1 1 300px;
    flex-direction: column;
    width: clamp(278px, 28vw, 330px);
    min-width: 0;
    padding: clamp(15px, 2.1dvh, 22px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 28px;
    background:
      linear-gradient(145deg, rgba(31, 40, 60, 0.98), rgba(10, 14, 24, 0.98) 65%),
      var(--ink);
    box-shadow: 0 40px 110px rgba(0, 0, 0, 0.46);
    overflow: hidden;
    user-select: none;
  }

  .desktop-controls::before {
    content: "";
    position: absolute;
    z-index: -2;
    inset: 0;
    opacity: 0.14;
    background-image:
      linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(180deg, #000, transparent 68%);
  }

  .desktop-controls::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: -76px;
    right: -56px;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: rgba(255, 201, 79, 0.16);
    filter: blur(2px);
  }

  .desktop-controls__header {
    padding-bottom: clamp(12px, 1.8dvh, 19px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  }

  .desktop-controls__status {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--teal);
    font-family: "SFMono-Regular", Menlo, monospace;
    font-size: 8px;
    font-weight: 950;
    letter-spacing: 0.14em;
  }

  .desktop-controls__status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 12px currentColor;
    animation: desktop-status-pulse 1.5s ease-in-out infinite alternate;
  }

  .desktop-controls__header p {
    max-width: 19ch;
    margin: 8px 0 0;
    font-size: clamp(17px, 2.4dvh, 23px);
    font-weight: 950;
    line-height: 1.15;
    letter-spacing: -0.055em;
    text-wrap: balance;
  }

  .desktop-controls__stage {
    position: relative;
    display: grid;
    gap: 4px;
    margin-top: clamp(12px, 2dvh, 20px);
    padding: clamp(12px, 1.8dvh, 17px);
    border: 2px solid rgba(255, 255, 255, 0.78);
    border-radius: 16px 16px 16px 5px;
    background: rgba(7, 11, 20, 0.67);
    box-shadow: 5px 6px 0 rgba(255, 96, 79, 0.72);
    backdrop-filter: blur(12px);
  }

  .desktop-controls__stage::after {
    content: "";
    position: absolute;
    top: 11px;
    right: 12px;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--yellow);
    transform: rotate(8deg);
  }

  .desktop-controls__stage > span {
    color: var(--yellow);
    font-family: "SFMono-Regular", Menlo, monospace;
    font-size: 8px;
    font-weight: 950;
    letter-spacing: 0.12em;
  }

  .desktop-controls__stage strong {
    padding-right: 18px;
    font-size: clamp(15px, 2dvh, 19px);
    line-height: 1.18;
    letter-spacing: -0.04em;
  }

  .desktop-controls__stage p {
    margin: 1px 0 0;
    color: rgba(255, 255, 255, 0.62);
    font-size: clamp(9px, 1.25dvh, 11px);
    font-weight: 700;
    line-height: 1.45;
    word-break: keep-all;
  }

  .desktop-controls__mode {
    margin-top: clamp(13px, 2.3dvh, 23px);
  }

  .desktop-controls__mode--rhythm {
    display: none;
  }

  .desktop-controls[data-mode="rhythm"] .desktop-controls__mode--tap {
    display: none;
  }

  .desktop-controls[data-mode="rhythm"] .desktop-controls__mode--rhythm {
    display: block;
  }

  .desktop-any-key {
    display: grid;
    justify-items: center;
    gap: clamp(10px, 1.7dvh, 15px);
    padding: clamp(15px, 2.6dvh, 26px) 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.045);
    text-align: center;
    transition: border-color 100ms ease, background 100ms ease;
  }

  .desktop-any-key kbd,
  .desktop-key-zone kbd {
    font-family: "SFMono-Regular", Menlo, monospace;
    font-weight: 950;
  }

  .desktop-any-key kbd {
    display: grid;
    place-items: center;
    width: min(100%, 182px);
    min-height: clamp(58px, 9dvh, 78px);
    border: 2px solid #0c111d;
    border-radius: 14px;
    background: var(--paper);
    box-shadow:
      inset 0 -7px 0 #d8cfbd,
      0 7px 0 #080c14,
      0 14px 25px rgba(0, 0, 0, 0.34);
    color: var(--ink);
    font-size: clamp(14px, 2.1dvh, 19px);
    letter-spacing: 0.06em;
    transform: translateY(-2px);
    transition: transform 70ms ease, box-shadow 70ms ease, background 70ms ease;
  }

  .desktop-any-key > span {
    display: grid;
    gap: 4px;
  }

  .desktop-any-key strong {
    font-size: clamp(13px, 1.8dvh, 16px);
  }

  .desktop-any-key small {
    color: rgba(255, 255, 255, 0.58);
    font-size: clamp(8px, 1.2dvh, 10px);
  }

  .desktop-controls__hold-copy {
    display: grid;
    gap: 4px;
    margin-bottom: clamp(10px, 1.7dvh, 15px);
  }

  .desktop-controls__hold-copy span {
    color: var(--yellow);
    font-family: "SFMono-Regular", Menlo, monospace;
    font-size: 8px;
    font-weight: 950;
    letter-spacing: 0.12em;
  }

  .desktop-controls__hold-copy strong {
    font-size: clamp(11px, 1.55dvh, 14px);
    line-height: 1.35;
    letter-spacing: -0.035em;
  }

  .desktop-keyboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .desktop-key-zone {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 6px;
    min-width: 0;
    min-height: clamp(82px, 13dvh, 112px);
    padding: 10px 7px 13px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 15px 15px 15px 5px;
    background: rgba(255, 255, 255, 0.045);
    text-align: center;
    transition: border-color 90ms ease, background 90ms ease, transform 90ms ease;
  }

  .desktop-key-zone kbd {
    display: grid;
    place-items: center;
    width: min(74px, 80%);
    min-height: 35px;
    border: 2px solid #0b101b;
    border-radius: 9px;
    background: var(--paper);
    box-shadow: inset 0 -4px 0 #d8cfbd, 0 4px 0 #070b12;
    color: var(--ink);
    font-size: 9px;
    letter-spacing: 0.05em;
    transition: transform 70ms ease, box-shadow 70ms ease, background 70ms ease;
  }

  .desktop-key-zone > span {
    color: rgba(255, 255, 255, 0.64);
    font-size: clamp(8px, 1.15dvh, 10px);
    font-weight: 800;
    line-height: 1.3;
  }

  .desktop-key-zone--left {
    grid-column: 1;
    grid-row: 1;
  }

  .desktop-key-zone--right {
    grid-column: 2;
    grid-row: 1;
  }

  .desktop-key-zone--space {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: minmax(110px, 1fr) auto;
    min-height: clamp(66px, 9dvh, 78px);
    padding-inline: 14px;
  }

  .desktop-key-zone--space kbd {
    width: 100%;
    min-height: 31px;
  }

  .desktop-key-zone--space > span {
    white-space: nowrap;
  }

  .desktop-any-key.is-active,
  .desktop-any-key.is-flashing,
  .desktop-key-zone.is-active,
  .desktop-key-zone.is-flashing {
    border-color: var(--yellow);
    background: rgba(255, 201, 79, 0.16);
  }

  .desktop-any-key.is-active kbd,
  .desktop-any-key.is-flashing kbd,
  .desktop-key-zone.is-active kbd,
  .desktop-key-zone.is-flashing kbd {
    background: var(--yellow);
    box-shadow: inset 0 -2px 0 #d5a932, 0 2px 0 #080c14, 0 0 22px rgba(255, 201, 79, 0.42);
    transform: translateY(4px) scale(0.985);
  }

  .desktop-key-zone.is-hit {
    border-color: var(--teal);
    background: rgba(59, 208, 189, 0.16);
  }

  .desktop-key-zone.is-hit kbd {
    background: var(--teal);
    box-shadow: inset 0 -2px 0 #249f90, 0 2px 0 #080c14, 0 0 22px rgba(59, 208, 189, 0.42);
    transform: translateY(4px) scale(0.985);
  }

  .desktop-key-zone.is-miss {
    border-color: var(--danger);
    background: rgba(255, 55, 87, 0.18);
    animation: target-miss 260ms ease;
  }

  .desktop-key-zone.is-miss kbd {
    background: #ff8ca0;
  }

  .desktop-controls__footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: clamp(12px, 2dvh, 19px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .desktop-controls__footer > span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 11px 11px 11px 4px;
    background: var(--yellow);
    color: var(--ink);
    font-size: 19px;
    font-weight: 950;
  }

  .desktop-controls__footer p {
    display: grid;
    gap: 2px;
    margin: 0;
  }

  .desktop-controls__footer strong {
    font-size: 10px;
  }

  .desktop-controls__footer small {
    color: rgba(255, 255, 255, 0.52);
    font-size: 8px;
  }

  .rhythm-help--touch,
  .anchor-button__touch-help {
    display: none;
  }

  .rhythm-help--keyboard,
  .anchor-button__desktop-help {
    display: block;
  }

  .beat-target__core {
    align-content: center;
    line-height: 0.85;
  }

  .beat-target__core small {
    display: block;
    margin-top: 6px;
    font-size: 7px;
    font-weight: 900;
    letter-spacing: -0.02em;
  }

  .anchor-button__finger {
    font-size: 0;
  }

  .anchor-button__finger::after {
    content: "SPACE";
    font-family: "SFMono-Regular", Menlo, monospace;
    font-size: 7px;
    font-weight: 950;
  }

  .ending-screen::before {
    position: absolute;
    width: 100%;
  }
}

@media (min-width: 900px) and (max-height: 620px) and (hover: hover) and (pointer: fine) {
  .desktop-controls__footer {
    display: none;
  }

  .desktop-controls__stage {
    margin-top: 10px;
    padding: 10px 12px;
  }

  .desktop-controls__mode {
    margin-top: 11px;
  }

  .desktop-any-key {
    gap: 8px;
    padding-block: 12px;
  }

  .desktop-key-zone {
    min-height: 72px;
  }

  .desktop-key-zone--space {
    min-height: 54px;
  }
}

@keyframes desktop-status-pulse {
  to { opacity: 0.42; transform: scale(0.82); }
}

@media (max-height: 760px) {
  .opening-screen__masthead {
    bottom: calc(9px + env(safe-area-inset-bottom));
  }

  .opening-screen__masthead > p {
    margin-bottom: 5px;
  }

  .opening-screen__records {
    margin-bottom: 6px;
  }

  .start-button {
    min-height: 54px;
  }

  .mission-flash {
    top: calc(160px + env(safe-area-inset-top));
    width: min(76%, 238px);
    padding: 8px 11px 9px;
  }

  .mission-flash > p:last-child {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .ending-screen__visual {
    height: 150px;
  }

  .ending-screen__visual::after {
    left: 74%;
    bottom: -6px;
    width: 132px;
  }

  .ending-sheet h2,
  .share-screen h2,
  .fail-sheet h2 {
    font-size: 32px;
  }

  .share-screen {
    padding-top: calc(17px + env(safe-area-inset-top));
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .share-screen__header {
    margin-bottom: 8px;
  }

  .share-card-preview {
    width: min(100%, 300px, calc(50dvh * 0.5625));
  }

  .share-screen__actions {
    gap: 6px;
    margin-top: 8px;
  }

  .share-screen__actions .primary-button {
    min-height: 50px;
  }

  .share-screen__actions .secondary-button {
    min-height: 42px;
  }

  .share-screen__actions .text-button {
    padding-block: 5px;
  }

  .phone-card {
    padding: 18px 14px 13px;
  }

  .phone-card__message {
    margin-block: 10px 7px;
    padding: 10px;
  }

  .phone-card__choices {
    gap: 5px;
  }

  .phone-card__choices button {
    min-height: 44px;
    padding: 7px 10px;
  }
}

@media (max-width: 350px) {
  :root { --edge: 14px; }

  .opening-screen__bubble--one { width: 44cqw; }
  .opening-screen__bubble--two { width: 44cqw; }
  .mission-chip__copy strong { max-width: 82px; }
  .tap-hint { width: min(232px, calc(100% - (var(--edge) * 2))); }
  .timer-stack__time { font-size: 23px; }
  .rhythm-layer__instruction { top: calc(150px + env(safe-area-inset-top)); }
  .phone-card__choices b { font-size: 10px; }
}

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