.seth-character,
.seth-character *,
.seth-speech,
.seth-speech * {
  box-sizing: border-box;
}

.seth-character[hidden],
.seth-speech[hidden] {
  display: none !important;
}

.seth-character {
  position: fixed;
  z-index: 14;
  width: 70px;
  height: 78px;
  color: #fff3ec;
  font-family: 'Manrope', sans-serif;
  pointer-events: none;
  user-select: none;
}

.seth-companion {
  position: absolute;
  inset: auto 0 0 auto;
  display: block;
  width: 68px;
  height: 76px;
  padding: 2px;
  border: 0;
  background: transparent;
  filter: drop-shadow(0 7px 13px rgba(4, 1, 8, .72));
  pointer-events: none;
  touch-action: none;
}

.seth-companion img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 50% 82%;
  user-select: none;
}

.seth-character.is-distracted .seth-companion {
  pointer-events: auto;
  cursor: grab;
}

.seth-character.is-distracted .seth-companion:active,
.seth-character.is-caught .seth-companion {
  cursor: grabbing;
}

.seth-character.is-caught .seth-companion {
  pointer-events: auto;
}

.seth-character.is-running .seth-companion img {
  animation: seth-sprint 240ms ease-in-out infinite alternate;
}

.seth-character.is-alerted .seth-companion img {
  animation: seth-alert 320ms ease-in-out 2;
}

.seth-character.is-distracted .seth-companion img {
  animation: seth-daydream 1.2s ease-in-out infinite;
}

.seth-character.is-caught .seth-companion img {
  animation: seth-caught 700ms ease-in-out infinite alternate;
}

.seth-character.is-hammering .seth-companion img {
  animation: seth-hammer-windup 460ms ease-in-out;
}

.seth-character.is-recoiling .seth-companion img {
  animation: seth-recoil 420ms ease-in-out infinite alternate;
}

.seth-character.is-recovering .seth-companion img {
  animation: seth-land 740ms ease-out;
}

.seth-alert-mark {
  position: absolute;
  z-index: 2;
  top: 2px;
  left: 10px;
  color: #ffe49a;
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  text-shadow: 0 2px 6px rgba(29, 12, 12, .8), 0 0 14px rgba(247, 181, 75, .72);
  transform: translateY(5px) scale(.7);
  transition: opacity 120ms ease, transform 180ms ease;
}

.seth-character.is-alerted .seth-alert-mark,
.seth-character.is-hammering .seth-alert-mark {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.seth-speech {
  position: fixed;
  z-index: 26;
  left: 0;
  top: 0;
  width: fit-content;
  min-width: min(150px, calc(100vw - 24px));
  max-width: min(350px, calc(100vw - 24px));
  overflow-wrap: anywhere;
  padding: 11px 13px;
  border: 1px solid rgba(220, 174, 108, .82);
  border-radius: 15px;
  background: linear-gradient(145deg, #fff1d7, #e7c393);
  box-shadow: 0 8px 26px rgba(6, 2, 10, .48);
  color: #352331;
  font-size: clamp(.65rem, 2vw, .79rem);
  font-weight: 700;
  line-height: 1.45;
  white-space: pre-line;
  pointer-events: none;
  animation: mascot-bubble-in 180ms ease-out both;
}

.seth-speech[data-anchor="top"] {
  border-radius: 15px 15px 4px 15px;
}

.seth-speech[data-anchor="bottom"] {
  border-radius: 15px 4px 15px 15px;
}

.seth-speech::after {
  position: absolute;
  width: 0;
  height: 0;
  border: 8px solid transparent;
  content: "";
}

.seth-speech[data-anchor="top"]::after {
  top: 100%;
  left: calc(var(--seth-tail-offset) - 8px);
  border-top-color: #e7c393;
  border-bottom: 0;
}

.seth-speech[data-anchor="bottom"]::after {
  bottom: 100%;
  left: calc(var(--seth-tail-offset) - 8px);
  border-bottom-color: #fff1d7;
  border-top: 0;
}

.seth-speech[data-anchor="left"]::after {
  top: calc(var(--seth-tail-offset) - 8px);
  left: 100%;
  border-left-color: #e7c393;
  border-right: 0;
}

.seth-speech[data-anchor="right"]::after {
  top: calc(var(--seth-tail-offset) - 8px);
  right: 100%;
  border-right-color: #fff1d7;
  border-left: 0;
}

.discord-badge .seth-impact-burst {
  position: absolute;
  z-index: 3;
  top: 50%;
  right: -2px;
  display: none;
  width: 100px;
  height: 100px;
  border: 2px solid rgba(255, 220, 142, .96);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 240, 197, .42), rgba(233, 142, 56, .12) 48%, transparent 72%);
  box-shadow: 0 0 14px rgba(255, 199, 98, .9), inset 0 0 14px rgba(255, 238, 193, .72);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scale(.3);
}

