:root {
  color-scheme: dark;
  --ink: #f8fafc;
  --muted: #cbd5e1;
  --deep: #0b1020;
  --panel: #171b31;
  --panel-2: #222945;
  --purple: #8b5cf6;
  --purple-dark: #5b21b6;
  --green: #34d399;
  --green-dark: #065f46;
  --amber: #fbbf24;
  --red: #fb7185;
  --blue: #38bdf8;
  --cream: #fff7db;
  --shadow: 0 24px 60px rgb(0 0 0 / 40%);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #0b1020;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 18%, rgb(139 92 246 / 25%), transparent 30%),
    radial-gradient(circle at 88% 26%, rgb(52 211 153 / 20%), transparent 28%),
    linear-gradient(155deg, #11132a 0%, #080b15 72%);
  font-family: Inter, ui-rounded, "Arial Rounded MT Bold", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 4px solid var(--amber);
  outline-offset: 3px;
}

.game-shell {
  width: min(1320px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(16px, 2vw, 28px);
  display: flex;
  flex-direction: column;
}

.game-shell:fullscreen,
.game-shell:-webkit-full-screen {
  width: 100%;
  max-width: none;
  height: 100%;
  overflow: auto;
  padding: clamp(16px, 2vw, 30px);
  background:
    radial-gradient(circle at 14% 18%, rgb(139 92 246 / 25%), transparent 30%),
    radial-gradient(circle at 88% 26%, rgb(52 211 153 / 20%), transparent 28%),
    linear-gradient(155deg, #11132a 0%, #080b15 72%);
}

.mission-screen {
  position: fixed;
  z-index: 1000;
  inset: 0;
  padding: clamp(18px, 4vw, 44px);
  display: grid;
  place-items: center;
  overflow-y: auto;
  background:
    radial-gradient(circle at 20% 15%, rgb(139 92 246 / 35%), transparent 34%),
    radial-gradient(circle at 82% 78%, rgb(52 211 153 / 24%), transparent 30%),
    rgb(7 10 20 / 97%);
  backdrop-filter: blur(12px);
}

.mission-card {
  width: min(680px, 100%);
  padding: clamp(25px, 5vw, 48px);
  position: relative;
  overflow: hidden;
  border: 2px solid rgb(167 139 250 / 58%);
  border-radius: 30px;
  background: linear-gradient(145deg, #25184a, #12182a 72%);
  box-shadow: 0 30px 80px rgb(0 0 0 / 55%);
  text-align: center;
}

.mission-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgb(255 255 255 / 8%), transparent 38%);
}

.mission-badge {
  width: 82px;
  height: 82px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border: 2px solid rgb(255 255 255 / 22%);
  border-radius: 24px;
  background: linear-gradient(135deg, #047857, #065f46);
  box-shadow: 0 15px 34px rgb(0 0 0 / 30%);
  font-size: 2.35rem;
  transform: rotate(-3deg);
}

.mission-card .eyebrow {
  margin-bottom: 7px;
}

.mission-card h2 {
  margin: 0 0 16px;
  color: #fff;
  font-size: clamp(2rem, 6vw, 3.3rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.mission-copy {
  max-width: 560px;
  margin: 0 auto;
  color: #e2e8f0;
  font-size: clamp(1rem, 2.3vw, 1.22rem);
  font-weight: 680;
  line-height: 1.62;
}

.mission-audio-status {
  margin: 20px 0 0;
  color: #a7f3d0;
  font-size: 0.82rem;
  font-weight: 760;
}

.mission-actions {
  width: min(390px, 100%);
  margin: 26px auto 0;
}

.mission-button {
  min-height: 52px;
  padding: 0 19px;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 15px;
  color: #fff;
  background: #293148;
  box-shadow: 0 10px 20px rgb(0 0 0 / 22%);
  cursor: pointer;
  font-weight: 880;
}

.mission-button:hover {
  border-color: var(--green);
  background: #35415d;
  transform: translateY(-1px);
}

.enter-game-button {
  width: 100%;
  min-height: 66px;
  padding: 0 26px;
  border: 2px solid #a7f3d0;
  border-radius: 18px;
  color: #062f25;
  background: linear-gradient(135deg, #6ee7b7, #34d399 55%, #10b981);
  box-shadow: 0 14px 28px rgb(6 95 70 / 42%);
  font-size: clamp(1.05rem, 2.8vw, 1.25rem);
  letter-spacing: 0.01em;
}

.enter-game-button:hover {
  color: #031d17;
  background: linear-gradient(135deg, #a7f3d0, #6ee7b7);
  box-shadow: 0 17px 32px rgb(6 95 70 / 52%);
}

.enter-game-button:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--green);
  font-size: clamp(0.7rem, 1.4vw, 0.82rem);
  font-weight: 900;
  letter-spacing: 0.16em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 1px;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.subtitle {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 700;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.secondary-button,
.icon-button {
  min-height: 46px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 14px;
  color: var(--ink);
  background: rgb(30 41 59 / 80%);
  box-shadow: 0 8px 20px rgb(0 0 0 / 20%);
  cursor: pointer;
}

.secondary-button {
  padding: 0 18px;
  font-weight: 850;
}

.fullscreen-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.icon-button {
  width: 48px;
  font-size: 1.15rem;
}

.secondary-button:hover,
.icon-button:hover {
  border-color: var(--green);
  transform: translateY(-1px);
}

.story-stage {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(340px, 430px) minmax(210px, 1fr);
  grid-template-areas: "nan phone player";
  align-items: end;
  justify-content: center;
  gap: clamp(12px, 2vw, 32px);
  min-height: 720px;
  position: relative;
  isolation: isolate;
}

.story-stage::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 12% 0 0;
  border-radius: 44px 44px 20px 20px;
  border: 1px solid rgb(255 255 255 / 8%);
  background:
    linear-gradient(90deg, transparent 49.7%, rgb(255 255 255 / 4%) 49.7% 50.3%, transparent 50.3%),
    linear-gradient(#383052 0 58%, #171427 58% 100%);
  box-shadow: inset 0 -110px 130px rgb(0 0 0 / 38%);
}

.story-stage::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: 0;
  width: min(88%, 1040px);
  height: 18%;
  transform: translateX(-50%);
  border-radius: 50% 50% 10px 10px;
  background: radial-gradient(ellipse, #2c2550 0%, #1d1935 58%, transparent 72%);
  filter: drop-shadow(0 -12px 25px rgb(0 0 0 / 24%));
}

.character {
  align-self: end;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  height: min(710px, 82vh);
  position: relative;
}

.character.is-offstage {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.character-nan {
  grid-area: nan;
}

.character-player {
  grid-area: player;
}

.character img {
  display: block;
  width: auto;
  max-width: 100%;
  height: min(540px, 63vh);
  object-fit: contain;
  object-position: bottom center;
  user-select: none;
  filter: drop-shadow(0 25px 22px rgb(0 0 0 / 42%));
  transition: filter 180ms ease, transform 180ms ease, opacity 180ms ease;
}

.character.speaking img {
  transform: translateY(-5px) scale(1.015);
  filter: drop-shadow(0 25px 22px rgb(0 0 0 / 42%)) drop-shadow(0 0 20px rgb(251 191 36 / 25%));
}

.name-tag {
  min-width: 74px;
  margin-top: -4px;
  padding: 7px 14px;
  border: 2px solid rgb(255 255 255 / 30%);
  border-radius: 999px;
  color: #171427;
  background: var(--cream);
  box-shadow: 0 7px 16px rgb(0 0 0 / 24%);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 1000;
  letter-spacing: 0.12em;
}

.speech-bubble {
  position: relative;
  z-index: 4;
  flex: 0 0 auto;
  width: min(300px, 94%);
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 3px solid #121629;
  border-radius: 22px;
  color: #111827;
  background: var(--cream);
  box-shadow: 8px 10px 0 rgb(0 0 0 / 25%);
  font-size: clamp(0.92rem, 1.4vw, 1.05rem);
  font-weight: 750;
  line-height: 1.35;
  animation: bubble-in 220ms cubic-bezier(.2, .8, .2, 1);
}

.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -18px;
  width: 28px;
  height: 28px;
  border-right: 3px solid #121629;
  border-bottom: 3px solid #121629;
  background: var(--cream);
  transform: rotate(45deg);
}

.bubble-nan {
  align-self: flex-end;
  right: -4px;
}

.bubble-nan::after {
  left: 44px;
}

.bubble-player {
  align-self: flex-start;
  left: -4px;
  background: #dcfce7;
}

.bubble-player::after {
  right: 44px;
  background: #dcfce7;
}

.phone-zone {
  grid-area: phone;
  align-self: center;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0 18px;
}

.mission-strip {
  width: min(400px, 95%);
  min-height: 38px;
  margin-bottom: 9px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgb(52 211 153 / 50%);
  border-radius: 12px;
  color: #a7f3d0;
  background: rgb(6 78 59 / 82%);
  box-shadow: 0 8px 22px rgb(0 0 0 / 24%);
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.mission-progress {
  color: var(--amber);
  white-space: nowrap;
}

.phone-frame {
  width: min(400px, 95vw);
  height: min(650px, 77vh);
  min-height: 590px;
  padding: 14px;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 4px solid #49516d;
  border-radius: 48px;
  background: linear-gradient(145deg, #31384f, #171c2e 70%);
  box-shadow: var(--shadow), inset 0 0 0 2px rgb(255 255 255 / 7%);
}

.phone-frame::before {
  content: "";
  position: absolute;
  inset: 4px;
  pointer-events: none;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 41px;
}

.phone-top {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.speaker {
  width: 64px;
  height: 6px;
  border-radius: 99px;
  background: #080b12;
}

.camera {
  width: 9px;
  height: 9px;
  border: 2px solid #121b2e;
  border-radius: 50%;
  background: #31557b;
}

.hardware-button {
  position: absolute;
  top: 132px;
  right: -12px;
  width: 8px;
  height: 74px;
  border: 0;
  border-radius: 0 6px 6px 0;
  background: #59627d;
  cursor: pointer;
}

.hardware-button:hover {
  background: var(--amber);
}

.phone-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 30px;
  background:
    radial-gradient(circle at 80% 15%, rgb(56 189 248 / 12%), transparent 28%),
    linear-gradient(180deg, #0f172a, #111827);
}

.status-bar {
  height: 24px;
  padding: 6px 14px 0;
  display: flex;
  justify-content: space-between;
  color: #dbeafe;
  font-size: 0.63rem;
  font-weight: 850;
}

.app-titlebar {
  min-height: 58px;
  padding: 9px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgb(255 255 255 / 6%);
  border-bottom: 1px solid rgb(255 255 255 / 9%);
  background: rgb(15 23 42 / 84%);
}

.app-titlebar strong,
.app-titlebar small {
  display: block;
}

.app-titlebar strong {
  font-size: 0.84rem;
}

.app-titlebar small {
  color: #94a3b8;
  font-size: 0.67rem;
}

.app-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #0f766e, #047857);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 20%);
}

.listening-dot {
  width: 10px;
  height: 10px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgb(52 211 153 / 60%);
  animation: pulse 1.6s infinite;
}

.phone-content {
  flex: 1;
  min-height: 0;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.phone-card {
  padding: 12px 14px;
  border: 1px solid rgb(255 255 255 / 11%);
  border-radius: 15px;
  color: #e2e8f0;
  background: #20283d;
  box-shadow: 0 6px 12px rgb(0 0 0 / 14%);
  font-size: 0.88rem;
  line-height: 1.4;
  animation: phone-card-in 180ms ease-out;
}

.phone-card.app {
  border-color: rgb(52 211 153 / 35%);
  background: linear-gradient(135deg, #064e3b, #075f4c);
}

.phone-card.system {
  color: #cbd5e1;
  border-style: dashed;
  text-align: center;
  font-style: italic;
}

.phone-card.puzzle-intro {
  border-color: rgb(251 191 36 / 35%);
  color: #fef3c7;
  background: #4b3410;
  font-style: normal;
}

.puzzle-panel {
  padding: 15px;
  border: 2px solid rgb(139 92 246 / 55%);
  border-radius: 18px;
  background: linear-gradient(145deg, rgb(76 29 149 / 58%), rgb(30 41 59 / 92%));
  box-shadow: 0 10px 25px rgb(0 0 0 / 20%);
}

.puzzle-type {
  margin-bottom: 7px;
  color: #c4b5fd;
  font-size: 0.67rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.puzzle-question {
  margin: 0;
  color: #fff;
  font-size: clamp(1rem, 2.2vw, 1.12rem);
  font-weight: 850;
  line-height: 1.38;
}

.feedback-panel {
  margin: 0 13px 10px;
  padding: 11px 13px;
  border-radius: 13px;
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.35;
}

.feedback-panel.correct {
  border: 1px solid var(--green);
  color: #d1fae5;
  background: #064e3b;
}

.feedback-panel.incorrect {
  border: 1px solid var(--red);
  color: #ffe4e6;
  background: #701a2d;
}

.feedback-panel.hint {
  border-color: var(--amber);
  color: #fef3c7;
  background: #713f12;
}

.choices-container {
  padding: 0 13px 14px;
  display: grid;
  gap: 8px;
}

.choice-button,
.continue-button,
.keypad-button {
  min-height: 47px;
  border: 1px solid #475569;
  border-radius: 13px;
  color: #f8fafc;
  background: #252d43;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.choice-button,
.continue-button {
  padding: 11px 13px;
  font-size: 0.88rem;
  font-weight: 780;
  line-height: 1.25;
  text-align: left;
}

.choice-button:hover,
.keypad-button:hover {
  border-color: var(--green);
  background: #334155;
  transform: translateY(-1px);
}

.choice-button:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.choice-button.correct-choice {
  border-color: var(--green);
  background: #065f46;
}

.choice-button.wrong-choice {
  border-color: var(--red);
  background: #701a2d;
}

.continue-button {
  border-color: #a78bfa;
  text-align: center;
  background: linear-gradient(135deg, #6d28d9, #7c3aed);
}

.continue-button:hover {
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
}

.keypad-display {
  min-height: 52px;
  margin-bottom: 10px;
  display: grid;
  place-items: center;
  border: 2px inset #475569;
  border-radius: 12px;
  color: var(--green);
  background: #020617;
  font: 900 1.35rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.22em;
}

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

.keypad-button {
  font-size: 1.05rem;
  font-weight: 900;
}

.phone-home {
  width: 108px;
  height: 5px;
  margin: 9px auto 2px;
  border-radius: 99px;
  background: #6b7280;
}

.interaction-hint {
  width: min(390px, 94%);
  margin: 10px 0 0;
  color: #cbd5e1;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.research-panel {
  width: min(860px, 96%);
  margin: 4px auto 16px;
  padding: 16px 18px;
  border: 2px solid #3b82f6;
  border-radius: 22px;
  color: #e0f2fe;
  background: linear-gradient(145deg, #172554, #172033);
  box-shadow: 0 16px 32px rgb(0 0 0 / 25%);
  animation: research-in 260ms ease-out;
}

.research-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.research-heading h2 {
  margin: 0;
  font-size: 1.08rem;
}

.research-heading .eyebrow {
  color: #7dd3fc;
}

.research-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #1e3a8a;
  font-size: 1.25rem;
}

.research-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 18px;
  color: #dbeafe;
  font-size: 0.86rem;
  line-height: 1.45;
}

.research-grid p,
.research-grid ol {
  margin-bottom: 0;
}

.research-grid ol {
  padding-left: 22px;
}

.research-grid li + li {
  margin-top: 4px;
}

.game-footer {
  padding-top: 8px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 700;
}

[hidden] {
  display: none !important;
}

@keyframes bubble-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes phone-card-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 9px rgb(52 211 153 / 0%); }
  100% { box-shadow: 0 0 0 0 rgb(52 211 153 / 0%); }
}

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

@media (max-width: 920px) {
  .story-stage {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "nan player"
      "phone phone";
    align-items: end;
    min-height: auto;
    padding-top: 10px;
  }

  .story-stage::before {
    inset: 0;
  }

  .character {
    height: 370px;
  }

  .character img {
    height: 235px;
    max-width: min(74%, 210px);
  }

  .speech-bubble {
    top: 0;
    width: min(300px, 96%);
    font-size: 0.9rem;
  }

  .bubble-nan,
  .bubble-player {
    left: auto;
    right: auto;
    align-self: stretch;
    width: auto;
    margin-right: 2%;
    margin-left: 2%;
  }

  .phone-zone {
    padding-top: 0;
  }

  .phone-frame {
    height: min(680px, 78vh);
  }
}

@media (max-width: 700px) {
  .game-shell {
    min-height: 100vh;
    min-height: 100svh;
  }

  .story-stage {
    height: calc(100vh - 158px);
    height: calc(100svh - 158px);
    min-height: 470px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(92px, 16svh) minmax(0, 1fr);
    grid-template-areas:
      "speaker"
      "phone";
    align-items: end;
    gap: 4px;
    padding-top: 0;
  }

  .story-stage[data-active-speaker="none"] {
    grid-template-rows: 0 minmax(0, 1fr);
  }

  .story-stage[data-active-speaker="none"] .character,
  .story-stage[data-active-speaker="nan"] .character-player,
  .story-stage[data-active-speaker="player"] .character-nan,
  .character.is-offstage {
    display: none;
  }

  .character-nan,
  .character-player {
    grid-area: speaker;
  }

  .character {
    width: 100%;
    height: 100%;
    min-height: 0;
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
  }

  .character img {
    width: auto;
    max-width: 30vw;
    height: min(14svh, 118px);
  }

  .speech-bubble {
    align-self: center;
    width: min(62vw, 300px);
    max-height: 15svh;
    margin: 0 0 4px;
    overflow-y: auto;
  }

  .bubble-nan,
  .bubble-player {
    left: auto;
    right: auto;
    align-self: center;
    width: min(62vw, 300px);
    margin: 0 0 4px;
  }

  .speech-bubble::after {
    display: none;
  }

  .name-tag {
    position: absolute;
    right: 3%;
    bottom: 2px;
    min-width: 56px;
    padding: 4px 8px;
  }

  .phone-zone {
    grid-area: phone;
    align-self: stretch;
    min-height: 0;
    height: 100%;
    padding: 0 0 4px;
  }

  .mission-strip {
    flex: 0 0 auto;
    width: min(360px, 94vw);
    min-height: 32px;
    margin-bottom: 5px;
    padding: 6px 9px;
  }

  .phone-frame {
    flex: 1 1 auto;
    width: min(360px, 94vw);
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 9px;
    border-width: 3px;
    border-radius: 36px;
  }

  .phone-frame::before {
    border-radius: 30px;
  }

  .phone-top {
    height: 18px;
  }

  .phone-screen {
    border-radius: 24px;
  }

  .phone-home {
    margin-top: 5px;
  }

  .interaction-hint {
    flex: 0 0 auto;
    margin-top: 4px;
    font-size: 0.68rem;
  }
}

@media (max-width: 560px) {
  .game-shell {
    padding: 12px 10px 18px;
  }

  .game-header {
    align-items: flex-start;
  }

  .subtitle {
    max-width: 220px;
    font-size: 0.78rem;
  }

  .secondary-button {
    min-height: 42px;
    padding: 0 12px;
    font-size: 0.78rem;
  }

  .fullscreen-button {
    width: 43px;
    padding: 0;
  }

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

  .icon-button {
    width: 43px;
    min-height: 42px;
  }

  .story-stage {
    gap: 3px;
  }

  .speech-bubble {
    top: 0;
    padding: 11px 12px;
    border-width: 2px;
    border-radius: 16px;
    box-shadow: 5px 6px 0 rgb(0 0 0 / 25%);
    font-size: clamp(0.74rem, 3vw, 0.86rem);
    line-height: 1.28;
  }

  .speech-bubble::after {
    bottom: -13px;
    width: 20px;
    height: 20px;
    border-width: 0 2px 2px 0;
  }

  .name-tag {
    min-width: 62px;
    padding: 5px 10px;
    font-size: 0.62rem;
  }

  .phone-frame {
    width: min(350px, 94vw);
    height: auto;
    min-height: 0;
    border-radius: 34px;
  }

  .mission-strip {
    width: 94%;
    font-size: 0.59rem;
  }

  .phone-card,
  .choice-button,
  .continue-button {
    font-size: 0.84rem;
  }

  .research-panel {
    width: 100%;
    padding: 14px;
  }

  .research-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .game-footer {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }

  .mission-screen {
    padding: 12px;
  }

  .mission-card {
    padding: 24px 17px;
    border-radius: 22px;
  }

  .mission-badge {
    width: 66px;
    height: 66px;
    margin-bottom: 14px;
    font-size: 1.9rem;
  }

  .mission-actions {
    width: 100%;
  }

  .enter-game-button {
    min-height: 64px;
  }
}

@media (max-height: 720px) and (min-width: 921px) {
  .story-stage {
    min-height: 610px;
  }

  .character {
    height: 580px;
  }

  .character img {
    height: 470px;
  }

  .phone-frame {
    height: 570px;
    min-height: 550px;
  }
}

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