/* Airport Empire — playful HUD. Rounded display type, chunky "pressable" buttons,
   bright sky palette. Google Fonts are optional; SF Rounded (ui-rounded) is the
   fallback on iPad, so it looks right even offline. */
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&family=Fredoka:wght@500;600;700&display=swap');
:root {
  --ink: #15305a;
  --ink-soft: #4a6188;
  --sky: #29a8e0;
  --sky-deep: #1676c8;
  --sun: #ffc83a;
  --sun-deep: #e79a00;
  --coral: #ff6b6b;
  --mint: #22d38d;
  --mint-deep: #109a62;
  --grape: #8b5cf6;
  --paper: #ffffff;
  --cream: #fff8e8;
  --line: #d9e6f5;
  --radius: 18px;
  --display:
    'Baloo 2', 'Fredoka', ui-rounded, 'SF Pro Rounded', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: 'Fredoka', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
  font-family: var(--body);
  color: var(--ink);
  font-size: 15px;
  -webkit-tap-highlight-color: transparent;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  overflow: hidden;
  height: 100%;
  background: linear-gradient(#7fd3f7, #c9f0ff);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
}
input,
select {
  user-select: text;
  -webkit-user-select: text;
}
[hidden] {
  display: none !important;
}
#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%, transparent 55%, #0a2b5a2e 100%);
}
/* Chunky card + button language ------------------------------------------------ */
.chunky,
.tools button,
.action,
.icon,
.zoom button,
.location,
.money,
footer .progress-info,
#context,
#designDock {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow:
    0 4px 0 #b9cde6,
    0 10px 24px #0b2f6a26;
}
.tools button:active,
.action:active,
.icon:active,
.zoom button:active,
.big-button:active,
.sub-button:active {
  transform: translateY(3px);
  box-shadow:
    0 1px 0 #b9cde6,
    0 4px 10px #0b2f6a26;
}
/* Top bar ------------------------------------------------------------------- */
#hud {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  z-index: 5;
}
#hud > * {
  pointer-events: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 800;
  line-height: 0.95;
  font-size: 15px;
  color: #fff;
  text-shadow: 0 2px 0 #0f4c8c;
  letter-spacing: 0.04em;
}
.brand span {
  display: block;
  font-size: 19px;
  color: var(--sun);
}
.brand-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: linear-gradient(160deg, var(--sun), #ff9f1c);
  color: #fff;
  box-shadow:
    0 4px 0 var(--sun-deep),
    0 8px 18px #0b2f6a33;
  transform: rotate(-8deg);
}
.tier-pill {
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 5px 10px 4px;
  border-radius: 999px;
  background: var(--grape);
  color: #fff;
  text-shadow: none;
  box-shadow: 0 3px 0 #5b33c2;
}
.top-center {
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffffd9;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-soft);
  box-shadow: 0 6px 16px #0b2f6a1f;
}
.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px #22d38d33;
}
#roomShare {
  background: var(--sky);
  color: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 700;
}
.money {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 10px;
  min-width: 230px;
}
.coin {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
  color: #8a5a00;
  background: radial-gradient(circle at 35% 30%, #fff2b3, var(--sun) 55%, var(--sun-deep));
  box-shadow:
    inset 0 -3px 0 #c98400,
    0 3px 8px #e79a0055;
}
.money.pop .coin {
  animation: coinpop 0.45s;
}
@keyframes coinpop {
  40% {
    transform: scale(1.25) rotate(-12deg);
  }
}
.money-main strong {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.01em;
}
.money-sub {
  display: flex;
  gap: 6px;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 700;
}
#rate {
  color: #fff;
  background: var(--mint);
  border-radius: 999px;
  padding: 1px 8px;
}
#pendingCash {
  color: var(--sun-deep);
  background: #fff3cf;
  border-radius: 999px;
  padding: 1px 8px;
}
.icon {
  width: 52px;
  height: 52px;
  font-size: 24px;
  display: grid;
  place-items: center;
}
/* Location + zoom ------------------------------------------------------------- */
.location {
  position: fixed;
  top: calc(max(14px, env(safe-area-inset-top)) + 66px);
  left: max(16px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  z-index: 4;
  max-width: 300px;
}
.airport-code {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--sky);
  color: #fff;
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
}
.location strong {
  display: block;
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.1;
}
.location small {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  font-weight: 600;
}
.zoom {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  top: calc(max(14px, env(safe-area-inset-top)) + 128px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 4;
}
.zoom button {
  width: 46px;
  height: 46px;
  font-size: 22px;
  font-weight: 700;
}
/* Right tool rail ------------------------------------------------------------- */
.tools {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  top: 50%;
  transform: translateY(-58%);
  display: flex;
  flex-direction: column;
  gap: 11px;
  z-index: 4;
}
.tools button {
  position: relative;
  width: 74px;
  height: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.tools b {
  font-size: 24px;
  line-height: 1;
}
.tools span {
  font-size: 11.5px;
  font-weight: 700;
}
.tools em {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 26px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-style: normal;
  font-weight: 800;
  font-size: 11px;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 0 #c73d3d;
}
#collectBtn em {
  background: var(--sun);
  color: #6b4300;
  box-shadow: 0 2px 0 var(--sun-deep);
}
/* Context card + hint --------------------------------------------------------- */
#context {
  position: fixed;
  left: 50%;
  bottom: 118px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 10px 10px 14px;
  min-width: 360px;
  z-index: 6;
  animation: rise 0.25s;
}
@keyframes rise {
  from {
    transform: translate(-50%, 14px);
    opacity: 0;
  }
}
.context-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--sun);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 22px;
  color: #7a4b00;
}
#context small {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--ink-soft);
}
#contextName {
  display: block;
  font-family: var(--display);
  font-size: 18px;
  line-height: 1.1;
}
#contextCost {
  display: block;
  font-family: var(--display);
  font-size: 15px;
  color: var(--mint-deep);
}
#contextAction {
  margin-left: auto;
  background: var(--mint);
  color: #fff;
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  border-radius: 14px;
  padding: 12px 18px;
  box-shadow: 0 4px 0 var(--mint-deep);
  white-space: nowrap;
}
#contextAction:disabled {
  background: #c7d3e3;
  box-shadow: 0 4px 0 #9fb0c6;
  opacity: 1;
}
#stepHint {
  position: fixed;
  left: 50%;
  bottom: 122px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 14px;
  z-index: 6;
  box-shadow: 0 8px 20px #0b2f6a40;
}
/* Joystick + actions ---------------------------------------------------------- */
#joystick {
  position: fixed;
  left: max(28px, env(safe-area-inset-left));
  bottom: max(96px, calc(env(safe-area-inset-bottom) + 84px));
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff59 0 54%, #ffffff40 55%);
  border: 3px solid #ffffffb3;
  z-index: 4;
  touch-action: none;
  box-shadow: 0 10px 30px #0b2f6a26;
}
#stick {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 62px;
  height: 62px;
  margin: -31px 0 0 -31px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #e4f2ff);
  box-shadow:
    0 4px 0 #b9cde6,
    0 8px 16px #0b2f6a33;
}
#joystick span {
  position: absolute;
  bottom: -22px;
  width: 100%;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px #0b2f6a66;
}
.actions {
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(92px, calc(env(safe-area-inset-bottom) + 80px));
  display: flex;
  align-items: flex-end;
  gap: 12px;
  z-index: 4;
}
.action {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  touch-action: none;
}
.action small {
  font-size: 10.5px;
  font-weight: 700;
  margin-top: 3px;
}
.action.primary {
  width: 98px;
  height: 98px;
  background: linear-gradient(170deg, #3dc2ff, var(--sky-deep));
  color: #fff;
  font-size: 34px;
  box-shadow:
    0 6px 0 #0f5596,
    0 14px 26px #0b2f6a40;
}
.action.primary small {
  font-size: 12px;
}
#gearToggle.gravity {
  background: #dff4ff;
  color: #0a7ec2;
}
#gearToggle.speed {
  background: #ffe5e8;
  color: #d23b4f;
}
#gearToggle.glider {
  background: #fff1d1;
  color: #b97700;
}
/* Footer progress ------------------------------------------------------------ */
footer {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  gap: 14px;
  pointer-events: none;
  z-index: 3;
}
.progress-info {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 10px 10px;
  width: min(520px, 52vw);
}
.terminal-pill {
  font-family: var(--display);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--coral);
  padding: 6px 10px 5px;
  border-radius: 10px;
  white-space: nowrap;
  box-shadow: 0 3px 0 #c74848;
}
.progress-copy {
  flex: 1;
  min-width: 0;
}
.progress-copy strong {
  font-family: var(--display);
  font-size: 15px;
  display: block;
  line-height: 1.1;
}
.progress-copy small {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.progress-track {
  height: 10px;
  border-radius: 999px;
  background: #e5eef9;
  margin: 5px 0 4px;
  overflow: hidden;
}
.progress-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mint), #7cf0b8);
  transition: width 0.6s cubic-bezier(0.2, 1.4, 0.4, 1);
}
#progressCount {
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  white-space: nowrap;
}
.controlhint {
  font-size: 11px;
  color: #fff;
  text-shadow: 0 1px 2px #0b2f6a88;
  font-weight: 600;
  margin: 0 auto 6px;
}
#fps {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px #000a;
}
@media (pointer: coarse) {
  .controlhint {
    display: none;
  }
}
/* Toast, banner and floating rewards ----------------------------------------- */
#toast {
  position: fixed;
  left: 50%;
  top: 92px;
  transform: translate(-50%, -16px);
  opacity: 0;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  padding: 11px 20px;
  border-radius: 999px;
  z-index: 20;
  pointer-events: none;
  transition: 0.25s;
  max-width: 70vw;
  text-align: center;
  box-shadow: 0 10px 24px #0b2f6a40;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
