.hall-assistant-launcher,
.hall-assistant-overlay {
  font-family: "Nunito", "Trebuchet MS", sans-serif;
}

.hall-assistant-launcher[hidden],
.hall-assistant-overlay[hidden] {
  display: none !important;
}

.hall-assistant-launcher {
  position: absolute;
  z-index: 24;
  left: 67%;
  top: 78%;
  display: none;
  width: clamp(62px, 7.2vw, 88px);
  min-width: 62px;
  border: 0;
  padding: 0;
  color: #fff;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 13px 12px rgba(35, 15, 70, .34));
  transform: translate(-50%, -50%) rotate(7deg);
  transform-origin: 50% 88%;
  transition: filter 180ms ease, transform 180ms ease;
}

.fake-game-stage[data-game-state="lobby"] .hall-assistant-launcher {
  display: block;
}

.hall-assistant-launcher:hover {
  filter: drop-shadow(0 16px 15px rgba(35, 15, 70, .42));
  transform: translate(-50%, -54%) rotate(3deg) scale(1.045);
}

.hall-assistant-launcher:focus-visible {
  outline: 4px solid #ffe45e;
  outline-offset: 7px;
  border-radius: 18px;
}

.hall-assistant-phone {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: .54;
  grid-template-rows: 12px minmax(0, 1fr) 12px;
  overflow: hidden;
  border: clamp(4px, .42vw, 6px) solid #27143f;
  border-radius: clamp(15px, 1.7vw, 22px);
  padding: 0 4px;
  background: linear-gradient(145deg, #4b2b69, #180e28);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, .22),
    0 5px 0 #140a20;
}

.hall-assistant-phone-speaker {
  width: 34%;
  height: 3px;
  align-self: center;
  justify-self: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, .66);
}

.hall-assistant-phone-screen {
  display: grid;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto auto;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .82);
  border-radius: clamp(9px, 1vw, 13px);
  padding: 3px 2px 5px;
  color: #fff;
  background:
    radial-gradient(circle at 70% 12%, rgba(255, 255, 255, .24), transparent 30%),
    linear-gradient(160deg, #ed3b89, #7439bd 74%);
}

.hall-assistant-phone-screen img {
  width: 118%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  object-position: center bottom;
  transform: translateY(7%);
}

.hall-assistant-phone-screen b {
  font-size: clamp(.55rem, .78vw, .72rem);
  line-height: 1;
  letter-spacing: .04em;
}

