:root {
  --ink: #162c45;
  --ink-soft: #365169;
  --paper: #fff4d9;
  --paper-deep: #ead49a;
  --teal: #087d82;
  --teal-dark: #07535f;
  --coral: #d95645;
  --coral-dark: #9e332f;
  --gold: #c98725;
  --gold-light: #ffd47a;
  --green: #2f9668;
  --shadow: rgba(12, 30, 42, .28);
  color-scheme: light;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  letter-spacing: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #102f37;
}

body,
button {
  font-family: Inter, ui-rounded, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
}

button {
  color: inherit;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  cursor: default;
  opacity: .55;
}

[hidden] {
  display: none !important;
}

#game {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  color: var(--ink);
}

.scene,
.sunwash {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scene {
  z-index: -3;
  background: #d8ae62 url("assets/cartographer-desk.webp") center center / cover no-repeat;
  transform: scale(1.018);
  animation: cabinBreath 12s ease-in-out infinite alternate;
}

.sunwash {
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(255, 240, 189, .08), transparent 28%),
    linear-gradient(0deg, rgba(8, 62, 69, .12), transparent 32%);
}

#hud {
  position: absolute;
  z-index: 20;
  top: calc(8px + env(safe-area-inset-top, 0px));
  left: 10px;
  right: 74px;
  display: flex;
  align-items: stretch;
  gap: 8px;
  height: 54px;
  pointer-events: none;
}

.hud-chip {
  display: flex;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(255, 244, 217, .64);
  border-radius: 8px;
  background: rgba(18, 44, 63, .89);
  box-shadow: 0 4px 12px var(--shadow), inset 0 1px rgba(255, 255, 255, .14);
  color: #fff8e5;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hud-chip b,
.hud-chip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-chip b {
  font-size: 15px;
  line-height: 1.1;
  font-weight: 850;
}

.hud-chip small {
  margin-top: 3px;
  font-size: 9px;
  line-height: 1.05;
  color: #d5f0ea;
  font-weight: 700;
}

.currency-chip {
  flex: 0 0 88px;
  gap: 7px;
  padding: 6px 8px;
}

.currency-chip b {
  color: var(--gold-light);
  font-size: 17px;
}

.hud-gem {
  width: 22px;
  height: 29px;
  flex: none;
  clip-path: polygon(50% 0, 89% 27%, 77% 83%, 50% 100%, 23% 83%, 11% 27%);
  background: linear-gradient(135deg, #fff2a6 0 18%, #efb247 20% 62%, #b96825 64%);
  box-shadow: inset 0 0 0 2px rgba(80, 39, 20, .34);
}

.route-chip {
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  padding: 7px 10px;
  text-align: center;
}

.play-surface {
  position: absolute;
  inset: 0;
}

.landmark,
.guide {
  position: absolute;
  z-index: 0;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 8px 9px rgba(11, 35, 46, .23));
}

.landmark {
  top: calc(72px + env(safe-area-inset-top, 0px));
  right: 0;
  width: clamp(86px, 28vw, 132px);
  height: clamp(125px, 35vw, 190px);
  opacity: .94;
  animation: landmarkFloat 4.8s ease-in-out infinite;
}

.guide {
  left: max(4px, calc(50% - 245px));
  top: clamp(270px, 38svh, 340px);
  width: clamp(92px, 25vw, 130px);
  height: clamp(138px, 37.5vw, 195px);
  object-position: center bottom;
  transform-origin: 50% 92%;
  animation: guideIdle 3.7s ease-in-out infinite;
}

.puzzle {
  position: absolute;
  z-index: 4;
  top: clamp(124px, 18.8svh, 166px);
  left: 50%;
  width: min(calc(100% - 44px), 440px);
  min-height: 184px;
  transform: translateX(-50%);
  padding: 13px 14px 11px;
  border: 1px solid rgba(74, 52, 28, .2);
  border-radius: 8px;
  background: rgba(255, 246, 219, .9);
  box-shadow: 0 7px 22px rgba(64, 39, 16, .16), inset 0 1px rgba(255, 255, 255, .72);
  text-align: center;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.puzzle::before,
.puzzle::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(var(--teal), var(--gold), var(--coral));
  opacity: .62;
}

.puzzle::before { left: 7px; }
.puzzle::after { right: 7px; }

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  color: var(--teal-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 800;
}

.brand-mark {
  width: 16px;
  height: 16px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background:
    linear-gradient(45deg, transparent 44%, var(--coral) 45% 55%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, var(--teal) 45% 55%, transparent 56%);
}

.objective {
  min-height: 17px;
  margin-top: 4px;
  color: var(--coral-dark);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
}

.puzzle h1 {
  min-height: 34px;
  margin: 3px auto 8px;
  max-width: 92%;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(20px, 6.2vw, 28px);
  line-height: 1.15;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.answer-slots {
  --slot-size: 42px;
  display: flex;
  justify-content: center;
  gap: 5px;
  width: 100%;
  min-height: var(--slot-size);
}

.answer-slot {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--slot-size);
  height: var(--slot-size);
  flex: 0 1 var(--slot-size);
  min-width: 24px;
  border: 1px solid rgba(22, 44, 69, .32);
  border-bottom: 3px solid var(--ink-soft);
  border-radius: 7px;
  background: rgba(255, 255, 255, .62);
  color: var(--ink);
  font-size: clamp(17px, 5.2vw, 23px);
  line-height: 1;
  font-weight: 900;
}

.answer-slot.locked {
  border-color: rgba(8, 125, 130, .58);
  background: #d9f3e8;
  color: var(--teal-dark);
}

.answer-slot.locked::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}

