/* Persistent, evidence-bounded Jiminy guide shared by every Daisychain room. */
.jiminy-route-guide {
  --jiminy-mint: #8df2c5;
  --jiminy-ink: #071612;
  --jiminy-panel: rgba(6, 24, 20, .96);
  --jiminy-line: rgba(141, 242, 197, .44);
  position: fixed;
  z-index: 69;
  top: clamp(88px, 17vh, 148px);
  right: max(12px, env(safe-area-inset-right));
  width: min(352px, calc(100vw - 24px));
  color: #e9fff5;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .36));
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  transition: width .2s ease, transform .2s ease;
}

.jiminy-route-guide[data-side="left"] {
  right: auto;
  left: max(12px, env(safe-area-inset-left));
}

.jiminy-route-guide__shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: min(720px, calc(100dvh - 176px));
  overflow: hidden;
  border: 1px solid var(--jiminy-line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 24px 24px, rgba(255, 135, 203, .16), transparent 48px),
    linear-gradient(145deg, rgba(19, 58, 48, .98), var(--jiminy-panel));
  box-shadow: inset 0 1px rgba(255, 255, 255, .08), 0 0 0 3px rgba(3, 17, 14, .38);
  backdrop-filter: blur(14px);
}

.jiminy-route-guide__bar {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 9px 10px;
}

.jiminy-route-guide__face {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  overflow: visible;
  border: 1px solid rgba(149, 255, 196, .82);
  border-radius: 50% 46% 52% 44%;
  color: #9dffc7;
  background: radial-gradient(circle at 50% 38%, #267b58 0 25%, #102d26 70%);
  box-shadow: 0 0 17px rgba(115, 255, 178, .3), inset 0 0 0 3px rgba(141, 242, 197, .08);
  transform: rotate(-2deg);
}

.jiminy-route-guide__face::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: 2px;
  width: 8px;
  height: 8px;
  border: 2px solid #092019;
  border-radius: 50%;
  background: var(--jiminy-mint);
  box-shadow: 0 0 8px var(--jiminy-mint);
}

.jiminy-route-guide__face::before {
  position: absolute;
  z-index: 4;
  left: -5px;
  top: -6px;
  display: grid;
  min-width: 17px;
  height: 17px;
  place-items: center;
  padding: 0 3px;
  border: 1px solid #fff2ae;
  border-radius: 999px;
  color: #25301b;
  background: #ffe17b;
  box-shadow: 0 0 9px rgba(255, 225, 123, .45);
  content: attr(data-coin-count);
  font: 950 8px/1 ui-monospace, monospace;
}

/* The same tiny magical mantis-cricket is reused anywhere Jiminy has a clear
   avatar host. It is decorative; Jiminy's name and role remain in text. */
.jiminy-cricket-host {
  line-height: 0;
}

