* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--color-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(180deg, #153754 0%, #0a1d2e 100%);
}

button {
  font: inherit;
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0 max(20px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}

.topbar {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid #ffffff1a;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--color-text);
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
}

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

.brand small {
  display: block;
  font: 9px/1.5 ui-monospace, monospace;
  color: var(--color-muted);
  letter-spacing: .17em;
}

.progress-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font: 11px ui-monospace, monospace;
  color: var(--color-muted);
}

.progress-track {
  width: 120px;
  height: 3px;
  background: #ffffff22;
}

.progress-track span {
  height: 100%;
  display: block;
  width: 10%;
  background: var(--color-accent);
  transition: width .2s;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 11px 17px;
  border: 1px solid var(--color-accent);
  border-radius: 7px;
  background: var(--color-accent);
  color: #102638;
  font-weight: 750;
  cursor: pointer;
}

.button:hover {
  filter: brightness(1.07);
}

.button-quiet,
.button-secondary {
  background: transparent;
  border-color: #5b7381;
  color: var(--color-text);
}

[hidden] {
  display: none !important;
}

.step-nav {
  padding: 35px 0 22px;
  border-right: 1px solid #ffffff17;
}

.eyebrow {
  margin: 0;
  color: var(--color-accent);
  font: 10px ui-monospace, monospace;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.step-nav ol {
  list-style: none;
  padding: 0;
  margin: 22px 0;
  display: grid;
  gap: 5px;
}

.step-nav button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  text-align: left;
  background: transparent;
  color: #a9c0cd;
  font-size: 12px;
  cursor: pointer;
}

.step-nav button[aria-current=step] {
  background: #ffffff0c;
  color: var(--color-text);
}

.step-nav button:disabled {
  cursor: default;
  opacity: .55;
}

.step-number {
  width: 23px;
  height: 23px;
  border: 1px solid #526772;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 10px ui-monospace, monospace;
  flex: none;
}

.step-nav button[aria-current=step] .step-number {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #10262b;
}

.side-note {
  max-width: 160px;
  margin: 20px 12px;
  color: #a9c0cd;
  font-size: 11px;
  line-height: 1.6;
}

main {
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 42px 0;
}

.screen {
  width: 100%;
  max-width: 900px;
  margin: auto;
  animation: enter .2s ease;
}

@keyframes enter {
  from {
    opacity: .45;
    transform: translateY(4px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

.kicker {
  font: 10px ui-monospace, monospace;
  color: var(--color-accent);
  letter-spacing: .18em;
  text-transform: uppercase;
}

.title {
  margin: 11px 0 14px;
  font: clamp(2.2rem, 5.5vw, 3.9rem)/1.03 var(--font-display);
  font-weight: 500;
  letter-spacing: -.035em;
}

.lead {
  max-width: 680px;
  color: #c7d6e3;
  font-size: 15px;
  line-height: 1.65;
}

.panel {
  background: linear-gradient(165deg, #203c50, #0b1e2d 70%);
  border: 1px solid #526772;
  border-radius: 15px;
  box-shadow: 0 20px 60px #0003;
}

.screen-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.micro {
  font: 10px ui-monospace, monospace;
  color: var(--color-muted);
  letter-spacing: .08em;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--color-accent);
  font: 10px ui-monospace, monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.tag:before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--color-accent);
  border-radius: 50%;
}

.footer {
  width: min(100%, var(--content-width));
  min-height: 46px;
  margin: 0 auto;
  border-top: 1px solid #ffffff19;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #809492;
  font: 9px ui-monospace, monospace;
  letter-spacing: .13em;
}

.phone-card,
.chat-box,
.call-card,
.riddle-panel,
.radio-panel,
.finish-card {
  padding: clamp(18px, 3vw, 28px);
}

.phone-card {
  max-width: 580px;
  margin: 22px auto 0;
  background: linear-gradient(165deg, #203c50, #0b1e2d 70%);
  border: 1px solid #526772;
  border-radius: 20px;
}

.phone-bar {
  display: flex;
  justify-content: space-between;
  padding: 0 4px 13px;
  color: var(--color-muted);
  font: 10px ui-monospace, monospace;
}

.mail-subject {
  padding: 17px;
  background: #f4f3ee;
  color: #24343d;
  border-radius: 10px;
}

.mail-subject h2 {
  font: 18px var(--font-body);
}

.mail-subject p {
  font: 14px/1.7 var(--font-display);
}

.chat-stream {
  max-height: 55vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px 0;
}

.bubble {
  max-width: 90%;
  padding: 11px 14px;
  background: var(--color-blue);
  border: 1px solid #ffffff15;
  border-radius: 13px 13px 13px 4px;
  color: #edf2ec;
  font-size: 13px;
  line-height: 1.55;
}

.bubble .sender {
  display: block;
  margin-bottom: 5px;
  color: var(--color-accent);
  font: 9px ui-monospace, monospace;
  letter-spacing: .1em;
}

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

.inventory-item {
  min-width: 0;
  padding: 0;
  text-align: left;
  background: #0b1e2d;
  border: 1px solid #526772;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
}

.inventory-item[aria-pressed=true] {
  border-color: var(--color-accent);
}

.inventory-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.inventory-item strong,
.inventory-item small {
  display: block;
  padding: 0 10px;
}

.inventory-item strong {
  font-size: 12px;
  margin: 10px 0 4px;
}

.inventory-item small {
  font-size: 10px;
  color: var(--color-muted);
  margin-bottom: 11px;
}

.item-detail {
  display: grid;
  grid-template-columns: .7fr 1.3fr;
  gap: 14px;
  align-items: center;
  margin-top: 14px;
  padding: 15px;
  background: #0b1e2d;
  border-left: 3px solid var(--color-gold);
  line-height: 1.6;
}

.item-detail img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

.signal-canvas {
  width: 100%;
  height: auto;
  background: #020b10;
  border: 1px solid #537078;
  border-radius: 10px;
}

.knob-row {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin: 18px 0;
}

.knob {
  width: 62px;
  height: 62px;
  border: 4px solid #789096;
  border-radius: 50%;
  background: repeating-conic-gradient(#50666d 0 10deg, #83979a 10deg 20deg);
  cursor: pointer;
}

.knob-count {
  font: 20px ui-monospace, monospace;
  text-align: center;
  margin-top: 5px;
}

.knob-label {
  text-align: center;
  color: var(--color-muted);
  font-size: 10px;
}

.hack-layout,
.map-layout,
.riddle-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: center;
}

.hack-video {
  display: block;
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 10px;
}

.call-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid #ffffff1a;
}

.call-profile img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
}

.call-lines {
  min-height: 100px;
  padding: 14px 0;
  line-height: 1.6;
}

.choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-list button {
  font-size: 12px;
}

.map-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 400px;
  padding: 8px;
  background: #f4f3ee;
  border-radius: 11px;
}