.coach {
  min-height: 16px;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 750;
}

.coach.hidden-coach {
  visibility: hidden;
}

.letter-rack {
  --tile-size: 58px;
  position: absolute;
  z-index: 5;
  top: clamp(334px, 52.5svh, 465px);
  left: 50%;
  display: grid;
  grid-template-columns: repeat(var(--rack-cols, 4), var(--tile-size));
  justify-content: center;
  gap: 8px;
  width: min(calc(100% - 24px), 430px);
  min-height: calc(var(--tile-size) * 2 + 8px);
  transform: translateX(-50%);
}

.letter-tile {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--tile-size);
  height: var(--tile-size);
  border: 1px solid rgba(70, 43, 19, .46);
  border-bottom: 5px solid #98621d;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.5), transparent 36%),
    linear-gradient(180deg, #ffe8a8, #d99a3a);
  box-shadow: 0 5px 9px rgba(65, 38, 15, .2), inset 0 1px rgba(255, 255, 255, .62);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  line-height: 1;
  font-weight: 900;
  text-transform: uppercase;
  transition: transform .13s ease, opacity .13s ease, filter .13s ease;
}

.letter-tile::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 248, 215, .34);
  border-radius: 5px;
  pointer-events: none;
}

.letter-tile:active {
  transform: translateY(3px) scale(.97);
  border-bottom-width: 2px;
}

.letter-tile.used {
  opacity: .26;
  filter: saturate(.3);
  transform: scale(.9);
}

.letter-tile.decoy {
  background:
    linear-gradient(145deg, rgba(255,255,255,.45), transparent 36%),
    linear-gradient(180deg, #f9cf9c, #c8754e);
  border-bottom-color: #884437;
}

.tool-dock {
  position: absolute;
  z-index: 7;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: repeat(3, minmax(78px, 104px));
  justify-content: center;
  gap: 7px;
  width: min(calc(100% - 24px), 340px);
  min-height: 62px;
  transform: translateX(-50%);
}

.tool-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 58px;
  padding: 5px 6px;
  border: 1px solid rgba(255, 244, 217, .72);
  border-radius: 8px;
  background: rgba(18, 63, 73, .91);
  box-shadow: 0 5px 12px rgba(11, 33, 42, .24), inset 0 1px rgba(255,255,255,.13);
  color: #fff8e6;
  font-size: 10px;
  line-height: 1.05;
  font-weight: 800;
}

.tool-button > span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.undo-icon,
.shuffle-icon {
  height: 30px;
  color: var(--gold-light);
  font-size: 27px;
  line-height: 28px;
  font-weight: 850;
}

.compass-button img {
  width: 35px;
  height: 35px;
  object-fit: contain;
  margin-top: -5px;
  margin-bottom: -2px;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.2));
}

.compass-button b {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  margin-left: 2px;
  border-radius: 50%;
  background: var(--coral);
  color: white;
  font-size: 10px;
}

