/* Original editorial ink drawings. States illustrate model pressure, not health outcomes. */
.character-illustration {
  display: block;
  width: 100%;
  height: auto;
  max-height: 340px;
  overflow: visible;
  isolation: isolate;
  shape-rendering: geometricPrecision;
}

.character-illustration .character-body {
  transform-origin: 120px 244px;
  animation: character-breathe 6.8s ease-in-out infinite;
}

.character-illustration .character-sparkles {
  transform-origin: center;
  animation: character-twinkle 5.4s ease-in-out infinite;
}

.character-illustration .character-sweat {
  animation: character-drip 2.2s ease-in-out infinite;
}

.character-illustration .character-smoke {
  animation: character-steam 2.5s ease-in-out infinite;
}

.character-illustration .character-scribble {
  transform-origin: 180px 77px;
  animation: character-scribble-wiggle 1.4s ease-in-out infinite;
}

/* A stationary pause sign keeps the model's highest state clear at small sizes. */
.character-illustration .character-overload-sign text {
  font-family: var(--font, 'Noto Sans TC', system-ui, sans-serif);
}

.character-level-1 .character-body { animation-duration: 5.8s; }
.character-level-2 .character-body { animation: character-weary 5.4s ease-in-out infinite; }
.character-level-3 .character-body { animation: none; }
.character-role-family .character-sparkles { animation-delay: -.8s; }
.character-role-senior .character-body { animation-delay: -1.6s; }
.character-role-chronic .character-body { animation-delay: -.9s; }
.character-role-medic .character-body { animation-delay: -2.4s; }

.character-illustration.character-no-motion *,
.character-illustration.character-no-motion {
  animation: none !important;
  transition: none !important;
}

@keyframes character-breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.2px); }
}

@keyframes character-weary {
  0%, 100% { transform: rotate(-.6deg) translateY(1px); }
  50% { transform: rotate(.6deg) translateY(2px); }
}

@keyframes character-twinkle {
  0%, 100% { opacity: .45; }
  50% { opacity: .75; }
}

@keyframes character-drip {
  0%, 100% { transform: translateY(-1px); opacity: .7; }
  50% { transform: translateY(3px); opacity: 1; }
}

@keyframes character-steam {
  0%, 100% { transform: translateY(1px); opacity: .4; }
  50% { transform: translateY(-4px); opacity: .7; }
}

@keyframes character-scribble-wiggle {
  0%, 100% { transform: rotate(-7deg); }
  50% { transform: rotate(7deg); }
}

@media (prefers-reduced-motion: reduce) {
  .character-illustration,
  .character-illustration * {
    animation: none !important;
    transition: none !important;
  }
}

@media print {
  .character-illustration * { animation: none !important; }
}

/* Keep the pause label readable when the mobile character drawings are compact.
   The label uses CSS pixels inside the existing art cell, so names/ages and the
   first-screen grid do not move. Its meaning remains in the SVG aria-label. */
@media (max-width: 650px) {
  .person-art:has(.character-level-3) {
    position: relative;
    padding-top: 16px;
  }
  .person-art .character-level-3 .character-overload-sign {
    display: none;
  }
  .person-art:has(.character-level-3)::after {
    content: '需要喘息';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    box-sizing: border-box;
    padding: 0 5px;
    border: 1px solid var(--coral, #a13c2f);
    border-radius: 2px;
    background: var(--paper, #f9f8f4);
    color: var(--ink, #292724);
    font-family: var(--font, 'Noto Sans TC', system-ui, sans-serif);
    font-size: 10px;
    font-weight: 600;
    line-height: 13px;
    white-space: nowrap;
    pointer-events: none;
  }
}
