html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #05080a;
  overflow: hidden;
  font-family: system-ui, sans-serif;
  color: #cfd8d0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body.high-contrast {
  background: #000000;
  color: #ffffff;
}
#game {
  width: 100vw;
  height: 100vh;
  height: 100svh;
  display: block;
}
#game canvas {
  display: block;
  max-width: 100vw;
  max-height: 100svh;
}
.monster-truck-three-canvas {
  position: fixed;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: normal;
  opacity: 0.38;
}
#hud {
  position: fixed;
  top: 8px;
  right: 8px;
  max-width: min(280px, calc(100vw - 16px));
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.48);
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.12;
  pointer-events: none;
  text-align: right;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.78);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}
#hud::before {
  content: attr(data-summary);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#hud:not([data-summary])::before {
  content: "Run 0";
}
#hud > div {
  display: none;
}
#hud > div:first-child {
  display: none;
}
#hud > div:last-child {
  display: none;
}
#hud b {
  color: #ffd36b;
  font-weight: 800;
  text-shadow:
    0 0 6px rgba(255, 211, 107, 0.45),
    0 1px 2px rgba(0, 0, 0, 0.7);
}
@media (max-width: 760px), (max-height: 620px) {
  #hud {
    top: 6px;
    left: 6px;
    right: 6px;
    max-width: none;
    max-height: min(32px, calc(100svh - 12px));
    padding: 5px 8px;
    overflow: hidden;
    border-radius: 7px;
    font-size: 10px;
    line-height: 1.08;
    text-align: center;
  }
  #levelMapBtn {
    top: auto;
    right: 6px;
    bottom: max(8px, env(safe-area-inset-bottom));
    min-height: 34px;
    padding: 6px 9px;
    font-size: 12px;
  }
}
@media (max-width: 520px), (max-height: 500px) {
  #hud {
    left: 6px;
    right: 6px;
    max-width: none;
    text-align: center;
  }
  #hud > div:first-child,
  #hud > div:last-child {
    display: none;
  }
  #levelMapBtn {
    top: auto;
    right: 6px;
    bottom: max(8px, env(safe-area-inset-bottom));
  }
}
#levelMapBtn {
  position: fixed;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 14;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 12px;
  border: 2px solid rgba(255, 211, 107, 0.82);
  border-radius: 8px;
  background: rgba(5, 8, 10, 0.74);
  color: #fff7ce;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.32);
}
#levelMapBtn:hover {
  background: rgba(255, 211, 107, 0.2);
}
#levelMapBtn:focus-visible {
  outline: 3px solid rgba(141, 252, 255, 0.85);
  outline-offset: 2px;
}
@media (max-width: 760px), (max-height: 620px) {
  #levelMapBtn {
    right: 6px;
    bottom: max(8px, env(safe-area-inset-bottom));
    min-height: 34px;
    padding: 6px 9px;
    font-size: 12px;
  }
}
@media (max-width: 520px), (max-height: 500px) {
  #levelMapBtn {
    top: auto;
    right: 6px;
    bottom: max(8px, env(safe-area-inset-bottom));
  }
}
.jumpTutorialCue {
  position: fixed;
  left: clamp(360px, 38vw, 560px);
  bottom: clamp(110px, 17vh, 170px);
  z-index: 12;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}
.jumpTutorialCue.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.jumpTutorialCue.leaving {
  opacity: 0;
  transform: translate(-50%, -10px);
}
.jumpTutorialCue span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 2px solid rgba(255, 211, 107, 0.92);
  border-radius: 8px;
  background: rgba(5, 8, 10, 0.86);
  color: #fff7ce;
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
  text-shadow:
    0 0 6px rgba(255, 211, 107, 0.45),
    0 2px 2px #000000;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.32);
}
.jumpTutorialCue b {
  align-self: center;
  margin-bottom: -2px;
  color: #ffd36b;
  font-size: 38px;
  line-height: 0.9;
  text-shadow:
    0 0 4px rgba(255, 211, 107, 0.48),
    0 2px 2px #000000;
}
body.high-contrast .jumpTutorialCue span {
  border-color: #ffffff;
  background: #000000;
  color: #ffffff;
  text-shadow: none;
}
body.high-contrast .jumpTutorialCue b {
  color: #ffff00;
  text-shadow: none;
}
@media (max-width: 760px), (max-height: 620px) {
  .jumpTutorialCue {
    left: 50%;
    bottom: max(108px, calc(env(safe-area-inset-bottom) + 108px));
  }
  .jumpTutorialCue span {
    padding: 8px 12px;
    font-size: 17px;
  }
  .jumpTutorialCue b {
    font-size: 34px;
  }
}
body.secret-swamp-active #hud,
body.secret-swamp-active #levelMapBtn,
body.secret-swamp-active #touchSettingsPad,
body.secret-swamp-active #helperBadge,
body.secret-swamp-active #muteBadge,
body.secret-swamp-active #inputHintBadge,
body.secret-swamp-active #settingsBtn {
  display: none !important;
}
body.high-contrast #hud,
body.high-contrast #levelMapBtn,
body.high-contrast #levelCoach,
body.high-contrast #brainBridgePanel,
body.high-contrast #learningBridgePanel,
body.high-contrast #patternPainterPanel,
body.high-contrast #settingsPanel,
body.high-contrast #leaderboardPanel,
body.high-contrast #dailyMissionsPanel {
  background: #000000;
  border: 3px solid #ffffff;
  color: #ffffff;
  text-shadow: none;
  box-shadow: none;
}
body.high-contrast #hud b,
body.high-contrast #levelCoach .coachTitle,
body.high-contrast #brainBridgeTitle,
body.high-contrast #learningBridgeTitle,
body.high-contrast #settingsPanel h2,
body.high-contrast #leaderboardPanel h2 {
  color: #ffff00;
  text-shadow: none;
}
body.high-contrast #levelCoach .coachSkill,
body.high-contrast #levelCoach .coachGoal,
body.high-contrast #levelCoach .coachKidCue,
body.high-contrast #levelCoach .coachTip,
body.high-contrast #levelCoach .coachBridge,
body.high-contrast #levelCoach .coachHelper,
body.high-contrast #levelCoach .coachVoiceStatus,
body.high-contrast #brainBridgeKicker,
body.high-contrast #learningBridgeKicker,
body.high-contrast .learningBridgeRow b,
body.high-contrast #replayGoalTitle,
body.high-contrast #replayGoalPrompt,
body.high-contrast #inputHint,
body.high-contrast #inputHintBadge,
body.high-contrast #helperBadge,
body.high-contrast #helperChoice,
body.high-contrast #bridgeSnippet {
  color: #ffffff;
  opacity: 1;
}
#helperBadge {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 13;
  display: none;
  max-width: min(360px, calc(100vw - 24px));
  padding: 9px 12px;
  border: 2px solid rgba(255, 211, 107, 0.72);
  border-radius: 8px;
  background: rgba(5, 8, 10, 0.72);
  color: #f7ffe8;
  font-size: 13px;
  line-height: 1.22;
  pointer-events: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.34);
}
#helperBadge.show {
  display: block;
}
body:has(#start.show) #helperBadge {
  display: none !important;
}
body.high-contrast #helperBadge {
  background: #000000;
  border: 3px solid #ffffff;
  box-shadow: none;
}
body.high-contrast #levelCoach .coachVoiceButton {
  background: #000000;
  border-color: #ffff00;
  color: #ffff00;
}
#hud.foodGroupMode #runnerOnlyHudStats {
  display: none;
}
body:has(#start.show) #hud {
  opacity: 0;
}
body:has(#start.show) #levelMapBtn {
  display: none;
}
body:has(#over.show) #levelMapBtn,
body:has(#over.show) #touchSettingsPad,
body:has(#over.show) #settingsBtn {
  display: none !important;
}
/* Touch pad for mute/pause/restart so kids on phones/tablets have
   a path to those actions. Keyboard kids can still use M/P/R. */
#touchSettingsPad {
  position: fixed;
  top: 12px;
  left: 12px;
  display: none;
  gap: 12px;
  z-index: 14;
  pointer-events: auto;
}
body:has(#start.show) #touchSettingsPad {
  display: none !important;
}
body.show-touch-pad #touchSettingsPad {
  display: flex;
}
body.show-touch-pad #hud {
  top: 8px;
  left: 76px;
  right: 8px;
  padding: 5px 8px;
  font-size: 11px;
  line-height: 1.12;
  text-align: center;
}
body.show-touch-pad #hud > div:first-child {
  font-size: 0;
}
body.show-touch-pad #hud > div:first-child::before {
  content: "Tap or swipe in the game. Round buttons pause, restart, and pick a level.";
  font-size: 13px;
  line-height: 1.2;
}
body.show-touch-pad #hud > div:last-child {
  display: none;
}
body.show-touch-pad #levelMapBtn {
  display: none;
}
@media (max-width: 520px) {
  body.show-touch-pad #hud {
    top: 142px;
    left: 8px;
    right: 8px;
  }
}
#touchSettingsPad button {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(5, 8, 10, 0.62);
  color: #f5fff1;
  border: 2px solid rgba(255, 211, 107, 0.8);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.32);
  touch-action: manipulation;
  padding: 0;
}
#touchSettingsPad button:active {
  transform: scale(0.94);
  background: rgba(255, 211, 107, 0.32);
}
#touchSettingsPad button[data-on="true"] {
  background: rgba(255, 211, 107, 0.32);
}
#levelCoach {
  position: fixed;
  left: 12px;
  top: 96px;
  width: min(390px, calc(100vw - 24px));
  box-sizing: border-box;
  padding: 12px 14px;
  border: 2px solid rgba(255, 211, 107, 0.62);
  border-radius: 10px;
  background: rgba(5, 8, 10, 0.94);
  color: #fbfff8;
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 0.28s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
  pointer-events: none;
  z-index: 9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
#levelCoach.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: none;
}
body:has(#brainBridgePanel.show) #levelCoach {
  display: none;
}
body.show-touch-pad #levelCoach {
  top: 172px;
  max-height: min(42svh, 360px);
  overflow: auto;
}
#levelCoach .coachTitle {
  color: #ffd36b;
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
}
#levelCoach .coachSkill {
  margin-top: 7px;
  font-size: 12px;
  color: #dfeadd;
  opacity: 0.9;
}
#levelCoach .coachKidCue {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  margin-top: 8px;
  color: #f8fff0;
  font-size: 15px;
  line-height: 1.28;
}
#levelCoach .coachKidCue b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: 999px;
  background: rgba(255, 211, 107, 0.2);
  color: #ffd36b;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}
#levelCoach .coachKidGoal span {
  font-weight: 850;
}
#levelCoach .coachKidTry {
  color: #dffcff;
}
#levelCoach .coachVoiceRow {
  margin-top: 7px;
  display: flex;
  align-items: center;
  gap: 8px;
}
#levelCoach .coachVoiceButton {
  min-height: 44px;
  padding: 8px 14px;
  border: 2px solid rgba(255, 211, 107, 0.72);
  border-radius: 8px;
  background: rgba(255, 211, 107, 0.16);
  color: #fff7ce;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
  pointer-events: auto;
}
#levelCoach .coachVoiceStatus {
  min-height: 16px;
  color: #8dfcff;
  font-size: 12px;
}
#levelCoach .coachHelper {
  margin-top: 6px;
  padding: 5px 7px;
  border-radius: 7px;
  background: rgba(255, 211, 107, 0.12);
  color: #fff9d8;
  font-size: 13px;
  line-height: 1.28;
}
#levelCoach .coachTips {
  margin-top: 7px;
  display: grid;
  gap: 4px;
}
#levelCoach .coachTip {
  padding: 5px 7px;
  border-radius: 7px;
  background: rgba(141, 252, 255, 0.1);
  color: #fbfff8;
  font-size: 12px;
  line-height: 1.28;
}
/* AGENT_TARGET: coach-replay-btn — "Show me again" button at bottom of level coach panel */
#levelCoach .coachReplayBtn {
  display: block;
  margin: 8px auto 2px;
  min-height: 44px;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 211, 107, 0.12);
  color: #ffd36b;
  border: 1px solid rgba(255, 211, 107, 0.38);
  border-radius: 20px;
  cursor: pointer;
  touch-action: manipulation;
  pointer-events: auto;
}
body.high-contrast #levelCoach .coachReplayBtn {
  background: #222;
  color: #ffe566;
  border-color: #ffe566;
}
#levelCoach .coachBridge {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 211, 107, 0.22);
  color: #8dfcff;
  font-size: 12px;
  line-height: 1.35;
}
#over {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, 0.65);
  font-size: 28px;
  text-align: center;
}
#over.show {
  display: grid;
}
#over:has(#brainBridgePanel.show) {
  place-items: start center;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}
#over:has(#brainBridgePanel.show) > div {
  width: min(1180px, calc(100vw - 28px));
  min-height: 100svh;
  padding: 10px 0 max(28px, env(safe-area-inset-bottom));
  box-sizing: border-box;
}
#over:has(#brainBridgePanel.show) #overMsg,
#over:has(#brainBridgePanel.show) #overStats {
  display: none !important;
}
#over[data-outcome="loss"] {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 211, 107, 0.16), transparent 38%),
    rgba(1, 5, 8, 0.9);
}
#over[data-outcome="loss"] > div {
  width: min(860px, calc(100vw - 28px));
}
#over[data-outcome="loss"]:has(#learningBridgePanel.compact.show) #overMsg,
#over[data-outcome="loss"]:has(#learningBridgePanel.compact.show) #overStats,
#over[data-outcome="loss"]:has(#learningBridgePanel.compact.show) #replayGoalPanel,
#over[data-outcome="loss"]:has(#learningBridgePanel.compact.show) #patternPainterBtn,
#over[data-outcome="loss"]:has(#learningBridgePanel.compact.show) #overRetryBtn,
#over[data-outcome="loss"]:has(#learningBridgePanel.compact.show) #overPickLevelBtn,
#over[data-outcome="loss"]:has(#learningBridgePanel.compact.show) #overNextLevelBtn {
  display: none !important;
}
#over[data-bridge-page="mind"] #overMsg,
#over[data-bridge-page="mind"] #overStats,
#over[data-bridge-page="mind"] #replayGoalPanel,
#over[data-bridge-page="mind"] #patternPainterBtn,
#over[data-bridge-page="mind"] #overRetryBtn,
#over[data-bridge-page="mind"] #overPickLevelBtn,
#over[data-bridge-page="mind"] #overNextLevelBtn {
  display: none !important;
}
#over[data-outcome="loss"]:has(#learningBridgePanel.compact.show) {
  place-items: stretch;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(180deg, rgba(1, 5, 8, 0.12), rgba(1, 5, 8, 0.72)),
    radial-gradient(circle at 72% 20%, rgba(255, 211, 107, 0.18), transparent 28%),
    url("../../assets/level5_monkey_rescue_background.png") center / cover no-repeat,
    #050a08;
}
#over[data-outcome="loss"]:has(#learningBridgePanel.compact.show) > div {
  width: 100%;
  min-height: 100svh;
  padding: clamp(18px, 4vw, 48px);
  padding-bottom: max(48px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  display: grid;
  place-items: start center;
  align-content: start;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 0,
      rgba(0, 0, 0, 0) 3px,
      rgba(0, 0, 0, 0.24) 4px,
      rgba(0, 0, 0, 0) 5px
    ),
    radial-gradient(ellipse at center, transparent 34%, rgba(0, 0, 0, 0.72) 100%);
}
#over[data-bridge-page="mind"] {
  place-items: stretch;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(180deg, rgba(1, 5, 8, 0.12), rgba(1, 5, 8, 0.72)),
    radial-gradient(circle at 72% 20%, rgba(255, 211, 107, 0.18), transparent 28%),
    url("../../assets/level5_monkey_rescue_background.png") center / cover no-repeat,
    #050a08;
}
#over[data-bridge-page="mind"] > div {
  width: 100%;
  min-height: 100svh;
  padding: clamp(18px, 4vw, 48px);
  padding-bottom: max(48px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  display: grid;
  place-items: start center;
  align-content: start;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 0,
      rgba(0, 0, 0, 0) 3px,
      rgba(0, 0, 0, 0.24) 4px,
      rgba(0, 0, 0, 0) 5px
    ),
    radial-gradient(ellipse at center, transparent 34%, rgba(0, 0, 0, 0.72) 100%);
}
#over button,
#start button {
  margin-top: 18px;
  padding: 14px 26px;
  min-height: 56px;
  font-size: 18px;
  font-weight: 700;
  color: #10130d;
  border: 0;
  border-radius: 8px;
  background: #ffd36b;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
  transition:
    transform 0.16s cubic-bezier(0.22, 0.61, 0.36, 1),
    box-shadow 0.16s cubic-bezier(0.22, 0.61, 0.36, 1);
}
#over button {
  margin-left: 6px;
  margin-right: 6px;
}
#brainBridgePanel {
  position: relative;
  overflow-x: clip;
  overflow-y: auto;
  display: none;
  width: min(1080px, calc(100vw - 18px));
  max-height: calc(100svh - 20px);
  box-sizing: border-box;
  margin: 0 auto;
  padding: 14px 14px 18px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, #3266ba 0%, #4c8bd3 100%);
  color: #1d3154;
  text-align: left;
  font-size: 15px;
  line-height: 1.35;
  isolation: isolate;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}
