@font-face {
  font-family: Rounded;
  src: local("Nunito"), local("Arial Rounded MT Bold"), local("Trebuchet MS");
  font-display: swap;
}
:root {
  font-family: Rounded, "Trebuchet MS", sans-serif;
  color: #fff4d4;
  color-scheme: dark;
  --aqua: #7dfff4;
  --purple: #6434be;
  --gold: #ffdf69;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overscroll-behavior: none;
}
body {
  display: grid;
  place-items: center;
  background: #20123c;
  background-image: radial-gradient(ellipse at 50% 30%, #5c4691 0, #271844 65%);
  overflow: hidden;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible {
  outline: 3px solid #fff8bd;
  outline-offset: 3px;
}
button {
  border: 0;
}
button:active {
  filter: brightness(1.12);
}
[hidden] {
  display: none !important;
}
#game {
  position: relative;
  width: min(100vw, 75dvh);
  height: 100dvh;
  max-width: 820px;
  overflow: hidden;
  background: #372066;
  box-shadow: 0 0 110px #07031199;
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
#scene {
  position: absolute;
  top: var(--scene-top, 0px);
  left: 0;
  width: 100%;
  aspect-ratio: 3/4;
  pointer-events: none;
}
#backdrop {
  display: block;
  width: 100%;
  height: auto;
}
#effects {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
}
#scene:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    #24124266,
    transparent 19%,
    transparent 70%,
    #33206033
  );
}
#hud {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 3%;
  right: 3%;
  display: flex;
  gap: 12px;
  align-items: center;
  z-index: 12;
}
.icon-button {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: 2px solid #b398ef;
  box-shadow:
    inset 0 2px 3px #e6caff88,
    0 4px 0 #2d164f,
    0 7px 15px #11072966;
  background: linear-gradient(#9765e2, #5e32aa);
  border-radius: 16px;
  display: grid;
  place-items: center;
}
.icon-button svg {
  height: 25px;
  width: 25px;
  stroke: #fff5e7;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sound[aria-pressed="true"] {
  filter: saturate(0.45);
}
.sound[aria-pressed="true"]:after {
  content: "";
  position: absolute;
  width: 27px;
  height: 3px;
  background: #ffb9e9;
  transform: rotate(-45deg);
}
.mission {
  flex: 1;
  background: linear-gradient(135deg, #603992ee, #3a225cee);
  padding: 11px 15px 12px;
  border: 1px solid #bb8be7;
  border-radius: 18px;
  box-shadow:
    inset 0 2px 0 #dcc1f533,
    0 6px 16px #120a3f77;
}
.mission-label {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 900;
  margin-bottom: 7px;
}
#step-count {
  color: #dac5f0;
  white-space: nowrap;
  letter-spacing: 0;
}
.progress-track {
  height: 9px;
  border-radius: 10px;
  background: #24133f;
  box-shadow: inset 0 2px 4px #0008;
  overflow: hidden;
}
#progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 10px;
  background: linear-gradient(90deg, #35b9df, #93fff1);
  box-shadow: 0 0 10px #51e7f7;
  transition: width 0.2s ease;
}
.screen {
  position: absolute;
  inset: 0;
  z-index: 10;
}
.brand {
  position: absolute;
  top: max(21px, env(safe-area-inset-top));
  width: 100%;
  text-align: center;
  filter: drop-shadow(0 5px 3px #291244);
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2.1px;
  font-weight: 900;
  color: #c8f7fc;
}
h1 {
  margin: 6px 0;
  line-height: 0.95;
  font-size: clamp(31px, 5.4dvh, 62px);
  font-weight: 1000;
  color: #fff7d4;
  letter-spacing: -1.6px;
  text-shadow:
    0 3px #6b3299,
    0 5px #452264;
  paint-order: stroke fill;
  -webkit-text-stroke: 1px var(--title-outline, #773eb3);
}
h1 > span {
  display: block;
  font-size: 1.2em;
  color: var(--title-gold, #ffda68);
  letter-spacing: 0;
}
h1 .title-star {
  display: inline-block;
  color: #74f3ed;
  font-size: 0.8em;
  margin-left: 8px;
}
.menu-sound {
  position: absolute;
  right: 3%;
  top: 22%;
  width: 39px;
  height: 39px;
  border-radius: 13px;
}
.menu-sound svg {
  width: 21px;
}
.welcome-panel {
  position: absolute;
  bottom: max(25px, env(safe-area-inset-bottom));
  left: 5%;
  right: 5%;
  padding: 19px 23px 15px;
  text-align: center;
  border-radius: 30px;
  background: linear-gradient(150deg, #7545b9ee, #3a2269f5);
  border: 2px solid #ae83db;
  box-shadow:
    inset 0 2px 1px #e5c8ff55,
    0 12px 35px #190e4baa;
}
.patient-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #b6f2dc66;
  border-radius: 20px;
  background: #2d4f6455;
  color: #adffea;
  font-size: 10px;
  letter-spacing: 1.6px;
  padding: 5px 10px;
  font-weight: bold;
}
.patient-tag i {
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background: #9affc8;
  box-shadow: 0 0 10px #9effcb;
}
.welcome-panel h2 {
  font-size: 24px;
  letter-spacing: -0.7px;
  margin: 10px 0 7px;
}
.welcome-panel p {
  color: #e3d2ed;
  line-height: 1.45;
  font-size: 14px;
  margin: 0 0 16px;
}
.primary {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 54px;
  padding: 12px 18px;
  border-radius: 18px;
  background: linear-gradient(#c7ff6f, #90d832);
  border: 2px solid #e4ffb8;
  color: #3d4b1d;
  font-weight: 1000;
  letter-spacing: -0.3px;
  font-size: 18px;
  box-shadow:
    inset 0 2px 1px #fff9,
    0 5px 0 #537e24,
    0 10px 17px #1a17394d;
  transition: transform 0.15s;
}
.primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}
.primary:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #537e24;
}
.primary span {
  font-size: 16px;
}
.menu-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
  font-size: 10px;
  color: #c9b7df;
}
.text-button {
  background: transparent;
  color: #e4d3fc;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 8px;
}
.menu-footer .text-button {
  padding: 0;
  font-size: 12px;
}
#status-bubble {
  position: absolute;
  z-index: 11;
  top: var(--status-top, 15%);
  left: 50%;
  transform: translateX(-50%) translateY(-7px);
  opacity: 0;
  white-space: nowrap;
  background: #fff3cb;
  color: #65408b;
  padding: 9px 15px;
  border-radius: 18px 18px 18px 3px;
  box-shadow: 0 4px 12px #25134455;
  font-size: 13px;
  font-weight: bold;
  pointer-events: none;
  transition: 0.3s;
}
#status-bubble.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#care-area {
  position: absolute;
  left: 0;
  top: var(--scene-top, 0px);
  width: 100%;
  aspect-ratio: 3/4;
  z-index: 5;
  touch-action: none;
  outline: none;
}
#tool-cursor {
  position: absolute;
  z-index: 16;
  width: 110px;
  height: 110px;
  pointer-events: none;
  opacity: 0;
  transform: translate(-25%, -12%);
  filter: drop-shadow(0 7px 4px #21093866);
}
#tool-cursor.visible {
  opacity: 1;
}
#tool-cursor .tool-art {
  position: absolute;
  inset: 0;
  display: block;
}
#tool-cursor.working .tool-art {
  animation: work 0.1s linear infinite alternate;
}
#console {
  position: absolute;
  bottom: max(0px, env(safe-area-inset-bottom));
  left: 2.7%;
  right: 2.7%;
  z-index: 10;
  padding: 0 9px 7px;
  border: 2px solid #ac8ed7;
  border-bottom: 0;
  border-radius: 35px 35px 0 0;
  background: linear-gradient(150deg, #8152bbf5, #462381f5 50%, #592a9af8);
  box-shadow:
    inset 0 4px 2px #d6aaff55,
    0 -8px 35px #2a165766;
}
.instruction {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 61px;
  padding: 10px 7px;
}
.instruction h2 {
  font-size: 18px;
  letter-spacing: -0.5px;
  margin: 0 0 3px;
  color: #fff1c3;
}
.instruction p {
  font-size: 11px;
  color: #ddc9ed;
  line-height: 1.25;
  margin: 0;
}
.stage-number {
  flex-shrink: 0;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  background: linear-gradient(#d8ff87, #90d746);
  border: 2px solid #ecffd1;
  color: #4e6525;
  font-size: 15px;
  font-weight: 1000;
  border-radius: 11px;
  box-shadow: 0 3px 0 #38591f;
}
#remaining {
  margin-left: auto;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 900;
  background: #29144f88;
  color: #b2fcf0;
  border: 1px solid #b491dd66;
  border-radius: 11px;
  padding: 6px;
}
.tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}
.tool {
  position: relative;
  min-width: 0;
  height: clamp(91px, 15.5dvh, 166px);
  border-radius: 23px;
  background: linear-gradient(140deg, #3b1e71, #60319e);
  border: 2px solid #a37acd;
  box-shadow:
    inset 0 3px 9px #1b0e4d99,
    0 3px 0 #2d174e;
  transition:
    border-color 0.2s,
    transform 0.2s;
  overflow: visible;
}
.tool-light {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 20%;
  height: 25%;
  border-radius: 50%;
  background: #6028ba;
  filter: blur(10px);
  opacity: 0.5;
}
.tool.selected {
  border-color: var(--tool-highlight, #9afff2);
  background: radial-gradient(ellipse at 50% 80%, #409a9e, #3a367d 75%);
  box-shadow:
    0 0 13px #5af7e577,
    inset 0 0 8px #6effeb55,
    0 3px 0 #246a6d;
}
.tool.selected .tool-light {
  background: #53ffeb;
  opacity: 0.9;
}
.tool-art {
  background-image: url("../assets/tools.png");
  background-repeat: no-repeat;
  background-size: 300% 100%;
  position: absolute;
  left: 5%;
  right: 5%;
  top: 1%;
  bottom: 16%;
  filter: drop-shadow(0 4px 3px #190d3566);
  transition: transform 0.2s;
}
.art-0 {
  background-position: 0% 50%;
}
.art-1 {
  background-position: 50% 50%;
}
.art-2 {
  background-position: 100% 50%;
}
.tool:hover .tool-art,
.tool.selected .tool-art {
  transform: translateY(-6px) rotate(-5deg);
}
.tool-name {
  position: absolute;
  bottom: 7%;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  letter-spacing: 1.3px;
  font-weight: 900;
  color: #c6b3e6;
}
.tool.selected .tool-name {
  color: #d4fff3;
}
.tool-check {
  display: none;
  position: absolute;
  right: 4px;
  top: 4px;
  border-radius: 50%;
  height: 22px;
  width: 22px;
  background: #b5f56c;
  color: #4c6622;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
}
.tool.done .tool-check {
  display: flex;
}
.console-caption {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  color: #b9a1d4;
  padding: 9px 0 0;
}
.tiny-star {
  color: #adf9ee;
  font-size: 12px;
}
.modal {
  color: #fff2d7;
  width: min(88vw, 410px);
  max-height: 88dvh;
  overflow: auto;
  padding: 33px 27px 25px;
  border: 2px solid #b990e6;
  border-radius: 30px;
  background: radial-gradient(ellipse at 50% 0%, #8754bb, #492778 75%);
  box-shadow:
    inset 0 3px 1px #debfff55,
    0 20px 90px #0a052866;
  text-align: center;
  animation: arrive 0.35s ease-out;
}
.modal::backdrop {
  background: #130b39a8;
  backdrop-filter: blur(5px);
}
.modal h2 {
  font-size: 29px;
  letter-spacing: -1px;
  line-height: 1.1;
  margin: 13px 0;
}
.modal p {
  color: #e0caeb;
  font-size: 14px;
  line-height: 1.5;
}
.modal .primary {
  margin: 20px 0 12px;
}
.close {
  position: absolute;
  right: 12px;
  top: 8px;
  font-size: 30px;
  background: none;
  color: #d9c5f1;
}
.modal ol {
  margin: 22px 0;
  padding: 0;
  list-style: none;
  counter-reset: steps;
  text-align: left;
  display: grid;
  gap: 19px;
}
.modal li {
  counter-increment: steps;
  position: relative;
  padding-left: 43px;
}
.modal li:before {
  content: counter(steps);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  background: #b9fa80;
  color: #4b5b25;
  width: 29px;
  height: 29px;
  border-radius: 11px;
  font-weight: bold;
}
.modal li b {
  display: block;
  color: #f8edcd;
  font-size: 16px;
  margin-bottom: 4px;
}
.modal li span {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  color: #dac8e9;
}
.award-stars {
  font-size: 44px;
  color: #ffdb5c;
  letter-spacing: 2px;
  text-shadow:
    0 3px #b96d2f,
    0 0 18px #ffd26188;
  margin-bottom: 18px;
}
.finish h2 {
  font-size: 38px;
}
.award {
  display: flex;
  align-items: center;
  text-align: left;
  justify-content: center;
  gap: 13px;
  padding: 14px;
  background: #361e5e88;
  border: 1px solid #b590cc77;
  border-radius: 19px;
  margin-top: 18px;
}
.award > span {
  font-size: 34px;
  color: #b4fff0;
}
.award b {
  display: block;
  font-size: 16px;
  color: #fff1bd;
}
.award small {
  display: block;
  font-size: 11px;
  color: #cbb5e3;
  margin-top: 4px;
}
#load-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 22px;
  background: #382061;
  z-index: 100;
  text-align: center;
  font-size: 16px;
  color: #e5d7f8;
}
.loading-bar {
  height: 6px;
  width: 160px;
  border-radius: 5px;
  background: linear-gradient(90deg, #6f42aa, #6affdf, #6f42aa);
  background-size: 200% 100%;
  animation: loading 1.2s infinite;
}
@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes work {
  to {
    transform: rotate(5deg) translateX(3px);
  }
}
@keyframes loading {
  to {
    background-position: 200% 0;
  }
}
@media (max-width: 420px) {
  .eyebrow {
    font-size: 8px;
    letter-spacing: 1.4px;
  }
  .welcome-panel {
    padding: 17px 19px 13px;
  }
  .welcome-panel h2 {
    font-size: 22px;
  }
  .welcome-panel p {
    font-size: 13px;
  }
  .mission {
    padding: 9px 11px;
  }
  .mission-label {
    font-size: 9px;
    letter-spacing: 1px;
  }
  .icon-button {
    width: 42px;
    height: 42px;
  }
  .instruction {
    gap: 7px;
    padding-left: 3px;
    padding-right: 3px;
  }
  .instruction h2 {
    font-size: 16px;
  }
  .instruction p {
    font-size: 10px;
  }
  .stage-number {
    width: 25px;
    height: 25px;
    font-size: 13px;
  }
  .tools {
    gap: 7px;
  }
  .tool {
    border-radius: 18px;
  }
}
@media (max-height: 570px) {
  .brand {
    top: 11px;
  }
  .brand .eyebrow {
    display: none;
  }
  .brand h1 {
    font-size: 31px;
  }
  .welcome-panel {
    padding: 11px 18px 10px;
    bottom: 13px;
  }
  .patient-tag {
    display: none;
  }
  .welcome-panel h2 {
    font-size: 19px;
    margin: 3px 0 7px;
  }
  .welcome-panel p {
    display: none;
  }
  .primary {
    min-height: 44px;
    font-size: 16px;
  }
  .menu-footer {
    margin-top: 12px;
  }
  .instruction {
    min-height: 48px;
    padding-top: 5px;
    padding-bottom: 5px;
  }
  .instruction p {
    display: none;
  }
  .instruction h2 {
    font-size: 14px;
  }
  .tool {
    height: 85px;
  }
  .console-caption {
    padding-top: 5px;
    font-size: 7px;
  }
  .modal {
    padding: 20px;
  }
  .modal h2 {
    font-size: 24px;
  }
  .modal p {
    font-size: 12px;
  }
  .modal .award-stars {
    font-size: 26px;
    margin-bottom: 9px;
  }
  .modal .award {
    padding: 8px;
  }
  .modal .primary {
    margin: 12px 0 5px;
  }
  .modal li {
    padding-left: 36px;
  }
  .modal ol {
    gap: 10px;
    margin: 15px 0;
  }
  .modal li span {
    font-size: 11px;
  }
}
.tool .tool-art {
  left: 50%;
  right: auto;
  top: -5%;
  bottom: auto;
  height: 90%;
  width: auto;
  aspect-ratio: 1;
  transform: translateX(-50%);
}
.tool:hover .tool-art,
.tool.selected .tool-art {
  transform: translateX(-50%) translateY(-4px) rotate(-5deg);
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
/* Clinic adventures and saved collections. */
#visit-label {
  font-size: 10px;
  color: #dbc6f0;
  margin-top: 6px;
  letter-spacing: 0.3px;
}
#hud .mission-label {
  font-size: 10px;
  letter-spacing: 1px;
}
.welcome-panel {
  padding-top: 14px;
}
.welcome-panel h2 {
  font-size: 23px;
}
.welcome-panel p {
  margin-bottom: 7px;
}
.patient-lineup {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin: 8px 0 13px;
}
.portrait {
  display: inline-block;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 2px solid #c8a5f3;
  background-size: 245% auto;
  background-position: 50% 26%;
  box-shadow: 0 3px 0 #29104b;
  background-color: #553478;
}
.momo {
  background-image: url("../assets/clinic.png");
}
.luna {
  background-image: url("../assets/luna.png");
}
.pip {
  background-image: url("../assets/pip.png");
}
.nova {
  background-image: url("../assets/nova.png");
  border-color: #ffdf82;
}
.menu-actions {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 9px;
  margin-top: 13px;
}
.secondary {
  background: #39235caa;
  border: 1px solid #ac87d0;
  border-radius: 12px;
  padding: 10px 6px;
  font-size: 12px;
  font-weight: 900;
  min-height: 40px;
  color: #e2d2f8;
}
.secondary span {
  display: inline-block;
  margin-left: 4px;
  color: #aef6ed;
  font-size: 10px;
}
.welcome-panel .menu-footer {
  margin-top: 11px;
}
.tool-art {
  filter: drop-shadow(0 4px 3px #190d3566) hue-rotate(var(--tool-hue, 0deg));
}
.art-3,
.art-4,
.art-5 {
  background-image: url("../assets/extra-tools.png");
}
.art-3 {
  background-position: 0% 50%;
}
.art-4 {
  background-position: 50% 50%;
}
.art-5 {
  background-position: 100% 50%;
}
.tool {
  transition:
    background 0.2s,
    border-color 0.2s;
}
.tool-name {
  font-size: 9px;
}
.tool:disabled {
  cursor: default;
}
.tool.done {
  border-color: #bce284;
}
.tool.unavailable {
  opacity: 0.55;
}
.instruction h2 {
  font-size: 17px;
}
.case-modal .portrait {
  display: block;
  width: 91px;
  height: 91px;
  margin: 17px auto 0;
  border-width: 3px;
}
.case-modal h2 {
  font-size: 34px;
  margin: 11px 0 5px;
}
.case-modal h3 {
  font-size: 17px;
  font-weight: 900;
  color: #ffe79b;
  margin: 0;
}
.case-modal p {
  font-size: 14px;
}
.case-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 17px 0;
}
.case-steps span {
  padding: 6px 9px;
  font-size: 9px;
  letter-spacing: 0.7px;
  color: #b6fff2;
  background: #30204e88;
  border: 1px solid #9977bd77;
  border-radius: 10px;
}
.case-modal .primary {
  margin-top: 17px;
}
.reward-stickers {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.reward-sticker {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  color: #fff1bc;
}
.sticker-art {
  display: block;
  aspect-ratio: 1;
  background-image: url("../assets/rewards.png");
  background-size: 400% 300%;
  background-repeat: no-repeat;
}
.reward-sticker .sticker-art {
  height: 91px;
  width: 91px;
  filter: drop-shadow(0 4px 5px #1e153d66);
}
.reward-new {
  font-size: 12px;
  line-height: 1.5;
  color: #a9ffe1;
  margin-top: 10px;
}
.finish .award-stars {
  font-size: 33px;
  margin-bottom: 13px;
}
.finish h2 {
  font-size: 31px;
}
.finish p {
  margin: 10px 0 12px;
}
.finish .award {
  padding: 10px;
  margin-top: 12px;
}
.finish .award small {
  font-size: 10px;
}
.finish .primary {
  margin-top: 16px;
}
.collection-modal {
  width: min(94vw, 530px);
  max-height: 90dvh;
  padding: 0;
  overflow: hidden;
}
.collection-modal[open] {
  display: flex;
  flex-direction: column;
}
.collection-heading {
  flex: 0 0 auto;
  padding: 27px 21px 0;
}
.collection-heading h2 {
  font-size: 25px;
  letter-spacing: -0.7px;
}
.collection-heading p {
  font-size: 12px;
  margin: 8px 0 14px;
}
.collection-tabs {
  display: flex;
  gap: 6px;
}
.collection-tabs button {
  flex: 1;
  border: 1px solid #9e79c4;
  border-radius: 12px 12px 0 0;
  min-height: 40px;
  padding: 8px 4px;
  font-size: 12px;
  background: #38235c;
  color: #cfb4ec;
  font-weight: 900;
}
.collection-tabs button.active {
  background: #8b5abd;
  color: #fff7d4;
  border-color: #deb6f1;
}
.collection-modal #collection-body {
  overflow: auto;
  min-height: 0;
  padding: 18px;
  flex: 1;
}
.collection-modal > .primary {
  width: auto;
  margin: 6px 18px 20px;
  flex: 0 0 auto;
}
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.sticker-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 10px 5px;
  background: #382157a6;
  border: 1px solid #9c72bc88;
  border-radius: 16px;
  font-size: 10px;
  color: #e9d8f3;
  min-height: 119px;
  justify-content: center;
}
.sticker-card .sticker-art {
  width: 78px;
  max-width: 100%;
}
.sticker-card.locked .sticker-art {
  filter: grayscale(1) brightness(0.5);
  opacity: 0.5;
}
.sticker-card.locked {
  color: #b6a0ca;
}
.cosmetic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.cosmetic-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 7px;
  border: 1px solid #a780cd;
  border-radius: 17px;
  background: #37215c;
  padding: 13px 10px;
  color: #f5e9d0;
  min-height: 159px;
}
.cosmetic-card:disabled {
  opacity: 0.55;
  cursor: default;
}
.cosmetic-card.equipped {
  border: 2px solid #a2ffe0;
  background: #3d4a68;
}
.cosmetic-card b {
  font-size: 13px;
}
.cosmetic-card small {
  font-size: 10px;
  color: #cdb5e4;
  line-height: 1.4;
}
.cosmetic-preview {
  position: relative;
  width: 75px;
  height: 75px;
}
.cosmetic-preview .tool-art {
  inset: 0;
}
.cosmetic-preview .sticker-art {
  width: 75px;
  height: 75px;
}
.cosmetic-card .equip-label {
  color: #b4ffe3;
  font-size: 11px;
  font-weight: 900;
}
.scene-react {
  animation: patient-bounce 0.4s ease-out;
}
@keyframes patient-bounce {
  50% {
    filter: brightness(1.06);
    transform: translateY(-3px);
  }
}
@media (max-width: 420px) {
  .welcome-panel h2 {
    font-size: 20px;
  }
  .welcome-panel p {
    font-size: 12px;
  }
  .portrait {
    width: 39px;
    height: 39px;
  }
  .patient-lineup {
    gap: 8px;
    margin-bottom: 11px;
  }
  .instruction h2 {
    font-size: 14px;
  }
  .instruction p {
    font-size: 10px;
  }
  .mission-label #step-label {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #visit-label {
    font-size: 9px;
  }
  .reward-sticker .sticker-art {
    width: 75px;
    height: 75px;
  }
  .case-modal .portrait {
    width: 76px;
    height: 76px;
  }
  .case-modal h2 {
    font-size: 28px;
  }
  .case-modal h3 {
    font-size: 16px;
  }
  .sticker-card {
    min-height: 99px;
    font-size: 9px;
  }
  .sticker-card .sticker-art {
    width: 67px;
  }
  .collection-modal #collection-body {
    padding: 13px;
  }
  .sticker-grid {
    gap: 7px;
  }
}
@media (max-height: 650px) {
  .patient-lineup {
    display: none;
  }
  .welcome-panel h2 {
    font-size: 19px;
  }
  .welcome-panel {
    padding: 11px 17px;
  }
  .welcome-panel p {
    display: none;
  }
  .welcome-panel .patient-tag {
    display: none;
  }
  .menu-actions {
    margin-top: 10px;
  }
  .welcome-panel .primary {
    min-height: 45px;
    font-size: 16px;
  }
  .case-modal .portrait {
    width: 59px;
    height: 59px;
    margin-top: 10px;
  }
  .case-modal h2 {
    font-size: 26px;
  }
  .case-modal p {
    font-size: 12px;
    margin: 9px 0;
  }
  .case-steps {
    margin: 11px 0;
  }
  .case-modal .primary {
    margin-top: 12px;
  }
  .collection-heading {
    padding-top: 19px;
  }
  .collection-heading h2 {
    font-size: 21px;
  }
  .collection-heading p {
    margin: 5px 0 9px;
  }
  .collection-modal > .primary {
    min-height: 42px;
    margin-bottom: 13px;
  }
  .cosmetic-card {
    min-height: 139px;
  }
  .finish .award-stars {
    font-size: 25px;
    margin-bottom: 7px;
  }
  .finish h2 {
    font-size: 26px;
  }
  .finish p {
    font-size: 12px;
  }
  .reward-sticker .sticker-art {
    width: 63px;
    height: 63px;
  }
}
.care-target {
  position: absolute;
  transform: translate(-50%, -50%);
  width: clamp(38px, 7vw, 62px);
  height: clamp(38px, 7vw, 62px);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: transparent;
  touch-action: none;
  outline: none;
  padding: 0;
}
.care-target:focus-visible {
  outline: 3px dashed #d8ff99;
  outline-offset: 0;
  background: #b7ffe719;
}
@media (max-height: 450px) {
  .welcome-panel h2 {
    display: none;
  }
  .welcome-panel {
    bottom: 10px;
    padding: 10px 15px;
  }
  .menu-actions {
    margin-top: 10px;
  }
  .secondary {
    min-height: 32px;
    padding: 7px 4px;
    font-size: 11px;
  }
  .menu-footer {
    margin-top: 9px;
  }
  .case-modal .portrait {
    display: none;
  }
  .case-modal h2 {
    font-size: 23px;
    margin: 10px 0 6px;
  }
  .case-modal h3 {
    font-size: 14px;
  }
  .case-modal .case-steps {
    display: none;
  }
  .case-modal p {
    font-size: 11px;
    line-height: 1.4;
  }
  .case-modal .primary {
    min-height: 42px;
  }
  .finish .award-stars {
    font-size: 20px;
    margin-bottom: 4px;
  }
  .finish h2 {
    font-size: 23px;
  }
  .finish .award {
    padding: 7px;
    margin-top: 8px;
  }
  .finish .text-button {
    padding: 5px;
  }
  .finish .primary {
    margin-top: 12px;
  }
  .collection-heading .eyebrow {
    display: none;
  }
  .collection-heading h2 {
    margin-top: 2px;
  }
}
/* Decorative tray surfaces must not block the offset working point. */
#console {
  pointer-events: none;
}
#console .tool {
  pointer-events: auto;
}
.reward-sticker {
  min-width: 0;
  flex: 1;
  max-width: 110px;
}
.reward-sticker > span:last-child {
  overflow-wrap: anywhere;
}
@media (max-height: 650px) {
  .finish {
    padding: 18px 20px 15px;
  }
  .finish .award-stars {
    display: none;
  }
  .finish h2 {
    margin: 8px 0;
    font-size: 25px;
  }
  .finish p {
    font-size: 11px;
    line-height: 1.35;
    margin: 8px 0;
  }
  .finish .reward-new {
    font-size: 11px;
    margin-top: 6px;
  }
  .finish .reward-sticker {
    font-size: 10px;
  }
  .finish .reward-sticker .sticker-art {
    width: min(100%, 60px);
    height: auto;
    aspect-ratio: 1;
  }
  .finish .award {
    padding: 8px;
    margin-top: 10px;
  }
  .finish .award b {
    font-size: 14px;
  }
  .finish .primary {
    margin: 13px 0 6px;
  }
  .finish .text-button {
    padding: 7px;
  }
}
@media (max-height: 450px) {
  .finish {
    padding: 15px 20px 12px;
  }
  .finish h2 {
    font-size: 21px;
    margin: 6px 0;
  }
  .finish .reward-sticker .sticker-art {
    width: min(100%, 42px);
  }
  .finish .reward-sticker {
    font-size: 9px;
  }
  .finish .award {
    padding: 6px;
    margin-top: 6px;
  }
  .finish .award > span {
    font-size: 24px;
  }
  .finish .award small {
    font-size: 9px;
  }
  .finish .primary {
    min-height: 40px;
    margin: 10px 0 4px;
  }
  .finish .text-button {
    padding: 4px;
  }
}
@media (max-height: 450px) {
  #console .tool {
    height: 60px;
    border-radius: 15px;
  }
  #console .instruction {
    min-height: 38px;
    padding-top: 4px;
    padding-bottom: 4px;
  }
  #console .instruction h2 {
    font-size: 12px;
  }
  #console .stage-number {
    height: 23px;
    width: 23px;
    font-size: 12px;
  }
  #console .console-caption {
    padding-top: 4px;
    font-size: 6px;
  }
  #console .tool-name {
    font-size: 8px;
  }
  #console .tool-check {
    width: 17px;
    height: 17px;
    font-size: 11px;
  }
}
/* Clean, isolated sprite frames are shared by gameplay and every collection view. */
.tool-art,
.art-0,
.art-1,
.art-2,
.art-3,
.art-4,
.art-5 {
  background-image: none;
  background-size: contain;
  background-position: center;
  filter: drop-shadow(0 4px 3px #190d3566) var(--tool-filter, none);
}
.art-0 {
  background-image: var(--tool-0);
}
.art-1 {
  background-image: var(--tool-1);
}
.art-2 {
  background-image: var(--tool-2);
}
.art-3 {
  background-image: var(--tool-3);
}
.art-4 {
  background-image: var(--tool-4);
}
.art-5 {
  background-image: var(--tool-5);
}
.sticker-art {
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}
#game.mouse-tool-active,
#game.mouse-tool-active * {
  cursor: none !important;
}
.bix {
  background-image: url("../assets/bix.png");
}
.fern {
  background-image: url("../assets/fern.png");
}
.rosie {
  background-image: url("../assets/rosie.png");
}
.patient-lineup {
  gap: 7px;
}
.patient-lineup .portrait {
  width: 38px;
  height: 38px;
}
.sticker-card {
  justify-content: flex-start;
  min-height: 142px;
}
.sticker-card small {
  order: 2;
  font-size: 10px;
  color: #b9f6e5;
  line-height: 1.3;
}
.sticker-card.locked small {
  color: #bca4d0;
}
.sticker-card > span:last-child {
  order: 1;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cosmetic-card {
  display: grid;
  grid-template-rows: 75px 32px 36px 18px;
  justify-items: center;
  align-items: center;
  gap: 6px;
  height: 214px;
  min-height: 214px;
  padding: 12px 8px;
  border: 2px solid #a780cd;
  min-width: 0;
}
.cosmetic-card.equipped {
  border-width: 2px;
}
.cosmetic-card b {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cosmetic-card small {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}
.cosmetic-card .equip-label {
  height: 18px;
  white-space: nowrap;
}
.cosmetic-preview .tool-art {
  height: 100%;
  width: 100%;
  aspect-ratio: 1;
}
@media (max-width: 420px) {
  .patient-lineup {
    gap: 5px;
  }
  .patient-lineup .portrait {
    width: 33px;
    height: 33px;
  }
  .sticker-card {
    min-height: 129px;
  }
  .sticker-card small {
    font-size: 9px;
  }
}
@media (max-height: 650px) {
  .cosmetic-card {
    height: 200px;
    min-height: 200px;
    padding: 10px 7px;
    grid-template-rows: 64px 32px 36px 18px;
  }
  .cosmetic-card .cosmetic-preview {
    width: 64px;
    height: 64px;
  }
  .cosmetic-preview .sticker-art {
    width: 100%;
    height: 100%;
  }
}

/* Rounded lavender scroll controls belong to the same toy-clinic surfaces. */
.modal,
#collection-body {
  scrollbar-width: thin;
  scrollbar-color: #b99ae6 #321c53;
  overscroll-behavior: contain;
}
#collection-body {
  scrollbar-gutter: stable;
}
@supports selector(::-webkit-scrollbar) {
  .modal,
  #collection-body {
    scrollbar-width: auto;
    scrollbar-color: auto;
  }
}
.modal::-webkit-scrollbar,
#collection-body::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}
.modal::-webkit-scrollbar-track,
#collection-body::-webkit-scrollbar-track {
  background: #321c53;
  border: 2px solid #633e8e;
  border-radius: 20px;
  margin: 10px 0;
}
.modal::-webkit-scrollbar-thumb,
#collection-body::-webkit-scrollbar-thumb {
  background: linear-gradient(#dec1ff, #a27bd8);
  border: 2px solid #321c53;
  border-radius: 20px;
  min-height: 42px;
}
.modal::-webkit-scrollbar-thumb:hover,
#collection-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(#d2fff2, #80d9d0);
}
.modal::-webkit-scrollbar-button,
#collection-body::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}
.modal::-webkit-scrollbar-corner,
#collection-body::-webkit-scrollbar-corner {
  background: transparent;
}

/* Share one cover transform between artwork, effects and dental targets. */
#scene,
#care-area {
  left: var(--scene-left, 0px);
  top: var(--scene-top, 0px);
  width: var(--scene-width, 100%);
}