.ink-meter {
  position: absolute;
  z-index: 9;
  top: calc(72px + env(safe-area-inset-top, 0px));
  left: 12px;
  display: flex;
  gap: 5px;
  min-width: 88px;
  min-height: 30px;
  pointer-events: none;
}

.ink-drop {
  position: relative;
  width: 24px;
  height: 29px;
  clip-path: polygon(50% 0, 86% 34%, 91% 59%, 78% 84%, 50% 100%, 22% 84%, 9% 59%, 14% 34%);
  background: linear-gradient(145deg, #32b6b4, #07535f 68%);
  filter: drop-shadow(0 2px 2px rgba(12, 33, 43, .28));
  transition: transform .2s ease, filter .2s ease, opacity .2s ease;
}

.ink-drop.empty {
  opacity: .25;
  filter: grayscale(1);
  transform: scale(.82);
}

.ink-drop.bonus {
  background: linear-gradient(145deg, #ffd47a, #d95645 72%);
}

.toast {
  position: absolute;
  z-index: 55;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  max-width: min(86vw, 360px);
  min-height: 38px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 244, 217, .42);
  border-radius: 8px;
  background: rgba(18, 44, 63, .95);
  box-shadow: 0 6px 16px rgba(8, 23, 30, .34);
  color: white;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 800;
  text-align: center;
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.puzzle.correct {
  animation: correctPulse .48s ease;
}

.puzzle.wrong {
  animation: wrongShake .38s ease;
}

.burst-particle {
  position: absolute;
  z-index: 8;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--gold-light);
  pointer-events: none;
  animation: burst .72s ease-out forwards;
}

.overlay {
  position: absolute;
  z-index: 70;
  inset: 0;
  display: grid;
  place-items: center;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 12px calc(12px + env(safe-area-inset-bottom, 0px));
}

.overlay-scrim {
  position: absolute;
  inset: 0;
  background: rgba(8, 28, 38, .8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 390px);
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 18px;
  border: 1px solid rgba(255, 226, 157, .7);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 250, 232, .98), rgba(239, 219, 170, .98));
  box-shadow: 0 18px 44px rgba(2, 19, 28, .5), inset 0 1px rgba(255,255,255,.8);
}

.sheet h2 {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(22px, 6.8vw, 29px);
  line-height: 1.08;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--coral-dark);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 900;
}

.sheet-hero {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 98px;
}

.sheet-hero img {
  width: 88px;
  height: 98px;
  object-fit: contain;
  filter: drop-shadow(0 5px 5px rgba(20, 48, 58, .22));
}

.reward-line {
  margin-top: 7px;
  color: var(--teal-dark);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 850;
}

.upgrade-list {
  display: grid;
  gap: 6px;
  margin: 11px 0;
}

.upgrade-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 55px;
  padding: 6px 7px;
  border-bottom: 1px solid rgba(22, 44, 69, .16);
  background: rgba(255, 255, 255, .3);
}

.upgrade-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--teal-dark);
  color: var(--gold-light);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 900;
}

.upgrade-copy {
  min-width: 0;
}

.upgrade-copy b,
.upgrade-copy small {
  display: block;
  overflow-wrap: anywhere;
}

.upgrade-copy b {
  font-size: 13px;
  line-height: 1.16;
}

.upgrade-copy small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.15;
}

.upgrade-buy {
  min-width: 64px;
  min-height: 44px;
  padding: 5px 7px;
  border: 1px solid rgba(255,255,255,.48);
  border-radius: 7px;
  background: var(--teal);
  color: white;
  font-size: 11px;
  line-height: 1.1;
  font-weight: 900;
}

.upgrade-buy.short {
  background: var(--coral);
}

.upgrade-buy.locked {
  background: #8a8c86;
}

.status-line {
  min-height: 18px;
  margin: 3px 0 6px;
  color: var(--coral-dark);
  font-size: 11px;
  line-height: 1.25;
  font-weight: 800;
  text-align: center;
}

.action-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  margin-top: 7px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 900;
  text-align: center;
  overflow-wrap: anywhere;
}

