#chat-window-position {
  display: none !important;
}

.foxhud-chat {
  --chat-bg: #0d0d0b;
  --chat-ink: #f4f4f1;
  --chat-muted: #969691;
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  z-index: 80;
  color: var(--chat-ink);
  font-family: 'Barlow', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.foxhud-chat button {
  border: 0;
  font: inherit;
}

.foxhud-chat__trigger {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 3.5rem;
  padding: 0.55rem 1.25rem 0.55rem 0.65rem;
  border-radius: 999px;
  color: var(--chat-ink);
  background: var(--chat-bg);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.09) inset;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 220ms ease, background-color 220ms ease;
}

.foxhud-chat__trigger:hover {
  transform: translateY(-2px);
  background: #171715;
}

.foxhud-chat__trigger:focus-visible,
.foxhud-chat__panel button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.foxhud-chat__orbit {
  position: relative;
  display: block;
  width: 2.35rem;
  height: 2.35rem;
  flex: none;
  animation: foxhud-chat-orbit 18s linear infinite;
}

.foxhud-chat__orbit i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.25rem;
  height: 0.25rem;
  margin: -0.125rem;
  border-radius: 50%;
  background: currentColor;
}

.foxhud-chat__orbit i:nth-child(1) { transform: rotate(0deg) translateY(-1rem); }
.foxhud-chat__orbit i:nth-child(2) { transform: rotate(28deg) translateY(-1rem); }
.foxhud-chat__orbit i:nth-child(3) { transform: rotate(56deg) translateY(-1rem); }
.foxhud-chat__orbit i:nth-child(4) { transform: rotate(84deg) translateY(-1rem); }
.foxhud-chat__orbit i:nth-child(5) { transform: rotate(112deg) translateY(-1rem); }
.foxhud-chat__orbit i:nth-child(6) { transform: rotate(140deg) translateY(-1rem); }
.foxhud-chat__orbit i:nth-child(7) { transform: rotate(168deg) translateY(-1rem); }
.foxhud-chat__orbit i:nth-child(8) { transform: rotate(196deg) translateY(-1rem); }
.foxhud-chat__orbit i:nth-child(9) { transform: rotate(224deg) translateY(-1rem); }
.foxhud-chat__orbit i:nth-child(10) { transform: rotate(252deg) translateY(-1rem); }
.foxhud-chat__orbit i:nth-child(11) { transform: rotate(280deg) translateY(-1rem); }
.foxhud-chat__orbit i:nth-child(12) { transform: rotate(308deg) translateY(-1rem); }
.foxhud-chat__orbit i:nth-child(13) { transform: rotate(336deg) translateY(-1rem); }
.foxhud-chat__orbit i:nth-child(14) { transform: translate(-0.2rem, -0.2rem); }

.foxhud-chat__panel {
  position: absolute;
  bottom: calc(100% + 0.75rem);
  left: 0;
  width: min(24.5rem, calc(100vw - 2rem));
  min-height: min(39rem, calc(100svh - 6rem));
  overflow: hidden;
  border-radius: 1.6rem;
  background: var(--chat-bg);
  box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, 0.32);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(1rem) scale(0.97);
  transform-origin: bottom left;
  transition: opacity 260ms ease, transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1), visibility 260ms;
}

.foxhud-chat[data-open='true'] .foxhud-chat__panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.foxhud-chat__media {
  position: absolute;
  inset: 0;
}

.foxhud-chat__media::after {
  position: absolute;
  inset: 0;
  content: '';
  background: linear-gradient(180deg, rgba(13, 13, 11, 0.03) 20%, rgba(13, 13, 11, 0.24) 45%, var(--chat-bg) 78%);
}

.foxhud-chat__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: saturate(0.82) contrast(1.03);
}

.foxhud-chat__header {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
}

.foxhud-chat__mode {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.foxhud-chat__mode span:last-child {
  color: var(--chat-muted);
  font-size: 0.58rem;
}

.foxhud-chat__close {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  color: var(--chat-ink);
  background: rgba(255, 255, 255, 0.12);
  font-size: 1.45rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: background-color 180ms ease, transform 180ms ease;
}

.foxhud-chat__close:hover {
  transform: rotate(5deg);
  background: rgba(255, 255, 255, 0.2);
}

.foxhud-chat__content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: inherit;
  padding: 5.5rem 2rem 2rem;
}

.foxhud-chat__intro,
.foxhud-chat__answer {
  width: 100%;
  margin-top: auto;
}

.foxhud-chat__eyebrow,
.foxhud-chat__answer-label {
  display: block;
  margin-bottom: 0.7rem;
  color: var(--chat-muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.foxhud-chat__identity {
  max-width: 17rem;
  margin: 0;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: -0.025em;
}

.foxhud-chat__prompt {
  margin: 1.3rem 0 1rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.foxhud-chat__questions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.foxhud-chat__questions button {
  padding: 0.72rem 1rem;
  border-radius: 999px;
  color: var(--chat-ink);
  background: rgba(255, 255, 255, 0.11);
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.15;
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.foxhud-chat__questions button:first-child {
  color: #111;
  background: #f4f4f1;
}

.foxhud-chat__questions button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.18);
}

.foxhud-chat__questions button:first-child:hover {
  background: #fff;
}

.foxhud-chat__answer {
  display: flex;
  min-height: 25rem;
  flex-direction: column;
  justify-content: flex-end;
}

.foxhud-chat__answer[hidden],
.foxhud-chat__intro[hidden] {
  display: none;
}

.foxhud-chat__back {
  position: absolute;
  top: 4.25rem;
  left: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.75rem;
  border-radius: 999px;
  color: var(--chat-ink);
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.72rem;
  cursor: pointer;
}

.foxhud-chat__answer-body {
  display: grid;
  gap: 1rem;
}

.foxhud-chat__answer-body p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.42;
}

.foxhud-chat__answer-body strong {
  font-size: 1.04rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

@keyframes foxhud-chat-orbit {
  to { transform: rotate(360deg); }
}

@media (max-width: 520px) {
  .foxhud-chat {
    right: 1rem;
  }

  .foxhud-chat__panel {
    width: 100%;
    min-height: min(36rem, calc(100svh - 6rem));
  }

  .foxhud-chat__content {
    padding: 5rem 1.4rem 1.5rem;
  }

  .foxhud-chat__identity {
    font-size: 1.05rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .foxhud-chat *,
  .foxhud-chat *::before,
  .foxhud-chat *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