.hall-assistant-phone-screen small {
  color: #fbe8ff;
  font-size: clamp(.34rem, .5vw, .46rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.hall-assistant-phone-home {
  width: 28%;
  height: 3px;
  align-self: center;
  justify-self: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
}

.hall-assistant-phone-status {
  position: absolute;
  top: 8px;
  right: 4px;
  width: clamp(12px, 1.25vw, 16px);
  height: clamp(12px, 1.25vw, 16px);
  border: 2px solid #fff;
  border-radius: 50%;
  background: #31c789;
}

.hall-assistant-phone-status::after {
  display: grid;
  height: 100%;
  place-items: center;
  color: #143d2f;
  content: "?";
  font-size: clamp(.45rem, .6vw, .58rem);
  font-style: normal;
  font-weight: 1000;
  line-height: 1;
}

.hall-assistant-callout {
  position: absolute;
  right: calc(100% + 13px);
  top: 50%;
  display: grid;
  width: max-content;
  gap: 0;
  border: 2px solid #ec3886;
  border-radius: 13px 13px 4px 13px;
  padding: 7px 10px;
  color: #30174d;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 5px 0 rgba(49, 23, 77, .3);
  text-align: left;
  transform: translateY(-50%) rotate(-7deg);
  white-space: nowrap;
}

.hall-assistant-callout small {
  color: #d82f7b;
  font-size: clamp(.46rem, .58vw, .58rem);
  font-weight: 1000;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.hall-assistant-callout strong {
  font-size: clamp(.58rem, .72vw, .72rem);
  line-height: 1.1;
}

.hall-assistant-overlay {
  position: absolute;
  z-index: 92;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 28px);
  background: rgba(30, 14, 49, .48);
  backdrop-filter: blur(7px);
}

.hall-assistant-dialog {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  width: min(430px, 100%);
  height: min(700px, calc(100dvh - 42px));
  min-height: 390px;
  overflow: hidden;
  border: 10px solid #28143f;
  border-radius: 42px;
  color: #25133f;
  background: #f8f6ff;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, .22),
    0 8px 0 #13091f,
    0 32px 70px rgba(20, 9, 36, .48);
  animation: hallAssistantEnter 220ms cubic-bezier(.2, .8, .2, 1) both;
}

.hall-assistant-dialog::before {
  position: absolute;
  z-index: 5;
  top: -5px;
  left: 50%;
  width: 30%;
  height: 15px;
  border-radius: 0 0 12px 12px;
  content: "";
  background: #28143f;
  transform: translateX(-50%);
}

.hall-assistant-dialog::after {
  position: absolute;
  z-index: 5;
  bottom: -7px;
  left: 50%;
  width: 28%;
  height: 4px;
  border-radius: 999px;
  content: "";
  background: rgba(255, 255, 255, .74);
  transform: translateX(-50%);
}

@keyframes hallAssistantEnter {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.hall-assistant-header {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 19px 16px 15px;
  color: #fff;
  background:
    radial-gradient(circle at 78% 10%, rgba(255,255,255,.18), transparent 26%),
    linear-gradient(135deg, #e92f81, #713bbd 76%);
}

.hall-assistant-header-avatar {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.88);
  border-radius: 17px;
  background: #e6f5ff;
}

.hall-assistant-header-avatar img {
  width: 66px;
  height: 66px;
  object-fit: contain;
  transform: translateY(6px);
}

.hall-assistant-header > span:nth-child(2) {
  display: grid;
  gap: 0;
}

.hall-assistant-header small {
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .84;
}

.hall-assistant-header strong {
  font-size: 1.28rem;
  line-height: 1.1;
}

.hall-assistant-header em {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  color: #e8ffef;
  font-size: .67rem;
  font-style: normal;
  font-weight: 800;
}

.hall-assistant-header em::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  content: "";
  background: #46e39f;
  box-shadow: 0 0 0 3px rgba(70,227,159,.2);
}

.hall-assistant-header button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid rgba(255,255,255,.78);
  border-radius: 13px;
  color: #fff;
  background: rgba(54, 22, 86, .32);
  font-size: 1.45rem;
  font-weight: 900;
  cursor: pointer;
}

.hall-assistant-header button:focus-visible,
.hall-assistant-suggestions button:focus-visible,
.hall-assistant-form input:focus-visible,
.hall-assistant-form button:focus-visible {
  outline: 3px solid #ffe45e;
  outline-offset: 2px;
}

.hall-assistant-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding: 17px 16px 12px;
  scrollbar-width: thin;
  scrollbar-color: #b78bd9 #eee8f6;
  scrollbar-gutter: stable;
}

.hall-assistant-message {
  display: grid;
  gap: 4px;
  max-width: 86%;
}

.hall-assistant-message.is-user {
  align-self: flex-end;
}

.hall-assistant-message.is-assistant {
  align-self: flex-start;
}

.hall-assistant-message > span {
  border: 1px solid #ddd4eb;
  border-radius: 7px 18px 18px 18px;
  padding: 10px 12px;
  color: #34234a;
  background: #fff;
  box-shadow: 0 4px 12px rgba(48, 28, 76, .08);
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: pre-line;
}

.hall-assistant-message.is-user > span {
  border-color: transparent;
  border-radius: 18px 7px 18px 18px;
  color: #fff;
  background: linear-gradient(135deg, #713bbd, #c83291);
}

.hall-assistant-message > small {
  padding-inline: 4px;
  color: #786b88;
  font-size: .62rem;
  font-weight: 800;
}

.hall-assistant-message.is-user > small {
  text-align: right;
}

.hall-assistant-typing > span {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 54px;
}

.hall-assistant-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a45ac2;
  animation: hallAssistantTyping 900ms ease-in-out infinite alternate;
}

.hall-assistant-typing i:nth-child(2) { animation-delay: 140ms; }
.hall-assistant-typing i:nth-child(3) { animation-delay: 280ms; }

@keyframes hallAssistantTyping {
  from { opacity: .34; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(-2px); }
}

.hall-assistant-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  overflow-x: visible;
  padding: 8px 14px 10px;
  scrollbar-width: thin;
  scrollbar-color: #c595df transparent;
}

.hall-assistant-suggestions button {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid #cbb9df;
  border-radius: 999px;
  padding: 6px 11px;
  color: #5f2a89;
  background: #f4edfb;
  font-size: .7rem;
  font-weight: 900;
  cursor: pointer;
}