.discord-badge.is-seth-struck .seth-impact-burst {
  display: block;
  animation: seth-discord-burst 850ms ease-out both;
}

.discord-badge.is-seth-struck .discord-badge-logo {
  animation: seth-logo-impact 850ms cubic-bezier(.2, .8, .3, 1);
}

@keyframes seth-sprint {
  from { transform: translateY(1px) rotate(-2deg) scale(.99, 1.01); }
  to { transform: translateY(-4px) rotate(3deg) scale(1.02, .98); }
}

@keyframes seth-alert {
  0%, 100% { transform: translateY(0) rotate(0); }
  40% { transform: translateY(-6px) rotate(-5deg); }
  70% { transform: translateY(1px) rotate(4deg); }
}

@keyframes seth-daydream {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-4px) rotate(2deg); }
}

@keyframes seth-caught {
  from { transform: rotate(-4deg) translateY(-1px); }
  to { transform: rotate(4deg) translateY(1px); }
}

@keyframes seth-hammer-windup {
  0%, 100% { transform: rotate(0) translateY(0); }
  42% { transform: rotate(-12deg) translateY(-5px); }
  72% { transform: rotate(18deg) translateY(3px); }
}

@keyframes seth-recoil {
  from { transform: rotate(-13deg) scale(.98); }
  to { transform: rotate(13deg) scale(1.02); }
}

@keyframes seth-land {
  0% { transform: translateY(-12px) rotate(10deg); }
  48% { transform: translateY(2px) rotate(-7deg); }
  75% { transform: translateY(-3px) rotate(3deg); }
  100% { transform: translateY(0) rotate(0); }
}

@keyframes seth-discord-burst {
  0% { opacity: .95; transform: translateY(-50%) scale(.3); }
  65% { opacity: .85; transform: translateY(-50%) scale(1.18); }
  100% { opacity: 0; transform: translateY(-50%) scale(1.55); }
}

@keyframes seth-logo-impact {
  0%, 100% { transform: translateX(0) rotate(0) scale(1); }
  18% { transform: translateX(5px) rotate(8deg) scale(1.1); }
  42% { transform: translateX(-6px) rotate(-10deg) scale(1.08); }
  68% { transform: translateX(3px) rotate(5deg) scale(1.04); }
}

@media (max-width: 560px) {
  .seth-companion {
    width: 61px;
    height: 70px;
    padding: 1.5px;
  }

  .seth-alert-mark {
    top: 1px;
    left: 11px;
    font-size: 20px;
  }

  .seth-speech {
    max-width: calc(100vw - 24px);
    padding: 9px 11px;
  }

  .discord-badge .seth-impact-burst {
    width: 64px;
    height: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .seth-character *,
  .seth-character *::before,
  .seth-character *::after,
  .discord-badge.is-seth-struck .seth-impact-burst,
  .discord-badge.is-seth-struck .discord-badge-logo {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