.jiminy-cricket {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.jiminy-cricket__sparkles {
  fill: none;
  stroke: #ffd0eb;
  stroke-linecap: round;
  stroke-width: 1.7;
  filter: drop-shadow(0 0 2px rgba(255, 159, 214, .92));
  transform-box: fill-box;
  transform-origin: center;
  animation: jiminy-cricket-sparkle 2.8s ease-in-out infinite;
}

.jiminy-cricket__antennae {
  fill: #9dffc7;
  stroke: #b8ffd5;
  stroke-linecap: round;
  stroke-width: 1.8;
  filter: drop-shadow(0 0 2px rgba(115, 255, 178, .76));
}

.jiminy-cricket__wings {
  fill: rgba(153, 246, 223, .48);
  stroke: #a7ffe4;
  stroke-linejoin: round;
  stroke-width: 1.1;
}

.jiminy-cricket__wing {
  transform-box: fill-box;
  transform-origin: center;
  animation: jiminy-cricket-wing 3.4s ease-in-out infinite;
}

.jiminy-cricket__wing--right {
  animation-delay: -.18s;
}

.jiminy-cricket__body {
  fill: #42b875;
  stroke: #baffd5;
  stroke-width: 1.1;
}

.jiminy-cricket__chest {
  fill: #174a3a;
  stroke: #72e6a7;
  stroke-width: .8;
}

.jiminy-cricket__insignia {
  fill: none;
  stroke: #d8ffe8;
  stroke-linecap: round;
  stroke-width: 1;
}

.jiminy-cricket__forearms {
  fill: #84f6ae;
  stroke: #caffdb;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  filter: drop-shadow(0 0 1px rgba(116, 255, 173, .7));
}

.jiminy-cricket__head {
  fill: #59d98f;
  stroke: #c8ffdc;
  stroke-width: 1.35;
}

.jiminy-cricket__ear {
  fill: #2b8f5e;
  stroke: #b7ffd2;
  stroke-width: 1;
}

.jiminy-cricket__faceplate {
  fill: #102923;
  stroke: #78eaae;
  stroke-width: 1;
}

.jiminy-cricket__eyes {
  fill: #d8ffe6;
}

.jiminy-cricket__eye {
  fill: #78ffac;
  filter: drop-shadow(0 0 2px #67ff9e);
  transform-box: fill-box;
  transform-origin: center;
  animation: jiminy-cricket-blink 5.4s ease-in-out infinite;
}

.jiminy-cricket__blush {
  fill: #ff9fd6;
  opacity: .86;
}

.jiminy-cricket__smile {
  fill: none;
  stroke: #dfffea;
  stroke-linecap: round;
  stroke-width: 1.15;
}

.jiminy-guide-avatar[data-jiminy-avatar="cricket"] {
  overflow: visible;
  padding: 2px;
  border-color: rgba(149, 255, 196, .78);
  color: #8dffc0;
  background: radial-gradient(circle at 50% 42%, rgba(71, 185, 122, .42), rgba(5, 35, 28, .96) 72%);
  box-shadow: 0 0 23px rgba(111, 255, 178, .28), inset 0 0 0 3px rgba(255,255,255,.035);
}

.chat-party > .jiminy > i[data-jiminy-avatar="cricket"],
.quest-chat-log article.from-jiminy > i[data-jiminy-avatar="cricket"],
.case-crew-cards > article.is-jiminy > i[data-jiminy-avatar="cricket"] {
  overflow: visible;
  padding: 1px;
  border-color: rgba(126, 255, 184, .7);
  color: #8dffc0;
  background: #0d3529;
  box-shadow: 0 0 12px rgba(97, 255, 164, .2);
}

@keyframes jiminy-cricket-blink {
  0%, 45%, 49%, 100% { transform: scaleY(1); }
  47% { transform: scaleY(.16); }
}

@keyframes jiminy-cricket-sparkle {
  0%, 100% { opacity: .35; transform: scale(.88) rotate(-4deg); }
  50% { opacity: 1; transform: scale(1.08) rotate(4deg); }
}

@keyframes jiminy-cricket-wing {
  0%, 100% { transform: rotate(0deg) scale(.96); opacity: .55; }
  50% { transform: rotate(4deg) scale(1.03); opacity: .92; }
}

.jiminy-route-guide__peek {
  min-width: 0;
}

.jiminy-route-guide__peek b,
.jiminy-route-guide__peek span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jiminy-route-guide__peek b {
  color: var(--jiminy-mint);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: lowercase;
}

.jiminy-route-guide__peek span {
  margin-top: 3px;
  color: #d2e8de;
  font: 700 10px/1.25 system-ui, sans-serif;
}

.jiminy-route-guide__icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(196, 231, 216, .28);
  border-radius: 10px;
  color: #dffbef;
  background: rgba(0, 0, 0, .17);
  box-shadow: none;
  font: 900 16px/1 system-ui, sans-serif;
  cursor: pointer;
}

.jiminy-route-guide__icon-button:hover,
.jiminy-route-guide__icon-button:focus-visible {
  border-color: var(--jiminy-mint);
  color: var(--jiminy-mint);
  outline: none;
}

.jiminy-route-guide__icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.jiminy-route-guide__toggle {
  font-size: 22px;
  font-weight: 800;
}

.jiminy-route-guide__body {
  display: grid;
  gap: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 12px 13px;
  border-top: 1px solid rgba(141, 242, 197, .15);
}

.jiminy-route-guide[data-open="false"] .jiminy-route-guide__body {
  display: none;
}

.jiminy-route-guide[data-open="false"] {
  width: 56px;
}

.jiminy-route-guide[data-open="false"] .jiminy-route-guide__shell {
  border-radius: 18px;
}

.jiminy-route-guide[data-open="false"] .jiminy-route-guide__bar {
  grid-template-columns: 38px;
  min-height: 54px;
  padding: 8px;
}

.jiminy-route-guide[data-open="false"] .jiminy-route-guide__peek,
.jiminy-route-guide[data-open="false"] .jiminy-route-guide__side {
  display: none;
}

.jiminy-route-guide[data-open="false"] .jiminy-route-guide__toggle {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.jiminy-route-guide__room {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-top: 11px;
}

.jiminy-route-guide__room strong {
  color: #fff2ad;
  font-size: 12px;
}

.jiminy-route-guide__room span {
  color: #8eb4a5;
  font-size: 9px;
}

.jiminy-route-guide__proof {
  display: grid;
  gap: 8px;
  margin: 0;
}

.jiminy-route-guide__proof > div {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.jiminy-route-guide__proof dt {
  color: #ff9fd6;
  font-family: inherit;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.45;
  letter-spacing: .08em;
}

.jiminy-route-guide__proof dd {
  margin: 0;
  color: #e7f7ef;
  font: 650 11px/1.38 system-ui, sans-serif;
}

.jiminy-route-guide__proof > div:last-child dd {
  color: #fff3b8;
  font-weight: 800;
}

.jiminy-route-guide__limit {
  margin: 0;
  padding: 8px 10px;
  border-left: 2px solid #ffb56f;
  border-radius: 0 9px 9px 0;
  color: #d8cabb;
  background: rgba(108, 57, 27, .19);
  font: 700 9px/1.35 system-ui, sans-serif;
}

.jiminy-route-guide__economy {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px 9px;
  padding: 10px;
  border: 1px solid rgba(255, 225, 123, .32);
  border-radius: 13px;
  background:
    radial-gradient(circle at 22px 18px, rgba(255, 225, 123, .11), transparent 42px),
    rgba(0, 0, 0, .14);
}

.jiminy-route-guide__wallet {
  display: grid;
  grid-template-columns: 20px auto;
  grid-template-rows: auto auto;
  column-gap: 6px;
  align-items: center;
  min-width: 90px;
}

.jiminy-route-guide__wallet i {
  grid-row: 1 / 3;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid #fff1a9;
  border-radius: 50%;
  color: #6b4f10;
  background: #ffe17b;
  box-shadow: 0 0 9px rgba(255, 225, 123, .32), inset 0 0 0 2px rgba(255,255,255,.25);
  font: normal 950 10px/1 sans-serif;
}

.jiminy-route-guide__wallet output {
  color: #fff0a9;
  font: 950 14px/1 ui-monospace, monospace;
}

.jiminy-route-guide__wallet span {
  color: #c6d9d0;
  font: 750 8px/1 system-ui, sans-serif;
}

.jiminy-route-guide__health {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 20px auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid rgba(117, 232, 173, .32);
  border-radius: 10px;
  color: #dfffee;
  background: rgba(45, 123, 87, .12);
}

.jiminy-route-guide__health i {
  color: #ff92bd;
  font: normal 950 13px/1 sans-serif;
  text-shadow: 0 0 8px rgba(255, 111, 170, .5);
}

.jiminy-route-guide__health output {
  color: #9bf0c0;
  font: 950 13px/1 ui-monospace, monospace;
}

.jiminy-route-guide__health span {
  color: #a9c8ba;
  font: 750 8px/1.2 system-ui, sans-serif;
}

.jiminy-route-guide__health[data-state="warn"] {
  border-color: rgba(255, 213, 122, .45);
  background: rgba(143, 97, 24, .15);
}

.jiminy-route-guide__health[data-state="warn"] output { color: #ffd57a; }
.jiminy-route-guide__health[data-state="danger"] {
  border-color: rgba(251, 113, 133, .55);
  background: rgba(138, 39, 59, .18);
}
.jiminy-route-guide__health[data-state="danger"] output { color: #fb7185; }

.jiminy-route-guide__economy > button {
  min-height: 38px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid rgba(255, 225, 123, .7);
  border-radius: 10px;
  color: #1b281d;
  background: linear-gradient(145deg, #fff0a8, #89efb9);
  box-shadow: 0 3px 0 rgba(35, 84, 62, .65);
  font: 900 10px/1.15 system-ui, sans-serif;
  cursor: pointer;
}

.jiminy-route-guide__economy > button:hover,
.jiminy-route-guide__economy > button:focus-visible {
  filter: brightness(1.08);
  outline: 2px solid #fff0a8;
  outline-offset: 2px;
}

.jiminy-route-guide__economy > button:disabled {
  color: #789086;
  border-color: rgba(172, 201, 189, .22);
  background: rgba(172, 201, 189, .08);
  box-shadow: none;
  cursor: not-allowed;
  filter: none;
}

.jiminy-route-guide__economy > p,
.jiminy-route-guide__economy > small,
.jiminy-route-guide__economy > output {
  grid-column: 1 / -1;
  margin: 0;
}

.jiminy-route-guide__economy > p {
  color: #eafff3;
  font: 750 9px/1.35 system-ui, sans-serif;
}

.jiminy-route-guide__economy > small {
  color: #9eb7ac;
  font: 650 8px/1.35 system-ui, sans-serif;
}

.jiminy-route-guide__economy > output {
  min-height: 12px;
  color: #ffdff1;
  font: 800 8px/1.3 ui-monospace, monospace;
}

.jiminy-route-guide__route {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.jiminy-route-guide__route a {
  display: grid;
  min-height: 43px;
  place-items: center;
  gap: 2px;
  border: 1px solid rgba(196, 231, 216, .2);
  border-radius: 10px;
  color: #8eb4a5;
  background: rgba(0, 0, 0, .14);
  text-decoration: none;
  font-size: 8px;
}

.jiminy-route-guide__route a i {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 6px;
  font-style: normal;
  font-weight: 950;
}

.jiminy-route-guide__route li[data-state="complete"] a {
  border-color: rgba(141, 242, 197, .48);
  color: #b9ffdc;
  background: rgba(31, 104, 72, .25);
}

.jiminy-route-guide__route li[data-state="current"] a {
  border-color: rgba(255, 213, 122, .7);
  color: #fff0af;
  background: rgba(104, 73, 24, .34);
  box-shadow: 0 0 10px rgba(255, 213, 122, .1);
}

.jiminy-route-guide__action {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  border: 1px solid rgba(141, 242, 197, .52);
  border-radius: 12px;
  color: var(--jiminy-ink);
  background: var(--jiminy-mint);
  text-decoration: none;
  font: 900 10px/1.2 system-ui, sans-serif;
}

.jiminy-route-guide__action::after {
  content: "→";
  font-size: 16px;
}

.jiminy-route-guide__action[aria-disabled="true"] {
  border-color: rgba(196, 231, 216, .22);
  color: #93aa9f;
  background: rgba(196, 231, 216, .08);
  pointer-events: none;
}

@media (max-width: 700px) {
  .jiminy-route-guide,
  .jiminy-route-guide[data-side="left"] {
    top: max(74px, calc(env(safe-area-inset-top) + 62px));
    right: max(8px, env(safe-area-inset-right));
    left: auto;
    width: min(336px, calc(100vw - 16px));
  }

  .jiminy-route-guide__shell {
    max-height: calc(100dvh - 90px);
  }

  .jiminy-route-guide[data-open="false"] {
    width: 56px;
  }

  .jiminy-route-guide[data-open="false"] .jiminy-route-guide__shell {
    border-radius: 18px;
  }

  .jiminy-route-guide[data-open="false"] .jiminy-route-guide__bar {
    grid-template-columns: 38px;
    min-height: 54px;
    padding: 8px;
  }

  .jiminy-route-guide[data-open="false"] .jiminy-route-guide__peek,
  .jiminy-route-guide[data-open="false"] .jiminy-route-guide__side {
    display: none;
  }

  .jiminy-route-guide[data-open="false"] .jiminy-route-guide__toggle {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
  }

  .jiminy-route-guide__side {
    display: none;
  }
}

@media (max-width: 390px) {
  .jiminy-route-guide__economy {
    grid-template-columns: 1fr;
  }

  .jiminy-route-guide__wallet {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jiminy-route-guide {
    transition: none;
  }

  .jiminy-cricket__sparkles,
  .jiminy-cricket__wing,
  .jiminy-cricket__eye {
    animation: none;
  }
}