#brainBridgePanel.show {
  display: block;
}
#brainBridgePanel::before {
  content: none;
}
#brainBridgePanel > * {
  position: relative;
  z-index: 1;
}
#replayGoalPanel {
  display: none;
  width: min(620px, calc(100vw - 40px));
  margin: 14px auto 0;
  padding: 12px;
  border: 1px solid rgba(255, 211, 107, 0.38);
  border-radius: 8px;
  background: rgba(8, 18, 24, 0.86);
  color: #edf7ed;
  text-align: left;
  font-size: 15px;
  line-height: 1.35;
}
#replayGoalPanel.show {
  display: block;
}
#replayGoalTitle {
  color: #ffd36b;
  font-size: 18px;
  font-weight: 900;
}
#replayGoalPrompt {
  margin-top: 5px;
  color: #cfd8d0;
}
#replayGoalChoices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
#over #replayGoalChoices button {
  margin: 0;
  padding: 10px 12px;
  min-height: 48px;
  font-size: 14px;
}
body.high-contrast #replayGoalPanel {
  background: #000000;
  border: 3px solid #ffffff;
  color: #ffffff;
  text-shadow: none;
  box-shadow: none;
}
body.high-contrast #replayGoalTitle {
  color: #ffff00;
}
#brainBridgeKicker {
  color: #fff7df;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
  text-align: center;
}
#brainBridgeTitle {
  margin-top: 2px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  text-align: center;
}
#brainBridgePrompt {
  position: relative;
  min-height: 82px;
  margin-top: 10px;
  padding: 14px 16px 14px 94px;
  border-radius: 20px;
  background: #ffffff;
  color: #233866;
  font-size: clamp(22px, 2.4vw, 34px);
  font-weight: 900;
  line-height: 1.04;
  box-shadow: 0 7px 0 rgba(18, 57, 124, 0.34);
}
#brainBridgePrompt::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  width: 56px;
  height: 56px;
  transform: translateY(-50%);
  border-radius: 50%;
  background-color: #fff2c9;
  background-image: url("../../assets/helper_croc_ready.png");
  background-repeat: no-repeat;
  background-size: 50px auto;
  background-position: center 7px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.8);
}
#brainBridgePrompt::after {
  content: "CROC SAYS";
  position: absolute;
  left: 94px;
  top: 12px;
  color: #e56527;
  font-size: 11px;
  font-weight: 950;
}
#brainBridgePrompt {
  padding-top: 28px;
}
#brainBridgeProgress {
  display: none;
  margin-top: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 800;
}
#brainBridgeOutcome {
  margin: 10px 0 8px;
  padding: 9px 12px;
  border-radius: 16px;
  color: #102018;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}
#brainBridgeOutcome.win {
  background: #ffda6b;
}
#brainBridgeOutcome.loss {
  background: #bff4ff;
}
#brainBridgeChoices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}
#over #brainBridgeChoices button {
  min-height: 0;
  margin: 0;
  padding: 10px 12px 12px;
  border: 0;
  border-left: 7px solid #75cb5a;
  border-radius: 18px;
  background: #ffffff;
  color: #24395a;
  font-size: 14px;
  text-align: left;
  box-shadow: 0 6px 0 rgba(18, 57, 124, 0.28);
}
#over #brainBridgeChoices button:nth-child(2) {
  border-left-color: #ff8c88;
}
#over #brainBridgeChoices button:nth-child(3) {
  border-left-color: #b899d8;
}
#over #brainBridgeChoices button:nth-child(4) {
  border-left-color: #ffd36b;
}
#over #brainBridgeChoices button.correct {
  background: #ecffe8;
}
#over #brainBridgeChoices button.wrong {
  background: #ffe7e7;
}
.brainBridgeChoiceHeader {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #24395a;
  font-size: 16px;
  font-weight: 950;
  line-height: 1.08;
}
.brainBridgeChoiceDot {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #75cb5a;
}
#brainBridgeChoices button:nth-child(2) .brainBridgeChoiceDot {
  background: #ff8c88;
}
#brainBridgeChoices button:nth-child(3) .brainBridgeChoiceDot {
  background: #b899d8;
}
#brainBridgeChoices button:nth-child(4) .brainBridgeChoiceDot {
  background: #ffd36b;
}
.brainBridgeStoryStrip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}
.brainBridgeStoryStrip:not(.hasGeneratedArt) {
  aspect-ratio: 16 / 7;
  align-items: stretch;
  padding: 8px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(130, 212, 232, 0.45) 0 55%, rgba(75, 173, 198, 0.72) 56% 100%),
    linear-gradient(90deg, #f6e9bd, #e5f0d6);
}
.brainBridgeStoryStrip.hasGeneratedArt {
  display: block;
}
.brainBridgeStoryStrip.textOnly {
  align-items: stretch;
  padding: 8px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(130, 212, 232, 0.45) 0 55%, rgba(75, 173, 198, 0.72) 56% 100%),
    linear-gradient(90deg, #f6e9bd, #e5f0d6);
}
.brainBridgeTextStep {
  display: flex;
  min-height: 44px;
  padding: 8px 6px;
  border-radius: 9px;
  background: rgba(255, 253, 249, 0.82);
  align-items: center;
  justify-content: center;
  color: #24395a;
  font-size: clamp(10px, 0.9vw, 13px);
  font-weight: 950;
  line-height: 1.08;
  text-align: center;
}
.brainBridgeGeneratedCardArt {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  border-radius: 12px;
  background: #f2ecd7;
}
.brainBridgeStoryStrip.hasGeneratedArt .brainBridgeStoryPanel {
  display: none;
}
.brainBridgeStoryPanel {
  display: flex;
  min-height: 0;
  padding: 8px 6px 6px;
  border-radius: 9px;
  background: rgba(255, 253, 249, 0.78);
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  overflow: hidden;
}
.brainBridgeStoryPanel:nth-child(2) {
  background: #dcefd2;
}
.brainBridgeStoryPanel:nth-child(3) {
  background: #ffd8d8;
}
.brainBridgeStoryArt {
  position: relative;
  display: block;
  flex: 1 1 auto;
  min-height: 42px;
  border-radius: 4px;
  background:
    linear-gradient(180deg, transparent 0 56%, #74cde0 57% 100%),
    linear-gradient(90deg, #f2dbaa, #f7edd0);
}
.brainBridgeStoryArt::before,
.brainBridgeStoryArt::after {
  content: "";
  position: absolute;
  display: block;
}
.icon-eye .brainBridgeStoryArt::before {
  left: 10px;
  bottom: 13px;
  width: 22px;
  height: 10px;
  border-radius: 50%;
  background: #5fc15d;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.16);
}
.icon-eye .brainBridgeStoryArt::after {
  left: 34px;
  top: 8px;
  width: 22px;
  height: 2px;
  border-top: 2px dotted #24395a;
  transform: rotate(10deg);
}
.icon-spark .brainBridgeStoryArt::before {
  left: 50%;
  top: 6px;
  width: 18px;
  height: 30px;
  transform: translateX(-50%) skew(-12deg);
  background: #ffd33f;
  clip-path: polygon(55% 0, 100% 0, 66% 42%, 100% 42%, 32% 100%, 48% 55%, 12% 55%);
}
.icon-go .brainBridgeStoryArt::before {
  left: 13px;
  bottom: 11px;
  width: 26px;
  height: 12px;
  border-radius: 14px 14px 8px 8px;
  background: #8b5a2b;
  box-shadow: 18px 0 0 #e94e44;
}
.icon-wait .brainBridgeStoryArt::before {
  left: 50%;
  top: 10px;
  width: 28px;
  height: 28px;
  transform: translateX(-50%);
  border: 4px solid #76c96b;
  border-radius: 50%;
}
.icon-warn .brainBridgeStoryArt::before {
  left: 50%;
  top: 9px;
  width: 34px;
  height: 28px;
  transform: translateX(-50%);
  border-radius: 45% 45% 35% 35%;
  background: #68bd5f;
}
.icon-warn .brainBridgeStoryArt::after {
  right: 5px;
  top: 8px;
  color: #ff4054;
  content: "!";
  font-size: 21px;
  font-weight: 950;
}
.brainBridgeStoryPanel b {
  display: block;
  margin-top: 5px;
  color: #24395a;
  font-size: clamp(10px, 0.9vw, 13px);
  font-weight: 950;
  line-height: 1.05;
  text-align: center;
}
#coinSaverSheet {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 253, 249, 0.96);
  color: #24395a;
  box-shadow: 0 5px 0 rgba(18, 57, 124, 0.24);
}
.coinSaverSheetTitle {
  color: #233866;
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 950;
  line-height: 1;
}
.coinSaverSheetSubtitle {
  margin-top: 4px;
  color: #e56527;
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}
.coinSaverCoinRows {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.coinSaverCoinRow {
  display: grid;
  grid-template-columns: minmax(132px, 0.26fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #fff5cf;
}
.coinSaverCoinRow.nickel {
  background: #e8ffe2;
}
.coinSaverCoinRow.dime {
  background: #eef6ff;
}
.coinSaverCoinRow.quarter {
  background: #fff0d7;
}
.coinSaverCoinLabel {
  color: #233866;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.05;
}
.coinSaverCoinPile {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  min-height: 34px;
}
.coinSaverCoin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6a6, #ffd23f 58%, #c78318 100%);
  border: 3px solid #9a6815;
  color: #5a3900;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.45),
    0 2px 0 rgba(38, 37, 25, 0.18);
}
.coinSaverCoin.penny {
  background: radial-gradient(circle at 35% 30%, #ffe2b6, #d98a42 58%, #8a4b1f 100%);
  border-color: #7f451c;
  color: #4a250d;
}
.coinSaverCoin.nickel {
  width: 38px;
  height: 38px;
  background: radial-gradient(circle at 35% 30%, #ffffff, #d9d5c8 58%, #8f8877 100%);
  border-color: #756f61;
  color: #37342d;
}
.coinSaverCoin.dime {
  width: 28px;
  height: 28px;
  background: radial-gradient(circle at 35% 30%, #ffffff, #e9e7dd 58%, #9d988b 100%);
  border-color: #817b70;
  color: #37342d;
  font-size: 10px;
}
.coinSaverCoin.quarter {
  width: 42px;
  height: 42px;
  background: radial-gradient(circle at 35% 30%, #ffffff, #d9d2bd 58%, #87806f 100%);
  border-color: #746c5e;
  color: #37342d;
}
.coinSaverNoCoins {
  color: #687487;
  font-size: 13px;
  font-weight: 850;
  font-style: italic;
}
.coinSaverReceiptVoice {
  margin-top: 8px;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 3px solid #79f3ff;
  background: #143846;
  color: #e8feff;
  font-size: 14px;
  font-weight: 950;
}
.coinSaverEquation,
.coinSaverAddition {
  margin-top: 8px;
  padding: 9px 11px;
  border-radius: 10px;
  background: #dff7ff;
  color: #233866;
  font-size: clamp(15px, 1.6vw, 19px);
  font-weight: 950;
}
.coinSaverAddition {
  background: #e8ffe2;
}
#brainBridgePanel[data-scene="coin-saver"] #coinSaverSheet {
  margin-top: 7px;
  padding: 8px;
}
#brainBridgePanel[data-scene="coin-saver"] .coinSaverCoinRows {
  gap: 6px;
  margin-top: 7px;
}
#brainBridgePanel[data-scene="coin-saver"] .coinSaverCoinRow {
  min-height: 46px;
  padding: 6px;
  gap: 8px;
}
#brainBridgePanel[data-scene="coin-saver"] .coinSaverCoin {
  width: 28px;
  height: 28px;
  border-width: 2px;
  font-size: 11px;
}
#brainBridgePanel[data-scene="coin-saver"] .coinSaverCoin.nickel {
  width: 32px;
  height: 32px;
}
#brainBridgePanel[data-scene="coin-saver"] .coinSaverCoin.dime {
  width: 25px;
  height: 25px;
  font-size: 10px;
}
#brainBridgePanel[data-scene="coin-saver"] .coinSaverCoin.quarter {
  width: 35px;
  height: 35px;
}
#brainBridgePanel[data-scene="coin-saver"] .coinSaverReceiptVoice {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 13px;
}
#brainBridgePanel[data-scene="coin-saver"] .coinSaverEquation,
#brainBridgePanel[data-scene="coin-saver"] .coinSaverAddition {
  margin-top: 5px;
  padding: 5px 8px;
  font-size: 13px;
}
#brainBridgeResult {
  min-height: 20px;
  margin-top: 10px;
  color: #dcefdc;
  font-size: 14px;
}
#brainBridgeResult strong {
  color: #ffd36b;
}
.learningRewardBurst {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  max-width: 560px;
  min-height: 92px;
  margin: 12px auto 4px;
  padding: 14px 16px;
  box-sizing: border-box;
  border: 2px solid rgba(255, 211, 107, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(10, 51, 46, 0.94), rgba(56, 31, 78, 0.92)),
    #123b3a;
  color: #fff8d9;
  text-align: center;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.26),
    inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.learningRewardCopy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 4px;
}
.learningRewardKicker {
  color: #8dfcff;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}
.learningRewardTitle {
  color: #ffd36b;
  font-size: 22px;
  font-weight: 950;
  line-height: 1.08;
}
.learningRewardBody {
  color: #f8ffef;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.28;
}
.learningRewardSparks {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.learningRewardSparks span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: hsl(var(--hue) 94% 68%);
  box-shadow: 0 0 10px hsl(var(--hue) 94% 68% / 0.75);
  animation: learningRewardFirework 940ms ease-out var(--delay) both;
}
body.high-contrast .learningRewardBurst {
  border-color: #ffffff;
  background: #000000;
  color: #ffffff;
  box-shadow: none;
}
@keyframes learningRewardFirework {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.35);
  }
  14% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(0.08);
  }
}
@media (prefers-reduced-motion: reduce) {
  .learningRewardSparks span {
    opacity: 0.8;
    animation: none;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(0.82);
  }
}
.storyVideoPanel {
  width: min(620px, 100%);
  margin: 12px auto 4px;
  padding: 12px;
  box-sizing: border-box;
  display: grid;
  gap: 10px;
  border: 2px solid rgba(141, 252, 255, 0.62);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(8, 38, 47, 0.94), rgba(8, 22, 28, 0.95)),
    #0a2530;
  color: #f8ffef;
  text-align: left;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.storyVideoCopy {
  display: grid;
  gap: 3px;
}
.storyVideoKicker {
  color: #8dfcff;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}
.storyVideoTitle {
  color: #ffd36b;
  font-size: 21px;
  font-weight: 950;
  line-height: 1.08;
}
.storyVideoCue {
  color: #f8ffef;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.3;
}
.storyVideoFrame {
  overflow: hidden;
  border-radius: 8px;
  background: #051118;
}
.storyVideoFrame video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.storyVideoActions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
#over .storyVideoPlay {
  margin: 0;
  min-height: 46px;
  padding: 9px 14px;
  border: 2px solid rgba(255, 211, 107, 0.7);
  border-radius: 8px;
  background: #ffd36b;
  color: #10130d;
  font-size: 15px;
  font-weight: 950;
  box-shadow: none;
}
#over .storyVideoPlay:disabled {
  opacity: 0.7;
  cursor: default;
}
.storyVideoStatus {
  min-height: 18px;
  color: #8dfcff;
  font-size: 13px;
  font-weight: 850;
}
body.high-contrast .storyVideoPanel {
  border-color: #ffffff;
  background: #000000;
  color: #ffffff;
  box-shadow: none;
}
body.high-contrast .storyVideoKicker,
body.high-contrast .storyVideoTitle,
body.high-contrast .storyVideoStatus {
  color: #ffff00;
}
#brainBridgeCoachCard {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  margin-top: 12px;
}
#brainBridgeCoachCharacter {
  width: 148px;
  height: 158px;
  box-sizing: border-box;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center bottom;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.42));
  animation: mindBridgeGuideIn 360ms cubic-bezier(0.16, 1, 0.3, 1) both,
    mindBridgeGuideFloat 2600ms ease-in-out 360ms infinite;
}
#brainBridgePanel[data-helper="croc"] #brainBridgeCoachCharacter {
  background-image: url("../../assets/helper_croc_ready.png");
}
#brainBridgePanel[data-helper="firefly"] #brainBridgeCoachCharacter {
  background-image: url("../../assets/helper_firefly_ready.png");
}
#brainBridgePanel[data-helper="monkey"] #brainBridgeCoachCharacter {
  background-image: url("../../assets/helper_monkey_ready.png");
}
#over #brainBridgeBubble {
  position: relative;
  min-height: 126px;
  margin: 0;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  border: 2px solid rgba(141, 252, 255, 0.46);
  border-radius: 8px;
  background: #f7fbff;
  color: #17232a;
  font-size: 18px;
  font-weight: 850;
  line-height: 1.22;
  text-align: left;
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.2),
    inset 0 0 0 2px rgba(255, 255, 255, 0.8);
}
#over #brainBridgeBubble::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 28px;
  border-width: 8px 11px 8px 0;
  border-style: solid;
  border-color: transparent rgba(141, 252, 255, 0.46) transparent transparent;
}
#over #brainBridgeBubble::after {
  content: "";
  position: absolute;
  left: -8px;
  top: 30px;
  border-width: 6px 8px 6px 0;
  border-style: solid;
  border-color: transparent #f7fbff transparent transparent;
}
#brainBridgeGrowth {
  height: 12px;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 211, 107, 0.48);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}
