.finder-open-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 55%, #a855f7 100%);
  box-shadow: 0 4px 18px rgba(79, 70, 229, 0.45);
}

.home-crazy .site-header .finder-open-btn {
  order: 2;
}

.finder-modal {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.finder-modal[hidden] {
  display: none !important;
}

.finder-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 6, 14, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.finder-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 640px);
  height: min(82vh, 760px);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: linear-gradient(
    155deg,
    rgba(30, 24, 56, 0.98),
    rgba(12, 10, 20, 0.99)
  );
  border: 1px solid rgba(99, 102, 241, 0.45);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.62);
  overflow: hidden;
}

.finder-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.finder-modal__title {
  font-size: 1rem;
  font-weight: 800;
}

.finder-modal__close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.finder-chat {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 85, 247, 0.65) rgba(255, 255, 255, 0.08);
}

.finder-chat::-webkit-scrollbar {
  width: 10px;
}

.finder-chat::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.finder-chat::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(59, 130, 246, 0.9),
    rgba(124, 58, 237, 0.92),
    rgba(236, 72, 153, 0.9)
  );
  border-radius: 999px;
  border: 2px solid rgba(12, 10, 20, 0.75);
}

.finder-msg {
  max-width: min(86%, 520px);
  border-radius: 14px;
  padding: 0.62rem 0.75rem;
  line-height: 1.45;
  font-size: 0.92rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.finder-msg--user {
  margin-left: auto;
  color: #fff;
  background: rgba(79, 70, 229, 0.35);
  border-color: rgba(99, 102, 241, 0.55);
}

.finder-msg--bot {
  margin-right: auto;
  background: rgba(22, 18, 42, 0.92);
}

.finder-msg__games {
  margin-top: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.finder-game-btn {
  width: 100%;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: stretch;
  gap: 0.7rem;
  border: 1px solid rgba(168, 85, 247, 0.45);
  border-radius: 12px;
  background: rgba(124, 58, 237, 0.18);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.45rem;
  cursor: pointer;
  text-align: left;
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease);
}

.finder-game-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(192, 132, 252, 0.75);
}

.finder-game-btn__thumb {
  width: 100%;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  background: #10091d;
}

.finder-game-btn__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.28rem;
}

.finder-game-btn__title {
  font-size: 0.9rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.finder-game-btn__meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

.finder-chat-form {
  display: flex;
  gap: 0.55rem;
  padding: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 8, 18, 0.6);
}

.finder-chat-input {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  background: rgba(22, 18, 42, 0.95);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  padding: 0.72rem 0.8rem;
}

.finder-chat-send {
  white-space: nowrap;
}

body.finder-modal-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .finder-open-btn {
    padding: 0.45rem 0.82rem;
    font-size: 0.8rem;
  }

  .home-crazy .site-header .finder-open-btn {
    order: 2;
    margin-left: 0;
  }

  .finder-modal {
    align-items: flex-end;
    padding: 0.7rem;
  }

  .finder-modal__panel {
    height: min(88vh, 760px);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .finder-msg {
    max-width: 100%;
  }

  .finder-game-btn {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 0.58rem;
    padding: 0.38rem;
  }

  .finder-game-btn__thumb {
    height: 64px;
  }

  .finder-game-btn__title {
    font-size: 0.84rem;
  }
}