#banner {
  position: fixed;
  left: 50%;
  top: 30%;
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0;
  z-index: 21;
  pointer-events: none;
  text-align: center;
  color: #fff;
  font-family: var(--display);
  text-shadow:
    0 4px 0 #0f4c8c,
    0 10px 30px #0b2f6a88;
}
#banner small {
  display: block;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--sun);
}
#banner strong {
  display: block;
  font-size: 54px;
  font-weight: 800;
  line-height: 1;
}
#banner.show {
  animation: banner 2.6s cubic-bezier(0.2, 1.3, 0.4, 1) forwards;
}
@keyframes banner {
  12% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.06);
  }
  20%,
  80% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -62%) scale(0.96);
  }
}
#fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 15;
  overflow: hidden;
}
.floater {
  position: absolute;
  font-family: var(--display);
  font-weight: 800;
  font-size: 26px;
  color: #fff;
  -webkit-text-stroke: 1px #0d7a4c;
  text-shadow:
    0 3px 0 #0d7a4c,
    0 6px 14px #0b2f6a55;
  animation: floatup 1.3s ease-out forwards;
  white-space: nowrap;
  transform: translate(-50%, -50%);
}
.floater.gold {
  -webkit-text-stroke: 1px #a86800;
  text-shadow:
    0 3px 0 #a86800,
    0 6px 14px #0b2f6a55;
  color: #fff3b8;
}
@keyframes floatup {
  0% {
    opacity: 0;
    transform: translate(-50%, -20%) scale(0.6);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -60%) scale(1.15);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -260%) scale(1);
  }
}
.coinfly {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff2b3, var(--sun) 55%, var(--sun-deep));
  box-shadow: inset 0 -2px 0 #c98400;
  transition:
    transform 0.75s cubic-bezier(0.5, -0.3, 0.7, 1),
    opacity 0.75s;
}
.confetti {
  position: absolute;
  width: 10px;
  height: 14px;
  border-radius: 3px;
  animation: confetti 1.6s ease-in forwards;
}
@keyframes confetti {
  to {
    transform: translate(var(--dx), 110vh) rotate(var(--rot));
  }
}
/* Panels --------------------------------------------------------------------- */
#panelBackdrop {
  position: fixed;
  inset: 0;
  background: #0b2f6a4d;
  z-index: 10;
  backdrop-filter: blur(2px);
}
#panel {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  top: max(16px, env(safe-area-inset-top));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(440px, 46vw);
  background: var(--cream);
  border-radius: 26px;
  z-index: 11;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 6px 0 #e8d7ad,
    0 24px 60px #0b2f6a59;
  animation: slidein 0.28s cubic-bezier(0.2, 1.2, 0.4, 1);
  overflow: hidden;
}
@keyframes slidein {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
}
.panel-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 18px 18px 14px 22px;
  background: linear-gradient(160deg, var(--sky), var(--sky-deep));
  color: #fff;
}
.panel-head small {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #d9f2ff;
}
.panel-head h2 {
  margin: 2px 0 0;
  font-family: var(--display);
  font-size: 26px;
  line-height: 1.05;
  text-shadow: 0 2px 0 #0f5596;
}
.close {
  margin-left: auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #ffffff33;
  color: #fff;
  font-size: 26px;
  line-height: 1;
}
#panelBody {
  overflow-y: auto;
  padding: 16px 18px 24px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