#brainBridgeGrowth span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8dfcff, #ffd36b, #a8ff90);
  transition: width 260ms ease;
}
#brainBridgeVoiceStatus {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 7px;
  background: rgba(141, 252, 255, 0.09);
  color: #8dfcff;
  font-size: 14px;
  font-weight: 800;
  text-align: right;
}
#brainBridgeVoiceControls {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}
#over #brainBridgeVoiceControls button {
  min-height: 44px;
  margin: 0;
  padding: 8px 13px;
  border: 2px solid rgba(141, 252, 255, 0.58);
  border-radius: 8px;
  background: rgba(8, 18, 24, 0.72);
  color: #dffcff;
  font-size: 14px;
  font-weight: 900;
  box-shadow: none;
}
#over #brainBridgeVoiceControls button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}
#brainBridgeActions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
#over #brainBridgeActions button {
  min-height: 46px;
  margin: 0;
  padding: 10px 12px;
  font-size: 15px;
  text-align: center;
  box-shadow: none;
}
#over #brainBridgeActions button.primary {
  border-color: rgba(255, 211, 107, 0.9);
  background: #ffd36b;
  color: #17232a;
}
#over #brainBridgeActions button.secondary {
  border-color: rgba(141, 252, 255, 0.58);
  background: rgba(8, 18, 24, 0.72);
  color: #dffcff;
}
@media (max-width: 700px) {
  #over:has(#brainBridgePanel.show) > div {
    width: 100%;
    padding: 6px 6px max(14px, env(safe-area-inset-bottom));
  }
  #brainBridgePanel {
    width: min(430px, calc(100vw - 18px));
    max-height: calc(100svh - 12px);
    padding: 10px;
  }
  #brainBridgeOutcome {
    margin: 6px 0;
    padding: 7px 9px;
    font-size: 15px;
  }
  #brainBridgePrompt {
    min-height: 62px;
    margin-top: 6px;
    padding: 22px 12px 10px 68px;
    border-radius: 16px;
    font-size: clamp(18px, 5vw, 24px);
  }
  #brainBridgePrompt::before {
    left: 13px;
    width: 40px;
    height: 40px;
    background-size: 36px auto;
  }
  #brainBridgePrompt::after {
    left: 68px;
    top: 8px;
  }
  #brainBridgeChoices {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  #brainBridgeCoachCard {
    grid-template-columns: 108px minmax(0, 1fr);
  }
  #brainBridgeCoachCharacter {
    width: 108px;
    height: 115px;
  }
  #over #brainBridgeBubble {
    min-height: 118px;
    padding: 14px;
    font-size: 16px;
  }
  #brainBridgeChoices {
    grid-template-columns: 1fr;
  }
  #brainBridgeActions {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  #brainBridgeVoiceControls {
    justify-content: stretch;
  }
  #over #brainBridgeVoiceControls button {
    width: 100%;
  }
  #over #brainBridgeActions button {
    min-height: 44px;
    padding: 8px 10px;
    font-size: 14px;
  }
  #brainBridgeVoiceStatus {
    text-align: left;
    padding: 6px 8px;
    font-size: 13px;
  }
  .brainBridgeGeneratedCardArt,
  .brainBridgeStoryStrip:not(.hasGeneratedArt) {
    border-radius: 10px;
  }
  .coinSaverCoinRow {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .coinSaverCoinLabel {
    font-size: 14px;
  }
  .coinSaverCoinPile {
    gap: 4px;
  }
}
@media (min-width: 701px) and (max-height: 860px) {
  #over:has(#brainBridgePanel.show) > div {
    width: min(1060px, calc(100vw - 18px));
    padding-top: 6px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  #brainBridgePanel {
    width: min(1000px, calc(100vw - 18px));
    max-height: calc(100svh - 12px);
    padding: 10px 10px 14px;
    font-size: 14px;
  }
  #brainBridgeKicker {
    font-size: 10px;
  }
  #brainBridgeTitle {
    font-size: 15px;
  }
  #brainBridgeOutcome {
    margin: 6px 0 6px;
    padding: 7px 10px;
    font-size: 15px;
  }
  #brainBridgePrompt {
    min-height: 58px;
    margin-top: 7px;
    padding: 20px 14px 10px 70px;
    border-radius: 16px;
    font-size: clamp(19px, 1.9vw, 25px);
    box-shadow: 0 5px 0 rgba(18, 57, 124, 0.28);
  }
  #brainBridgePrompt::before {
    left: 14px;
    width: 40px;
    height: 40px;
    background-size: 36px auto;
    background-position: center 6px;
  }
  #brainBridgePrompt::after {
    left: 70px;
    top: 9px;
    font-size: 10px;
  }
  #brainBridgeVoiceControls {
    margin-top: 7px;
  }
  #brainBridgeVoiceStatus {
    margin-top: 6px;
    padding: 6px 8px;
    font-size: 13px;
  }
  #brainBridgeActions {
    gap: 7px;
    margin-top: 7px;
  }
  #over #brainBridgeActions button {
    min-height: 44px;
    padding: 8px 10px;
    font-size: 14px;
  }
  #brainBridgeChoices {
    gap: 9px;
    margin-top: 8px;
  }
  #over #brainBridgeChoices button {
    padding: 8px 10px 10px;
    border-left-width: 6px;
    border-radius: 14px;
    box-shadow: 0 4px 0 rgba(18, 57, 124, 0.24);
  }
  .brainBridgeChoiceHeader {
    font-size: 14px;
  }
  .brainBridgeStoryStrip {
    margin-top: 7px;
  }
  .brainBridgeGeneratedCardArt {
    border-radius: 10px;
  }
}
@media (min-width: 701px) and (max-height: 720px) {
  #over:has(#brainBridgePanel.show) > div {
    width: min(940px, calc(100vw - 14px));
    padding-top: 4px;
  }
  #brainBridgePanel {
    width: min(900px, calc(100vw - 14px));
    max-height: calc(100svh - 8px);
    padding: 8px;
  }
  #brainBridgeOutcome {
    margin: 4px 0;
    padding: 6px 9px;
  }
  #brainBridgePrompt {
    min-height: 60px;
    margin-top: 5px;
    padding: 21px 12px 10px 68px;
    font-size: clamp(18px, 1.8vw, 24px);
  }
  #brainBridgePrompt::before {
    left: 13px;
    width: 40px;
    height: 40px;
    background-size: 36px auto;
  }
  #brainBridgePrompt::after {
    left: 68px;
    top: 8px;
  }
  #brainBridgeVoiceControls,
  #brainBridgeVoiceStatus,
  #brainBridgeActions,
  #brainBridgeChoices {
    margin-top: 5px;
  }
  #over #brainBridgeVoiceControls button,
  #over #brainBridgeActions button {
    min-height: 44px;
    padding: 7px 9px;
    font-size: 13px;
  }
  #brainBridgeChoices {
    gap: 7px;
  }
  .brainBridgeChoiceHeader {
    font-size: 13px;
  }
  .brainBridgeStoryStrip {
    margin-top: 5px;
  }
}
#learningBridgePanel {
  display: none;
  width: min(620px, calc(100vw - 40px));
  margin: 14px auto 0;
  padding: 14px;
  border: 1px solid rgba(141, 252, 255, 0.34);
  border-radius: 8px;
  background: rgba(6, 14, 18, 0.88);
  color: #edf7ed;
  text-align: left;
  font-size: 15px;
  line-height: 1.35;
}
#learningBridgePanel.show {
  display: grid;
  gap: 8px;
}
#learningBridgePanel.compact {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 0;
  text-align: left;
  gap: 18px;
  background: transparent;
  color: #fff8d9;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  touch-action: pan-y;
}
#learningBridgePanel.mindBridgePage #learningBridgeAsk,
#learningBridgePanel.mindBridgePage #learningBridgeTry,
#learningBridgePanel.mindBridgePage #learningBridgeBuild,
#learningBridgePanel.mindBridgePage #learningBridgeNotice,
#learningBridgePanel.mindBridgePage #learningBridgeAction {
  display: none !important;
}
#learningBridgePanel.compact #learningBridgeKicker {
  font-size: 12px;
  color: #8dfcff;
  letter-spacing: 0;
}
#learningBridgePanel.compact #learningBridgeTitle {
  font-size: clamp(30px, 5vw, 58px);
  color: #fff7ce;
  line-height: 1;
  font-family: Impact, "Arial Black", system-ui, sans-serif;
  text-shadow:
    0 0 22px rgba(255, 211, 107, 0.24),
    0 6px 0 rgba(0, 0, 0, 0.7);
}
#learningBridgePanel.compact .learningBridgeRow {
  padding: 0;
  background: transparent;
}
#learningBridgePanel.compact #learningBridgeAsk {
  display: none;
}
#learningBridgePanel.compact #learningBridgeTry,
#learningBridgePanel.compact #learningBridgeBuild,
#learningBridgePanel.compact #learningBridgeNotice,
#learningBridgePanel.compact #learningBridgeAction {
  display: none;
}
#learningBridgeMiniGame {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  width: min(260px, 100%);
  justify-self: end;
  margin-top: 0;
}
#learningBridgeCoachCard {
  display: grid;
  grid-template-columns: minmax(210px, 0.42fr) minmax(0, 1fr);
  gap: clamp(18px, 4vw, 44px);
  align-items: end;
}
#learningBridgeCoachCharacter {
  width: min(320px, 32vw);
  height: min(520px, 58vh);
  min-height: 300px;
  border-radius: 0;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center bottom;
  background-color: transparent;
  border: 0;
  filter: drop-shadow(0 28px 28px rgba(0, 0, 0, 0.52));
  animation: mindBridgeGuideIn 420ms cubic-bezier(0.16, 1, 0.3, 1) both,
    mindBridgeGuideFloat 2600ms ease-in-out 420ms infinite;
}
#learningBridgePanel[data-helper="croc"] #learningBridgeCoachCharacter {
  background-image: url("../../assets/helper_croc_ready.png");
}
#learningBridgePanel[data-helper="firefly"] #learningBridgeCoachCharacter {
  background-image: url("../../assets/helper_firefly_ready.png");
}
#learningBridgePanel[data-helper="monkey"] #learningBridgeCoachCharacter {
  background-image: url("../../assets/helper_monkey_ready.png");
}
#learningBridgeBubble {
  position: relative;
  min-height: 250px;
  margin: 0;
  padding: clamp(24px, 3vw, 38px);
  display: flex;
  align-items: center;
  border: 3px solid rgba(47, 111, 143, 0.36);
  border-radius: 18px;
  background:
    linear-gradient(180deg, #ffffff, #f3fbff);
  color: #17232a;
  font-size: clamp(24px, 3.2vw, 42px);
  font-weight: 850;
  line-height: 1.16;
  text-align: left;
  box-shadow:
    0 16px 30px rgba(47, 111, 143, 0.14),
    inset 0 0 0 2px rgba(255, 255, 255, 0.86);
  animation: mindBridgeBubbleIn 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes mindBridgeGuideIn {
  from {
    opacity: 0;
    transform: translateX(-34px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}
@keyframes mindBridgeGuideFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}
@keyframes brainBridgeMascotIdle {
  from {
    background-position: 0% var(--brain-bridge-sprite-row);
  }
  to {
    background-position: 100% var(--brain-bridge-sprite-row);
  }
}
@keyframes mindBridgeBubbleIn {
  from {
    opacity: 0;
    transform: translateX(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}
#learningBridgeBubble::before {
  content: "";
  position: absolute;
  left: -13px;
  top: 34px;
  border-width: 9px 13px 9px 0;
  border-style: solid;
  border-color: transparent rgba(47, 111, 143, 0.34) transparent transparent;
}
#learningBridgeBubble::after {
  content: "";
  position: absolute;
  left: -9px;
  top: 36px;
  border-width: 7px 10px 7px 0;
  border-style: solid;
  border-color: transparent #f7fbff transparent transparent;
}
#learningBridgeStepTrack {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: flex-end;
  min-height: 14px;
}
.learningBridgeStepDot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid rgba(47, 111, 143, 0.38);
  background: #ffffff;
}
.learningBridgeStepDot.active {
  background: #ffd36b;
  border-color: #8b5d00;
  box-shadow: 0 0 0 3px rgba(255, 211, 107, 0.22);
}
#over #learningBridgeMiniGame button {
  min-height: 52px;
  margin: 0;
  padding: 10px 14px;
  border-color: rgba(255, 211, 107, 0.58);
  border-radius: 8px;
  background: rgba(255, 211, 107, 0.16);
  color: #17232a;
  font-size: 16px;
  font-weight: 900;
  box-shadow: none;
}
#over #learningBridgeMiniGame button.current {
  background: rgba(141, 252, 255, 0.22);
  border-color: rgba(141, 252, 255, 0.8);
}
#over #learningBridgeMiniGame button.done {
  background: rgba(168, 255, 144, 0.24);
  border-color: rgba(168, 255, 144, 0.86);
}
#over #learningBridgeMiniGame button.wrong {
  background: rgba(255, 195, 168, 0.26);
  border-color: rgba(255, 195, 168, 0.86);
}
#learningBridgeMiniStatus {
  min-height: 18px;
  color: #dffcff;
  font-size: 14px;
  font-weight: 900;
  text-align: right;
}
#learningBridgeVoiceLine {
  color: rgba(244, 241, 232, 0.78);
  font-size: 14px;
  font-weight: 800;
  text-align: right;
}
#learningBridgeExitActions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
#over #learningBridgeExitActions button {
  margin: 0;
  min-height: 58px;
  border-radius: 8px;
  border: 2px solid rgba(255, 211, 107, 0.7);
  background: rgba(255, 211, 107, 0.9);
  color: #10130d;
  font-size: 17px;
  font-weight: 900;
}
#over #learningBridgeExitActions button.moveOn {
  border-color: rgba(141, 252, 255, 0.76);
  background: rgba(5, 28, 32, 0.86);
  color: #dffcff;
}
@media (max-width: 700px) {
  #learningBridgeCoachCard {
    grid-template-columns: 1fr;
  }
  #learningBridgeCoachCharacter {
    width: 190px;
    height: 250px;
    min-height: 0;
    margin: 0 auto -8px;
  }
  #learningBridgeBubble {
    min-height: 180px;
    font-size: 20px;
  }
  #learningBridgeBubble::before,
  #learningBridgeBubble::after {
    display: none;
  }
  #learningBridgeExitActions {
    grid-template-columns: 1fr;
  }
}
#learningBridgeKicker {
  color: #8dfcff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