.map-stage img {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
}

.map-pin {
  position: absolute;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 3px solid #f4f3ee;
  border-radius: 50%;
  background: #2c7be5;
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.map-pin[aria-pressed=true] {
  background: var(--color-teal);
}

.map-detail {
  padding: 18px;
}

.map-detail img {
  width: 100%;
  height: 155px;
  object-fit: cover;
  border-radius: 8px;
  margin: 13px 0;
}

.compass-image {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  transition: transform .25s;
}

.route-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.route-card {
  padding: 10px;
  background: #0b1e2d;
  border: 1px solid #ffffff18;
  border-radius: 8px;
}

.route-card img {
  width: 54px;
  height: 42px;
  object-fit: cover;
  float: right;
}

.finish-card {
  text-align: center;
}

.finish-mark {
  font-size: 48px;
  color: var(--color-accent);
}

@media(max-width:850px) {
  .app-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .step-nav {
    padding: 10px 0;
    border-right: 0;
    border-bottom: 1px solid #ffffff18;
  }

  .step-nav .eyebrow,
  .side-note {
    display: none;
  }

  .step-nav ol {
    display: flex;
    overflow: auto;
    gap: 5px;
    margin: 0;
    padding-bottom: 5px;
  }

  .step-nav li {
    flex: none;
  }

  .step-nav button {
    width: auto;
    padding: 5px;
  }

  .step-name {
    display: none;
  }

  .step-number {
    width: 29px;
    height: 29px;
  }

  main {
    flex: 1;
    padding: 28px 0;
  }

}

@media(max-width:600px) {
  .app-shell {
    padding-inline: max(14px, env(safe-area-inset-left));
  }

  .topbar {
    min-height: 66px;
    gap: 8px;
  }

  .brand {
    font-size: 9px;
    letter-spacing: .1em;
  }

  .brand img {
    width: 31px;
    height: 31px;
  }

  .progress-meta {
    gap: 7px;
    font-size: 9px;
  }

  .progress-track {
    width: 52px;
  }

  .button-quiet {
    font-size: 11px;
    padding: 7px;
  }

  .title {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .lead {
    font-size: 14px;
  }

  .hack-layout,
  .map-layout,
  .riddle-layout {
    grid-template-columns: 1fr;
  }

  .inventory-grid {
    gap: 7px;
  }

  .inventory-item img {
    height: 95px;
  }

  .item-detail {
    grid-template-columns: 1fr;
  }

  .map-stage {
    min-height: 300px;
  }

  .map-stage img {
    max-height: 380px;
  }

  .footer {
    font-size: 8px;
    letter-spacing: .08em;
  }

  .screen-actions>* {
    flex: 1;
  }

}

@media(prefers-reduced-motion:reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }

}

.attachment-button {
  display: flex;
  flex-direction: column;
  align-self: flex-start;
  gap: 4px;
  max-width: 90%;
  padding: 11px 14px;
  background: #0b1e2d;
  border: 1px solid #526772;
  border-radius: 10px;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
}

.attachment-button small {
  color: var(--color-muted);
  font-size: 10px;
}

.book-thumb {
  height: 95px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #d0b276, #705537);
  color: #0b0b0b;
  font: 700 24px Georgia, serif;
}

.book-object {
  min-height: 150px;
  padding: 18px;
  background: #f4f3ee;
  color: #24343d;
  font: italic 14px/1.6 Georgia, serif;
}

.compass-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.small-chat {
  max-height: 260px;
}

.call-card {
  max-width: 700px;
  margin: 20px auto;
}

.call-lines p {
  margin: 5px 0;
}

.surface {
  padding: clamp(16px, 2.5vw, 24px);
}

.map-detail h2 {
  font: 28px var(--font-display);
  margin: 9px 0;
}

.riddle-panel p,
.map-detail p,
.finish-card p {
  line-height: 1.65;
}

.intrusion-card {
  margin: 4px 0 14px;
  padding: 13px;
  border: 1px solid #b93b46;
  border-radius: 8px;
  background: #0b1e2d;
}

.intrusion-card img {
  float: right;
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 50%;
}

.intrusion-card p {
  color: #ef938c;
  font-weight: 700;
}

.intrusion-card pre {
  overflow: auto;
  margin: 8px 0 0;
  color: #9adbb4;
  font: 10px/1.65 ui-monospace, monospace;
  white-space: pre-wrap;
}

.boot-message {
  max-width: 650px;
  margin: auto;
  padding: 20px;
}

.boot-message code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #0b1e2d;
  color: var(--color-accent);
  font-family: ui-monospace, monospace;
  font-size: .9em;
}

.wanny-call {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #ffffff22;
}

.wanny-call .call-profile img {
  width: 58px;
  height: 58px;
}

.wanny-call .call-lines {
  min-height: 48px;
  padding: 10px 0;
}

.wanny-call .call-lines p {
  margin: 4px 0;
}

.wanny-call .choice-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.wanny-call .choice-list button {
  justify-content: flex-start;
  text-align: left;
  line-height: 1.45;
}

.knob:disabled {
  opacity: .6;
  cursor: default;
}

.message.sos-message {
  width: 320px;
  max-width: 90%;
  padding: 12px;
  background: #351b24;
  border: 1px solid #e76570;
  border-left: 4px solid #ff6575;
}

.sos-heading {
  color: #ff9ca6;
  font-size: 12px;
  font-weight: 750;
}

.sos-filename {
  margin: 6px 0 10px;
  font-size: 12px;
}

.sos-message audio {
  display: block;
  width: 100%;
  height: 44px;
}

.sos-status {
  margin-top: 8px;
  color: #f4bdc4;
  font-size: 11px;
}