#panelBody h3 {
  font-family: var(--display);
  font-size: 18px;
  margin: 16px 0 8px;
}
.panel-copy {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.45;
  margin: 0 0 12px;
}
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.tab {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  background: #fff;
  font-weight: 700;
  box-shadow: 0 3px 0 var(--line);
}
.tab.selected {
  background: var(--sky);
  color: #fff;
  box-shadow: 0 3px 0 #0f5596;
}
.upgrade-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 16px;
  padding: 10px 12px;
  margin-bottom: 10px;
  box-shadow: 0 3px 0 var(--line);
}
.upgrade-card .glyph {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 14px;
  background: #e8f6ff;
  display: grid;
  place-items: center;
  font-size: 22px;
}
.upgrade-card > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.upgrade-card h3 {
  margin: 0 !important;
  font-size: 16px !important;
}
.upgrade-card p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.35;
}
.upgrade-card strong {
  font-size: 12px;
  color: var(--mint-deep);
}
.upgrade-card button {
  flex: none;
  background: var(--mint);
  color: #fff;
  font-weight: 800;
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 3px 0 var(--mint-deep);
}
.upgrade-card button:disabled {
  background: #c7d3e3;
  box-shadow: 0 3px 0 #9fb0c6;
  opacity: 1;
}
.medal {
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 4px;
}
.medal.gold {
  background: #ffe9a3;
  color: #8a5a00;
}
.medal.silver {
  background: #e6edf5;
  color: #4b5d76;
}
.medal.bronze {
  background: #f6dcc5;
  color: #8a4a1d;
}
.big-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(170deg, #3ddc97, var(--mint-deep));
  color: #fff;
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  padding: 15px 20px;
  border-radius: 18px;
  box-shadow:
    0 5px 0 #0b7a4c,
    0 12px 24px #0b2f6a2e;
  margin: 6px 0;
}
.big-button.gold {
  background: linear-gradient(170deg, #ffd45a, #f2a100);
  color: #5a3600;
  box-shadow:
    0 5px 0 #c98400,
    0 12px 24px #0b2f6a2e;
}
.big-button.grape {
  background: linear-gradient(170deg, #a483ff, #7046e8);
  box-shadow:
    0 5px 0 #4f2bb3,
    0 12px 24px #0b2f6a2e;
}
.sub-button {
  width: 100%;
  text-align: left;
  background: #fff;
  border-radius: 14px;
  padding: 12px 16px;
  margin: 6px 0;
  font-weight: 700;
  box-shadow: 0 3px 0 var(--line);
}
.summary-art {
  font-size: 64px;
  text-align: center;
  margin: 8px 0;
}
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.stats div {
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 3px 0 var(--line);
}
.stats small {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.stats strong {
  font-family: var(--display);
  font-size: 22px;
}
label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 10px 0;
}
label input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: #fff;
  font-size: 16px;
  letter-spacing: 0;
  color: var(--ink);
}
.map-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.map-grid button {
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  font-size: 13.5px;
  box-shadow: 0 3px 0 var(--line);
}
.map-grid small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.collectible {
  background: #fff;
  border-radius: 14px;
  padding: 10px 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 3px 0 var(--line);
}
.collectible b {
  display: block;
  font-size: 26px;
  margin-bottom: 4px;
}
.collectible.locked {
  opacity: 0.55;
  filter: grayscale(1);
}
.collectible .price {
  display: block;
  margin-top: 4px;
  color: var(--grape);
}
.rarity-0 {
  border-bottom: 3px solid #bcd0e6;
}
.rarity-1 {
  border-bottom: 3px solid var(--mint);
}
.rarity-2 {
  border-bottom: 3px solid var(--sky);
}
.rarity-3 {
  border-bottom: 3px solid var(--grape);
}
.rarity-4 {
  border-bottom: 3px solid var(--sun);
}
.code-display {
  font-family: var(--display);
  font-weight: 800;
  font-size: 40px;
  letter-spacing: 0.15em;
  text-align: center;
  background: #fff;
  border-radius: 18px;
  padding: 12px;
  margin: 8px 0;
}
.notice {
  background: #eaf6ff;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 10px 0;
}
.spacer {
  height: 10px;
}
.check {
  color: var(--mint-deep);
}
.meter {
  height: 12px;
  background: #e5eef9;
  border-radius: 999px;
  overflow: hidden;
  margin: 6px 0 2px;
}
.meter i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--sun), #ff9f1c);
  border-radius: 999px;
}
/* Design dock --------------------------------------------------------------- */
#designDock {
  position: fixed;
  left: 50%;
  bottom: 118px;
  transform: translateX(-50%);
  padding: 12px 14px;
  width: min(600px, 62vw);
  z-index: 7;
}
.design-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.design-top strong {
  font-family: var(--display);
  font-size: 17px;
}
.design-top span {
  font-size: 12px;
  color: var(--mint-deep);
  font-weight: 700;
}
.design-top button {
  margin-left: auto;
  font-size: 24px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #eef4fb;
}
#designTarget {
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: #fff;
  font-weight: 700;
  margin-bottom: 8px;
}
#designSwatches,
#designThemes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.design-chip,
.theme-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #f1f6fc;
  font-weight: 700;
  font-size: 13px;
  border: 2px solid transparent;
}
.design-chip i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}
.design-chip.selected,
.theme-chip.selected {
  border-color: var(--sky);
  background: #e3f4ff;
}
#designThemeDescription {
  font-size: 12px;
  color: var(--ink-soft);
}
/* Minigame overlay ---------------------------------------------------------- */
#minigame {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: #0b2f6a8c;
  backdrop-filter: blur(3px);
  touch-action: none;
}
.mg-frame {
  width: min(980px, 94vw);
  background: var(--cream);
  border-radius: 28px;
  padding: 12px;
  box-shadow:
    0 8px 0 #e8d7ad,
    0 30px 70px #0b2f6a80;
}
.mg-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 10px;
}
.mg-head small {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--ink-soft);
}
.mg-head strong {
  font-family: var(--display);
  font-size: 26px;
  line-height: 1;
}
.mg-stats {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.mg-stats span {
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  padding: 4px 14px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 3px 0 var(--line);
}
#mgScore::before {
  content: '★ ';
  color: var(--sun-deep);
}
#mgTime::before {
  content: '⏱ ';
}
.mg-head .close {
  margin-left: 0;
  background: var(--coral);
  box-shadow: 0 3px 0 #c74848;
}
#mgCanvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 960 / 560;
  border-radius: 18px;
  touch-action: none;
  background: #bfe9ff;
}
#mgHint {
  text-align: center;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 8px 0 2px;
  font-size: 14px;
}
/* Intro --------------------------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  padding-left: max(5vw, env(safe-area-inset-left));
  background: linear-gradient(100deg, #0b4d9ad9 0%, #1f8fe0a6 38%, #29a8e000 70%);
}
.intro-card {
  width: min(430px, 44vw);
  color: #fff;
}
.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--sun);
  display: flex;
  align-items: center;
  gap: 8px;
}
.eyebrow i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px #22d38d55;
}
h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 84px;
  line-height: 0.85;
  margin: 12px 0 8px;
  text-shadow:
    0 6px 0 #0f4c8c,
    0 16px 40px #0b2f6a88;
  letter-spacing: -0.01em;
}
h1 em {
  font-style: normal;
  color: var(--sun);
}
h1.game-title {
  font-size: 64px;
  line-height: 0.92;
}
.intro-card p {
  font-size: 17px;
  line-height: 1.4;
  margin: 0 0 14px;
  color: #e7f6ff;
  font-weight: 500;
}
.intro-card label {
  color: #d9f2ff;
}
.intro-card label input {
  border: 0;
  box-shadow: 0 3px 0 #b9cde6;
}
.intro-secondary {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}
.intro-secondary button {
  flex: 1;
  background: #ffffff2e;
  color: #fff;
  border: 2px solid #ffffff80;
  border-radius: 14px;
  padding: 11px;
  font-weight: 700;
}
.intro-card .sub-button {
  background: #ffffffe6;
  color: var(--ink);
  text-align: center;
}
.intro-note {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #d9f2ff;
  font-weight: 600;
}
.version {
  margin-top: 16px;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: #ffffffb3;
}
.version span {
  color: var(--sun);
  margin-left: 6px;
}
.intro-scene-label {
  position: absolute;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  background: #fff;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 4px 0 #b9cde6;
  animation: bob 2.4s ease-in-out infinite;
}
.intro-scene-label span {
  color: var(--sky);
}
@keyframes bob {
  50% {
    transform: translateY(-6px);
  }
}
#rotate {
  display: none;
}
@media (orientation: portrait) {
  #rotate {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-content: center;
    text-align: center;
    background: linear-gradient(#29a8e0, #1676c8);
    color: #fff;
    font-family: var(--display);
  }
  #rotate > div {
    font-size: 70px;
    animation: spin 2s ease-in-out infinite;
  }
  @keyframes spin {
    50% {
      transform: rotate(90deg);
    }
  }
}
@media (max-height: 650px) {
  .tools button {
    width: 64px;
    height: 56px;
  }
  .tools b {
    font-size: 20px;
  }
  #joystick {
    width: 124px;
    height: 124px;
  }
  .action {
    width: 60px;
    height: 60px;
  }
  .action.primary {
    width: 82px;
    height: 82px;
  }
  h1 {
    font-size: 60px;
  }
  h1.game-title {
    font-size: 46px;
  }
  .zoom {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
/* Hide the game HUD behind the title screen until play starts. */
body:not(.playing) .location,
body:not(.playing) .zoom,
body:not(.playing) .tools,
body:not(.playing) #joystick,
body:not(.playing) .actions,
body:not(.playing) footer,
body:not(.playing) #hud .money,
body:not(.playing) #hud .brand {
  display: none;
}
/* Photo mode ------------------------------------------------------------------ */
body.photo-mode #hud,
body.photo-mode .location,
body.photo-mode .tools,
body.photo-mode #joystick,
body.photo-mode .actions,
body.photo-mode footer,
body.photo-mode #context,
body.photo-mode #stepHint,
body.photo-mode #toast,
body.photo-mode #zoomIn,
body.photo-mode #zoomOut,
body.photo-mode #vignette {
  display: none !important;
}
body.photo-mode #photoBtn {
  display: none;
}
#photoBar {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 252, 244, 0.92);
  box-shadow: 0 10px 30px rgba(20, 40, 60, 0.25);
  z-index: 20;
}
#photoBar[hidden],
#photoShot[hidden] {
  display: none;
}
#photoFilters {
  display: flex;
  gap: 6px;
}
#photoBar button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font: 700 15px var(--font, system-ui);
  background: #e9f3f6;
  color: #284e4d;
}
#photoBar button.selected {
  background: #ffc83a;
  color: #4a2c00;
}
#photoBar .snap {
  width: 62px;
  height: 62px;
  font-size: 28px;
  background: #ff6b6b;
  color: #fff;
  box-shadow: 0 0 0 4px #fff inset;
}
#photoShot {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(10, 20, 35, 0.78);
  z-index: 30;
  color: #fff;
  font-weight: 700;
}
#photoShot img {
  max-width: 82vw;
  max-height: 70vh;
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  transform: rotate(-1.5deg);
  -webkit-touch-callout: default;
  user-select: auto;
}
#photoShot button {
  border: 0;
  border-radius: 999px;
  padding: 12px 30px;
  font: 800 17px system-ui;
  background: #ffc83a;
  color: #4a2c00;
}
#flash {
  position: fixed;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 25;
}
#flash.go {
  animation: flash 0.45s ease-out;
}
@keyframes flash {
  from {
    opacity: 0.85;
  }
  to {
    opacity: 0;
  }
}
/* Postcards & airline ----------------------------------------------------------- */
.postcards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 6px 0 10px;
}
.postcard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  border-radius: 12px;
  background: linear-gradient(160deg, #fffaf0, #ffe9c2);
  border: 2px dashed #e7b45c;
  text-align: center;
}
.postcard b {
  font-size: 26px;
}
.postcard small {
  font-size: 11px;
  opacity: 0.75;
}
.postcard.locked {
  filter: grayscale(1);
  opacity: 0.55;
}
.design-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 10px;
}
.airline-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  padding: 12px 16px;
  border-radius: 14px;
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  background: var(--livery);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}
.airline-preview b {
  font-size: 26px;
}

/* Reconnect + save tools ------------------------------------------------------ */
.intro-reconnect {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}
.intro-reconnect[hidden] {
  display: none;
}
.link-button {
  border: 0;
  background: none;
  color: #1676c8;
  font-weight: 700;
  text-decoration: underline;
  padding: 4px;
}
.save-text {
  width: 100%;
  min-height: 110px;
  font: 12px ui-monospace, monospace;
  border-radius: 10px;
  border: 2px solid #cfe0ea;
  padding: 8px;
  box-sizing: border-box;
}
.save-status {
  font-size: 13px;
  font-weight: 700;
}
.save-status.bad {
  color: #c0392b;
}