#learningBridgeTitle {
  color: #ffd36b;
  font-size: 19px;
  font-weight: 900;
}
.learningBridgeRow {
  padding: 8px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
}
.learningBridgeRow b {
  color: #8dfcff;
}
#learningBridgeBuild {
  border: 1px solid rgba(255, 211, 107, 0.24);
  background: rgba(255, 211, 107, 0.1);
}
#learningBridgeAction {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  background: rgba(141, 252, 255, 0.09);
}
#learningBridgeActionButtons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
#over #learningBridgeDoneBtn,
#over #learningBridgeVoiceBtn {
  margin: 0;
  min-height: 44px;
  padding: 9px 12px;
  font-size: 15px;
  box-shadow: none;
}
#over #learningBridgeVoiceBtn {
  background: rgba(141, 252, 255, 0.18);
  border-color: rgba(141, 252, 255, 0.6);
}
#learningBridgeDoneStatus,
#learningBridgeVoiceStatus {
  color: #8dfcff;
  font-size: 14px;
  font-weight: 800;
}
#patternPainterPanel {
  display: none;
  width: min(620px, calc(100vw - 40px));
  margin: 14px auto 0;
  padding: 14px;
  border: 1px solid rgba(255, 211, 107, 0.4);
  border-radius: 8px;
  background: rgba(12, 20, 16, 0.88);
  color: #edf7ed;
  text-align: left;
  font-size: 15px;
}
#patternPainterPanel.show {
  display: block;
}
#patternPainterTitle {
  color: #ffd36b;
  font-size: 19px;
  font-weight: 900;
}
#patternPainterSlots,
#patternPainterStamps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
#patternPainterSlots button,
#patternPainterStamps button {
  min-width: 58px;
  min-height: 48px;
  margin: 0;
  padding: 8px 10px;
  border: 2px solid rgba(255, 211, 107, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  box-shadow: none;
}
#patternPainterSlots button.good {
  border-color: #a8ff90;
  background: rgba(168, 255, 144, 0.18);
}
#patternPainterResult {
  min-height: 22px;
  margin-top: 9px;
  color: #8dfcff;
  font-weight: 800;
}
@media (max-width: 620px) {
  #brainBridgeChoices {
    grid-template-columns: 1fr;
  }
  #brainBridgePanel {
    font-size: 14px;
  }
}
@media (max-width: 420px), (max-height: 560px) {
  #brainBridgePanel {
    width: calc(100vw - 10px);
    max-height: calc(100svh - 8px);
    padding: 8px;
  }
  #brainBridgeKicker,
  #brainBridgeTitle {
    font-size: 13px;
  }
  #brainBridgePrompt {
    min-height: 54px;
    padding: 19px 10px 9px 58px;
    font-size: clamp(16px, 4.8vw, 20px);
  }
  #brainBridgePrompt::before {
    left: 10px;
    width: 34px;
    height: 34px;
    background-size: 31px auto;
  }
  #brainBridgePrompt::after {
    left: 58px;
    top: 7px;
    font-size: 9px;
  }
  .brainBridgeChoiceHeader {
    font-size: 13px;
  }
  .brainBridgeStoryStrip {
    margin-top: 5px;
  }
  #coinSaverSheet {
    padding: 8px;
  }
  .coinSaverSheetTitle {
    font-size: 19px;
  }
  .coinSaverEquation,
  .coinSaverAddition {
    font-size: 13px;
  }
}
#over button:hover,
#start button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.34);
}
#over button:active,
#start button:active {
  transform: translateY(0) scale(0.98);
}
#over button:focus-visible,
#start button:focus-visible {
  outline: 3px solid rgba(141, 252, 255, 0.85);
  outline-offset: 2px;
}
#start {
  position: fixed;
  inset: 0;
  display: none;
  place-items: start center;
  overflow: auto;
  box-sizing: border-box;
  padding: 16px;
  background: rgba(0, 0, 0, 0.78);
  text-align: center;
  color: #e8efe6;
  z-index: 10;
}
body.high-contrast #start {
  background: #000000;
  color: #ffffff;
}
#start.show {
  display: grid;
}
#startPanel {
  width: min(1040px, 100%);
  text-align: left;
  display: grid;
  grid-template-columns: minmax(250px, 0.75fr) minmax(360px, 1.25fr);
  gap: 28px;
  align-items: start;
}
#startPanel h1 {
  margin: 0 0 8px;
  font-size: 56px;
  line-height: 1;
  letter-spacing: 0;
}
#startPanel .subtitle {
  font-size: 17px;
  line-height: 1.45;
  opacity: 0.82;
  max-width: 340px;
}
#startPanel #inputHint {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 13px;
  line-height: 1.6;
  color: #dfe8df;
  overflow-wrap: anywhere;
}
#menuGrid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  max-height: min(82vh, 680px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(5, 8, 10, 0.54);
}
#menuGrid::before {
  content: "Level Select";
  display: block;
  margin: 0 0 4px;
  font-size: 12px;
  text-transform: uppercase;
  color: #ffd36b;
  font-weight: 800;
}
#start button.menuTile {
  position: relative;
  margin: 0;
  min-height: 48px;
  padding: 9px 12px;
  display: grid;
  grid-template-columns: 86px 1fr;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: rgba(255, 255, 255, 0.08);
  color: #e8efe6;
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition:
    background 0.16s,
    transform 0.16s,
    border-color 0.16s;
}
#start button.menuTile:hover {
  background: rgba(255, 211, 107, 0.14);
  border-color: rgba(255, 211, 107, 0.7);
  transform: translateY(-1px);
}
#start button.menuTile.primary {
  min-height: 62px;
  background: #ffd36b;
  color: #10130d;
  border-color: #ffd36b;
}
#start button.menuTile .tileTitle {
  display: block;
  font-weight: 800;
  font-size: 16px;
}
#start button.menuTile .tileMeta {
  display: block;
  font-size: 12px;
  opacity: 0.74;
}
#start button.menuTile.secondary {
  background: rgba(255, 255, 255, 0.08);
}
#start button.menuTile.utility {
  grid-template-columns: 1fr;
  min-height: 42px;
  background: rgba(90, 180, 122, 0.18);
  border-color: rgba(90, 180, 122, 0.36);
}
#start button.menuTile.newLevel {
  border-color: rgba(141, 252, 255, 0.48);
  background:
    linear-gradient(
      90deg,
      rgba(141, 252, 255, 0.12),
      rgba(255, 211, 107, 0.08)
    ),
    rgba(255, 255, 255, 0.08);
}
#start button.menuTile.newLevel .tileMeta::after {
  content: " · new";
  color: #8dfcff;
  font-weight: 800;
}
#utilityRow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}
#bestSnippet {
  margin-top: 12px;
  font-size: 13px;
  opacity: 0.72;
}
#bridgeSnippet {
  padding: 9px 12px;
  border: 1px solid rgba(141, 252, 255, 0.32);
  border-radius: 8px;
  background: rgba(141, 252, 255, 0.1);
  color: #dffcff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  cursor: pointer;
  user-select: none;
}
#bridgeSnippet[aria-expanded="true"] {
  border-color: rgba(255, 211, 107, 0.54);
  background: rgba(255, 211, 107, 0.1);
  color: #fff7ce;
}
#sprintSnippet {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(141, 252, 255, 0.28);
  border-radius: 8px;
  color: #dffcff;
  background: rgba(141, 252, 255, 0.08);
  font-size: 12px;
  line-height: 1.35;
}
#start {
  place-items: start center;
  padding: 14px;
  background:
    radial-gradient(
      circle at 50% 4%,
      rgba(255, 211, 107, 0.22),
      transparent 36%
    ),
    rgba(0, 0, 0, 0.78);
}
#startPanel {
  width: min(1240px, 100%);
  grid-template-columns: 1fr;
  gap: 12px;
}
#menuIntro {
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(250px, 1fr) auto;
  gap: 16px;
  align-items: center;
  color: #fff8d9;
}
#startPanel h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 64px);
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.58);
}
#startPanel .subtitle {
  max-width: 520px;
  font-size: 16px;
  opacity: 0.9;
}
#startPanel #inputHint {
  margin-top: 0;
  padding: 9px 12px;
  border: 1px solid rgba(255, 211, 107, 0.28);
  border-radius: 8px;
  background: rgba(4, 10, 8, 0.48);
  font-size: 12px;
}
#sprintSnippet {
  display: none;
}
#bestSnippet {
  display: none;
}
#bridgeSnippet {
  max-width: 220px;
}
#menuGrid {
  position: relative;
  width: 100%;
  max-height: none;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  border: 4px solid rgba(255, 232, 166, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(rgba(14, 21, 13, 0.02), rgba(14, 21, 13, 0.08)),
    url("../../assets/ui/level-adventure-map-1280.webp") center /
      cover no-repeat;
  background:
    linear-gradient(rgba(14, 21, 13, 0.02), rgba(14, 21, 13, 0.08)),
    url("../../assets/ui/level-adventure-map-1280.webp")
      center / cover no-repeat;
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.38),
    inset 0 0 0 1px rgba(95, 54, 21, 0.35);
}
body.high-contrast #menuGrid {
  border-color: #ffffff;
  background:
    linear-gradient(rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.22)),
    url("../../assets/ui/level-adventure-map-1280.webp")
      center / cover no-repeat;
  filter: contrast(1.25) saturate(0.85);
  box-shadow: none;
}
#menuGrid::before {
  content: "Choose Your Path";
  position: absolute;
  left: 16px;
  top: 14px;
  z-index: 4;
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(55, 31, 14, 0.72);
  color: #fff3b8;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}
#menuGrid::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  box-shadow:
    inset 0 0 44px rgba(50, 25, 5, 0.18),
    inset 0 -70px 70px rgba(49, 30, 11, 0.12);
}
#start button.menuTile {
  position: absolute;
  z-index: 3;
  width: clamp(86px, 8.8vw, 126px);
  min-height: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff8d9;
  text-align: center;
  box-shadow: none;
  transform: translate(-50%, -50%);
}
#start button.menuTile::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff8d9;
  box-shadow:
    0 0 0 3px rgba(91, 49, 18, 0.72),
    0 5px 9px rgba(35, 20, 8, 0.32);
}
#start button.menuTile:hover,
#start button.menuTile:focus-visible {
  background: transparent;
  border-color: transparent;
  outline: 0;
  transform: translate(-50%, -56%) scale(1.05);
}
#start button.menuTile > .tileTitle {
  width: clamp(42px, 4.4vw, 56px);
  height: clamp(42px, 4.4vw, 56px);
  display: grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 50%;
  border: 3px solid rgba(88, 48, 18, 0.82);
  background: radial-gradient(
    circle at 38% 26%,
    #ffffff 0 18%,
    #ffe892 42%,
    #f4a72f 100%
  );
  color: #2c1d0e;
  box-sizing: border-box;
  font-size: clamp(9px, 0.9vw, 12px);
  font-weight: 900;
  line-height: 0.95;
  box-shadow:
    0 7px 14px rgba(43, 24, 9, 0.34),
    inset 0 0 0 2px rgba(255, 255, 255, 0.38);
}
#start button.menuTile:hover > .tileTitle,
#start button.menuTile:focus-visible > .tileTitle {
  border-color: rgba(255, 255, 255, 0.94);
  box-shadow:
    0 0 0 5px rgba(255, 211, 107, 0.42),
    0 12px 20px rgba(43, 24, 9, 0.36),
    inset 0 0 0 2px rgba(255, 255, 255, 0.48);
}
#start button.menuTile > span:not(.tileTitle) {
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(43, 25, 10, 0.78);
  color: #fff8d9;
  box-shadow:
    0 5px 12px rgba(35, 20, 8, 0.26),
    inset 0 0 0 1px rgba(255, 232, 166, 0.28);
}
body.high-contrast #start button.menuTile > span:not(.tileTitle) {
  background: #000000;
  color: #ffffff;
  box-shadow: 0 0 0 2px #ffffff;
}
body.high-contrast #start button.menuTile > .tileTitle {
  background: #ffff00;
  color: #000000;
  border-color: #ffffff;
  box-shadow: 0 0 0 3px #000000;
}
body.high-contrast #start button.menuTile:focus-visible > .tileTitle,
body.high-contrast #start button.menuTile:hover > .tileTitle {
  box-shadow:
    0 0 0 4px #000000,
    0 0 0 8px #ffffff;
}
#start button.menuTile > span:not(.tileTitle) .tileTitle {
  display: block;
  margin: 0;
  color: inherit;
  font-size: clamp(10px, 0.95vw, 13px);
  line-height: 1.08;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.38);
}
#start button.menuTile .tileMeta {
  display: none;
}
#start button.menuTile.primary {
  width: clamp(96px, 9.6vw, 136px);
  min-height: 0;
  border-color: rgba(24, 91, 49, 0.82);
}
#start button.menuTile.primary > .tileTitle {
  background: radial-gradient(
    circle at 38% 26%,
    #ffffff 0 18%,
    #b7ffbd 42%,
    #35c56a 100%
  );
  border-color: rgba(24, 91, 49, 0.82);
}
#start button.menuTile.newLevel {
  border-color: transparent;
  background: transparent;
}
#start button.menuTile.newLevel > .tileTitle {
  background: radial-gradient(
    circle at 38% 26%,
    #ffffff 0 18%,
    #bdf8ff 42%,
    #36c6df 100%
  );
  border-color: rgba(37, 103, 122, 0.84);
}
#start button.menuTile.newLevel .tileMeta::after {
  content: "";
}
#startBtn {
  left: 5%;
  top: 26%;
}
#skipBtn {
  left: 7%;
  top: 38%;
}
#skipCartBtn {
  left: 13.5%;
  top: 30.5%;
}
#skipRiverBtn {
  left: 18.5%;
  top: 20%;
}
#skipCloudBtn {
  left: 25.5%;
  top: 14%;
}
#skipFinalBtn {
  left: 34%;
  top: 14%;
}
#skipBananaCatchBtn {
  left: 42%;
  top: 16%;
}
#skipMoneyBtn {
  left: 49.5%;
  top: 20%;
}
#skipMoonBtn {
  left: 55.5%;
  top: 26%;
}
#skipPicnicBtn {
  left: 62%;
  top: 21.5%;
}
#skipFireflyBtn {
  left: 68.5%;
  top: 17%;
}
#skipHungryCrocBtn {
  left: 75.5%;
  top: 19%;
}
#skipShapeLagoonBtn {
  left: 84%;
  top: 27%;
}
#skipWordOrchardBtn {
  left: 88%;
  top: 38%;
}
#skipMemoryBridgeBtn {
  left: 87%;
  top: 50%;
}
#skipCompassTrailsBtn {
  left: 82.5%;
  top: 62%;
}
#skipEcoRapidsBtn {
  left: 75.5%;
  top: 57%;
}
#skipSpiderWebBtn {
  left: 68.5%;
  top: 47%;
}
#skipCrocTourBtn {
  left: 62%;
  top: 52%;
}
#skipRaftCorridorBtn {
  left: 55.5%;
  top: 56%;
}
#skipBossCrocBtn {
  left: 50%;
  top: 64%;
}
#skipMonsterTruckBtn {
  left: 46.5%;
  top: 77%;
}
#utilityRow {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 4;
  display: flex;
  gap: 8px;
  margin: 0;
}
#utilityRow #start button,
#utilityRow button.menuTile,
#start #utilityRow button.menuTile {
  position: static;
  width: auto;
  min-width: 92px;
  padding: 8px 11px;
  display: grid;
  grid-template-columns: 1fr;
  transform: none;
  border-color: rgba(90, 180, 122, 0.48);
  background: rgba(9, 45, 28, 0.78);
  color: #efffe8;
}
#start #utilityRow button.menuTile:hover,
#start #utilityRow button.menuTile:focus-visible {
  transform: translateY(-1px);
  background: rgba(16, 68, 42, 0.9);
}
#helperChoice {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  border: 2px solid rgba(255, 211, 107, 0.5);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(5, 21, 20, 0.94), rgba(12, 54, 38, 0.9)),
    rgba(9, 45, 28, 0.9);
  color: #efffe8;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
}
#start:not(.map-open) #menuGrid {
  display: none;
}
#start.map-open {
  place-items: center;
  padding: 10px;
}
#start.map-open #startPanel {
  width: min(1240px, 100%);
  gap: 0;
  position: relative;
}
#start.map-open #menuIntro,
#start.map-open #helperChoice {
  display: none !important;
}
#start.map-open #menuGrid {
  max-height: calc(100vh - 20px);
}
#start:not(.map-open) #helperChoice {
  max-width: 760px;
  margin-top: 28px;
}
#helperChoice {
  position: relative;
  overflow: visible;
}
#helperChoice::before {
  content: "Select Your Guide";
  color: #ffd36b;
  font-family: Impact, Arial Black, sans-serif;
  font-size: 28px;
  line-height: 1;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.72);
}
#helperChoiceTitle {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  color: #ffd36b;
}
#helperChoiceButtons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
#start #helperChoiceButtons button {
  min-height: 126px;
  padding: 10px 8px 8px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 255, 255, 0.16), transparent 35%),
    rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
