:root {
  color-scheme: dark;
  --river: #08756b;
  --river-deep: #064c48;
  --cream: #fff3d7;
  --paper: #f8e6bd;
  --ink: #153c36;
  --coral: #f05b3f;
  --orange: #f28a2e;
  --gold: #f3c64e;
  --pink: #e94d88;
  --blue: #33a9c2;
  --shadow: rgba(2, 23, 21, 0.4);
  --safe-top: max(0px, env(safe-area-inset-top, 0px));
  --safe-right: max(0px, env(safe-area-inset-right, 0px));
  --safe-bottom: max(0px, env(safe-area-inset-bottom, 0px));
  --safe-left: max(0px, env(safe-area-inset-left, 0px));
}

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

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #075f57;
  touch-action: none;
}

body,
button {
  font-family: "Avenir Next Condensed", "Trebuchet MS", sans-serif;
}

button,
a {
  -webkit-user-select: none;
  user-select: none;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

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

#game-shell {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 480px;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(#6dcbd2 0 44%, #d8b875 44% 100%);
}

/* Every game surface is tied to the visual viewport. This avoids mobile
   browser toolbar and overlay transitions shifting absolute descendants. */
#game-shell > * {
  position: fixed;
}

#game-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
}

#game-shell[data-pointer-lock="unlocked"] #game-canvas,
#game-shell[data-pointer-lock="fallback"] #game-canvas {
  cursor: crosshair;
}

#game-shell[data-pointer-lock="locked"] #game-canvas {
  cursor: none;
}

.world-tint,
.sun-wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.world-tint {
  background:
    linear-gradient(to bottom, rgba(255, 246, 207, 0.18), transparent 28%),
    radial-gradient(circle at 50% 48%, transparent 42%, rgba(1, 29, 26, 0.24) 120%);
  mix-blend-mode: soft-light;
}

.sun-wash {
  background: radial-gradient(circle at 83% 12%, rgba(255, 241, 164, 0.34), transparent 28%);
}

.top-hud {
  position: absolute;
  z-index: 10;
  top: calc(8px + var(--safe-top));
  left: calc(10px + var(--safe-left));
  right: calc(10px + var(--safe-right));
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.mini-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--cream);
  text-decoration: none;
  text-shadow: 0 2px 10px rgba(2, 33, 29, 0.5);
  pointer-events: auto;
}

.brand-flower {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 244, 214, 0.86);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(4, 73, 65, 0.78);
  box-shadow: 0 4px 16px var(--shadow);
  font-size: 23px;
}

.mini-brand > span:last-child {
  display: grid;
  grid-template-columns: auto auto;
  line-height: 0.86;
  letter-spacing: -0.03em;
}

.mini-brand b,
.mini-brand strong {
  font-family: "Rockwell Extra Bold", "Cooper Black", Georgia, serif;
  font-size: clamp(12px, 3.8vw, 17px);
}

.mini-brand b {
  color: var(--gold);
  margin-right: 4px;
}

.mini-brand small {
  grid-column: 1 / -1;
  margin-top: 4px;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.top-readouts {
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.cash-chip {
  min-width: 91px;
  padding: 7px 10px 6px;
  border: 1px solid rgba(255, 241, 201, 0.72);
  border-radius: 13px;
  background: rgba(6, 67, 60, 0.84);
  box-shadow: 0 6px 18px var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  line-height: 1;
}

.cash-chip span {
  display: block;
  color: #ffd863;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.cash-chip strong {
  display: inline-block;
  margin-top: 3px;
  color: white;
  font-family: "Rockwell Extra Bold", Georgia, serif;
  font-size: 16px;
}

.cash-chip small {
  color: rgba(255, 244, 216, 0.75);
  font-size: 8px;
}

.round-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 241, 201, 0.72);
  border-radius: 50%;
  background: rgba(6, 67, 60, 0.82);
  box-shadow: 0 5px 16px var(--shadow);
  color: var(--cream);
  font-size: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.round-button:active {
  transform: scale(0.92);
}

.round-button.needs-unlock {
  color: #173f38;
  background: var(--gold);
  animation: sound-unlock-pulse 1.15s ease-in-out infinite;
}

@keyframes sound-unlock-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(243, 198, 78, 0.62), 0 5px 16px var(--shadow); }
  50% { box-shadow: 0 0 0 8px rgba(243, 198, 78, 0), 0 5px 16px var(--shadow); }
}

.mission-card {
  position: absolute;
  z-index: 8;
  top: calc(67px + var(--safe-top));
  left: calc(11px + var(--safe-left));
  width: min(57vw, 228px);
  padding: 9px 12px 10px;
  border: 1px solid rgba(255, 244, 214, 0.58);
  border-radius: 13px 13px 18px 4px;
  background: linear-gradient(135deg, rgba(6, 73, 65, 0.91), rgba(5, 48, 44, 0.83));
  box-shadow: 0 7px 24px rgba(2, 28, 25, 0.28);
  color: white;
  pointer-events: none;
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.mission-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.mission-card::before {
  content: "";
  position: absolute;
  left: 11px;
  top: -4px;
  width: 38px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
  transform: rotate(-2deg);
}

.mission-kicker {
  display: block;
  min-width: 0;
  margin-bottom: 3px;
  overflow: hidden;
  color: #ffcf58;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cleanup-counter {
  display: flex;
  align-items: baseline;
  gap: 3px;
  flex: 0 0 auto;
  min-height: 21px;
  margin: -3px -5px 1px 0;
  padding: 3px 6px 2px;
  border: 1px solid rgba(255, 216, 99, 0.34);
  border-radius: 999px;
  background: rgba(255, 244, 214, 0.1);
  color: white;
  pointer-events: auto;
}

.cleanup-counter b {
  font-family: "Rockwell Extra Bold", Georgia, serif;
  font-size: 10px;
  line-height: 1;
}

.mission-card .cleanup-counter small {
  display: inline;
  margin: 0;
  color: #ffcf58;
  font-size: 5.5px;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
}

.cleanup-counter:active {
  transform: scale(0.95);
}

.mission-card strong {
  display: block;
  font-family: "Rockwell Extra Bold", Georgia, serif;
  font-size: 13px;
  line-height: 1.04;
}

.mission-card small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 248, 227, 0.78);
  font-size: 8px;
  line-height: 1.2;
}

.mission-track {
  height: 3px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.cleanup-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-3px);
  transition: max-height 180ms ease, margin-top 180ms ease, opacity 140ms ease, transform 180ms ease;
}

.mission-card.expanded .cleanup-breakdown {
  max-height: 36px;
  margin-top: 7px;
  opacity: 1;
  transform: translateY(0);
}

.cleanup-breakdown span {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 4px 3px 3px;
  border: 1px solid rgba(255, 244, 214, 0.12);
  border-radius: 6px;
  background: rgba(2, 31, 28, 0.2);
  text-align: center;
}

.cleanup-breakdown b {
  overflow: hidden;
  color: rgba(255, 248, 227, 0.63);
  font-size: 5px;
  letter-spacing: 0.09em;
  text-overflow: ellipsis;
}

.cleanup-breakdown i {
  color: white;
  font-family: "Rockwell Extra Bold", Georgia, serif;
  font-size: 9px;
  font-style: normal;
}

.mission-card.fresh-drop .cleanup-counter {
  animation: fresh-count 520ms ease both;
}

@keyframes fresh-count {
  0% { color: white; background: rgba(255, 244, 214, 0.1); transform: scale(1); }
  20%, 82% { color: #173f38; background: #ffcf58; transform: scale(1.09); }
  100% { color: white; background: rgba(255, 244, 214, 0.1); transform: scale(1); }
}

.mission-track i,
.bag-meter i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--coral));
  transition: width 240ms ease;
}