.hall-assistant-suggestions button:hover {
  border-color: #e43888;
  color: #be1e6d;
  background: #fff0f7;
}

.hall-assistant-form {
  display: grid;
  grid-template-columns: 1fr 46px;
  gap: 8px;
  padding: 10px 14px 7px;
  border-top: 1px solid #e0d8eb;
  background: #fff;
}

.hall-assistant-form input {
  min-width: 0;
  min-height: 46px;
  border: 2px solid #d8cee5;
  border-radius: 14px;
  padding: 10px 12px;
  color: #28173e;
  background: #faf9fd;
  font: inherit;
  font-size: .88rem;
}

.hall-assistant-form input:focus {
  border-color: #a849be;
}

.hall-assistant-form button {
  display: grid;
  min-height: 46px;
  place-items: center;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #ed3484, #7439bd);
  box-shadow: 0 4px 0 #411963;
  cursor: pointer;
}

.hall-assistant-form button:disabled {
  cursor: wait;
  filter: grayscale(.35);
  opacity: .62;
}

.hall-assistant-form svg {
  width: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.hall-assistant-privacy {
  padding: 0 14px 11px;
  color: #81758d;
  background: #fff;
  font-size: .62rem;
  line-height: 1.25;
  text-align: center;
}

@media (max-width: 720px) {
  .hall-assistant-launcher {
    left: 68%;
    top: 76%;
    width: clamp(54px, 8.5vw, 66px);
  }

  .hall-assistant-overlay {
    padding: 8px;
  }

  .hall-assistant-dialog {
    width: min(100%, 560px);
    height: calc(100dvh - 16px);
    min-height: 0;
    border-width: 7px;
    border-radius: 30px;
  }

  .hall-assistant-header {
    grid-template-columns: 44px 1fr 38px;
    gap: 9px;
    padding: 9px 11px;
  }

  .hall-assistant-header-avatar {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .hall-assistant-header-avatar img {
    width: 54px;
    height: 54px;
  }

  .hall-assistant-header strong { font-size: 1.05rem; }
  .hall-assistant-header small { font-size: .55rem; }
  .hall-assistant-header button { width: 38px; height: 38px; }
  .hall-assistant-messages { padding: 10px 10px 7px; }
  .hall-assistant-message > span { padding: 8px 10px; font-size: .76rem; line-height: 1.32; }
  .hall-assistant-suggestions { padding: 5px 9px 7px; }
  .hall-assistant-suggestions { flex-wrap: nowrap; overflow-x: auto; }
  .hall-assistant-suggestions button { min-height: 30px; font-size: .62rem; }
  .hall-assistant-form { grid-template-columns: 1fr 42px; padding: 7px 9px 5px; }
  .hall-assistant-form input, .hall-assistant-form button { min-height: 40px; }
  .hall-assistant-privacy { padding: 0 9px 6px; font-size: .55rem; }
}

@media (max-height: 520px) {
  .hall-assistant-launcher {
    left: 68%;
    top: 78%;
    width: clamp(48px, 7.2vw, 60px);
  }

  .hall-assistant-callout {
    display: none;
  }

  .hall-assistant-overlay {
    padding: 8px;
  }

  .hall-assistant-dialog {
    width: min(520px, 100%);
    height: calc(100dvh - 16px);
    min-height: 0;
    border-width: 7px;
    border-radius: 28px;
  }

  .hall-assistant-header {
    grid-template-columns: 44px 1fr 38px;
    gap: 9px;
    padding: 8px 11px;
  }

  .hall-assistant-header-avatar {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .hall-assistant-header-avatar img {
    width: 54px;
    height: 54px;
  }

  .hall-assistant-header strong { font-size: 1.02rem; }
  .hall-assistant-header small { font-size: .54rem; }
  .hall-assistant-header button { width: 38px; height: 38px; }
  .hall-assistant-messages { padding: 9px 10px 6px; }
  .hall-assistant-message > span { padding: 8px 10px; font-size: .74rem; line-height: 1.3; }
  .hall-assistant-suggestions { padding: 4px 9px 6px; }
  .hall-assistant-suggestions button { min-height: 29px; font-size: .6rem; }
  .hall-assistant-form { grid-template-columns: 1fr 42px; padding: 6px 9px 4px; }
  .hall-assistant-form input, .hall-assistant-form button { min-height: 39px; }
  .hall-assistant-privacy { padding: 0 9px 5px; font-size: .53rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hall-assistant-dialog,
  .hall-assistant-typing i {
    animation: none !important;
  }
}