#start #helperChoiceButtons button::before {
  content: "";
  display: block;
  width: 92px;
  height: 132px;
  margin: 0 auto 8px;
  border: 2px solid rgba(255, 211, 107, 0.48);
  border-radius: 8px;
  background-image: url("../../assets/mind_bridge_helpers.png");
  background-repeat: no-repeat;
  background-size: 300% auto;
  background-color: transparent;
}
#start #helperChoiceButtons [data-helper="croc"]::before {
  background-position: 0% 0%;
}
#start #helperChoiceButtons [data-helper="firefly"]::before {
  background-position: 50% 0%;
}
#start #helperChoiceButtons [data-helper="monkey"]::before {
  background-position: 100% 0%;
}
#start #helperChoiceButtons button.selected {
  border-color: #ffd36b;
  background:
    linear-gradient(180deg, rgba(255, 211, 107, 0.3), rgba(80, 56, 8, 0.42)),
    rgba(255, 211, 107, 0.22);
  color: #fff7ce;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.4), 0 0 24px rgba(255, 211, 107, 0.45);
}
#helperChoiceStatus {
  min-height: 16px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 14px;
  color: #dffcff;
}
#helperReadyPreview {
  position: absolute;
  right: -156px;
  bottom: -4px;
  width: 132px;
  height: 214px;
  border-radius: 8px;
  background-image: url("../../assets/mind_bridge_helpers.png");
  background-repeat: no-repeat;
  background-size: contain;
  background-color: rgba(7, 21, 26, 0.72);
  border: 2px solid rgba(141, 252, 255, 0.4);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.42);
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.34));
  opacity: 0;
  transform: translateX(36px) scale(0.96);
  transition:
    opacity 220ms ease,
    transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
#helperChoice[data-helper="croc"] #helperReadyPreview {
  background-image: url("../../assets/helper_croc_ready.png");
  background-position: center bottom;
  opacity: 1;
  transform: translateX(0) scale(1);
}
#helperChoice[data-helper="firefly"] #helperReadyPreview {
  background-image: url("../../assets/helper_firefly_ready.png");
  background-position: center bottom;
  opacity: 1;
  transform: translateX(0) scale(1);
}
#helperChoice[data-helper="monkey"] #helperReadyPreview {
  background-image: url("../../assets/helper_monkey_ready.png");
  background-position: center bottom;
  opacity: 1;
  transform: translateX(0) scale(1);
}
#helperChoiceActions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
#helperFullRunBtn,
#helperChoiceMapBtn {
  min-height: 48px;
  border: 2px solid rgba(255, 211, 107, 0.72);
  border-radius: 8px;
  background: rgba(255, 211, 107, 0.16);
  color: #fff7ce;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}
#start:not(.helper-picked) #helperChoiceActions {
  opacity: 1;
}
#practicePathTitle {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  color: #ffd36b;
}
#practicePathButtons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
#start #practicePathButtons button {
  min-height: 66px;
  padding: 8px 10px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
#start #practicePathButtons button.selected {
  border-color: #8dfcff;
  background: rgba(141, 252, 255, 0.2);
  color: #dffcff;
}
#practicePathStatus {
  min-height: 16px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 14px;
  color: #dffcff;
}
#start .menuTile.practicePathMatch {
  outline: 3px solid #8dfcff;
  outline-offset: 3px;
  box-shadow:
    0 0 0 4px rgba(0, 0, 0, 0.35),
    0 0 18px rgba(141, 252, 255, 0.65);
}
#start .menuTile.mapStopNext {
  outline: 3px solid #ffd36b;
  outline-offset: 5px;
  box-shadow:
    0 0 0 4px rgba(0, 0, 0, 0.35),
    0 0 20px rgba(255, 211, 107, 0.72);
}
#start .menuTile.practicePathMatch::after {
  content: attr(data-practice-badge);
  position: absolute;
  right: -8px;
  top: -12px;
  z-index: 3;
  padding: 3px 6px;
  border: 2px solid #000000;
  border-radius: 8px;
  background: #8dfcff;
  color: #001015;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
body.high-contrast #helperChoice {
  background: #000000;
  border-color: #ffffff;
  box-shadow: none;
}
body.high-contrast #helperChoiceTitle,
body.high-contrast #practicePathTitle,
body.high-contrast #start #helperChoiceButtons button.selected {
  color: #ffff00;
}
body.high-contrast #start #helperChoiceButtons button,
body.high-contrast #start #practicePathButtons button {
  background: #000000;
  border-color: #ffffff;
  color: #ffffff;
}
body.high-contrast #start #practicePathButtons button.selected {
  border-color: #ffff00;
  color: #ffff00;
}
body.high-contrast #start .menuTile.practicePathMatch {
  outline-color: #ffff00;
  box-shadow: none;
}
body.high-contrast #start .menuTile.practicePathMatch::after {
  background: #ffff00;
  color: #000000;
}
@media (max-width: 760px) {
  #startPanel {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  #menuIntro {
    grid-template-columns: 1fr;
    gap: 8px;
    text-align: center;
  }
  #menuGrid {
    aspect-ratio: 10 / 14;
    background-position: center;
  }
  #startPanel h1 {
    font-size: 40px;
    text-align: center;
  }
  #startPanel .subtitle,
  #startPanel #inputHint {
    max-width: none;
    text-align: center;
  }
  #start button.menuTile {
    width: 72px;
    min-height: 64px;
    gap: 4px;
  }
  #start button.menuTile > .tileTitle {
    width: 46px;
    height: 46px;
    font-size: 9px;
    border-width: 2px;
  }
  #start button.menuTile > span:not(.tileTitle) {
    padding: 3px 5px;
  }
  #start button.menuTile > span:not(.tileTitle) .tileTitle {
    font-size: 9px;
    line-height: 1;
  }
  #utilityRow {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 10px;
    justify-content: center;
  }
  #start.map-open #menuGrid {
    aspect-ratio: auto;
    max-height: none;
    overflow: visible;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-width: 2px;
    background: rgba(5, 18, 16, 0.92);
  }
  #start.map-open #menuGrid::before {
    content: "Choose a level";
    position: static;
    margin: 0 0 4px;
    padding: 0;
    background: transparent;
    color: #ffd36b;
    box-shadow: none;
  }
  #start.map-open #menuGrid::after,
  #start.map-open button.menuTile::after {
    display: none;
  }
  #start.map-open #adventureMapStatus {
    position: static;
    max-width: none;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 211, 107, 0.12);
    box-shadow: none;
  }
  #start.map-open button.menuTile,
  #start.map-open #utilityRow button.menuTile {
    position: static;
    z-index: auto;
    width: 100%;
    min-height: 54px;
    padding: 9px 11px;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #e8efe6;
    text-align: left;
    transform: none;
  }
  #start.map-open button.menuTile:hover,
  #start.map-open button.menuTile:focus-visible,
  #start.map-open #utilityRow button.menuTile:hover,
  #start.map-open #utilityRow button.menuTile:focus-visible {
    background: rgba(255, 211, 107, 0.14);
    border-color: rgba(255, 211, 107, 0.7);
    transform: none;
  }
  #start.map-open button.menuTile > .tileTitle {
    width: auto;
    height: auto;
    display: block;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #ffd36b;
    font-size: 13px;
    line-height: 1.1;
    box-shadow: none;
  }
  #start.map-open button.menuTile > span:not(.tileTitle) {
    max-width: none;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    box-shadow: none;
  }
  #start.map-open button.menuTile > span:not(.tileTitle) .tileTitle {
    font-size: 15px;
    line-height: 1.12;
    text-shadow: none;
  }
  #start.map-open button.menuTile .tileMeta {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.18;
  }
  #start.map-open .mapStamp {
    position: static;
    max-width: none;
    min-height: 0;
    margin-top: 4px;
    padding: 3px 6px;
    display: none;
    justify-self: start;
    font-size: 10px;
  }
  #start.map-open .mapTrail {
    position: static;
    width: max-content;
    margin-top: 3px;
    justify-self: start;
    transform: none;
  }
  #start.map-open .mapStopLit .mapStamp {
    display: flex;
  }
  #start.map-open #utilityRow {
    position: static;
    z-index: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin-top: 6px;
  }
  #start.map-open #utilityRow button.menuTile {
    grid-template-columns: 1fr;
    min-width: 0;
    min-height: 48px;
  }
  #helperChoice {
    width: auto;
    grid-template-columns: 1fr;
  }
  #helperChoiceTitle,
  #helperChoiceButtons,
  #helperChoiceStatus,
  #practicePathTitle,
  #practicePathButtons,
  #practicePathStatus {
    grid-column: 1;
    grid-row: auto;
  }
}
#start:not(.map-open) {
  place-items: start center;
  padding: 22px 16px 64px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 176, 26, 0.18), transparent 34%),
    radial-gradient(circle at 18% 90%, rgba(54, 232, 255, 0.1), transparent 42%),
    radial-gradient(circle at 82% 85%, rgba(166, 255, 94, 0.11), transparent 44%),
    linear-gradient(180deg, rgba(2, 6, 5, 0.54), rgba(1, 4, 4, 0.96)),
    url("../../assets/level5_monkey_rescue_background.png") center / cover no-repeat,
    #050a08;
  color: #f4f1e8;
  isolation: isolate;
}
#start:not(.map-open)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 0,
      rgba(0, 0, 0, 0) 3px,
      rgba(0, 0, 0, 0.3) 4px,
      rgba(0, 0, 0, 0) 5px
    ),
    radial-gradient(ellipse at center, transparent 36%, rgba(0, 0, 0, 0.72) 100%);
  opacity: 0.86;
}
#start:not(.map-open)::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 211, 107, 0.58) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(126, 255, 140, 0.42) 0 2px, transparent 3px),
    linear-gradient(rgba(126, 255, 140, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 255, 140, 0.14) 1px, transparent 1px);
  background-size: 180px 220px, 260px 240px, 76px 76px, 76px 76px;
  background-position: 12% 110%, 74% 100%, center 78%, center 78%;
  mask-image: linear-gradient(180deg, transparent 0%, black 46%, black 100%);
  opacity: 0.22;
  animation: startEmbers 12s linear infinite;
}
@keyframes startEmbers {
  from {
    background-position: 12% 110%, 74% 100%, center 78%, center 78%;
  }
  to {
    background-position: 16% -12%, 70% -18%, center 78%, center 78%;
  }
}
#start:not(.map-open) #startPanel {
  width: min(1240px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 34px;
  position: relative;
  z-index: 1;
}
#start:not(.map-open) #menuIntro {
  display: grid;
  grid-template-columns: minmax(300px, auto) minmax(260px, 1fr) minmax(250px, 338px);
  gap: 18px;
  align-items: start;
  width: 100%;
}
#start:not(.map-open) #startPanel h1 {
  margin: -4px 0 0;
  color: #fff7ce;
  font-family: Impact, "Arial Black", system-ui, sans-serif;
  font-size: 68px;
  line-height: 0.9;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow:
    0 0 24px rgba(255, 176, 26, 0.28),
    0 6px 0 rgba(0, 0, 0, 0.62);
}
#start:not(.map-open) #startPanel .subtitle {
  max-width: 520px;
  color: rgba(244, 241, 232, 0.78);
  font-size: 16px;
  line-height: 1.42;
}
#start:not(.map-open) #inputHint {
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(255, 211, 107, 0.34);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.72);
  color: rgba(244, 241, 232, 0.86);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
}
#start:not(.map-open) #sprintSnippet {
  display: none;
}
#start:not(.map-open) #bestSnippet,
#start:not(.map-open) #adventureMapStatus,
#start:not(.map-open) #bridgeSnippet {
  grid-column: 1;
  width: min(246px, 100%);
  margin: -6px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(141, 252, 255, 0.48);
  background: rgba(9, 35, 32, 0.78);
  color: #dffcff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}
#start:not(.map-open) #bestSnippet:empty {
  display: none;
}
#start:not(.map-open) #adventureMapStatus:empty {
  display: none;
}
#adventureMapStatus {
  overflow-wrap: anywhere;
}
#adventureMapStatus > div + div {
  margin-top: 3px;
}
#start.map-open #adventureMapStatus {
  position: absolute;
  left: 16px;
  top: 54px;
  z-index: 4;
  max-width: min(310px, calc(100% - 32px));
  padding: 7px 10px;
  border: 1px solid rgba(255, 243, 184, 0.42);
  border-radius: 8px;
  background: rgba(55, 31, 14, 0.72);
  color: #fff3b8;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}
#start.map-open .mapStamp {
  position: absolute;
  right: -8px;
  top: -10px;
  z-index: 5;
  max-width: 92px;
  min-height: 20px;
  padding: 3px 6px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid #2a1608;
  border-radius: 8px;
  background: #ffd36b;
  color: #10130d;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.28);
}
#start.map-open .mapTrail {
  position: absolute;
  left: 50%;
  bottom: -12px;
  z-index: 4;
  padding: 2px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(141, 252, 255, 0.52);
  border-radius: 8px;
  background: rgba(7, 28, 32, 0.8);
  color: #dffcff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  transform: translateX(-50%);
  pointer-events: none;
  white-space: nowrap;
}
#start.map-open .mapStopLit .mapStamp {
  display: flex;
}
#start.map-open .mapStopLit > .tileTitle {
  border-color: #ffd36b;
  box-shadow:
    0 0 0 2px rgba(255, 211, 107, 0.34),
    0 0 18px rgba(255, 211, 107, 0.42);
}
.adventureMapEarnedLine {
  margin: 10px auto 0;
  max-width: 420px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 211, 107, 0.48);
  border-radius: 8px;
  background: rgba(255, 211, 107, 0.12);
  color: #fff3b8;
  font-weight: 900;
  line-height: 1.25;
}
.adventureMapEarnedLine > div + div {
  margin-top: 5px;
}
.adventureMapEarnedLine button {
  margin-left: 8px;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 243, 184, 0.72);
  border-radius: 8px;
  background: rgba(255, 211, 107, 0.22);
  color: #fff3b8;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.adventureMapEarnedLine button:hover,
.adventureMapEarnedLine button:focus-visible {
  background: rgba(255, 211, 107, 0.36);
  outline: 2px solid rgba(141, 252, 255, 0.85);
  outline-offset: 2px;
}
@media (max-width: 760px) {
  #start.map-open .mapStamp,
  #start.map-open .mapTrail {
    position: static;
    max-width: none;
    min-height: 0;
    justify-self: start;
    transform: none;
  }
  #start.map-open .mapStamp {
    margin-top: 4px;
  }
  #start.map-open .mapTrail {
    width: max-content;
    margin-top: 3px;
  }
}
#start:not(.map-open) #helperChoice {
  width: min(790px, calc(100% - 210px));
  max-width: none;
  margin: 6px auto 0;
  padding: 16px;
  gap: 12px;
  border: 2px solid rgba(255, 211, 107, 0.52);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(3, 44, 32, 0.96), rgba(0, 31, 24, 0.96)),
    rgba(3, 42, 30, 0.94);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.72) inset,
    0 0 46px rgba(255, 176, 26, 0.08),
    0 28px 58px rgba(0, 0, 0, 0.48);
}
#start:not(.map-open) #helperChoice::before {
  content: "Choose Your Hero";
  font-size: 32px;
  color: #ffd36b;
  letter-spacing: 0;
  text-shadow:
    0 0 14px rgba(255, 176, 26, 0.5),
    0 4px 0 rgba(0, 0, 0, 0.72);
}
#start:not(.map-open) #helperChoiceTitle,
#start:not(.map-open) #practicePathTitle {
  color: #ffd36b;
  font-size: 12px;
  letter-spacing: 0;
}
#start:not(.map-open) #helperChoiceButtons {
  gap: 10px;
}
#start:not(.map-open) #helperChoiceButtons button {
  position: relative;
  min-height: 182px;
  margin: 0;
  padding: 10px 10px 9px;
  display: grid;
  place-items: center;
  align-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 211, 107, 0.13), transparent 38%),
    linear-gradient(180deg, rgba(36, 75, 61, 0.96), rgba(24, 58, 49, 0.94));
  border-color: rgba(244, 241, 232, 0.24);
  color: #f4f1e8;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}