.action-button.primary {
  border-bottom: 4px solid #05535c;
  background: linear-gradient(180deg, #16999c, #08747a);
  color: white;
}

.action-button.rewarded {
  border: 1px solid #d98a27;
  border-bottom: 4px solid #9a5523;
  background: linear-gradient(180deg, #ffdf84, #e9a739);
  color: #3b2817;
}

.action-button.quiet {
  border: 1px solid rgba(22, 44, 69, .24);
  background: rgba(255,255,255,.48);
  color: var(--ink-soft);
}

.action-button:active:not(:disabled) {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.video-icon {
  position: relative;
  width: 25px;
  height: 18px;
  flex: none;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.video-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 7px solid currentColor;
}

.action-arrow {
  font-size: 22px;
  line-height: 1;
}

.decision-sheet,
.utility-sheet {
  text-align: center;
}

.decision-art {
  display: block;
  width: 116px;
  height: 155px;
  margin: -6px auto 4px;
  object-fit: contain;
  object-position: center 22%;
  filter: drop-shadow(0 7px 5px rgba(24, 50, 58, .22));
}

.decision-copy {
  margin: 9px auto 5px;
  max-width: 310px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.utility-art {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto 4px;
  object-fit: contain;
  filter: drop-shadow(0 6px 5px rgba(24, 50, 58, .2));
}

@keyframes cabinBreath {
  from { transform: scale(1.018) translate3d(-2px, -1px, 0); }
  to { transform: scale(1.03) translate3d(2px, 2px, 0); }
}

@keyframes guideIdle {
  0%, 100% { transform: translateY(0) rotate(-.5deg); }
  50% { transform: translateY(-5px) rotate(.7deg); }
}

@keyframes landmarkFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@keyframes correctPulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  45% { transform: translateX(-50%) scale(1.025); box-shadow: 0 0 0 5px rgba(47, 150, 104, .22); }
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(-50%); }
  25% { transform: translateX(calc(-50% - 7px)); }
  70% { transform: translateX(calc(-50% + 6px)); }
}

@keyframes burst {
  from { transform: translate(0, 0) rotate(0); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)) rotate(180deg); opacity: 0; }
}

@media (max-width: 350px) {
  #hud {
    left: 7px;
    right: 69px;
    gap: 5px;
  }

  .currency-chip {
    flex-basis: 78px;
    padding: 5px 6px;
  }

  .hud-gem {
    width: 18px;
    height: 24px;
  }

  .hud-chip b { font-size: 13px; }
  .currency-chip b { font-size: 15px; }

  .puzzle {
    width: calc(100% - 30px);
    padding-left: 11px;
    padding-right: 11px;
  }

  .answer-slots {
    --slot-size: 37px;
    gap: 4px;
  }

  .letter-rack {
    --tile-size: 54px;
    gap: 7px;
  }

  .tool-dock {
    grid-template-columns: repeat(3, minmax(72px, 94px));
  }

  .sheet {
    padding: 14px;
  }
}