.bag-chip {
  position: absolute;
  z-index: 8;
  top: calc(67px + var(--safe-top));
  right: calc(11px + var(--safe-right));
  display: grid;
  grid-template-columns: 29px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 1px 7px;
  width: min(34vw, 137px);
  padding: 8px 9px;
  border: 1px solid rgba(255, 245, 218, 0.75);
  border-radius: 13px 13px 5px 18px;
  background: rgba(255, 239, 202, 0.91);
  box-shadow: 0 7px 22px var(--shadow);
  color: var(--ink);
  pointer-events: none;
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.bag-symbol {
  grid-row: 1 / 3;
  font-family: Georgia, serif;
  font-size: 34px;
  line-height: 0.8;
  transform: rotate(-5deg);
}

.bag-chip small {
  display: block;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.bag-chip strong {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 1px;
  font-family: "Rockwell Extra Bold", Georgia, serif;
  font-size: 17px;
}

.bag-chip strong span,
.bag-chip strong b:last-child {
  font-size: 10px;
  opacity: 0.62;
}

.bag-meter {
  grid-column: 1 / -1;
  height: 3px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(21, 60, 54, 0.15);
}

.location-ribbon {
  position: absolute;
  z-index: 5;
  top: calc(145px + var(--safe-top));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: rgba(255, 249, 228, 0.9);
  background: rgba(4, 47, 43, 0.48);
  box-shadow: 0 3px 12px rgba(3, 29, 26, 0.2);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.1em;
  transform: translateX(-50%);
  pointer-events: none;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.location-ribbon i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold);
}

.aim-layer {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 52%;
  display: grid;
  place-items: center;
  gap: 12px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.reticle {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 248, 226, 0.65);
  border-radius: 50%;
  box-shadow: 0 1px 8px rgba(0, 32, 29, 0.38);
  transition: transform 130ms ease, border-color 130ms ease, background 130ms ease;
}

.reticle::before,
.reticle::after {
  content: "";
  position: absolute;
  background: rgba(255, 248, 226, 0.72);
}

.reticle::before {
  width: 38px;
  height: 1px;
}

.reticle::after {
  width: 1px;
  height: 38px;
}

.reticle i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.reticle.targeting {
  border-color: #ff8b2f;
  background: rgba(242, 111, 36, 0.3);
  box-shadow: 0 0 0 4px rgba(255, 139, 47, 0.14), 0 2px 14px rgba(119, 49, 23, 0.48);
  transform: scale(1.18) rotate(45deg);
}

.reticle.targeting i {
  background: #ff8b2f;
}

.reticle.targeting {
  animation: tap-ready 460ms ease-out;
}

.aim-label {
  padding: 4px 8px;
  border-radius: 999px;
  color: white;
  background: rgba(3, 44, 40, 0.54);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.11em;
  opacity: 0.72;
  transition: opacity 150ms ease, transform 150ms ease;
}

.targeting + .aim-label {
  color: #143d37;
  background: rgba(255, 167, 65, 0.95);
  opacity: 1;
  transform: translateY(2px);
}

.desktop-control-hint {
  display: none;
}

@keyframes tap-ready {
  0% { box-shadow: 0 0 0 0 rgba(255, 139, 47, 0.65); }
  100% { box-shadow: 0 0 0 14px rgba(255, 139, 47, 0); }
}

.context-action {
  position: absolute;
  z-index: 16;
  left: 50%;
  bottom: calc(150px + var(--safe-bottom));
  min-width: 174px;
  padding: 10px 16px 9px;
  border: 2px solid rgba(255, 244, 210, 0.92);
  border-radius: 16px;
  background: linear-gradient(135deg, var(--coral), #d9412e);
  box-shadow: 0 8px 0 #7d2d25, 0 14px 28px var(--shadow);
  color: white;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: auto;
}

.context-action span,
.context-action small {
  display: block;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.context-action strong {
  display: block;
  margin: 2px 0;
  font-family: "Rockwell Extra Bold", Georgia, serif;
  font-size: 17px;
}

.context-action:active {
  box-shadow: 0 3px 0 #7d2d25, 0 8px 18px var(--shadow);
  transform: translate(-50%, 5px);
}

.grab-button {
  position: absolute;
  z-index: 14;
  right: calc(24px + var(--safe-right));
  bottom: calc(24px + var(--safe-bottom));
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  padding: 6px;
  border: 2px solid rgba(255, 246, 219, 0.9);
  border-radius: 50%;
  background: linear-gradient(145deg, #ff9a3c, var(--coral));
  box-shadow: 0 7px 0 #963a2f, 0 12px 27px var(--shadow);
  color: white;
  pointer-events: auto;
  transition: filter 150ms ease, opacity 150ms ease, transform 100ms ease, visibility 150ms ease;
}

.grab-button[data-action="idle"],
.grab-button[data-action="pickup"] {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.78);
}

.move-right .grab-button {
  right: auto;
  left: calc(24px + var(--safe-left));
}

.grab-button[data-action="dump"] {
  background: linear-gradient(145deg, #f3c64e, #e56f2e);
}

.grab-button[data-action="shop"] {
  background: linear-gradient(145deg, #24a798, #07645d);
  box-shadow: 0 7px 0 #034d48, 0 12px 27px var(--shadow);
}

.grab-button:disabled {
  filter: saturate(0.3);
  opacity: 0.48;
}

.grab-button:not(:disabled) {
  animation: hand-ready 1.45s ease-in-out infinite;
}

.grab-button:not(:disabled) .grab-pulse {
  position: absolute;
  inset: -8px;
  border: 2px solid rgba(255, 214, 86, 0.75);
  border-radius: 50%;
  animation: pickup-pulse 1.45s ease-out infinite;
}

.grab-button:active {
  box-shadow: 0 2px 0 #963a2f, 0 7px 17px var(--shadow);
  transform: translateY(5px) scale(0.96);
}

.grab-hand {
  font-size: 28px;
  line-height: 1;
}

.grab-button small {
  margin-top: -6px;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.07em;
}

@keyframes pickup-pulse {
  from { opacity: 0.75; transform: scale(0.82); }
  to { opacity: 0; transform: scale(1.22); }
}

@keyframes hand-ready {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.control-zone {
  position: absolute;
  z-index: 12;
  top: 34%;
  bottom: 0;
  width: 50%;
  pointer-events: auto;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.control-zone-left {
  left: 0;
}

.control-zone-right {
  right: 0;
}

.floating-stick {
  position: absolute;
  left: 72px;
  top: calc(100% - 116px);
  width: 118px;
  height: 118px;
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.74);
  transition: opacity 110ms ease, transform 110ms ease;
  pointer-events: none;
}

.control-zone[data-control="move"].active .floating-stick {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.joystick-ring {
  position: absolute;
  inset: 2px;
  border: 2px solid rgba(255, 244, 213, 0.46);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 49.5%, rgba(255,255,255,.13) 50%, transparent 50.5%),
    linear-gradient(0deg, transparent 49.5%, rgba(255,255,255,.13) 50%, transparent 50.5%),
    rgba(3, 49, 45, 0.27);
  box-shadow: inset 0 0 24px rgba(2, 32, 29, 0.18), 0 7px 24px rgba(2, 28, 25, 0.18);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.joystick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 250, 231, 0.77);
  border-radius: 50%;
  background: rgba(9, 94, 85, 0.76);
  box-shadow: 0 6px 18px rgba(2, 27, 24, 0.34), inset 0 3px 7px rgba(255,255,255,.16);
  transform: translate(-50%, -50%);
  transition: background 140ms ease;
}

.control-zone.active .joystick-knob {
  background: rgba(240, 91, 63, 0.86);
}

.control-hint {
  position: absolute;
  bottom: calc(31px + var(--safe-bottom));
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  color: rgba(255, 249, 230, 0.78);
  background: rgba(3, 45, 41, 0.5);
  font-weight: 900;
  opacity: 0.82;
  transition: opacity 180ms ease;
  pointer-events: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.control-zone[data-control="look"] .control-hint {
  bottom: calc(119px + var(--safe-bottom));
}

.control-zone-left .control-hint {
  left: calc(20px + var(--safe-left));
}

.control-zone-right .control-hint {
  right: calc(20px + var(--safe-right));
}

.control-hint b {
  font-size: 16px;
  line-height: 0.8;
}

.control-hint small {
  font-size: 6px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.control-zone.control-used .control-hint {
  opacity: 0.3;
}

.control-zone[data-control="move"].active .control-hint {
  opacity: 0;
}

.swap-shortcut {
  position: absolute;
  z-index: 12;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  display: grid;
  place-items: center;
  gap: 1px;
  width: 66px;
  padding: 5px 4px;
  border: 1px solid rgba(255, 244, 214, 0.38);
  border-radius: 11px;
  background: rgba(4, 53, 48, 0.5);
  box-shadow: 0 5px 16px rgba(2, 30, 27, 0.16);
  color: rgba(255, 247, 226, 0.82);
  transform: translateX(-50%);
  pointer-events: auto;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.swap-shortcut span {
  font-size: 18px;
  line-height: 1;
}

.swap-shortcut small {
  font-size: 6px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.toast-stack {
  position: absolute;
  z-index: 40;
  left: 50%;
  top: 35%;
  display: grid;
  justify-items: center;
  gap: 6px;
  width: min(82vw, 340px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 7px 11px;
  border: 1px solid rgba(255, 247, 220, 0.73);
  border-radius: 10px;
  background: rgba(5, 58, 53, 0.9);
  box-shadow: 0 7px 24px var(--shadow);
  color: white;
  font-size: 10px;
  font-weight: 800;
  animation: toast-in 2.4s both;
}

@keyframes toast-in {
  0% { opacity: 0; transform: translateY(8px) scale(.96); }
  12%, 82% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-7px); }
}

.pickup-float {
  position: absolute;
  z-index: 17;
  left: 50%;
  top: 56%;
  color: #fff4bf;
  font-family: "Rockwell Extra Bold", Georgia, serif;
  font-size: 24px;
  text-shadow: 0 3px 12px rgba(2, 32, 29, 0.7);
  opacity: 0;
  transform: translate(-50%, 0);
  pointer-events: none;
}

.pickup-float.show {
  animation: pickup-float 650ms ease-out;
}

@keyframes pickup-float {
  0% { opacity: 0; transform: translate(-50%, 15px) scale(.78); }
  22% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -34px) scale(1.04); }
}

.ability-unlock {
  position: absolute;
  z-index: 46;
  left: 50%;
  top: 36%;
  display: grid;
  justify-items: center;
  width: min(84vw, 390px);
  padding: 14px 18px 16px;
  overflow: hidden;
  border: 2px solid #fff0bd;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% -30%, rgba(244, 203, 74, 0.48), transparent 48%),
    linear-gradient(145deg, rgba(4, 92, 82, 0.97), rgba(3, 49, 45, 0.98));
  box-shadow: 0 0 0 5px rgba(5, 86, 77, 0.46), 0 22px 70px rgba(0, 25, 23, 0.55);
  color: #fff8df;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 18px) scale(0.78) rotate(-1.5deg);
  pointer-events: none;
}

.ability-unlock::before,
.ability-unlock::after {
  content: "✦";
  position: absolute;
  top: 16px;
  color: #f4ca4b;
  font-size: 22px;
}

.ability-unlock::before { left: 18px; }
.ability-unlock::after { right: 18px; }
.ability-unlock[hidden] { display: none; }

.ability-unlock.show {
  animation: ability-unlock-card 3.35s cubic-bezier(.18,.88,.22,1) both;
}

.ability-unlock > span {
  color: #f4ca4b;
  font-size: 8px;
  font-weight: 1000;
  letter-spacing: 0.16em;
}

.ability-unlock h2 {
  margin: 5px 0 2px;
  color: #fff2be;
  font-family: "Rockwell Extra Bold", Georgia, serif;
  font-size: clamp(22px, 7vw, 34px);
  line-height: 0.95;
  text-shadow: 0 4px 0 #94392f, 0 10px 26px rgba(0, 0, 0, 0.28);
}

.ability-unlock p {
  margin: 5px 0 0;
  color: rgba(255, 248, 225, 0.84);
  font-size: 10px;
  font-weight: 800;
}

.ability-bag {
  position: relative;
  width: 72px;
  height: 56px;
  margin-top: 8px;
  border: 4px solid #f4ca4b;
  border-top-width: 2px;
  border-radius: 8px 8px 18px 18px;
  background: linear-gradient(145deg, #fff0bd, #e9c86f);
  box-shadow: inset 0 -7px 0 rgba(182, 78, 55, 0.17), 0 8px 18px rgba(0, 0, 0, 0.2);
  transform: rotate(-3deg);
}

.ability-bag i {
  position: absolute;
  left: 50%;
  top: -11px;
  width: 35px;
  height: 15px;
  border: 4px solid #f4ca4b;
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
  transform: translateX(-50%);
}

.ability-bag b {
  display: grid;
  place-items: center;
  height: 100%;
  color: #b73f31;
  font-family: "Rockwell Extra Bold", Georgia, serif;
  font-size: 22px;
}

@keyframes ability-unlock-card {
  0% { opacity: 0; transform: translate(-50%, 18px) scale(.72) rotate(-2deg); }
  9% { opacity: 1; transform: translate(-50%, -5px) scale(1.05) rotate(.8deg); }
  15%, 82% { opacity: 1; transform: translate(-50%, 0) scale(1) rotate(0); }
  100% { opacity: 0; transform: translate(-50%, -18px) scale(.94); }
}

.sheet-scrim {
  position: absolute;
  z-index: 50;
  inset: 0;
  background: rgba(1, 24, 22, 0.58);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.bottom-sheet {
  position: absolute;
  z-index: 55;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(78dvh, 690px);
  padding: 10px calc(14px + var(--safe-right)) calc(18px + var(--safe-bottom)) calc(14px + var(--safe-left));
  overflow: auto;
  border: 2px solid #41645a;
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  background:
    linear-gradient(rgba(255,255,255,.23) 1px, transparent 1px),
    #f7e9c7;
  background-size: 100% 29px;
  box-shadow: 0 -18px 60px rgba(0, 27, 24, 0.42);
  color: var(--ink);
  opacity: 0;
  visibility: hidden;
  transform: translateY(105%);
  transition:
    transform 300ms cubic-bezier(.2,.8,.2,1),
    opacity 180ms ease,
    visibility 0s linear 300ms;
  pointer-events: none;
}

.bottom-sheet.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
  pointer-events: auto;
}

.sheet-handle {
  width: 58px;
  height: 5px;
  margin: 0 auto 11px;
  border-radius: 999px;
  background: rgba(21, 60, 54, 0.25);
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sheet-header span {
  color: #bd4934;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.sheet-header h2 {
  margin: 2px 0 11px;
  font-family: "Rockwell Extra Bold", "Cooper Black", Georgia, serif;
  font-size: clamp(22px, 7vw, 34px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.sheet-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(21, 60, 54, 0.25);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.38);
  color: var(--ink);
  font-size: 26px;
}

.shop-wallet {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 10px;
  padding: 6px 10px;
  border: 1px solid rgba(21, 60, 54, 0.2);
  border-radius: 8px;
  background: #f2cf65;
  box-shadow: 3px 3px 0 rgba(117, 72, 32, 0.18);
}

.shop-wallet span {
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.shop-wallet strong {
  font-family: "Rockwell Extra Bold", Georgia, serif;
  font-size: 18px;
}

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

.upgrade-card {
  position: relative;
  min-height: 145px;
  padding: 12px 10px 10px;
  overflow: hidden;
  border: 1px solid rgba(21, 60, 54, 0.27);
  border-radius: 7px 16px 8px 13px;
  background: rgba(255, 250, 232, 0.78);
  box-shadow: 3px 4px 0 rgba(86, 73, 45, 0.15);
}

.upgrade-card:nth-child(2) { transform: rotate(.55deg); }
.upgrade-card:nth-child(3) { transform: rotate(-.45deg); }

.upgrade-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.upgrade-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: white;
  background: var(--river);
  font-size: 19px;
}

.upgrade-level {
  color: #bd4934;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.09em;
}

.upgrade-card h3 {
  margin: 8px 0 3px;
  font-family: "Rockwell Extra Bold", Georgia, serif;
  font-size: 15px;
  line-height: 1;
}

.upgrade-card p {
  min-height: 31px;
  margin: 0 0 8px;
  color: rgba(21, 60, 54, 0.73);
  font-size: 9px;
  line-height: 1.15;
}

.upgrade-buy {
  width: 100%;
  padding: 8px 6px 7px;
  border: 0;
  border-radius: 8px;
  background: var(--coral);
  box-shadow: 0 3px 0 #8c342a;
  color: white;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.07em;
}

.upgrade-buy:disabled {
  background: #a8a598;
  box-shadow: 0 3px 0 #77756d;
  opacity: 0.72;
}

.settings-sheet {
  max-height: min(61dvh, 510px);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin: 9px 0;
  padding: 14px 12px;
  border: 1px solid rgba(21, 60, 54, 0.25);
  border-radius: 12px;
  background: rgba(255, 250, 231, 0.72);
  color: var(--ink);
  text-align: left;
}

.setting-row span,
.setting-row b,
.setting-row small {
  display: block;
}

.setting-row b {
  font-family: "Rockwell Extra Bold", Georgia, serif;
  font-size: 14px;
}

.setting-row small {
  margin-top: 2px;
  color: rgba(21, 60, 54, 0.66);
  font-size: 9px;
}

.setting-row strong {
  flex: 0 0 auto;
  padding: 6px 8px;
  border-radius: 7px;
  color: white;
  background: var(--river);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.settings-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 2px;
}

.settings-links a {
  min-width: 88px;
  padding: 8px 12px;
  border: 1px solid rgba(21, 60, 54, 0.22);
  border-radius: 999px;
  color: var(--river-dark);
  background: rgba(255, 250, 231, 0.56);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-align: center;
  text-decoration: none;
}

.desktop-help {
  margin: 13px 3px 0;
  color: rgba(21, 60, 54, 0.67);
  font-size: 10px;
  line-height: 1.35;
}

.start-screen {
  position: absolute;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 100%;
  overflow: hidden;
  padding: 12px;
  background:
    linear-gradient(to bottom, rgba(4, 45, 42, 0.04) 0 38%, rgba(4, 45, 42, 0.28) 66%, rgba(2, 28, 26, 0.72) 100%);
  color: var(--ink);
  transition: opacity 420ms ease, visibility 420ms ease;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
}

.start-screen.overview-dragging {
  cursor: grabbing;
}

.start-screen.dismissed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#game-shell[data-started="false"] > :is(
  .top-hud,
  .mission-card,
  .bag-chip,
  .location-ribbon,
  .aim-layer,
  .grab-button,
  .control-zone,
  .swap-shortcut
) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-map-label {
  position: absolute;
  top: calc(17px + var(--safe-top));
  left: 50%;
  display: grid;
  justify-items: center;
  width: max-content;
  max-width: calc(100% - 28px);
  padding: 8px 13px 7px;
  border: 1px solid rgba(255, 243, 215, 0.72);
  border-radius: 999px;
  color: var(--cream);
  background: rgba(4, 67, 61, 0.76);
  box-shadow: 0 7px 24px rgba(2, 24, 22, 0.34);
  text-align: center;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.intro-map-label {
  color: var(--cream);
  text-decoration: none;
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
}

.overview-hint {
  position: absolute;
  z-index: 2;
  top: calc(66px + var(--safe-top));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 243, 215, 0.52);
  border-radius: 999px;
  color: rgba(255, 249, 225, 0.94);
  background: rgba(5, 65, 59, 0.62);
  box-shadow: 0 6px 18px rgba(2, 24, 22, 0.2);
  font-family: "Rockwell Extra Bold", Georgia, serif;
  font-size: 7px;
  letter-spacing: 0.11em;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 180ms ease, transform 180ms ease, opacity 180ms ease;
}

.overview-hint span {
  color: var(--gold);
  font-size: 12px;
}

.start-screen.overview-dragging .overview-hint {
  background: rgba(8, 91, 81, 0.82);
  transform: translateX(-50%) scale(1.04);
}

.intro-copy {
  cursor: auto;
  touch-action: manipulation;
}

.intro-map-label:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.intro-map-label span {
  font-family: "Rockwell Extra Bold", Georgia, serif;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.intro-map-label small {
  margin-top: 2px;
  color: #f8d466;
  font-size: 6px;
  font-weight: 900;
  letter-spacing: 0.11em;
}

.intro-sky {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  border-bottom: 5px solid #0b5d54;
  background:
    linear-gradient(170deg, transparent 0 65%, rgba(255,255,255,.17) 65.5% 67%, transparent 67.5%),
    linear-gradient(#7dd7d5 0 52%, #18867d 52% 72%, #0a645d 72% 100%);
}

.intro-sky::before,
.intro-sky::after {
  content: "";
  position: absolute;
  z-index: 3;
  bottom: 0;
  width: 46%;
  height: 43%;
  background: #ccb37c;
  box-shadow: inset 0 9px 0 #ead8ac;
}

.intro-sky::before { left: 0; clip-path: polygon(0 0, 82% 16%, 100% 100%, 0 100%); }
.intro-sky::after { right: 0; clip-path: polygon(18% 16%, 100% 0, 100% 100%, 0 100%); }

.intro-sun {
  position: absolute;
  top: 18px;
  right: 13%;
  width: 61px;
  height: 61px;
  border-radius: 50%;
  background: #ffe782;
  box-shadow: 0 0 0 12px rgba(255, 231, 130, 0.15);
}

.intro-bridge {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 35px;
  width: min(78vw, 390px);
  height: 82px;
  border: 15px solid #e0c999;
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
  box-shadow: inset 0 0 0 3px #6b6857, 0 -3px 0 #6b6857;
  transform: translateX(-50%);
}

.intro-bridge::before {
  content: "";
  position: absolute;
  left: 3%;
  right: 3%;
  top: -27px;
  height: 18px;
  border: 3px solid #5d5a4b;
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
}

.intro-boat {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 8px;
  width: 122px;
  padding: 8px 8px 6px;
  border-radius: 5px 5px 40% 40%;
  color: #fff2b9;
  background: #ef5c3d;
  box-shadow: 0 5px 0 #7b392d;
  font-family: "Rockwell Extra Bold", Georgia, serif;
  font-size: 11px;
  text-align: center;
  transform: translateX(-50%);
}

.paper-flag {
  position: absolute;
  z-index: 7;
  top: 28px;
  width: 38px;
  height: 34px;
  clip-path: polygon(0 0, 100% 0, 100% 78%, 75% 100%, 50% 78%, 25% 100%, 0 78%);
}

.flag-one { left: 10%; background: var(--pink); transform: rotate(-7deg); }
.flag-two { left: 28%; top: 49px; background: var(--gold); transform: rotate(4deg); }
.flag-three { right: 7%; top: 92px; background: var(--coral); transform: rotate(8deg); }

.intro-copy {
  position: relative;
  z-index: 8;
  width: min(100%, 520px);
  margin: 0 auto calc(3px + var(--safe-bottom));
  padding: 16px 16px 14px;
  border: 2px solid rgba(255, 243, 215, 0.86);
  border-radius: 24px 9px 25px 12px;
  background: rgba(248, 232, 190, 0.93);
  box-shadow: 0 18px 60px rgba(1, 27, 24, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.56);
  text-align: center;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.intro-drag-handle {
  display: none;
}

.eyebrow {
  color: #bd4934;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.intro-copy h1 {
  margin: 3px 0 8px;
  color: #123f39;
  font-family: "Rockwell Extra Bold", "Cooper Black", Georgia, serif;
  font-size: clamp(42px, 13vw, 62px);
  line-height: 0.7;
  letter-spacing: -0.07em;
  text-shadow: 3px 3px 0 #e3bf56;
}

.intro-copy h1 i {
  color: var(--coral);
  font-size: 0.67em;
  font-style: normal;
  letter-spacing: 0.05em;
  text-shadow: 2px 2px 0 #f6d46d;
}

.intro-copy > p {
  max-width: 430px;
  margin: 9px auto 11px;
  color: rgba(21, 60, 54, 0.77);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.28;
}

.intro-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-width: 420px;
  margin: 0 auto 11px;
}

.intro-controls-desktop {
  display: none;
}

.intro-controls > div {
  display: grid;
  justify-items: center;
  align-content: start;
  min-height: 64px;
  padding: 6px 4px 5px;
  border: 1px solid rgba(21, 60, 54, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.28);
}

.mini-stick {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  margin-bottom: 3px;
  border: 2px solid var(--river);
  border-radius: 50%;
  color: var(--coral);
  background: rgba(8,117,107,.1);
  font-size: 15px;
}

.mini-hand {
  height: 30px;
  margin-bottom: 1px;
  font-size: 23px;
}

.mini-key,
.mini-mouse {
  display: grid;
  place-items: center;
  width: 30px;
  height: 27px;
  margin-bottom: 3px;
  border: 2px solid var(--river);
  border-radius: 7px;
  color: var(--coral);
  background: rgba(8, 117, 107, 0.1);
  font-size: 8px;
  font-weight: 1000;
  letter-spacing: -0.03em;
}

.mini-mouse {
  border-radius: 50%;
  font-size: 18px;
}

.intro-controls b,
.intro-controls small {
  display: block;
}

.intro-controls b {
  font-size: 8px;
  letter-spacing: 0.1em;
}

.intro-controls small {
  color: rgba(21, 60, 54, 0.65);
  font-size: 8px;
}

.start-button {
  width: min(100%, 420px);
  padding: 11px 15px 10px;
  border: 2px solid #fff1c9;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--coral), #d74333);
  box-shadow: 0 6px 0 #8d342c, 0 12px 24px rgba(94, 51, 35, 0.2);
  color: white;
}

.start-button span,
.start-button small {
  display: block;
}

.start-button span {
  font-family: "Rockwell Extra Bold", Georgia, serif;
  font-size: 18px;
}

.start-button small {
  margin-top: 2px;
  color: rgba(255, 244, 218, 0.8);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.start-button:active {
  box-shadow: 0 2px 0 #8d342c, 0 7px 16px rgba(94, 51, 35, 0.2);
  transform: translateY(4px);
}

.intro-swap {
  margin-top: 9px;
  padding: 4px;
  border: 0;
  background: transparent;
  color: rgba(21, 60, 54, 0.68);
  font-size: 10px;
}

.intro-swap b {
  color: #b84533;
  text-decoration: underline;
}

@media (max-width: 699px) {
  .top-hud {
    top: calc(6px + var(--safe-top));
    left: calc(8px + var(--safe-left));
    right: calc(8px + var(--safe-right));
    gap: 6px;
  }

  .mini-brand {
    gap: 6px;
    padding: 4px 7px 4px 4px;
    border: 1px solid rgba(255, 244, 214, 0.66);
    border-radius: 999px;
    background: rgba(4, 65, 59, 0.9);
    box-shadow: 0 5px 18px rgba(2, 25, 23, 0.38);
  }

  .brand-flower {
    width: 34px;
    height: 34px;
    font-size: 21px;
  }

  .mini-brand b,
  .mini-brand strong {
    font-size: clamp(13px, 3.8vw, 16px);
    text-shadow: 0 2px 0 rgba(0, 38, 34, 0.56);
  }

  .mini-brand small {
    margin-top: 3px;
    font-size: 7.5px;
    letter-spacing: 0.13em;
  }

  .top-readouts {
    gap: 4px;
  }

  .cash-chip {
    min-width: 88px;
    padding: 6px 9px 7px;
    border-width: 2px;
    border-radius: 11px;
    background: rgba(4, 61, 55, 0.96);
  }

  .cash-chip span {
    font-size: 7.5px;
  }

  .cash-chip strong {
    font-size: 18px;
    text-shadow: 0 2px 0 rgba(0, 32, 29, 0.55);
  }

  .cash-chip small {
    color: #fff2ca;
    font-size: 8.5px;
    opacity: 1;
  }

  .mission-card {
    top: calc(61px + var(--safe-top));
    width: min(58vw, 230px);
    padding: 10px 11px 11px;
    border-width: 2px;
    border-color: rgba(255, 244, 214, 0.82);
    border-radius: 12px 12px 16px 4px;
    background: linear-gradient(135deg, rgba(5, 69, 62, 0.98), rgba(3, 42, 39, 0.97));
    box-shadow: 0 9px 28px rgba(1, 24, 22, 0.42);
  }

  .mission-card::before {
    left: 9px;
    width: 32px;
    height: 6px;
  }

  .mission-kicker {
    margin-bottom: 3px;
    color: #ffd458;
    font-size: 7.7px;
    letter-spacing: 0.12em;
  }

  .cleanup-counter {
    min-height: 24px;
    margin: -2px -3px 0 0;
    padding: 4px 7px 3px;
    border-color: rgba(255, 216, 99, 0.65);
    background: rgba(255, 244, 214, 0.14);
  }

  .cleanup-counter b {
    font-size: 12px;
  }

  .mission-card .cleanup-counter small {
    font-size: 6.2px;
  }

  .mission-card strong {
    font-size: 15px;
    line-height: 1.08;
    text-shadow: 0 2px 0 rgba(0, 24, 22, 0.52);
  }

  .mission-card small {
    margin-top: 4px;
    color: #fff6dc;
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1.26;
  }

  .mission-track {
    height: 4px;
    margin-top: 8px;
  }

  .bag-chip {
    top: calc(61px + var(--safe-top));
    grid-template-columns: 28px 1fr;
    gap: 2px 6px;
    width: min(35vw, 140px);
    padding: 9px 9px 10px;
    border-width: 2px;
    border-color: #fff7df;
    border-radius: 12px 12px 5px 16px;
    background: rgba(255, 240, 204, 0.98);
    box-shadow: 0 9px 26px rgba(2, 27, 24, 0.4);
  }

  .bag-symbol {
    font-size: 32px;
  }

  .bag-chip small {
    font-size: 7.7px;
    letter-spacing: 0.11em;
  }

  .bag-chip strong {
    font-size: 20px;
  }

  .bag-chip strong span,
  .bag-chip strong b:last-child {
    font-size: 10.5px;
    opacity: 0.74;
  }

  .bag-meter {
    height: 4px;
    margin-top: 5px;
  }

  .location-ribbon {
    top: calc(178px + var(--safe-top));
    padding: 5px 9px;
    border: 1px solid rgba(255, 244, 214, 0.36);
    color: #fff8e4;
    background: rgba(3, 45, 41, 0.82);
    box-shadow: 0 5px 16px rgba(2, 27, 24, 0.34);
    font-size: 8.5px;
    letter-spacing: 0.08em;
  }

  .mission-card.expanded ~ .location-ribbon {
    opacity: 0;
  }

  .round-button {
    width: 38px;
    height: 38px;
    border-width: 2px;
    background: rgba(4, 61, 55, 0.96);
    font-size: 18px;
  }

  .aim-label {
    padding: 6px 10px;
    border: 1px solid rgba(255, 247, 223, 0.48);
    color: #fffaf0;
    background: rgba(3, 43, 39, 0.86);
    box-shadow: 0 4px 14px rgba(2, 27, 24, 0.3);
    font-size: 9px;
    letter-spacing: 0.08em;
    opacity: 0.96;
  }

  .targeting + .aim-label {
    border-color: #fff1c9;
    color: #123c36;
    background: #ff9d34;
  }

  .control-hint {
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid rgba(255, 244, 214, 0.58);
    color: #fff9e8;
    background: rgba(3, 45, 41, 0.8);
    box-shadow: 0 5px 16px rgba(2, 27, 24, 0.3);
    opacity: 0.96;
  }

  .control-hint b {
    font-size: 19px;
  }

  .control-hint small {
    font-size: 8px;
    letter-spacing: 0.08em;
  }

  .control-zone.control-used .control-hint {
    opacity: 0.72;
  }

  .swap-shortcut {
    width: 78px;
    min-height: 53px;
    padding: 7px 6px;
    border-color: rgba(255, 244, 214, 0.72);
    background: rgba(4, 53, 48, 0.82);
    box-shadow: 0 6px 18px rgba(2, 30, 27, 0.34);
    color: #fff8df;
  }

  .swap-shortcut span {
    font-size: 20px;
  }

  .swap-shortcut small,
  .grab-button small {
    font-size: 8px;
  }

  .toast {
    padding: 9px 13px;
    border-width: 2px;
    background: rgba(4, 55, 50, 0.96);
    color: #fffdf5;
    font-size: 11.5px;
    line-height: 1.25;
    text-align: center;
    text-shadow: 0 1px 0 rgba(0, 24, 22, 0.56);
  }

  .cleanup-breakdown b {
    font-size: 6.5px;
  }

  .cleanup-breakdown i {
    font-size: 11px;
  }

  .start-screen {
    padding: 0;
    background:
      linear-gradient(to bottom, rgba(4, 45, 42, 0.01) 0 54%, rgba(4, 45, 42, 0.17) 72%, rgba(2, 28, 26, 0.64) 100%);
  }

  .intro-map-label {
    top: calc(8px + var(--safe-top));
    max-width: calc(100% - 36px);
    padding: 5px 9px;
    border-color: rgba(255, 243, 215, 0.62);
    background: rgba(4, 67, 61, 0.68);
    box-shadow: 0 5px 18px rgba(2, 24, 22, 0.25);
  }

  .intro-map-label span {
    font-size: 7.5px;
  }

  .intro-map-label small {
    font-size: 4.7px;
  }

  .intro-copy {
    width: calc(100% - 20px);
    max-width: none;
    margin: 0 10px calc(6px + var(--safe-bottom));
    padding: 10px 9px 6px;
    border-width: 1px;
    border-radius: 20px 20px 13px 13px;
    background: rgba(249, 233, 192, 0.96);
    box-shadow: 0 -10px 42px rgba(1, 27, 24, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  }

  .intro-drag-handle {
    display: block;
    width: 42px;
    height: 4px;
    margin: -4px auto 5px;
    border-radius: 999px;
    background: rgba(21, 60, 54, 0.22);
  }

  .eyebrow {
    font-size: 7px;
    letter-spacing: 0.16em;
  }

  .intro-copy h1 {
    margin: 1px 0 3px;
    font-size: clamp(32px, 9.8vw, 41px);
    line-height: 0.88;
    white-space: nowrap;
  }

  .intro-copy h1 br {
    display: none;
  }

  .intro-copy h1 i {
    margin-right: 0.2em;
    font-size: 0.58em;
    vertical-align: 0.15em;
  }

  .intro-copy > p {
    max-width: 350px;
    margin: 4px auto 6px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.015em;
    line-height: 1.18;
    white-space: nowrap;
  }

  .intro-controls {
    gap: 4px;
    margin-bottom: 6px;
  }

  .intro-controls > div {
    min-height: 42px;
    padding: 4px 3px 3px;
    border-radius: 9px;
  }

  .mini-stick {
    width: 20px;
    height: 20px;
    margin-bottom: 1px;
    font-size: 11px;
  }

  .mini-hand {
    height: 21px;
    margin-bottom: 0;
    font-size: 16px;
  }

  .intro-controls b {
    font-size: 7px;
    letter-spacing: 0.075em;
  }

  .intro-controls small {
    display: none;
  }

  .start-button {
    width: 100%;
    min-height: 49px;
    padding: 7px 13px 6px;
    border-radius: 12px;
  }

  .start-button span {
    font-size: 16px;
  }

  .intro-swap {
    min-height: 30px;
    margin-top: 2px;
    padding: 4px 4px 1px;
    font-size: 9px;
  }

}

@media (max-width: 359px) {
  .mini-brand small { display: none; }
  .mini-brand b,
  .mini-brand strong { font-size: 12px; }
  .brand-flower { width: 31px; height: 31px; }
  .cash-chip { min-width: 79px; padding-inline: 7px; }
  .round-button { width: 35px; height: 35px; }
  .mission-card { width: 58vw; }
  .bag-chip { width: 35vw; }
}

@media (max-width: 699px) and (max-height: 590px) {
  .intro-map-label small,
  .intro-copy > p {
    display: none;
  }

  .intro-copy {
    padding-top: 11px;
  }

  .intro-controls {
    margin-top: 6px;
  }
}

.finale-screen {
  position: absolute;
  z-index: 110;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: max(20px, var(--safe-top)) 16px max(20px, var(--safe-bottom));
  background:
    radial-gradient(circle at 50% 24%, rgba(247, 205, 76, .34), transparent 31%),
    linear-gradient(150deg, rgba(2, 38, 35, .86), rgba(2, 25, 24, .97));
  backdrop-filter: blur(9px) saturate(1.15);
  pointer-events: auto;
}

.finale-screen[hidden] {
  display: none;
}

.finale-panel {
  position: relative;
  width: min(100%, 440px);
  padding: 25px 20px 20px;
  border: 3px solid #f1c652;
  border-radius: 24px 11px 27px 14px;
  background:
    linear-gradient(145deg, rgba(255, 250, 222, .98), rgba(244, 221, 165, .98)),
    #f7e6b9;
  box-shadow: 0 9px 0 #943b2d, 0 26px 80px rgba(1, 20, 19, .62);
  color: var(--ink);
  text-align: center;
  transform: rotate(-.35deg);
}

.finale-panel::before {
  content: "FIESTA SWEEP";
  position: absolute;
  top: -12px;
  left: 50%;
  padding: 5px 13px 4px;
  border: 2px solid #f1c652;
  border-radius: 99px;
  background: #164e47;
  color: #ffe8a1;
  font-size: 8px;
  font-weight: 1000;
  letter-spacing: .18em;
  transform: translateX(-50%);
}

.finale-kicker {
  display: block;
  margin-top: 4px;
  color: #b94534;
  font-size: 9px;
  font-weight: 1000;
  letter-spacing: .14em;
}

.finale-panel h2 {
  margin: 7px auto 8px;
  max-width: 360px;
  font-family: "Rockwell Extra Bold", Georgia, serif;
  font-size: clamp(28px, 8vw, 38px);
  line-height: .95;
}

.finale-panel > p {
  max-width: 350px;
  margin: 0 auto 15px;
  color: rgba(21, 60, 54, .73);
  font-size: 12px;
  line-height: 1.35;
}

.rocket-model {
  position: relative;
  width: 62px;
  height: 116px;
  margin: 5px auto 2px;
  border-radius: 60% 60% 24% 24%;
  background: linear-gradient(90deg, #cf3f31 0 18%, #f9e8b4 18% 76%, #da4d38 76%);
  box-shadow: inset -8px 0 rgba(57, 67, 57, .12), 0 12px 22px rgba(101, 55, 35, .25);
  transform: rotate(11deg);
}

.rocket-model::before {
  content: "";
  position: absolute;
  top: -23px;
  left: 0;
  border-right: 31px solid transparent;
  border-bottom: 31px solid #f2c64d;
  border-left: 31px solid transparent;
}

.rocket-model::after {
  content: "";
  position: absolute;
  right: 17px;
  bottom: -29px;
  width: 26px;
  height: 39px;
  border-radius: 50% 50% 70% 70%;
  background: linear-gradient(#f14d37, #f5c74e 55%, transparent 56%);
  filter: drop-shadow(0 0 8px #f58a3e);
}

.rocket-model i {
  position: absolute;
  top: 31px;
  left: 17px;
  width: 27px;
  height: 27px;
  border: 5px solid #144e49;
  border-radius: 50%;
  background: #46bbca;
}

.rocket-model b {
  position: absolute;
  right: -14px;
  bottom: 6px;
  width: 24px;
  height: 35px;
  border-radius: 0 80% 10% 0;
  background: #f2c64d;
}

.finale-credit {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 10px;
  margin: 14px 0 13px;
  padding: 11px 13px;
  border: 1px dashed rgba(21, 78, 71, .42);
  border-radius: 12px;
  background: rgba(255, 255, 255, .34);
  text-align: left;
}

.finale-credit span,
.finale-credit small {
  font-size: 8px;
  font-weight: 1000;
  letter-spacing: .09em;
}

.finale-credit strong {
  grid-row: 1 / 3;
  grid-column: 2;
  color: #b84434;
  font-family: "Rockwell Extra Bold", Georgia, serif;
  font-size: 27px;
}

.finale-credit small {
  color: rgba(21, 60, 54, .62);
}

.finale-primary {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 12px 13px 10px;
  border: 2px solid #ffe09a;
  border-radius: 13px;
  background: #e64a37;
  box-shadow: 0 6px 0 #8e3028;
  color: white;
  font-family: "Rockwell Extra Bold", Georgia, serif;
  font-size: 15px;
  line-height: 1.05;
  text-align: center;
  text-decoration: none;
}

.finale-primary:disabled {
  opacity: .7;
}

.finale-fire {
  background: #164e47;
  box-shadow: 0 6px 0 #072f2b;
}

.finale-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 15px;
}

.finale-stats span {
  padding: 7px 3px;
  border: 1px solid rgba(21, 60, 54, .16);
  border-radius: 9px;
  font-size: 7px;
  font-weight: 1000;
  letter-spacing: .06em;
}

.finale-stats b {
  display: block;
  margin-bottom: 2px;
  font-family: "Rockwell Extra Bold", Georgia, serif;
  font-size: 15px;
}

.reward-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.reward-option {
  min-width: 0;
  padding: 10px 8px 12px;
  border: 2px solid rgba(21, 78, 71, .22);
  border-radius: 14px 8px 16px 9px;
  background: rgba(255, 255, 255, .38);
  box-shadow: 0 4px 0 rgba(21, 78, 71, .2);
  color: var(--ink);
}

.reward-option:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(21, 78, 71, .2);
}

.reward-option small,
.reward-option strong {
  display: block;
}

.reward-option small {
  margin: 7px 0 3px;
  color: #b84434;
  font-size: 7px;
  font-weight: 1000;
  letter-spacing: .1em;
}

.reward-option strong {
  font-family: "Rockwell Extra Bold", Georgia, serif;
  font-size: 14px;
  line-height: 1.02;
}

.reward-art {
  position: relative;
  display: grid;
  width: 92px;
  height: 94px;
  margin: 0 auto;
  place-items: center;
  font-size: 49px;
}

.margarita-art {
  border-radius: 50%;
  overflow: hidden;
  background: #075a59;
  box-shadow: 0 6px 16px rgba(68, 49, 31, .25);
}

.margarita-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.candy-art {
  width: 84px;
  height: 86px;
  border: 7px solid #f0c84f;
  border-radius: 14px 14px 24px 24px;
  background: repeating-linear-gradient(135deg, #29a9bd 0 12px, #ea4c87 12px 24px, #f4cf4e 24px 36px);
  box-shadow: 0 7px 0 #a94336;
}

.candy-art i {
  position: absolute;
  right: -7px;
  bottom: 4px;
  padding: 3px 5px;
  border-radius: 5px 0 0 5px;
  background: #164e47;
  color: #ffe8a1;
  font-size: 9px;
  font-style: normal;
  font-weight: 1000;
}

.choice-warning {
  margin-top: 14px !important;
  color: #a83e32 !important;
  font-size: 8px !important;
  font-weight: 1000;
  letter-spacing: .1em;
}

.locked-reward-icon {
  display: grid;
  width: 118px;
  height: 118px;
  margin: 10px auto 4px;
  border: 9px double #f4c94c;
  border-radius: 50%;
  background: conic-gradient(#0f7c73, #2ba7b8, #e94a86, #f2c94d, #0f7c73);
  box-shadow: 0 10px 30px rgba(42, 73, 56, .28);
  font-size: 62px;
  place-items: center;
}

.locked-reward-icon.has-product-image {
  width: 138px;
  height: 138px;
  overflow: hidden;
  border: 0;
  background: #075a59;
}

.locked-reward-icon.has-product-image img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.reward-venue {
  color: #164e47 !important;
  font-size: 10px !important;
  font-weight: 900;
  letter-spacing: .06em;
}

.reward-code {
  margin: 13px 0;
  padding: 12px;
  border: 2px dashed #164e47;
  border-radius: 12px;
  background: #fff4c9;
}

.reward-code small,
.reward-code strong,
.reward-code span {
  display: block;
}

.reward-code small,
.reward-code span {
  font-size: 7px;
  font-weight: 1000;
  letter-spacing: .12em;
}

.reward-code strong {
  margin: 4px 0;
  color: #b84434;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 30px;
  letter-spacing: .08em;
}

.reward-map {
  background: #164e47;
  box-shadow: 0 6px 0 #073832;
}

.reward-terms {
  margin: 15px auto 0 !important;
  font-size: 8px !important;
  line-height: 1.35 !important;
}

.rocket-trail,
.boat-blast {
  position: fixed;
  z-index: 112;
  pointer-events: none;
}

.rocket-trail {
  left: 5%;
  bottom: 3%;
  width: 38px;
  height: 90px;
  border-radius: 50% 50% 20% 20%;
  background: linear-gradient(90deg, #cf3f31 0 20%, #f9e8b4 20% 75%, #db4e39 75%);
  opacity: 0;
  transform: rotate(48deg);
}

.rocket-trail::after {
  content: "";
  position: absolute;
  bottom: -64px;
  left: 8px;
  width: 23px;
  height: 78px;
  background: linear-gradient(#f3c84d, #eb4b39 48%, transparent);
  filter: blur(2px) drop-shadow(0 0 9px #f3c84d);
}

.finale-screen.launching .rocket-trail {
  animation: finale-rocket 1.15s cubic-bezier(.2,.7,.22,1) forwards;
}

.boat-blast {
  top: 23%;
  right: 13%;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff0a3;
  box-shadow: 0 0 0 18px #ef9a38, 0 0 0 38px rgba(228, 64, 49, .72), 0 0 50px 56px rgba(242, 198, 74, .44);
  opacity: 0;
}

.finale-screen.boat-hit .boat-blast {
  animation: finale-blast .85s ease-out forwards;
}

@keyframes finale-rocket {
  0% { opacity: 0; translate: 0 0; scale: .7; }
  12% { opacity: 1; }
  100% { opacity: 1; translate: 76vw -72vh; scale: 1.25; }
}

@keyframes finale-blast {
  0% { opacity: 0; scale: .15; }
  25% { opacity: 1; }
  100% { opacity: 0; scale: 3.5; }
}

.rotate-note {
  display: none;
}

@media (min-width: 700px) {
  .mission-card {
    width: 260px;
  }

  .bag-chip {
    width: 150px;
  }

  .grab-button {
    right: calc(44px + var(--safe-right));
  }

  .move-right .grab-button {
    right: auto;
    left: calc(44px + var(--safe-left));
  }

  .bottom-sheet {
    left: 50%;
    right: auto;
    width: min(620px, calc(100% - 28px));
    border-radius: 26px 26px 0 0;
    transform: translate(-50%, 105%);
  }

  .bottom-sheet.open {
    transform: translate(-50%, 0);
  }

  .shop-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 900px) and (min-height: 600px) {
  .start-screen {
    align-items: center;
    justify-content: flex-end;
    padding: clamp(24px, 4vw, 58px);
    background:
      linear-gradient(90deg, transparent 0 58%, rgba(3, 40, 37, 0.04) 68%, rgba(3, 40, 37, 0.32) 100%),
      linear-gradient(to bottom, rgba(4, 45, 42, 0.02) 0 72%, rgba(2, 28, 26, 0.34) 100%);
  }

  .intro-map-label {
    top: clamp(24px, 4vw, 48px);
    right: clamp(24px, 4vw, 58px);
    left: auto;
    transform: none;
  }

  .overview-hint {
    top: clamp(24px, 4vw, 48px);
    left: clamp(24px, 4vw, 58px);
    padding: 8px 12px;
    font-size: 8px;
    transform: none;
  }

  .start-screen.overview-dragging .overview-hint {
    transform: scale(1.04);
  }

  .intro-copy {
    width: min(31vw, 360px);
    min-width: 320px;
    margin: 38px 0 0;
    padding: 15px 15px 13px;
    border-radius: 22px 8px 23px 11px;
    background: rgba(248, 232, 190, 0.9);
    box-shadow: 0 20px 64px rgba(1, 27, 24, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.58);
  }

  .intro-copy h1 {
    margin: 3px 0 6px;
    font-size: clamp(44px, 4.5vw, 56px);
  }

  .intro-copy > p {
    margin: 7px auto 9px;
    font-size: 11px;
  }

  .intro-controls {
    gap: 5px;
    margin-bottom: 9px;
  }

  .intro-controls > div {
    min-height: 56px;
    padding: 5px 3px 4px;
  }

  .mini-stick {
    width: 24px;
    height: 24px;
  }

  .mini-hand {
    height: 27px;
    font-size: 21px;
  }

  .intro-controls small {
    font-size: 7px;
  }

  .start-button {
    padding: 9px 13px 8px;
  }

  .start-button span {
    font-size: 16px;
  }

  .intro-swap {
    margin-top: 7px;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .top-hud { top: calc(5px + var(--safe-top)); }
  .mission-card { top: calc(49px + var(--safe-top)); width: 210px; }
  .bag-chip { top: calc(49px + var(--safe-top)); }
  .location-ribbon { top: calc(112px + var(--safe-top)); }
  .control-zone { top: 28%; }
  .floating-stick { width: 96px; height: 96px; }
  .joystick-knob { width: 40px; height: 40px; }
  .grab-button { bottom: calc(14px + var(--safe-bottom)); width: 64px; height: 64px; }
  .control-hint { bottom: calc(18px + var(--safe-bottom)); }
  .control-zone[data-control="look"] .control-hint { bottom: calc(88px + var(--safe-bottom)); }
  .swap-shortcut { bottom: calc(8px + var(--safe-bottom)); }
  .start-screen { align-items: center; justify-content: flex-end; padding: 8px calc(8px + var(--safe-right)) 8px 8px; }
  .intro-map-label { left: calc(18px + var(--safe-left)); transform: none; }
  .intro-copy { width: min(54%, 520px); margin: 0; padding: 11px 13px 10px; }
  .intro-copy h1 { font-size: clamp(45px, 10vw, 70px); }
  .intro-copy > p { margin: 7px auto 9px; }
  .intro-controls { margin-bottom: 9px; }
}

@media (pointer: fine) and (hover: hover) and (min-width: 700px) {
  .intro-controls-mobile {
    display: none;
  }

  .intro-controls-desktop {
    display: grid;
  }

  .intro-swap {
    display: none;
  }

  .control-zone {
    display: none;
  }

  .swap-shortcut {
    display: none;
  }

  .grab-button {
    right: 38px;
  }

  .move-right .grab-button {
    right: 38px;
    left: auto;
  }

  #game-shell[data-started="true"][data-pointer-lock="unlocked"] .desktop-control-hint,
  #game-shell[data-started="true"][data-pointer-lock="unsupported"] .desktop-control-hint {
    position: absolute;
    z-index: 24;
    left: 50%;
    bottom: 28px;
    display: grid;
    gap: 3px;
    min-width: 390px;
    padding: 12px 18px 10px;
    border: 1px solid rgba(255, 239, 194, 0.78);
    border-radius: 999px;
    color: #fff1c8;
    background: rgba(3, 50, 46, 0.88);
    box-shadow: 0 10px 34px rgba(1, 24, 22, 0.34);
    text-align: center;
    transform: translateX(-50%);
    pointer-events: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .desktop-control-hint b {
    font-family: "Rockwell Extra Bold", Georgia, serif;
    font-size: 12px;
    letter-spacing: 0.035em;
  }

  .desktop-control-hint span {
    color: rgba(255, 241, 200, 0.74);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.12em;
  }
}

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