#start:not(.map-open) #helperChoiceButtons button:hover,
#start:not(.map-open) #helperChoiceButtons button:focus-visible {
  transform: translateY(-3px);
  border-color: var(--hero-accent, #ffd36b);
  box-shadow: 0 0 26px rgba(255, 211, 107, 0.18);
}
#start:not(.map-open) #helperChoiceButtons [data-helper="croc"] {
  --hero-accent: #76dd68;
}
#start:not(.map-open) #helperChoiceButtons [data-helper="firefly"] {
  --hero-accent: #ffd36b;
}
#start:not(.map-open) #helperChoiceButtons [data-helper="monkey"] {
  --hero-accent: #ffb070;
}
#start:not(.map-open) #helperChoiceButtons button::before {
  width: 74px;
  height: 132px;
  margin: 0 auto 6px;
  background-size: 300% auto;
  background-color: transparent;
  border-color: rgba(255, 211, 107, 0.72);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.22);
}
#start:not(.map-open) #helperChoiceButtons button.selected {
  border-color: #ffd36b;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 211, 107, 0.24), transparent 42%),
    linear-gradient(180deg, rgba(122, 106, 45, 0.92), rgba(73, 62, 28, 0.92));
  box-shadow:
    0 0 0 1px #ffd36b,
    0 0 38px rgba(255, 211, 107, 0.34),
    0 18px 30px rgba(0, 0, 0, 0.36);
}
#start:not(.map-open) #helperChoiceStatus,
#start:not(.map-open) #practicePathStatus {
  border-radius: 8px;
  background: rgba(0, 20, 15, 0.72);
  color: #dffcff;
  font-size: 14px;
}
#start:not(.map-open) #practicePathButtons {
  gap: 10px;
}
#start:not(.map-open) #practicePathButtons button,
#start:not(.map-open) #helperFullRunBtn,
#start:not(.map-open) #helperChoiceMapBtn {
  min-height: 64px;
  margin: 0;
  border-color: rgba(244, 241, 232, 0.26);
  background: rgba(43, 82, 68, 0.78);
  color: #f4f1e8;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}
#start:not(.map-open) #practicePathButtons button:hover,
#start:not(.map-open) #practicePathButtons button:focus-visible,
#start:not(.map-open) #helperFullRunBtn:hover,
#start:not(.map-open) #helperFullRunBtn:focus-visible,
#start:not(.map-open) #helperChoiceMapBtn:hover,
#start:not(.map-open) #helperChoiceMapBtn:focus-visible {
  transform: translateY(-2px);
  border-color: #8dfcff;
  box-shadow: 0 0 24px rgba(141, 252, 255, 0.24);
}
#start:not(.map-open) #practicePathButtons button.selected {
  border-color: #8dfcff;
  background: rgba(44, 92, 84, 0.94);
  box-shadow: 0 0 0 1px #8dfcff, 0 0 28px rgba(141, 252, 255, 0.26);
}
#start:not(.map-open) #helperReadyPreview {
  right: -154px;
  bottom: -2px;
  width: 160px;
  height: 318px;
  background-size: contain;
  background-repeat: no-repeat;
  background-color: transparent;
  border: 0;
  box-shadow:
    0 22px 34px rgba(0, 0, 0, 0.42);
}
#start:not(.map-open) #helperChoiceActions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
#start:not(.map-open) #helperFullRunBtn {
  background: rgba(255, 211, 107, 0.14);
  color: #fff7ce;
}
#start:not(.map-open) #helperChoiceMapBtn {
  background: rgba(141, 252, 255, 0.12);
  color: #dffcff;
}
@media (max-width: 980px) {
  #start:not(.map-open) #menuIntro {
    grid-template-columns: 1fr;
    text-align: center;
  }
  #start:not(.map-open) #startPanel .subtitle,
  #start:not(.map-open) #inputHint,
  #start:not(.map-open) #bestSnippet,
  #start:not(.map-open) #bridgeSnippet {
    max-width: none;
    width: 100%;
  }
  #start:not(.map-open) #helperChoice {
    width: 100%;
    margin-top: 0;
  }
  #start:not(.map-open) #helperReadyPreview {
    display: none;
  }
}
@media (max-width: 620px) {
  #start:not(.map-open) {
    padding: 14px 10px 42px;
  }
  #start:not(.map-open) #startPanel {
    gap: 16px;
  }
  #start:not(.map-open) #startPanel h1 {
    font-size: 42px;
  }
  #start:not(.map-open) #helperChoice {
    padding: 12px;
  }
  #start:not(.map-open) #helperChoiceActions {
    order: 1;
  }
  #start:not(.map-open) #helperChoiceTitle {
    order: 2;
  }
  #start:not(.map-open) #helperChoiceButtons {
    order: 3;
  }
  #start:not(.map-open) #helperChoiceStatus {
    order: 4;
  }
  #start:not(.map-open) #practicePathTitle {
    order: 5;
  }
  #start:not(.map-open) #practicePathButtons {
    order: 6;
  }
  #start:not(.map-open) #practicePathStatus {
    order: 7;
  }
  #start:not(.map-open) #helperChoiceButtons,
  #start:not(.map-open) #practicePathButtons {
    grid-template-columns: 1fr;
  }
  #start:not(.map-open) #helperChoiceActions {
    grid-template-columns: 1fr;
  }
  #start:not(.map-open) #helperChoiceButtons button {
    min-height: 112px;
    grid-template-columns: 72px 1fr;
    justify-items: start;
    text-align: left;
  }
  #start:not(.map-open) #helperChoiceButtons button::before {
    width: 54px;
    height: 96px;
    margin: 0;
  }
}
@media (min-width: 981px) and (max-height: 820px) {
  #start:not(.map-open) {
    padding: 14px 16px 24px;
  }
  #start:not(.map-open) #startPanel {
    gap: 12px;
  }
  #start:not(.map-open) #startPanel h1 {
    font-size: 56px;
  }
  #start:not(.map-open) #menuIntro {
    gap: 14px;
  }
  #start:not(.map-open) #helperChoice {
    padding: 12px;
    gap: 8px;
  }
  #start:not(.map-open) #helperChoice::before {
    font-size: 27px;
  }
  #start:not(.map-open) #helperChoiceButtons button {
    min-height: 142px;
    padding: 8px;
  }
  #start:not(.map-open) #helperChoiceButtons button::before {
    width: 62px;
    height: 108px;
    margin-bottom: 4px;
  }
  #start:not(.map-open) #practicePathButtons button,
  #start:not(.map-open) #helperFullRunBtn,
  #start:not(.map-open) #helperChoiceMapBtn {
    min-height: 48px;
  }
  #start:not(.map-open) #helperReadyPreview {
    width: 130px;
    height: 258px;
    right: -126px;
  }
}
#pauseBadge {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 42px;
  font-weight: 900;
  color: #ffd36b;
  background: rgba(0, 0, 0, 0.62);
  padding: 14px 30px;
  border-radius: 12px;
  display: none;
  pointer-events: none;
  z-index: 11;
  text-shadow:
    0 0 12px rgba(255, 211, 107, 0.45),
    0 2px 4px rgba(0, 0, 0, 0.7);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
#pauseBadge.show {
  display: block;
}
#pauseBadge.show::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: -1;
}
#muteBadge {
  position: fixed;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  display: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.78);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.24);
}
#muteBadge.show {
  display: block;
}
/* When the touch settings pad is visible the mute state is shown
   on the pad button itself; hide the corner badge to avoid overlap. */
body.show-touch-pad #muteBadge {
  display: none !important;
}
/* AGENT_TARGET: slip1-settings-modal */
#inputHint {
  margin-top: 18px;
  font-size: 15px;
  line-height: 1.6;
}
#inputHintBadge {
  position: fixed;
  bottom: 54px;
  left: 12px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  color: #cfd8d0;
  display: none;
  z-index: 20;
  transition: opacity 0.3s;
}
#inputHintBadge.show {
  display: block;
}
/* AGENT_TARGET: powerup-craft-ui — pre-run crafting panel in settings modal */
.craft-section-title {
  margin: 14px 0 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8dfcff;
  opacity: 0.75;
}
.craft-selects {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.craft-selects select {
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(141,252,255,0.35);
  color: #d4f5f8;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
  flex: 1;
  min-width: 110px;
}
.craft-plus {
  color: #8dfcff;
  font-size: 18px;
  font-weight: bold;
  line-height: 1;
}
#craftResult {
  margin-top: 8px;
  font-size: 13px;
  min-height: 20px;
  color: #ffd36b;
  font-weight: bold;
  letter-spacing: 0.04em;
}
/* AGENT_TARGET: slip2-daily-missions — panel, button, mission rows */
#dailyMissionsBtn {
  position: relative;
}
#dailyMissionsDot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  background: #f59e0b;
  border-radius: 50%;
  display: none;
}
#dailyMissionsOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  z-index: 120;
  align-items: center;
  justify-content: center;
}
#dailyMissionsOverlay.open {
  display: flex;
}
#dailyMissionsPanel {
  background: #1a2e1a;
  border: 2px solid #4ade80;
  border-radius: 16px;
  padding: 28px 32px;
  max-width: 480px;
  width: 92%;
  color: #e5f5e0;
}
#dailyMissionsPanel h2 {
  margin: 0 0 4px;
  font-size: 22px;
  color: #86efac;
}
#dailyMissionsPanel .dm-subtitle {
  font-size: 12px;
  color: #6b9c6b;
  margin-bottom: 20px;
}
.dm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 10px 14px;
}
.dm-row.done {
  opacity: 0.55;
}
.dm-info {
  flex: 1;
}
.dm-label {
  font-size: 14px;
  font-weight: 600;
}
.dm-bar-wrap {
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  margin-top: 5px;
  overflow: hidden;
}
.dm-bar {
  height: 100%;
  background: #4ade80;
  border-radius: 3px;
  transition: width 0.3s;
}
.dm-xp {
  font-size: 12px;
  color: #fbbf24;
  white-space: nowrap;
}
.dm-check {
  font-size: 20px;
}
#dailyMissionsClose {
  margin-top: 18px;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: #166534;
  color: #bbf7d0;
  font-size: 14px;
  cursor: pointer;
}
#settingsBtn {
  position: fixed;
  bottom: max(64px, calc(env(safe-area-inset-bottom) + 64px));
  left: 12px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f3f7f1;
  font-size: 22px;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  transition:
    transform 0.16s cubic-bezier(0.22, 0.61, 0.36, 1),
    background 0.16s cubic-bezier(0.22, 0.61, 0.36, 1);
}
body:has(#start.show) #settingsBtn {
  display: none;
}
#settingsBtn:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: translateY(-1px);
}
#settingsBtn:active {
  transform: translateY(0) scale(0.95);
}
#settingsModal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
  z-index: 30;
}
#settingsModal.show {
  display: grid;
}
#settingsPanel {
  background: #1a2820;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 28px 32px;
  min-width: 320px;
  color: #cfd8d0;
  font-family: system-ui, sans-serif;
}
#settingsPanel h2 {
  margin: 0 0 20px;
  font-size: 20px;
  color: #ffd36b;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
}
.settings-row label {
  font-size: 14px;
  min-width: 140px;
}
.settings-row input[type="range"] {
  flex: 1;
  accent-color: #ffd36b;
}
.settings-row .val {
  font-size: 13px;
  color: #ffd36b;
  min-width: 36px;
  text-align: right;
}
.settings-hint {
  margin: -10px 0 16px;
  color: #d7e6db;
  font-size: 12px;
  line-height: 1.25;
  opacity: 0.78;
}
body.high-contrast .settings-hint {
  color: #ffffff;
  opacity: 1;
}
#contrastPreview {
  margin: -4px 0 18px;
  padding: 12px;
  border: 2px solid rgba(255, 211, 107, 0.38);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}
#contrastPreviewTitle {
  margin-bottom: 9px;
  color: #ffd36b;
  font-size: 13px;
  font-weight: 800;
}
.contrast-preview-samples {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.contrast-sample {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(10, 24, 18, 0.82);
  color: #dffcff;
  font-size: 22px;
  font-weight: 900;
}
.contrast-sample.target {
  color: #ffe08a;
}
#contrastPreview.contrast-on {
  border-color: #ffffff;
  background: #000000;
}
#contrastPreview.contrast-on .contrast-sample {
  border-color: #ffffff;
  background: #000000;
  color: #ffffff;
  box-shadow: inset 0 0 0 3px #ffff00;
}
#contrastPreview.contrast-on .contrast-sample.target {
  color: #ffff00;
}
#settingsClose {
  margin-top: 20px;
  padding: 14px 26px;
  min-height: 48px;
  background: #ffd36b;
  color: #10130d;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  touch-action: manipulation;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
  transition:
    transform 0.16s cubic-bezier(0.22, 0.61, 0.36, 1),
    box-shadow 0.16s cubic-bezier(0.22, 0.61, 0.36, 1);
}
#settingsClose:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.34);
}
#settingsClose:active {
  transform: translateY(0) scale(0.97);
}
/* AGENT_TARGET: slip2-firebase-leaderboard */
#leaderboardModal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
  z-index: 31;
}
#leaderboardModal.show { display: none; }
#leaderboardPanel {
  background: #1a2820;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 24px 28px;
  min-width: 300px;
  max-width: 420px;
  width: 90vw;
  color: #cfd8d0;
  font-family: system-ui, sans-serif;
}
#leaderboardPanel h2 { margin: 0 0 16px; font-size: 20px; color: #ffd36b; }
#leaderboardNickRow {
  display: flex; gap: 8px; margin-bottom: 14px;
}
#leaderboardNick {
  flex: 1; padding: 8px 10px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.07); color: #f3f7f1;
  font-size: 15px;
}
#leaderboardSubmitBtn {
  padding: 8px 16px; background: #ffd36b; color: #10130d;
  border: 0; border-radius: 6px; font-weight: 800;
  cursor: pointer; font-size: 14px; white-space: nowrap;
}
#leaderboardStatus {
  font-size: 13px; min-height: 18px; margin-bottom: 12px;
  color: #a3e2b4;
}
#leaderboardList { list-style: none; padding: 0; margin: 0 0 16px; }
#leaderboardList li {
  display: flex; justify-content: space-between;
  padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.07);
  font-size: 14px;
}
#leaderboardList li:first-child { color: #ffd36b; font-weight: 700; }
#leaderboardClose {
  width: 100%; padding: 12px; background: rgba(255,255,255,0.1);
  color: #cfd8d0; border: 0; border-radius: 8px;
  cursor: pointer; font-size: 15px;
}
#leaderboardBtn {
  display: none;
  margin-top: 8px;
  padding: 10px 18px;
  background: rgba(255,211,107,0.15);
  border: 1px solid #ffd36b;
  color: #ffd36b;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  touch-action: manipulation;
}
#leaderboardBtn,
#shareClipBtn,
#leaderboardModal,
#shareClipUrl {
  display: none !important;
}
/* AGENT_TARGET: skin-unlock-showcase */
#skinShowcase {
  margin: 8px 0 4px;
  text-align: center;
  font-family: inherit;
}
.skin-showcase-label {
  font-size: 11px;
  opacity: 0.6;
  margin-bottom: 5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.skin-showcase-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.skin-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0,0,0,0.35);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  padding: 4px 8px;
  min-width: 46px;
  cursor: default;
  transition: border-color 0.2s;
}
.skin-chip.owned {
  border-color: rgba(255,211,63,0.7);
  background: rgba(255,211,63,0.12);
}
.skin-chip-icon {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
}
.skin-chip-hint {
  font-size: 9px;
  margin-top: 2px;
  opacity: 0.75;
  color: #ffd23f;
}
.skin-chip:not(.owned) .skin-chip-hint {
  color: rgba(255,255,255,0.5);
}