@media (max-height: 640px) and (orientation: portrait) {
  #hud { height: 47px; }
  .hud-chip { padding-top: 4px; padding-bottom: 4px; }
  .landmark { top: 57px; width: 78px; height: 108px; opacity: .7; }
  .ink-meter { top: 61px; }
  .ink-drop { width: 20px; height: 24px; }
  .guide { top: 248px; width: 95px; height: 142px; opacity: .8; }

  .puzzle {
    top: 103px;
    min-height: 166px;
    padding-top: 9px;
    padding-bottom: 8px;
  }

  .brand-lockup { font-size: 13px; min-height: 18px; }
  .brand-mark { width: 14px; height: 14px; }
  .objective { margin-top: 2px; }
  .puzzle h1 { min-height: 28px; margin: 1px auto 5px; font-size: 20px; }
  .answer-slots { --slot-size: 36px; }
  .coach { margin-top: 5px; }

  .letter-rack {
    --tile-size: 50px;
    top: 282px;
    gap: 6px;
    min-height: 106px;
  }

  .letter-tile {
    border-bottom-width: 4px;
    font-size: 22px;
  }

  .tool-dock {
    bottom: calc(7px + env(safe-area-inset-bottom, 0px));
    min-height: 54px;
  }

  .tool-button { min-height: 52px; }
  .undo-icon, .shuffle-icon { height: 25px; font-size: 23px; line-height: 24px; }
  .compass-button img { width: 31px; height: 31px; }

  .checkpoint-sheet {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .sheet-hero { min-height: 76px; grid-template-columns: 70px minmax(0, 1fr); }
  .sheet-hero img { width: 68px; height: 76px; }
  .sheet h2 { font-size: 21px; }
  .upgrade-list { margin: 7px 0; }
  .upgrade-row { min-height: 48px; padding-top: 3px; padding-bottom: 3px; }
  .action-button { min-height: 46px; margin-top: 5px; }
  .decision-art { width: 86px; height: 112px; margin-bottom: 2px; }
  .utility-art { width: 72px; height: 72px; }
}

@media (orientation: landscape) {
  #hud {
    right: 80px;
    width: min(46vw, 390px);
  }

  .landmark {
    top: 51px;
    right: 6px;
    width: 90px;
    height: 132px;
    opacity: .65;
  }

  .guide {
    left: 8px;
    top: auto;
    bottom: 4px;
    width: clamp(96px, 17vw, 145px);
    height: clamp(145px, 25vw, 218px);
    opacity: .88;
  }

  .ink-meter {
    top: 69px;
  }

  .puzzle {
    top: 72px;
    left: 29%;
    width: min(43vw, 360px);
    min-height: 212px;
    transform: translateX(-50%);
  }

  .puzzle h1 {
    font-size: clamp(20px, 3vw, 27px);
  }

  .answer-slots {
    --slot-size: 38px;
  }

  .letter-rack {
    --tile-size: 54px;
    top: 82px;
    left: 71%;
    width: min(45vw, 380px);
    min-height: 116px;
    transform: translateX(-50%);
  }

  .tool-dock {
    left: 71%;
    bottom: 12px;
    width: min(46vw, 340px);
  }

  .toast {
    left: 71%;
    bottom: 79px;
  }

  .sheet {
    width: min(92vw, 690px);
  }

  .checkpoint-sheet {
    display: grid;
    grid-template-columns: minmax(230px, .9fr) minmax(280px, 1.1fr);
    grid-template-areas:
      "hero upgrades"
      "status upgrades"
      "chart continue";
    column-gap: 16px;
    align-items: center;
  }

  .checkpoint-sheet .sheet-hero { grid-area: hero; }
  .checkpoint-sheet .upgrade-list { grid-area: upgrades; margin: 0; }
  .checkpoint-sheet .status-line { grid-area: status; }
  #chartAdBtn { grid-area: chart; }
  #continueBtn { grid-area: continue; }

  .decision-sheet,
  .utility-sheet {
    width: min(88vw, 560px);
    min-height: 290px;
    padding-left: 184px;
  }

  .decision-art,
  .utility-art {
    position: absolute;
    left: 24px;
    top: 50%;
    width: 142px;
    height: 220px;
    margin: 0;
    transform: translateY(-50%);
  }

  .utility-art {
    width: 126px;
    height: 126px;
    left: 36px;
  }
}

@media (orientation: landscape) and (max-height: 420px) {
  #hud { top: 5px; height: 48px; }
  .ink-meter { top: 57px; }
  .ink-drop { width: 20px; height: 24px; }
  .puzzle { top: 60px; min-height: 186px; padding-top: 9px; padding-bottom: 8px; }
  .brand-lockup { min-height: 18px; }
  .puzzle h1 { min-height: 28px; margin: 2px auto 5px; }
  .answer-slots { --slot-size: 34px; }
  .coach { margin-top: 5px; }
  .letter-rack { --tile-size: 49px; top: 61px; gap: 6px; min-height: 104px; }
  .tool-dock { bottom: 6px; min-height: 50px; }
  .tool-button { min-height: 49px; }
  .compass-button img { width: 29px; height: 29px; }
  .undo-icon, .shuffle-icon { height: 24px; font-size: 22px; line-height: 23px; }
  .sheet { padding: 12px 14px; }
  .sheet-hero { min-height: 72px; grid-template-columns: 68px minmax(0,1fr); }
  .sheet-hero img { width: 66px; height: 72px; }
  .upgrade-row { min-height: 46px; }
  .action-button { min-height: 45px; margin-top: 4px; }
  .decision-sheet, .utility-sheet { min-height: 260px; }
}

@media (min-width: 900px) and (orientation: landscape) {
  .puzzle { left: 32%; max-width: 420px; }
  .letter-rack, .tool-dock, .toast { left: 69%; }
  .letter-rack { --tile-size: 64px; }
}

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