:root { --underdog-width: 46px; }
.loyal { white-space: nowrap; }
#underdog {
  display: inline-block;
  vertical-align: baseline;
  position: relative;
  width: var(--underdog-width);
  height: 24px;
  bottom: -4px;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
}
#underdog img { width: var(--underdog-width); height: auto; position: absolute; bottom: 0; left: 0; }
#underdog:focus-visible { outline: 2px solid currentColor; }
body.dark #underdog { color: white; }
#underdog[aria-pressed="true"] picture { visibility: hidden; }
.underdog-visitor {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--underdog-width);
  height: auto;
  pointer-events: none;
  z-index: 800;
  transform-origin: bottom center;
}
@media (prefers-reduced-motion: reduce) {
  body { opacity: 1; }
}
@font-face {
  font-family: Gaegu;
  src: url("assets/fonts/gaegu-bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
.loyal-name {
  font: 700 21px/1 Gaegu, cursive;
  letter-spacing: 0;
}
.conway-wordmark {
  display: inline-block;
  width: 173px;
  height: auto;
  vertical-align: -.1em;
}
body.dark .conway-wordmark { filter: invert(1); }
#dapper-mark { display: inline-block; }
#chew-word { display: inline-block; }
.tossed { visibility: hidden !important; }
.dog-stage {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: clip;
  contain: strict;
  z-index: 980;
}
.dog-stage .dog-toy {
  position: absolute !important;
  inset: auto !important;
  margin: 0;
  top: 0 !important;
  left: 0 !important;
}
@media (max-width: 768px) {
  .toggle-wrap { width: fit-content; margin-inline: auto; }
}
.dog-fragment {
  position: absolute;
  white-space: pre;
  transform-origin: bottom center;
}
.dog-thought {
  position: absolute;
  bottom: 50px;
  white-space: normal;
  pointer-events: none;
  z-index: 801;
  width: max-content;
  max-width: min(210px, 85vw);
  padding: 9px 14px;
  border: 1.5px solid currentColor;
  border-radius: 48% 44% 40% 43% / 30% 44% 34% 46%;
  background: var(--bg);
  color: var(--fg);
  text-align: center;
  font: 700 20px/1.05 Gaegu, cursive;
  animation: dog-thinks .18s ease-out both;
}
.dog-thought::before, .dog-thought::after {
  content: '';
  position: absolute;
  left: var(--tail);
  bottom: -7px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: var(--bg);
  width: 7px;
  height: 5px;
}
.dog-thought::after { bottom: -10px; margin-left: -3px; width: 3px; height: 3px; }
@keyframes dog-thinks { from { opacity: 0; transform: translateY(4px); } }
.dog-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