/* AGENT_TARGET: slip1-cosmetics-shop */
#cosmeticsModal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, 0.8);
  z-index: 40;
}
#cosmeticsModal.show {
  display: grid;
}
#cosmeticsPanel {
  background: #1a2820;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 28px 32px;
  min-width: 360px;
  max-width: 480px;
  color: #cfd8d0;
  font-family: system-ui, sans-serif;
}
#cosmeticsPanel h2 {
  margin: 0 0 4px;
  color: #ffd36b;
  font-size: 20px;
}
#cosmeticsPanel .bank-row {
  font-size: 13px;
  margin-bottom: 18px;
  opacity: 0.8;
}
.cosmetic-section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.6;
  margin: 14px 0 6px;
}
.cosmetic-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.cosmetic-item {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 12px 14px;
  min-height: 56px;
  cursor: pointer;
  font-size: 14px;
  text-align: center;
  min-width: 88px;
  touch-action: manipulation;
  transition: border-color 0.15s;
}
.cosmetic-item.unlocked {
  border-color: #4fc87a;
}
.cosmetic-item.selected {
  background: rgba(79, 200, 122, 0.18);
  border-color: #ffd36b;
}
.cosmetic-item.locked {
  opacity: 0.6;
}
.cosmetic-item .item-icon {
  font-size: 22px;
  display: block;
  margin-bottom: 3px;
}
.cosmetic-item .item-cost {
  font-size: 11px;
  color: #ffd36b;
}
#cosmeticsClose {
  margin-top: 20px;
  padding: 14px 26px;
  min-height: 48px;
  background: #ffd36b;
  color: #10130d;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  touch-action: manipulation;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
  transition:
    transform 0.16s cubic-bezier(0.22, 0.61, 0.36, 1),
    box-shadow 0.16s cubic-bezier(0.22, 0.61, 0.36, 1);
}
#cosmeticsClose:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.34);
}
#cosmeticsClose:active {
  transform: translateY(0) scale(0.97);
}
.cosmetic-item {
  transition:
    border-color 0.15s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.15s cubic-bezier(0.22, 0.61, 0.36, 1),
    background 0.15s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.cosmetic-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.1);
}
.cosmetic-item.unlocked:hover {
  border-color: #6fdc94;
}
.cosmetic-item.selected {
  box-shadow: 0 0 0 2px rgba(255, 211, 107, 0.5);
}
/* AGENT_TARGET: slip2-replay-share */
#shareClipBtn {
  display: none;
  margin-top: 10px;
  padding: 14px 22px;
  min-height: 48px;
  background: #3a86ff;
  color: #fff;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  touch-action: manipulation;
}
#shareClipBtn.show {
  display: none;
}
#shareClipUrl {
  display: none;
  margin-top: 8px;
  font-size: 12px;
  word-break: break-all;
  color: #9be9ff;
}
#shareClipUrl.show {
  display: none;
}
#readingSliderOverlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 14px;
  box-sizing: border-box;
  overflow: auto;
  background:
    linear-gradient(118deg, rgba(12, 13, 16, 0.97), rgba(22, 25, 27, 0.97) 48%, rgba(5, 9, 11, 0.98)),
    #080a0c;
  z-index: 72;
  color: #f7fff4;
}
#readingSliderOverlay.show {
  display: grid;
}
#readingSliderPanel {
  position: relative;
  width: min(980px, 100%);
  max-height: calc(100svh - 28px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  padding: clamp(12px, 2.4vw, 22px);
  box-sizing: border-box;
  overflow: auto;
  border: 3px solid rgba(255, 211, 107, 0.78);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(218, 29, 29, 0.22), transparent 20% 80%, rgba(0, 184, 212, 0.2)),
    linear-gradient(180deg, #171b1d, #071013 62%, #050709);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.09);
}
#readingSliderPanel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(90deg, #d91f1f 0 32%, #ffd36b 32% 46%, #16bfd2 46% 100%);
  pointer-events: none;
}
#readingSliderHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 211, 107, 0.28);
  border-radius: 7px;
  background:
    linear-gradient(90deg, rgba(217, 31, 31, 0.85), rgba(23, 27, 30, 0.95) 42%, rgba(7, 28, 34, 0.94)),
    #121519;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.34);
}
#readingSliderTitle {
  color: #ffffff;
  font-family: Impact, Arial Black, sans-serif;
  font-size: clamp(26px, 5vw, 44px);
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow:
    0 3px 0 rgba(0, 0, 0, 0.8),
    0 0 14px rgba(255, 211, 107, 0.22);
}
#readingSliderCount {
  display: inline-flex;
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 5px;
  background: #ffd36b;
  color: #14120c;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}
#readingSliderCloseBtn,
#readingSliderSpeakBtn {
  min-height: 44px;
  padding: 9px 13px;
  border: 2px solid rgba(255, 211, 107, 0.88);
  border-radius: 7px;
  background: linear-gradient(180deg, #322f1c, #171612);
  color: #fff7ce;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow:
    inset 0 -3px 0 rgba(0, 0, 0, 0.28),
    0 3px 0 rgba(0, 0, 0, 0.28);
}
#readingSliderStage {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 1.08fr) minmax(250px, 0.92fr);
  grid-template-areas:
    "image word"
    "image sentence"
    "image letters";
  gap: clamp(10px, 2vw, 18px);
  align-items: center;
}
#readingSliderImageFrame {
  grid-area: image;
  aspect-ratio: 4 / 3;
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 4px solid #ffd36b;
  border-radius: 7px;
  background: #050709;
  cursor: pointer;
  box-shadow:
    0 10px 0 rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.18),
    inset 0 0 26px rgba(0, 0, 0, 0.42);
}
#readingSliderImageFrame::before {
  content: "LIVE";
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  padding: 4px 8px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 5px;
  background: #d91f1f;
  color: #ffffff;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
}
#readingSliderImage {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#readingSliderWord {
  grid-area: word;
  justify-self: start;
  display: inline-block;
  padding: 8px 18px 12px;
  border: 3px solid rgba(255, 211, 107, 0.9);
  border-radius: 7px;
  background:
    linear-gradient(90deg, rgba(217, 31, 31, 0.94), rgba(22, 25, 28, 0.98) 48%, rgba(7, 28, 34, 0.94)),
    #121519;
  color: #ffffff;
  font-family: Impact, Arial Black, sans-serif;
  font-size: clamp(54px, 9.4vw, 108px);
  line-height: 0.92;
  letter-spacing: 0;
  text-transform: lowercase;
  text-shadow:
    0 4px 0 rgba(0, 0, 0, 0.68),
    0 0 18px rgba(255, 211, 107, 0.28);
  overflow-wrap: anywhere;
  box-shadow:
    inset 0 -8px 0 rgba(255, 211, 107, 0.22),
    0 10px 0 rgba(0, 0, 0, 0.34);
}
#readingSliderWord.is-highlighted {
  animation: readingWordHighlight 280ms ease-out;
}
@keyframes readingWordHighlight {
  0% {
    background: rgba(255, 211, 107, 0.44);
    box-shadow: 0 0 0 0 rgba(255, 211, 107, 0.55);
    transform: scale(1);
  }
  45% {
    background: rgba(255, 211, 107, 0.3);
    box-shadow: 0 0 0 8px rgba(255, 211, 107, 0.12);
    transform: scale(1.025);
  }
  100% {
    background: rgba(255, 211, 107, 0.16);
    box-shadow: 0 0 0 0 rgba(255, 211, 107, 0);
    transform: scale(1);
  }
}
#readingSliderSentence {
  grid-area: sentence;
  padding: 12px 14px;
  border: 2px solid rgba(0, 184, 212, 0.42);
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(4, 7, 9, 0.92), rgba(7, 28, 34, 0.88));
  color: #f4fdff;
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 900;
  line-height: 1.12;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.28);
}
#readingSliderLetters {
  grid-area: letters;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#readingSliderLetters span {
  min-width: 42px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 211, 107, 0.82);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(32, 36, 38, 0.95), rgba(8, 10, 12, 0.96));
  color: #ffd36b;
  font-size: 28px;
  font-weight: 950;
  text-transform: lowercase;
  box-shadow:
    inset 0 -4px 0 rgba(217, 31, 31, 0.34),
    0 3px 0 rgba(0, 0, 0, 0.26);
}
#readingSliderControls {
  display: block;
  padding: 4px 8px 0;
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(217, 31, 31, 0.18), rgba(255, 211, 107, 0.08), rgba(0, 184, 212, 0.16));
}
#readingSliderRange {
  appearance: none;
  width: 100%;
  min-height: 64px;
  accent-color: #ffd36b;
  cursor: pointer;
  background: transparent;
  touch-action: pan-y;
}
#readingSliderRange::-webkit-slider-runnable-track {
  height: 16px;
  border: 2px solid rgba(255, 211, 107, 0.88);
  border-radius: 999px;
  background:
    linear-gradient(90deg, #d91f1f, #ffd36b 46%, #16bfd2),
    rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.2),
    0 3px 0 rgba(0, 0, 0, 0.36);
}
#readingSliderRange::-moz-range-track {
  height: 16px;
  border: 2px solid rgba(255, 211, 107, 0.88);
  border-radius: 999px;
  background:
    linear-gradient(90deg, #d91f1f, #ffd36b 46%, #16bfd2),
    rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.2),
    0 3px 0 rgba(0, 0, 0, 0.36);
}
#readingSliderRange::-webkit-slider-thumb {
  appearance: none;
  width: 56px;
  height: 56px;
  margin-top: -22px;
  border: 4px solid #fff7ce;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, #ffffff, transparent 18%),
    linear-gradient(180deg, #fff066, #d91f1f);
  box-shadow:
    0 4px 0 rgba(0, 0, 0, 0.42),
    0 0 0 5px rgba(22, 191, 210, 0.2);
}
#readingSliderRange::-moz-range-thumb {
  width: 56px;
  height: 56px;
  border: 4px solid #fff7ce;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, #ffffff, transparent 18%),
    linear-gradient(180deg, #fff066, #d91f1f);
  box-shadow:
    0 4px 0 rgba(0, 0, 0, 0.42),
    0 0 0 5px rgba(22, 191, 210, 0.2);
}
#readingSliderActions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255, 211, 107, 0.22);
  border-radius: 7px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.5), rgba(7, 28, 34, 0.7)),
    #0a0d0f;
}
#readingSliderWordStrip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.readingSliderWordChip {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border: 2px solid rgba(22, 191, 210, 0.5);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(28, 32, 34, 0.94), rgba(8, 10, 12, 0.94));
  color: #dffcff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.34);
}
.readingSliderWordChip.is-active,
.readingSliderWordChip[aria-current="true"] {
  border-color: #ffd36b;
  background: linear-gradient(180deg, #d91f1f, #7b1414);
  color: #ffffff;
  box-shadow:
    inset 0 -3px 0 rgba(0, 0, 0, 0.28),
    0 0 0 3px rgba(255, 211, 107, 0.18);
  transform: translateY(-1px);
}
body.high-contrast #readingSliderPanel {
  background: #000000;
  border-color: #ffffff;
  color: #ffffff;
  box-shadow: none;
}
body.high-contrast #readingSliderTitle,
body.high-contrast #readingSliderLetters span {
  color: #ffff00;
  text-shadow: none;
}
body.high-contrast #readingSliderCloseBtn,
body.high-contrast #readingSliderSpeakBtn,
body.high-contrast .readingSliderWordChip {
  background: #000000;
  border-color: #ffffff;
  color: #ffffff;
}
@media (max-width: 760px), (max-height: 620px) {
  #readingSliderOverlay {
    padding: 8px;
  }
  #start #utilityRow button.menuTile {
    min-width: 76px;
    padding: 7px 8px;
  }
  #start #utilityRow button.menuTile .tileMeta {
    display: none;
  }
  #utilityRow {
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: min(420px, calc(100% - 28px));
  }
  #readingSliderPanel {
    grid-template-rows: auto auto auto auto;
    max-height: calc(100svh - 16px);
    gap: 8px;
    padding: 8px 12px;
  }
  #readingSliderHeader {
    padding: 8px 10px;
  }
  #readingSliderTitle {
    max-width: calc(100% - 88px);
    font-size: clamp(22px, 7vw, 30px);
    line-height: 0.95;
  }
  #readingSliderStage {
    grid-template-columns: 1fr;
    grid-template-areas:
      "image"
      "word"
      "sentence"
      "letters";
    gap: 10px;
  }
  #readingSliderImageFrame {
    aspect-ratio: 16 / 9;
    margin-bottom: 10px;
    border-width: 3px;
    box-shadow:
      0 6px 0 rgba(0, 0, 0, 0.3),
      0 0 0 1px rgba(255, 255, 255, 0.18),
      inset 0 0 18px rgba(0, 0, 0, 0.38);
  }
  #readingSliderActions {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
  }
  #readingSliderWord {
    margin-top: 2px;
    padding: 5px 13px 9px;
    font-size: clamp(42px, 13.5vw, 62px);
    justify-self: center;
    text-align: center;
  }
  #readingSliderSentence {
    text-align: center;
    font-size: clamp(18px, 5.2vw, 22px);
  }
  #readingSliderLetters {
    justify-content: center;
  }
  #readingSliderRange {
    min-height: 52px;
  }
  #readingSliderLetters span {
    min-width: 40px;
    min-height: 40px;
    font-size: 26px;
  }
  #readingSliderWordStrip {
    gap: 6px;
  }
  .readingSliderWordChip {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 12px;
  }
}
#bookOverlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 211, 107, 0.16), transparent 30%),
    radial-gradient(circle at 82% 20%, rgba(105, 220, 148, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(5, 18, 20, 0.96), rgba(2, 6, 8, 0.94));
  z-index: 70;
  color: #f4f0df;
}
#bookOverlay.show {
  display: grid;
}
#bookShell {
  width: min(1280px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  justify-items: center;
}
#bookHeader,
#bookControls {
  width: min(1200px, 100%);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
#bookHeader {
  padding: 10px 14px;
  border: 1px solid rgba(255, 246, 202, 0.18);
  border-radius: 8px;
  background: rgba(5, 15, 18, 0.74);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}