.message {
  position: relative;
  align-self: flex-start;
  width: fit-content;
  max-width: 80%;
  margin-right: auto;
  padding: 7px 38px 7px 9px;
  border: 1px solid rgba(128, 190, 218, 0.16);
  border-radius: 13px;
  border-top-left-radius: 5px;
  background: #20465d;
  color: #f4f7f8;
  font-size: 14px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.message.from-user {
  align-self: flex-end;
  margin-left: auto;
  margin-right: 0;
  border-color: rgba(115, 218, 201, 0.15);
  border-top-left-radius: 13px;
  border-top-right-radius: 5px;
  background: #145f68;
}

.message-text {
  overflow-wrap: anywhere;
}

.message-time {
  position: absolute;
  right: 7px;
  bottom: 5px;
  color: rgba(235, 244, 247, 0.68);
  font-size: 9px;
  line-height: 1;
}

.typing {
  display: flex;
  align-self: flex-start;
  gap: 4px;
  padding: 8px 11px;
  border-radius: 12px;
  border-top-left-radius: 5px;
  background: #20465d;
}

.typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  animation: chat-blink 1.2s infinite;
}

.typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes chat-blink {

  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.topbar,
.app-layout,
.footer {
  width: min(100%, 1460px);
}

.app-layout {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  display: grid;
  flex: 1;
  grid-template-columns: 205px minmax(0, 1fr);
  gap: 24px;
}

#screen {
  display: flex;
  align-items: center;
  padding: 24px 0;
}

#screen>.screen {
  width: min(100%, 500px);
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: auto;
}

.phone-stage-heading,
.step-context,
.screen-actions-outside {
  width: min(100%, 418px);
}

.phone-stage-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.phone-stage-heading .eyebrow {
  font-size: 9px;
  white-space: nowrap;
}