#bookControls {
  padding: 0 2px;
}
#bookTitle {
  font-size: 24px;
  font-weight: 900;
  color: #ffd36b;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.68);
}
#bookPageCount {
  font-size: 14px;
  opacity: 0.78;
}
#bookChoices {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(196px, 1fr));
  gap: clamp(12px, 1.3vw, 18px);
  width: min(1220px, 100%);
  min-height: min(66svh, 700px);
  padding: clamp(22px, 3vw, 38px) clamp(20px, 2.6vw, 36px) clamp(48px, 4vw, 64px);
  justify-self: center;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(12, 45, 42, 0.72), rgba(5, 18, 16, 0.92)),
    linear-gradient(110deg, #193f38, #102723 52%, #071210);
  border: 1px solid rgba(255, 246, 202, 0.16);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.36);
}
#bookChoices::before,
#bookChoices::after {
  content: "";
  position: absolute;
  left: clamp(14px, 2vw, 26px);
  right: clamp(14px, 2vw, 26px);
  height: 14px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 210, 118, 0.4), rgba(93, 51, 22, 0.95)),
    #73451f;
  box-shadow:
    0 5px 0 rgba(45, 23, 9, 0.92),
    0 16px 22px rgba(0, 0, 0, 0.26);
  pointer-events: none;
  z-index: 0;
}
#bookChoices::before {
  top: calc(50% - 7px);
}
#bookChoices::after {
  bottom: clamp(24px, 2.8vw, 36px);
}
.bookChoice {
  position: relative;
  display: grid;
  grid-template-rows: minmax(92px, 1fr) auto auto;
  align-content: stretch;
  gap: 9px;
  min-width: 0;
  min-height: 0;
  padding: clamp(10px, 1.25vw, 14px);
  border: 2px solid rgba(255, 246, 202, 0.32);
  border-radius: 7px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.22), transparent 12% 86%, rgba(0, 0, 0, 0.28)),
    linear-gradient(180deg, var(--book-spine-top), var(--book-spine-bottom));
  color: #fff4c4;
  cursor: pointer;
  transform-origin: center bottom;
  z-index: 1;
  transition:
    transform 220ms ease,
    filter 220ms ease,
    box-shadow 220ms ease,
    background 220ms ease;
}
.bookChoice::after {
  content: "";
  position: absolute;
  inset: 10px auto 10px 10px;
  width: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  pointer-events: none;
}
.bookChoice[data-book="river"] {
  --book-spine-top: #188fa7;
  --book-spine-bottom: #0d526a;
}
.bookChoice[data-book="money"] {
  --book-spine-top: #4fa44f;
  --book-spine-bottom: #246638;
}
.bookChoice[data-book="moon"] {
  --book-spine-top: #5966c8;
  --book-spine-bottom: #263471;
}
.bookChoice[data-book="treehouse"] {
  --book-spine-top: #c06f2c;
  --book-spine-bottom: #6d3d1e;
}
.bookChoice[data-book="iceHammer"] {
  --book-spine-top: #f27a22;
  --book-spine-bottom: #8d3415;
}
.bookChoice[data-book="bananaBridge"] {
  --book-spine-top: #d8b72f;
  --book-spine-bottom: #87651a;
}
.bookChoice[data-book="riverDock"] {
  --book-spine-top: #2c9bbd;
  --book-spine-bottom: #15516f;
}
.bookChoice[data-book="moonRover"] {
  --book-spine-top: #7a82a7;
  --book-spine-bottom: #30384f;
}
.bookChoice[data-book="fireflyGarden"] {
  --book-spine-top: #f4cb3e;
  --book-spine-bottom: #8a6815;
}
.bookChoice[data-book="spiderWeb"] {
  --book-spine-top: #9d58c9;
  --book-spine-bottom: #49266b;
}
#bookChoices.visualShelf {
  display: block !important;
  width: min(1240px, 100%);
  min-height: 0;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(8, 20, 19, 0.08), rgba(8, 20, 19, 0.2)),
    url("../../assets/ui/story-shelf-bookshelf.png") center / cover no-repeat;
}
#bookChoices.visualShelf::before,
#bookChoices.visualShelf::after {
  display: none;
}
#bookChoices.visualShelf .bookChoice {
  position: absolute;
  display: block;
  width: max(8.4%, 44px);
  height: max(27%, 44px);
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px 10px 7px 7px;
  background: transparent;
  box-shadow: none;
  color: #fff8d8;
  transform-origin: 50% 100%;
}
#bookChoices.visualShelf .bookChoice::after {
  display: none;
}
#bookChoices.visualShelf .bookChoice[data-book="river"] {
  left: 21.9%;
  top: 25.4%;
}
#bookChoices.visualShelf .bookChoice[data-book="money"] {
  left: 33.8%;
  top: 25.4%;
}
#bookChoices.visualShelf .bookChoice[data-book="moon"] {
  left: 46.0%;
  top: 25.4%;
}
#bookChoices.visualShelf .bookChoice[data-book="treehouse"] {
  left: 58.2%;
  top: 25.4%;
}
#bookChoices.visualShelf .bookChoice[data-book="iceHammer"] {
  left: 70.7%;
  top: 25.4%;
}
#bookChoices.visualShelf .bookChoice[data-book="bananaBridge"] {
  left: 20.9%;
  top: 60.6%;
}
#bookChoices.visualShelf .bookChoice[data-book="riverDock"] {
  left: 33.7%;
  top: 60.6%;
}
#bookChoices.visualShelf .bookChoice[data-book="moonRover"] {
  left: 45.9%;
  top: 60.6%;
}
#bookChoices.visualShelf .bookChoice[data-book="fireflyGarden"] {
  left: 58.2%;
  top: 60.6%;
}
#bookChoices.visualShelf .bookChoice[data-book="spiderWeb"] {
  left: 70.8%;
  top: 60.6%;
}
#bookChoices.visualShelf .bookChoice:hover,
#bookChoices.visualShelf .bookChoice:focus-visible {
  outline: 3px solid rgba(255, 211, 107, 0.95);
  outline-offset: 4px;
  filter: saturate(1.12) brightness(1.08);
  transform: translateY(-3%) scale(1.04);
}
#bookChoices.visualShelf .bookChoice.pulled {
  z-index: 3;
  animation: bookshelfPull 620ms cubic-bezier(0.16, 0.84, 0.24, 1) both;
}
#bookChoices.visualShelf .bookChoice b,
#bookChoices.visualShelf .bookChoice span {
  position: absolute;
  left: 50%;
  max-width: min(220px, 24vw);
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 248, 221, 0.94);
  color: #3c230f;
  text-shadow: none;
  opacity: 0;
  transform: translateX(-50%) translateY(5px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  white-space: nowrap;
  pointer-events: none;
}
#bookChoices.visualShelf .bookChoice b {
  bottom: -34px;
  font-size: 12px;
  line-height: 1;
}
#bookChoices.visualShelf .bookChoice span {
  display: none;
}
#bookChoices.visualShelf .bookChoice:hover b,
#bookChoices.visualShelf .bookChoice:focus-visible b {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#bookChoices.visualShelf #bookShelfHint {
  left: 50%;
  right: auto;
  bottom: clamp(8px, 1.2vw, 16px);
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(5, 18, 16, 0.72);
  transform: translateX(-50%);
}
@keyframes bookshelfPull {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  62% {
    transform: translate3d(0, -28px, 0) scale(1.13) rotate(-2deg);
  }
  100% {
    transform: translate3d(0, -20px, 0) scale(1.08) rotate(-1deg);
  }
}
.bookChoice:hover,
.bookChoice:focus-visible {
  box-shadow:
    0 0 0 4px rgba(255, 211, 107, 0.82),
    0 12px 26px rgba(255, 211, 107, 0.22);
  filter: saturate(1.15) brightness(1.06);
  outline: none;
  transform: translateY(-3%) scale(1.025);
}
.bookChoice.picked {
  animation: bookPullOut 540ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.bookChoice b {
  display: block;
  font-size: clamp(14px, 1.25vw, 18px);
  line-height: 1.08;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.42);
}
.bookChoice span {
  display: block;
  color: rgba(255, 250, 221, 0.82);
  font-size: clamp(10px, 0.92vw, 12px);
  line-height: 1.18;
}
.bookCoverThumb {
  width: 100%;
  height: 100%;
  min-height: 86px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid rgba(255, 246, 202, 0.28);
  background: rgba(0, 0, 0, 0.22);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 8px 18px rgba(0, 0, 0, 0.28);
}
#bookShelfHint {
  position: absolute;
  left: clamp(18px, 3vw, 36px);
  right: clamp(18px, 3vw, 36px);
  bottom: clamp(8px, 1.4vw, 16px);
  pointer-events: none;
  z-index: 2;
  color: #fff7ce;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.78);
}
#bookPreview {
  position: absolute;
  inset: clamp(18px, 2.6vw, 34px);
  display: none;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 24px;
  border-radius: 8px;
  background: rgba(13, 33, 25, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.45);
  z-index: 4;
}
#bookPreview.show {
  display: grid;
}
#bookPreview.opening {
  animation: bookPreviewOpen 620ms ease-in both;
}
#bookPreviewCover {
  width: 100%;
  aspect-ratio: 1.4516;
  object-fit: contain;
  border-radius: 7px;
  background: #10150d;
  box-shadow:
    -10px 0 0 #744923,
    0 14px 28px rgba(0, 0, 0, 0.38);
  transform-origin: left center;
}
#bookPreview.opening #bookPreviewCover {
  animation: bookCoverOpen 620ms ease-in both;
}
#bookPreviewTitle {
  color: #ffd36b;
  font-size: clamp(28px, 5vw, 54px);
  line-height: 1.02;
  font-weight: 900;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.52);
}
#bookPreviewText {
  margin-top: 12px;
  color: #ffffff;
  font-size: 22px;
  line-height: 1.25;
}
#bookOpenBtn {
  margin-top: 20px;
  width: fit-content;
}
#bookReader {
  display: none;
  min-height: 0;
  perspective: 1200px;
  position: relative;
}
#bookReader.show {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
  gap: 0;
  width: min(1080px, calc(100vw - 42px));
  min-height: min(58svh, 560px);
  align-self: center;
  justify-self: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  background:
    linear-gradient(
      90deg,
      #f4e4bd,
      #fff5d8 48%,
      #debd80 50%,
      #fff5d8 52%,
      #f8e8c4
    ),
    #f7e6c2;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  transform-style: preserve-3d;
}
#bookReader.show::before {
  content: none;
}
#bookReader.show::after {
  content: none;
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      rgba(68, 38, 16, 0.14),
      transparent 8%,
      transparent 42%,
      rgba(68, 38, 16, 0.1) 49%,
      transparent 57%,
      transparent 92%,
      rgba(68, 38, 16, 0.12)
    ),
    repeating-linear-gradient(
      0deg,
      rgba(86, 49, 22, 0.035) 0 1px,
      transparent 1px 22px
    );
  mix-blend-mode: multiply;
}
#bookReader.opening #bookImageFrame {
  animation: bookPageOpen 820ms cubic-bezier(0.18, 0.86, 0.22, 1) both;
}
#bookReader.turning #bookImageFrame {
  animation: bookPageTurn 420ms ease-in-out both;
}
#bookImageFrame {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  border-right: 1px solid rgba(95, 61, 22, 0.16);
  border-radius: 0;
  background:
    radial-gradient(
      circle at 30% 18%,
      rgba(255, 255, 255, 0.5),
      transparent 26%
    ),
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.45),
      rgba(246, 222, 179, 0.34)
    );
  cursor: pointer;
  padding: clamp(6px, 1vw, 12px);
}
#bookImageFrame::before {
  content: none;
  position: absolute;
  inset: clamp(18px, 4.4vw, 42px);
  z-index: 0;
  border-radius: 10px;
  background:
    radial-gradient(
      circle at 80% 12%,
      rgba(143, 199, 255, 0.18),
      transparent 24%
    ),
    #fff2cf;
  box-shadow:
    inset 0 0 18px rgba(92, 54, 24, 0.12),
    0 10px 22px rgba(92, 54, 24, 0.14);
}
#bookImageFrame::after {
  content: none;
  position: absolute;
  inset: clamp(26px, 5.2vw, 54px);
  z-index: 1;
  border-radius: 8px;
  background: radial-gradient(
    circle at 85% 18%,
    rgba(255, 236, 150, 0.2),
    transparent 26%
  );
  box-shadow:
    0 0 0 2px rgba(122, 82, 42, 0.25),
    0 8px 20px rgba(92, 54, 24, 0.18);
  pointer-events: none;
}
#bookImageFrame.loading::after {
  content: "Loading page...";
  inset: auto;
  top: 50%;
  left: 50%;
  bottom: auto;
  width: auto;
  transform: translate(-50%, -50%);
  background: transparent;
  color: rgba(78, 43, 18, 0.62);
  font-size: 14px;
  letter-spacing: 0;
  box-shadow: none;
}
#bookImage {
  display: block;
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  max-height: min(52svh, 500px);
  object-fit: contain;
  object-position: center;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: 0 14px 38px rgba(52, 30, 12, 0.2);
}
#bookGutter {
  position: relative;
  display: block;
  background: linear-gradient(
    90deg,
    rgba(75, 43, 16, 0.24),
    rgba(255, 255, 255, 0.36),
    rgba(75, 43, 16, 0.28)
  );
  box-shadow:
    inset 7px 0 14px rgba(58, 33, 13, 0.22),
    inset -7px 0 14px rgba(58, 33, 13, 0.18);
}
#bookText {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  padding: clamp(8px, 1.2vw, 14px);
  border-left: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 0;
  background:
    radial-gradient(
      circle at 30% 18%,
      rgba(255, 255, 255, 0.5),
      transparent 26%
    ),
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.45),
      rgba(246, 222, 179, 0.34)
    );
  color: #2f1d0d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 4.2vw, 56px);
  font-weight: 700;
  line-height: 1.04;
  text-align: center;
  text-wrap: balance;
  box-shadow: none;
}
#bookOverlay button {
  border: 0;
  border-radius: 8px;
  padding: 14px 22px;
  min-height: 48px;
  background: #ffd36b;
  color: #111;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
#bookOverlay button.secondary {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
#bookControls > div {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
#bookPrevBtn,
#bookNextBtn {
  border-radius: 999px;
}
#bookNextBtn {
  width: min(340px, 100%);
  min-height: 58px;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}
#bookControls button,
#bookCloseBtn {
  backdrop-filter: blur(3px);
}
#bookOverlay button.bookChoice {
  color: #fff4c4;
  font: inherit;
}
#bookOverlay button.bookChoice b {
  color: #fff4c4;
}
#bookOverlay button.bookChoice span {
  color: rgba(255, 250, 221, 0.82);
}
#bookOverlay button.bookChoice:hover,
#bookOverlay button.bookChoice:focus-visible {
  box-shadow:
    0 0 0 4px rgba(255, 211, 107, 0.82),
    0 12px 26px rgba(255, 211, 107, 0.2);
}
@keyframes bookPullOut {
  0% {
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
  55% {
    transform: translateY(-12%) scale(1.08);
    filter: brightness(1.16);
  }
  100% {
    transform: translateY(-5%) scale(1.035);
    filter: brightness(1.08);
  }
}
@keyframes bookPreviewOpen {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}
@keyframes bookCoverOpen {
  0% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(-74deg);
  }
}
@keyframes bookPageOpen {
  0% {
    opacity: 0;
    transform: perspective(900px) rotateY(-72deg) scale(0.82);
    transform-origin: 0 50%;
  }
  72% {
    opacity: 1;
    transform: perspective(900px) rotateY(8deg) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: perspective(900px) rotateY(0deg) scale(1);
  }
}
@keyframes bookPageTurn {
  0% {
    transform: rotateY(0deg);
  }
  48% {
    transform: rotateY(-18deg) scale(0.985);
  }
  100% {
    transform: rotateY(0deg);
  }
}
@media (max-width: 720px) {
  #bookChoices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(5, minmax(188px, 1fr));
    gap: 12px;
    align-content: start;
    min-height: min(82svh, 980px);
    max-height: calc(100svh - 132px);
    overflow-y: auto;
    padding: 18px 14px 42px;
  }
  .bookChoice {
    grid-template-rows: minmax(90px, 1fr) auto auto;
    padding: 10px;
  }
  .bookChoice b {
    font-size: 13px;
  }
  .bookChoice span {
    font-size: 10px;
  }
  .bookCoverThumb {
    min-height: 70px;
  }
  #bookPreview {
    inset: 5%;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
    align-content: center;
  }
  #bookPreviewCover {
    max-height: 42vh;
    object-fit: contain;
  }
  #bookPreviewText {
    font-size: 18px;
  }
  #bookShelfHint {
    display: none;
  }
  #bookReader.show {
    width: 100%;
    min-height: min(58svh, 520px);
    grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr);
  }
  #bookImageFrame {
    min-height: 0;
    padding: 7px;
  }
  #bookImage {
    max-height: min(48svh, 380px);
  }
  #bookText {
    font-size: clamp(22px, 5.8vw, 34px);
    padding: 9px;
  }
}

/* AGENT_TARGET: achievement-badge-wall — badge wall on title screen + toast notification */
#achievementBadgeWall {
  margin: 8px 0 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.achv-title {
  width: 100%;
  text-align: center;
  font-size: 13px;
  font-weight: bold;
  color: #ffd36b;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.achv-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.55);
  border: 1.5px solid #ffd36b;
  border-radius: 8px;
  padding: 4px 10px;
  min-width: 100px;
  max-width: 160px;
}
.achv-badge-name {
  font-size: 12px;
  font-weight: bold;
}
.achv-badge-desc {
  font-size: 10px;
  color: #ccc;
  text-align: center;
}
.achv-empty {
  font-size: 11px;
  color: #888;
  text-align: center;
  width: 100%;
}
.achv-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0, 0, 0, 0.85);
  border: 1.5px solid #ffd36b;
  border-radius: 10px;
  padding: 10px 18px;
  color: #fff;
  font-size: 14px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 9999;
  pointer-events: none;
}
.achv-toast.achv-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* AGENT_TARGET: mistake-tracker — "★ Try this" badge overlaid on weak-skill level tile */
.mistake-try-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ffd36b;
  color: #1a2320;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  pointer-events: none;
  z-index: 5;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* Claude 18:44 — T3e Brain Bridge cleanup part 1: hide redundant top "CROC SAYS" card.
   User screenshot 16:51 confirmed two Croc-says renderings on the Next Step Bridge screen:
   the top white card (#brainBridgePrompt with ::after "CROC SAYS") and the bottom character-with-bubble.
   The bottom card contains the same text plus the "Your planning brain grows..." encouragement,
   so removing the top loses zero info. Helper-Moment hide-by-default + Quiet-mode dedupe queued
   for Pascal (more complex, may need scoped sync of brain-bridge.js or JSX edits). */
#brainBridgePrompt {
  display: none !important;
}