.phone-stage-caption {
  color: var(--color-muted);
  font: 8px ui-monospace, monospace;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.step-context .title {
  margin: 8px 0 10px;
  font-size: clamp(2rem, 3.2vw, 2.7rem);
}

.step-context .lead {
  margin: 0;
  font-size: 14px;
}

.phone-shell {
  width: 418px;
  height: min(650px, calc(100dvh - 360px));
  min-height: 360px;
  display: flex;
  flex-direction: column;
  padding: 8px 12px 12px;
  border: 1px solid #789098;
  border-radius: 38px;
  background: linear-gradient(145deg, #263c48, #09151d 70%);
  box-shadow: 0 22px 50px #0007, inset 0 0 0 2px #ffffff08;
}

.phone-earpiece {
  height: 28px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-earpiece span {
  width: 43px;
  height: 4px;
  border-radius: 10px;
  background: #70818a;
}

.phone-app>.chat-box,
.phone-app>.radio-panel {
  min-height: 100%;
  padding: 16px 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.phone-app>.chat-box {
  display: flex;
  flex-direction: column;
}

.phone-app .chat-stream {
  flex: 1;
  max-height: none;
  min-height: 0;
  overflow-y: auto;
}

.phone-app .hack-layout,
.phone-app .map-layout,
.phone-app .riddle-layout {
  grid-template-columns: minmax(0, 1fr);
}

.phone-app .inventory-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.phone-app .item-detail {
  grid-template-columns: 1fr;
}

.phone-home-indicator {
  width: 72px;
  height: 4px;
  flex: none;
  margin: 10px auto 0;
  border-radius: 8px;
  background: #aabbb9;
}

.screen-actions-outside {
  justify-content: flex-start;
  margin-top: 0;
}

@media (max-width: 1200px) {

  .topbar,
  .app-layout,
  .footer {
    width: min(100%, 1200px);
  }

  .app-layout {
    grid-template-columns: 205px minmax(0, 1fr);
    gap: 24px;
  }

  #screen>.screen {
    width: min(100%, 500px);
  }

  .phone-shell {
    width: min(418px, 100%);
  }

}

@media (min-width: 851px) {
  #screen>.screen {
    width: min(100%, 1120px);
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(440px, 1.2fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: ". phone-heading"
      "context phone"
      "actions phone";
    align-items: center;
    justify-items: stretch;
    gap: 18px 42px;
  }

  .phone-stage-heading {
    grid-area: phone-heading;
    width: 100%;
  }

  .step-context {
    grid-area: context;
    width: 100%;
    align-self: end;
  }

  .screen-actions-outside {
    grid-area: actions;
    width: 100%;
    align-self: start;
  }

  .phone-shell {
    grid-area: phone;
    justify-self: center;
    width: min(100%, 400px);
    height: min(760px, calc(100dvh - 230px));
    min-height: 520px;
  }

}

@media (min-width: 851px) and (max-width: 1200px) {
  #screen>.screen {
    grid-template-columns: minmax(220px, 0.8fr) minmax(390px, 1.2fr);
    gap: 18px 24px;
  }

  .phone-shell {
    width: min(100%, 430px);
  }

}

.phone-app-hackers {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.phone-app-hackers>.hacker-chat-panel {
  flex: 1;
  height: 100%;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0;
}

.phone-app-hackers>.hacker-chat-panel .hacker-chat-stream {
  flex: 1;
  max-height: none;
}

.phone-app-hackers .hacker-code-card {
  top: 8%;
  right: 4%;
  bottom: 8%;
  left: 4%;
  width: auto;
  max-height: none;
}

.amundsen-incoming-call {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  border-radius: 14px;
  color: #fff;
  background: radial-gradient(circle at 50% 15%, #123b63, #020812 78%);
  text-align: center;
}

.amundsen-caller-photo {
  position: relative;
  width: 158px;
  height: 158px;
  margin: 0 auto 24px;
  border: 4px solid rgba(125, 211, 252, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 0 8px rgba(37, 211, 102, 0.12);
  animation: amundsen-ring-pulse 1.2s infinite;
}

.amundsen-caller-photo::after {
  position: absolute;
  inset: -12px;
  border: 2px solid rgba(37, 211, 102, 0.3);
  border-radius: 50%;
  content: "";
  animation: amundsen-ring-wave 2s infinite;
  pointer-events: none;
}

.amundsen-incoming-label {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.amundsen-incoming-call h2 {
  margin: 0;
  color: #fff;
  font: 600 clamp(27px, 7vw, 36px)/1.15 var(--font-body);
}

.amundsen-caller-subtitle {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
}

.amundsen-call-status {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  color: #d9fdd3;
  font: 11px ui-monospace, monospace;
  letter-spacing: 0.12em;
}

.amundsen-call-dots {
  display: inline-flex;
  gap: 5px;
}

.amundsen-call-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d9fdd3;
  animation: amundsen-waiting-dot 1.2s infinite;
}

.amundsen-call-dots i:nth-child(2) {
  animation-delay: 0.2s;
}

.amundsen-call-dots i:nth-child(3) {
  animation-delay: 0.4s;
}

.amundsen-call-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 42px;
  margin-top: 24px;
}

.amundsen-call-button {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.amundsen-call-button:hover {
  transform: scale(1.08);
  filter: brightness(1.08);
}

.amundsen-call-button:active {
  transform: scale(0.94);
}

.amundsen-call-button svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.amundsen-call-button.decline-call {
  background: #e63946;
}

.amundsen-call-button.decline-call svg {
  transform: rotate(135deg);
}

.amundsen-call-button.accept-call {
  background: #22c55e;
  animation: amundsen-accept-pulse 1.4s infinite;
}

.amundsen-call-hint {
  max-width: 260px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  line-height: 1.5;
}

.amundsen-conversation {
  width: 100%;
  max-width: none;
  min-height: 100%;
  margin: 0;
}

.phone-viewport {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #000;
  border-radius: 25px;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
}

.phone-app {
  padding: 18px 16px 24px;
  width: 100%;
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.phone-app>.amundsen-incoming-call,
.phone-app>.amundsen-connected-call {
  flex: 1;
  min-height: 0;
}

.amundsen-call-duration {
  color: rgba(255, 255, 255, 0.64);
  font: 9px ui-monospace, monospace;
  letter-spacing: 0.1em;
}

.amundsen-control-button {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 24px;
  background: rgba(9, 22, 35, 0.9);
  color: #fff;
  cursor: pointer;
}

.amundsen-control-button:disabled {
  opacity: 0.5;
  cursor: default;
}

@keyframes amundsen-ring-pulse {
  50% {
    box-shadow:
      0 0 0 14px rgba(37, 211, 102, 0.18),
      0 15px 38px rgba(0, 0, 0, 0.4);
  }
}

@keyframes amundsen-ring-wave {
  0% {
    transform: scale(0.92);
    opacity: 0.8;
  }

  100% {
    transform: scale(1.2);
    opacity: 0;
  }
}

@keyframes amundsen-waiting-dot {

  0%,
  60%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@keyframes amundsen-accept-pulse {

  0%,
  100% {
    box-shadow:
      0 10px 24px rgba(0, 0, 0, 0.3),
      0 0 0 0 rgba(34, 197, 94, 0.45);
  }

  50% {
    box-shadow:
      0 10px 24px rgba(0, 0, 0, 0.3),
      0 0 0 12px rgba(34, 197, 94, 0);
  }
}

.amundsen-connected-heading h2 {
  margin: 0;
  color: #f5f7f8;
  font: 700 clamp(28px, 8vw, 42px)/1.1 var(--font-body);
}

.amundsen-speaking-photo::after {
  position: absolute;
  inset: -13px;
  border: 2px solid rgba(34, 197, 121, 0.28);
  border-radius: 50%;
  content: "";
  opacity: 0;
  pointer-events: none;
}

.amundsen-speaking-photo.is-speaking {
  animation: amundsen-ring-pulse 1.2s infinite;
}

.amundsen-speaking-photo.is-speaking::after {
  animation: amundsen-ring-wave 2s infinite;
}

.amundsen-speaking-photo img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.amundsen-call-visual {
  width: 100%;
  min-height: 54px;
  flex: 0 0 auto;
  margin-bottom: 16px;
  border-radius: 16px;
  background: rgba(237, 199, 121, 0.08);
}

@media (max-width: 850px) {
  .app-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  #screen {
    display: block;
    padding: 24px 0;
  }

  .phone-shell {
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .phone-earpiece,
  .phone-home-indicator {
    display: none;
  }

  .phone-viewport {
    height: auto;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .screen-actions-outside {
    width: 100%;
  }

  .screen-actions-outside>* {
    flex: 1;
  }

  #screen>.screen {
    width: min(100%, 500px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .step-context,
  .screen-actions-outside {
    width: min(100%, 418px);
  }

  .phone-app-hackers {
    height: auto;
  }

  .phone-app-hackers>.hacker-chat-panel {
    height: auto;
    min-height: 60dvh;
  }

  .amundsen-caller-photo {
    width: 138px;
    height: 138px;
  }

  .amundsen-call-actions {
    gap: 28px;
  }

  .amundsen-call-button {
    width: 58px;
    height: 58px;
  }

  .phone-app {
    padding: 14px 0;
    height: auto;
    min-height: calc(100dvh - 300px);
  }

  .phone-app>.amundsen-incoming-call,
  .phone-app>.amundsen-connected-call {
    min-height: calc(100dvh - 300px);
  }

  .amundsen-incoming-call {
    min-height: min(560px, calc(100dvh - 220px));
    height: auto;
  }

  .phone-app>.amundsen-connected-call {
    min-height: calc(100dvh - 300px);
  }

}

.amundsen-caller-photo,
.amundsen-speaking-photo {
  box-sizing: border-box;
  width: min(46%, 188px, 22dvh);
  height: auto;
  aspect-ratio: 1 / 1;
  flex: 0 0 auto;
}

.amundsen-caller-photo img,
.amundsen-speaking-photo img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.amundsen-connected-call {
  flex-direction: column;
  overflow-y: auto;
  border: 1px solid rgba(170, 187, 185, 0.2);
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
  padding: 18px 20px 20px;
  border-radius: 22px;
  color: #eaf0e8;
  background: linear-gradient(160deg, #102d4b, #0b2036);
  text-align: center;
}

.amundsen-connected-heading {
  justify-content: space-between;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.amundsen-connected-heading p {
  margin: 0;
  color: #aabbb9;
  font: 15px/1.4 var(--font-body);
}

.amundsen-speaking-photo {
  box-sizing: border-box;
  position: relative;
  flex: 0 0 auto;
  border: 5px solid #22c579;
  border-radius: 50%;
  box-shadow: 0 0 0 8px rgba(34, 197, 121, 0.12);
  justify-self: center;
  margin: 18px auto;
  width: min(46%, 188px, 22dvh);
  height: auto;
  aspect-ratio: 1 / 1;
}

.amundsen-call-messages {
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  overflow-y: auto;
  padding: 4px 0;
}

.amundsen-subtitle {
  box-sizing: border-box;
  width: 100%;
  min-height: 72px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid rgba(237, 199, 121, 0.16);
  border-radius: 16px;
  background: rgba(237, 199, 121, 0.08);
  color: #eaf0e8;
  font: 600 15px/1.45 var(--font-body);
}

.amundsen-response-choices {
  width: 100%;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.amundsen-response-choices button {
  width: 96%;
  min-height: 0;
  justify-self: center;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.3;
}

.amundsen-connected-controls {
  gap: 12px;
  margin-top: auto;
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 0;
  padding-top: clamp(20px, 3dvh, 32px);
}

.amundsen-control-button.hangup {
  border-color: #e2636d;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #e63946;
  color: #fff;
  cursor: pointer;
  transform: none;
  animation: none;
}

.amundsen-control-button.hangup svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
  transform: rotate(135deg);
}

.amundsen-map-intro {
  flex: 0 0 auto;
  padding: 4px 5px;
}

.amundsen-map-intro h2 {
  margin: 0 0 5px;
  color: #34291f;
  font: 700 20px/1.2 Georgia, "Times New Roman", serif;
}

.amundsen-map-intro p {
  margin: 0;
  color: #6c5238;
  font: italic 13px/1.4 Georgia, "Times New Roman", serif;
}

.amundsen-map-viewer {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 220px;
  max-height: 43dvh;
  aspect-ratio: 2142 / 2201;
  overflow: hidden;
  border: 1px solid #9b8057;
  border-radius: 8px;
  background: #d8d4c5;
}

.amundsen-map-world {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transform-origin: top left;
  transition: transform 520ms ease;
}

.amundsen-atlas-image,
.amundsen-route-overlay {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.amundsen-route-overlay {
  z-index: 1;
  pointer-events: none;
}

.amundsen-map-pin {
  position: absolute;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #34291f;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.amundsen-map-pin>span:first-child {
  font-size: 23px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px #fff);
}

.amundsen-pin-label {
  padding: 2px 5px;
  border-radius: 4px;
  background: #f4e9ce;
  font: 700 10px/1.2 Georgia, "Times New Roman", serif;
}

.amundsen-map-pin:hover .amundsen-pin-label,
.amundsen-map-pin:focus-visible .amundsen-pin-label {
  outline: 2px solid #824132;
}

.amundsen-map-return {
  position: absolute;
  z-index: 4;
  top: 8px;
  left: 8px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #a38b66;
  border-radius: 18px;
  background: #f6ebd2;
  color: #34291f;
  font: 700 12px Georgia, "Times New Roman", serif;
  cursor: pointer;
}

.amundsen-map-notes {
  box-sizing: border-box;
  flex: 0 0 178px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 7px 5px 3px;
  border-top: 1px solid #ad9671;
  color: #34291f;
}

.amundsen-map-hint {
  flex: 0 0 auto;
  margin: 0 0 5px;
  color: #6c5238;
  text-align: center;
  font: italic 11px/1.35 Georgia, "Times New Roman", serif;
}

.amundsen-map-timeline::-webkit-scrollbar {
  display: none;
}

.amundsen-map-timeline button::before {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #ad9671;
  content: "";
}

.amundsen-map-timeline button:first-child::before {
  left: 50%;
}

.amundsen-map-timeline button:last-child::before {
  right: 50%;
}

.amundsen-map-timeline button span {
  position: relative;
  width: 10px;
  height: 10px;
  border: 1px solid #775334;
  border-radius: 50%;
  background: #f4e9ce;
}

.amundsen-map-timeline button[aria-pressed="true"] span {
  width: 14px;
  height: 14px;
  border-color: #824132;
  background: #824132;
}

.amundsen-map-entry {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 0 5px;
  text-align: center;
}

.amundsen-map-entry h3 {
  margin: 0;
  color: #34291f;
  font: 700 16px/1.25 Georgia, "Times New Roman", serif;
}

.amundsen-map-entry p {
  margin: 4px 0 0;
  color: #34291f;
  font: 13px/1.4 Georgia, "Times New Roman", serif;
}

@media (prefers-reduced-motion: reduce) {
  .typing span {
    animation: none;
    opacity: 0.7;
  }

  .amundsen-caller-photo,
  .amundsen-caller-photo::after,
  .amundsen-call-dots i,
  .amundsen-call-button.accept-call {
    animation: none;
  }

  .amundsen-speaking-photo,
  .amundsen-speaking-photo::after {
    animation: none;
  }

  .amundsen-map-world {
    transition: none;
  }

}

.phone-app>.amundsen-map-ui {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: Georgia, "Times New Roman", serif;
  box-sizing: border-box;
  padding: clamp(14px, 3vw, 24px);
  border: 1px solid #9b8057;
  border-radius: 12px;
  color: #34291f;
  background: radial-gradient(circle at 30% 15%, rgba(125, 91, 44, 0.12), transparent 30%),
    linear-gradient(135deg, #e9d8ad, #cfb77e);
  box-shadow: inset 0 0 40px rgba(75, 47, 18, 0.18),
    0 12px 28px rgba(0, 0, 0, 0.25);
}

.amundsen-map-timeline {
  flex: 0 0 38px;
  display: flex;
  width: 100%;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  justify-content: center;
  overflow-x: hidden;
  padding-inline: 0;
  touch-action: pan-y;
}

.amundsen-map-timeline button {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  scroll-snap-align: center;
  cursor: pointer;
  flex: 0 0 40px;
}

@media (max-width: 600px) {
  .phone-app:has(> .amundsen-map-ui) {
    height: 100%;
    min-height: 100%;
    padding: 0;
  }

  .phone-app>.amundsen-map-ui {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    padding: 10px;
  }

  .amundsen-map-intro p {
    font-size: 12px;
    line-height: 1.3;
  }

  .amundsen-map-viewer {
    flex: 1 1 auto;
    min-height: clamp(250px, 40dvh, 340px);
    max-height: none;
  }

  .amundsen-map-notes {
    flex-basis: 168px;
    flex: 0 0 145px;
  }

}

.amundsen-map-viewer {
  background-color: #A9B5A1;
}

/* Let the map page grow naturally and scroll inside the phone screen. */
/* Keep the phone viewport fixed and scroll its contents. */
.phone-viewport:has(.amundsen-map-ui) {
  height: 100%;
  min-height: 0;
  overflow-y: auto !important;
}

.phone-app:has(> .amundsen-map-ui) {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  padding: 0;
}

/* Stretch the parchment to fill the phone, leaving spare space as paper. */
.phone-app>.amundsen-map-ui {
  box-sizing: border-box;
  width: 100%;
  height: auto;
  min-height: 100%;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  padding: 16px;
  background:
    radial-gradient(circle at 30% 15%, rgba(125, 91, 44, 0.12), transparent 30%),
    linear-gradient(135deg, #e9d8ad, #cfb77e);
}

/* Keep the atlas full-width and at its existing proportions. */
.amundsen-map-viewer {
  width: 100%;
  height: auto;
  flex: 0 0 auto;
  aspect-ratio: 2142 / 2201;
  min-height: 0;
  max-height: none;
}

.amundsen-map-notes,
.amundsen-map-entry {
  flex: 0 0 auto;
  overflow: visible;
  background: transparent;
}

.amundsen-map-return {
  width: 38px;
  height: 38px;
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  font-size: 22px;
}

/* Amundsen expedition riddle */
.expedition-riddle {
  width: min(100%, 680px);
  margin: 18px auto 0;
  padding: clamp(14px, 3vw, 24px);
  color: #34291f;
  background: linear-gradient(145deg, #f3e7c9, #d8c18c 78%, #c7ad73);
  border: 1px solid #9b8057;
  border-radius: 12px;
  box-shadow: 0 14px 36px #0003, inset 0 0 24px #fff5d4;
}

.expedition-riddle-heading .tag {
  color: #775334;
}

.expedition-riddle-heading .tag::before {
  background: #824132;
}

.expedition-riddle-heading p,
.expedition-order-instruction {
  margin: 8px 0 14px;
  color: #5f4630;
  font: italic 14px/1.5 var(--font-display);
}

.expedition-sort-list {
  display: grid;
  gap: 9px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.expedition-sort-card,
.expedition-riddle-card {
  display: grid;
  grid-template-columns: 34px 24px 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-height: 160px;
  padding: 8px;
  color: #34291f;
  background: linear-gradient(135deg, #f5e9cb, #e2cf9f);
  border: 1px solid #ae9362;
  border-radius: 9px;
  box-shadow: 0 3px 7px #4b38221c, inset 0 1px #fff9e8;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.expedition-sort-card.is-dragging,
.expedition-riddle-card.is-dragging {
  position: relative;
  z-index: 2;
  opacity: 0.68;
  border-color: #824132;
  transform: scale(0.985);
  box-shadow: 0 8px 20px #4b382244;
}

.expedition-drag-handle {
  width: 34px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #775334;
  background: #e6d3a8;
  border: 1px solid #b49a6b;
  border-radius: 6px;
  font-size: 20px;
  cursor: grab;
  touch-action: none;
}

.expedition-drag-handle:active {
  cursor: grabbing;
}

.expedition-position,
.expedition-order {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #f3e7c9;
  background: #824132;
  border-radius: 50%;
  font: 11px ui-monospace, monospace;
}

.expedition-sort-card>img,
.expedition-riddle-card>img {
  width: 52px;
  height: 48px;
  object-fit: cover;
  border: 1px solid #9b8057;
  border-radius: 5px;
}

.expedition-sort-details,
.expedition-card-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.expedition-sort-details strong,
.expedition-card-copy strong {
  color: #34291f;
  font: 700 14px/1.2 var(--font-display);
}

.expedition-sort-details span,
.expedition-sort-details small,
.expedition-card-copy span,
.expedition-card-copy small {
  color: #775e41;
  font: 11px/1.35 var(--font-body);
}

.expedition-move-controls {
  display: grid;
  gap: 4px;
}

.expedition-move-controls button {
  width: 30px;
  height: 28px;
  border: 1px solid #aa8d5c;
  border-radius: 5px;
  background: #f6eccf;
  color: #34291f;
  cursor: pointer;
}

.expedition-code {
  display: flex;
  gap: 3px;
  padding: 5px 7px;
  color: #34291f;
  background: #f6eccf;
  border: 1px solid #aa8d5c;
  border-radius: 5px;
  box-shadow: inset 0 1px 4px #5c48231a;
  font: 700 17px/1 ui-monospace, monospace;
  letter-spacing: 0.06em;
}

.expedition-code i {
  font-style: normal;
}

/* Cards collapse after the correct order is set. */
.expedition-sort-list.is-solved {
  gap: 0;
}

.expedition-sort-list.is-solved .expedition-sort-card,
.expedition-sort-list.is-solved .expedition-riddle-card {
  overflow: hidden;
  pointer-events: none;
  animation: expeditionCardsClear 0.42s ease-in forwards;
}

@keyframes expeditionCardsClear {
  to {
    max-height: 0;
    min-height: 0;
    margin-block: 0;
    padding-block: 0;
    border-block-width: 0;
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
}

/* Coordinate reveal */
.coordinate-area {
  min-height: 98px;
  margin-top: 14px;
  padding: 12px 10px 8px;
  text-align: center;
  border-top: 1px solid #a99062;
}

.coordinate-result {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.coordinate-label {
  flex-basis: 100%;
  color: #775334;
  font: 9px ui-monospace, monospace;
  letter-spacing: 0.13em;
}

.coordinate-result strong {
  display: inline-flex;
  align-items: baseline;
  color: #34291f;
  font: 700 24px/1.25 ui-monospace, monospace;
}

.coordinate-result strong i {
  padding: 0 1px;
  font-style: normal;
}

.coordinate-result strong>span:last-child {
  margin-left: 4px;
  color: #824132;
  font: 700 13px var(--font-body);
}

.coordinate-result>b {
  color: #824132;
  font-size: 19px;
}

.coordinate-digit {
  display: inline-block;
  animation: coordinateDigitIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(1000ms + var(--digit-index) * 110ms);
}

@keyframes coordinateDigitIn {
  from {
    opacity: 0;
    transform: translateY(-14px) rotateX(70deg);
  }

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

.coordinate-hidden {
  color: #775e41;
  font: italic 13px var(--font-display);
}

.riddle-feedback,
.expedition-riddle-feedback {
  min-height: 22px;
  margin: 7px 0 0;
  color: #775e41;
  font: italic 12px/1.4 var(--font-display);
}

.expedition-riddle-feedback.is-correct {
  color: #45633f;
}

.expedition-riddle-feedback.is-wrong {
  color: #824132;
}

@media (max-width: 420px) {

  .expedition-sort-card,
  .expedition-riddle-card {
    grid-template-columns: 30px 20px 40px minmax(0, 1fr) auto;
    gap: 6px;
    padding: 7px;
  }

  .expedition-drag-handle {
    width: 30px;
    height: 36px;
  }

  .expedition-position,
  .expedition-order {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }

  .expedition-sort-card>img,
  .expedition-riddle-card>img {
    width: 40px;
    height: 40px;
  }

  .expedition-sort-details strong,
  .expedition-card-copy strong {
    font-size: 12px;
  }

  .expedition-sort-details span,
  .expedition-sort-details small,
  .expedition-card-copy span,
  .expedition-card-copy small {
    font-size: 9px;
  }

  .expedition-code {
    gap: 2px;
    padding: 5px;
    font-size: 14px;
  }

  .coordinate-result strong {
    font-size: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .coordinate-digit {
    animation: none;
  }

  .expedition-sort-list.is-solved .expedition-sort-card,
  .expedition-sort-list.is-solved .expedition-riddle-card {
    animation-duration: 1ms;
  }

  .expedition-sort-card,
  .expedition-riddle-card {
    transition: none;
  }
}

.mission-success,
.mission-map-screen {
  padding: clamp(18px, 4vw, 28px);
  color: var(--color-text);
  background: #0b2940;
  border: 1px solid #34566b;
  border-radius: 18px;
}

.mission-success {
  text-align: center;
}

.mission-success-check {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
  color: #70f0d0;
  border: 2px solid #00b894;
  border-radius: 50%;
  font-size: 48px;
}

.mission-success h2 {
  margin: 0 0 28px;
  font: 800 clamp(1.8rem, 7vw, 2.7rem)/1.1 var(--font-body);
}

.mission-discovery {
  display: grid;
  gap: 10px;
  padding: 20px 12px;
  background: #0a3c4b;
  border: 1px solid #087f79;
  border-radius: 14px;
}

.mission-discovery span,
.mission-progress-label,
.mission-destination-label {
  color: #91b7c7;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.mission-discovery strong {
  color: #70f0d0;
  font-size: 24px;
}

.mission-progress-label {
  margin: 30px 0 10px;
}

.mission-progress-track {
  height: 10px;
  overflow: hidden;
  background: #29485c;
  border-radius: 999px;
}

.mission-progress-track span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #00b894, #52c8d8);
  border-radius: inherit;
}

.mission-destination {
  display: grid;
  gap: 12px;
  margin-top: 30px;
  padding: 22px 12px;
  background: #17374f;
  border: 1px solid #34566b;
  border-radius: 16px;
}

.mission-destination strong {
  font-size: clamp(16px, 4.5vw, 22px);
}

.mission-destination>span:last-child {
  color: #c5d8e5;
  font-size: 17px;
  font-weight: 700;
}

.mission-instruction {
  margin: 28px 0 18px;
  color: #c5d8e5;
  font-size: 16px;
  line-height: 1.5;
}

.mission-button {
  width: 100%;
  margin-top: 10px;
  text-decoration: none;
}

.mission-map-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 10px;
}

.mission-map-header h2 {
  margin: 0;
  font-size: 21px;
}

.mission-map-destination {
  margin: 18px 0 12px;
  font-size: 14px;
}

.mission-map-frame {
  width: 100%;
  height: clamp(280px, 48dvh, 520px);
  overflow: hidden;
  background: #e8e4d8;
  border: 1px solid var(--color-line);
  border-radius: 12px;
}

.mission-map-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 420px) {

  .mission-success,
  .mission-map-screen {
    padding: 16px;
  }

  .mission-map-frame {
    height: 55dvh;
  }
}

.mission-success,
.mission-map-screen {
  padding: clamp(18px, 4vw, 28px);
  color: var(--color-text);
  background: #0b2940;
  border: 1px solid #34566b;
  border-radius: 18px;
}

.mission-success {
  text-align: center;
}

.mission-success-check {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
  color: #70f0d0;
  border: 2px solid #00b894;
  border-radius: 50%;
  font-size: 48px;
}

.mission-success h2 {
  margin: 0 0 28px;
  font: 800 clamp(1.8rem, 7vw, 2.7rem)/1.1 var(--font-body);
}

.mission-discovery {
  display: grid;
  gap: 10px;
  padding: 20px 12px;
  background: #0a3c4b;
  border: 1px solid #087f79;
  border-radius: 14px;
}

.mission-discovery span,
.mission-progress-label,
.mission-destination-label {
  color: #91b7c7;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.mission-discovery strong {
  color: #70f0d0;
  font-size: 24px;
}

.mission-progress-label {
  margin: 30px 0 10px;
}

.mission-progress-track {
  height: 10px;
  overflow: hidden;
  background: #29485c;
  border-radius: 999px;
}

.mission-progress-track span {
  display: block;
  width: 25%;
  height: 100%;
  background: linear-gradient(90deg, #00b894, #52c8d8);
  border-radius: inherit;
}

.mission-destination {
  display: grid;
  gap: 12px;
  margin-top: 30px;
  padding: 22px 12px;
  background: #17374f;
  border: 1px solid #34566b;
  border-radius: 16px;
}

.mission-destination strong {
  font-size: clamp(16px, 4.5vw, 22px);
}

.mission-destination>span:last-child {
  color: #c5d8e5;
  font-size: 17px;
  font-weight: 700;
}

.mission-instruction {
  margin: 28px 0 18px;
  color: #c5d8e5;
  font-size: 16px;
  line-height: 1.5;
}

.mission-button {
  width: 100%;
  margin-top: 10px;
}

.mission-map-header h2 {
  margin: 0;
  font-size: 21px;
}

.mission-map-destination {
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.6;
}

.mission-map-frame {
  width: 100%;
  height: clamp(280px, 48dvh, 520px);
  overflow: hidden;
  background: #e8e4d8;
  border: 1px solid var(--color-line);
  border-radius: 12px;
}

#mission-leaflet-map {
  width: 100%;
  height: 100%;
}

.mission-map-caption {
  margin: 8px 0;
  color: var(--color-muted);
  font-size: 12px;
}

.mission-map-frame .leaflet-control-attribution {
  padding: 1px 4px;
  font-size: 8px;
  line-height: 1.2;
}

.mission-map-error {
  color: #ef938c;
  font-size: 12px;
}

@media (max-width: 420px) {

  .mission-success,
  .mission-map-screen {
    padding: 16px;
  }

  .mission-map-frame {
    height: 55dvh;
  }
}

.email-inbox-card {
  max-width: 620px;
  margin: 18px auto 0;
  overflow: hidden;
  color: #24343d;
  background: #f4f3ee;
  border: 1px solid #d2d4cf;
  border-radius: 12px;
  box-shadow: 0 12px 30px #0003;
}

.email-inbox-toolbar {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  color: #63737a;
  background: #e9ecea;
  border-bottom: 1px solid #d2d4cf;
  font: 10px ui-monospace, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.email-preview {
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: start;
  gap: 11px;
  padding: 16px;
  color: #24343d;
  background: #f4f3ee;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.email-preview:hover {
  background: #fffdf7;
}

.email-preview-icon,
.email-sender-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #f4f3ee;
  background: #20465d;
  border-radius: 50%;
  font: 700 11px ui-monospace, monospace;
}

.email-preview-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.email-preview-copy strong {
  font-size: 13px;
}

.email-preview-copy span {
  font-size: 12px;
}

.email-preview-copy small {
  overflow: hidden;
  color: #63737a;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-preview time {
  color: #63737a;
  font-size: 10px;
}

.email-paper {
  max-width: 620px;
  margin: 18px auto 0;
  padding: clamp(16px, 4vw, 24px);
  color: #24343d;
  background: #f4f3ee;
  border: 1px solid #d2d4cf;
  border-radius: 12px;
  box-shadow: 0 12px 30px #0003;
}

.email-header {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid #d2d4cf;
}

.email-sender-details {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.email-sender-details strong {
  font-size: 12px;
}

.email-sender-details span,
.email-header time {
  color: #63737a;
  font-size: 10px;
}

.email-addresses {
  display: grid;
  gap: 5px;
  padding: 13px 0;
  color: #63737a;
  border-bottom: 1px solid #d2d4cf;
  font-size: 11px;
}

.email-addresses strong {
  color: #344852;
}

.email-body {
  padding-top: 8px;
  font: 15px/1.65 var(--font-display);
}

.email-body p {
  margin: 14px 0;
}

.email-dispatch-link {
  color: #145f68;
  font: 700 14px/1.5 var(--font-body);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.email-dispatch-link:hover {
  color: #0b4148;
}

.email-dispatch-link:focus-visible,
.email-preview:focus-visible {
  outline: 3px solid #edc779;
  outline-offset: 3px;
}

/* Dispatch chat: team replies and image attachments */
.dispatch-response-form {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  width: min(100%, 430px);
  margin: 2px 0 10px;
  padding: 9px;
  background: #091923;
  border: 1px solid var(--color-line);
  border-radius: 10px;
}

.dispatch-response-form input[type="text"] {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--color-text);
  background: #102832;
  border: 1px solid var(--color-line);
  border-radius: 6px;
  font: inherit;
}

.dispatch-response-form input[type="file"] {
  flex: 1;
  min-width: 0;
  color: var(--color-muted);
  font-size: 11px;
}

.dispatch-response-form .button {
  min-height: 40px;
  padding: 9px 13px;
}

.dispatch-image-attachment {
  align-self: flex-start;
  width: min(86%, 390px);
  margin: 2px 0 10px;
  padding: 8px;
  background: #091923;
  border: 1px solid var(--color-line);
  border-radius: 10px;
}

.dispatch-image-attachment figcaption {
  margin-bottom: 7px;
  color: var(--color-accent);
  font: 9px ui-monospace, monospace;
  letter-spacing: 0.08em;
}

.dispatch-image-attachment img {
  display: block;
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  background: #020b10;
  border-radius: 6px;
}

.from-user-photo {
  align-self: flex-end;
}

.from-user-photo figcaption {
  text-align: right;
}

@media (max-width: 480px) {
  .dispatch-response-form {
    gap: 6px;
    padding: 7px;
  }

  .dispatch-response-form .button {
    padding-inline: 10px;
  }

  .dispatch-image-attachment {
    width: 94%;
  }
}

.dispatch-chat-link {
  margin-top: 8px;
  padding: 0;
  color: var(--color-gold);
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.dispatch-chat-link:hover {
  color: var(--color-accent);
}

.start-card {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  text-align: center;
}

.start-logo {
  display: block;
  width: clamp(90px, 28vw, 150px);
  height: auto;
  object-fit: contain;
  margin: 0 auto 22px;
}

.start-card h2 {
  margin: 10px 0;
  font: 700 clamp(1.8rem, 6vw, 2.6rem)/1.1 var(--font-display);
}

.start-card>p:last-child {
  max-width: 28ch;
  margin: 0;
  color: var(--color-muted);
  line-height: 1.6;
}

.email-arrival {
  animation: email-arrive 0.45s ease-out both;
}

.email-arrival-wait {
  margin: 22px 12px;
  color: var(--color-muted);
  font-size: 14px;
}

@keyframes email-arrive {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

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

@media (prefers-reduced-motion: reduce) {
  .email-arrival {
    animation: none;
  }
}

.email-lock-screen {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: 18px;
  color: #fff;
  background: #18394c;
  text-align: center;
}

.email-lock-screen::before,
.email-lock-screen::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
}

.email-lock-screen::before {
  filter: blur(7px);
  transform: scale(1.06);
}

.email-lock-screen::after {
  filter: blur(7px);
  transform: scale(1.06);
}

.email-lock-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.email-lock-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.email-lock-date {
  margin: 0;
  font-size: 16px;
}

.email-lock-time {
  margin-top: 2px;
  font-size: clamp(3.5rem, 16vw, 5rem);
  font-weight: 300;
  line-height: 1;
}

.email-lock-status {
  margin: 28px 0 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
}

#screen:focus {
  outline: none;
}