/* client/css/chat.css - Active Chat, Radar Timer, Typing Indicators, and Reveal Experience */

/* Chat View Wrapper */
.chat-screen-wrap {
  display: flex;
  flex-direction: column;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  min-height: calc(100vh - 160px);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
}

/* Chat Header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(13, 19, 34, 0.85);
}

.partner-info-box {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.partner-avatar-scan {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed var(--neon-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  position: relative;
}

.partner-meta {
  display: flex;
  flex-direction: column;
}

.partner-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.turing-mystery-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--neon-cyan);
  background: rgba(0, 229, 255, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.partner-status-text {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Circular Timer Ring */
.timer-radial-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.radial-svg-box {
  position: relative;
  width: 52px;
  height: 52px;
}

.radial-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.radial-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 4;
}

.radial-progress {
  fill: none;
  stroke: var(--neon-emerald);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 138;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.5s ease;
}

.radial-progress.warning {
  stroke: var(--neon-amber);
}

.radial-progress.danger {
  stroke: var(--neon-pink);
  animation: timer-danger-pulse 1s infinite alternate;
}

@keyframes timer-danger-pulse {
  from { filter: drop-shadow(0 0 2px var(--neon-pink)); }
  to { filter: drop-shadow(0 0 8px var(--neon-pink)); }
}

.timer-digits {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-leave-match {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-leave-match:hover {
  background: rgba(255, 0, 122, 0.15);
  border-color: var(--neon-pink);
  color: var(--neon-pink);
}

/* Chat Message Area */
.chat-messages-container {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  min-height: 360px;
  max-height: calc(100vh - 350px);
}

.system-announcement {
  align-self: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  text-align: center;
  max-width: 85%;
}

.chat-bubble-row {
  display: flex;
  flex-direction: column;
  max-width: 78%;
  animation: bubble-appear 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes bubble-appear {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-bubble-row.me {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-bubble-row.partner {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-bubble {
  padding: 0.85rem 1.15rem;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.45;
  word-break: break-word;
  position: relative;
}

.chat-bubble-row.me .chat-bubble {
  background: linear-gradient(135deg, rgba(0, 255, 163, 0.2), rgba(0, 229, 255, 0.15));
  border: 1px solid rgba(0, 255, 163, 0.4);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chat-bubble-row.partner .chat-bubble {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
}

.bubble-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  padding: 0 0.25rem;
}

/* Typing Indicator */
.typing-bubble-row {
  display: none;
  align-self: flex-start;
}

.typing-bubble-row.active {
  display: flex;
}

.typing-bubble {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.75rem 1.25rem;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: var(--neon-cyan);
  border-radius: 50%;
  animation: typing-dot-bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-dot-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 6px var(--neon-cyan); }
}

/* Quick Prompts Chips */
.quick-prompts-bar {
  padding: 0.5rem 1.5rem 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.quick-prompts-bar::-webkit-scrollbar {
  display: none;
}

.prompt-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.prompt-chip:hover {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

/* Chat Input Bar */
.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: rgba(13, 19, 34, 0.85);
  border-top: 1px solid var(--border-subtle);
}

.chat-input-box {
  flex: 1;
  background: rgba(7, 10, 18, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.chat-input-box:focus {
  border-color: var(--neon-emerald);
  box-shadow: 0 0 10px var(--neon-emerald-glow);
}

.chat-input-box::placeholder {
  color: var(--text-muted);
}

.btn-send-msg {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: var(--neon-emerald);
  border: none;
  color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.15rem;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-neon);
}

.btn-send-msg:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(0, 255, 163, 0.5);
}

/* VOTING MODAL OVERLAY */
.voting-overlay {
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 18, 0.92);
  backdrop-filter: blur(12px);
  z-index: 50;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.voting-overlay.active {
  display: flex;
  animation: vote-fade 0.3s ease forwards;
}

@keyframes vote-fade {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.voting-heading {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.voting-subtext {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.voting-timer-bar-wrap {
  width: 100%;
  max-width: 400px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  margin-bottom: 2.5rem;
  overflow: hidden;
}

.voting-timer-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink));
  transition: width 1s linear;
}

.voting-cards-row {
  display: flex;
  gap: 1.5rem;
  width: 100%;
  max-width: 580px;
}

.vote-card-btn {
  flex: 1;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: all var(--transition-smooth);
}

.vote-card-btn.human:hover {
  border-color: var(--neon-emerald);
  box-shadow: var(--shadow-neon);
  transform: translateY(-4px);
}

.vote-card-btn.ai:hover {
  border-color: var(--neon-pink);
  box-shadow: var(--shadow-pink);
  transform: translateY(-4px);
}

.vote-icon-large {
  font-size: 3rem;
}

.vote-card-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
}

.vote-card-btn.human .vote-card-title {
  color: var(--neon-emerald);
}

.vote-card-btn.ai .vote-card-title {
  color: var(--neon-pink);
}

.vote-card-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* REVEAL SCREEN */
.reveal-screen-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
  max-width: 680px;
  margin: 0 auto;
}

.verdict-banner-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.4rem 1.25rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.verdict-banner-badge.correct {
  background: rgba(0, 255, 163, 0.15);
  border: 1px solid var(--neon-emerald);
  color: var(--neon-emerald);
}

.verdict-banner-badge.wrong {
  background: rgba(255, 0, 122, 0.15);
  border: 1px solid var(--neon-pink);
  color: var(--neon-pink);
}

.reveal-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.reveal-partner-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin: 1.5rem 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.partner-truth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1rem;
}

.partner-truth-identity {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.partner-truth-icon {
  font-size: 2.2rem;
}

.partner-truth-name {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
}

.partner-truth-origin {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.partner-traits-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.trait-pill {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  color: var(--text-secondary);
}

/* Post-Match Actions */
.reveal-actions-row {
  display: flex;
  gap: 1rem;
  width: 100%;
}

.btn-diagnostics {
  flex: 1;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-diagnostics:hover {
  background: var(--neon-cyan);
  color: var(--bg-primary);
  box-shadow: var(--shadow-cyan);
}

.btn-play-again {
  flex: 1;
  background: var(--neon-emerald);
  border: none;
  color: var(--bg-primary);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-neon);
}

.btn-play-again:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 255, 163, 0.5);
}

@media (max-width: 600px) {
  .voting-cards-row {
    flex-direction: column;
  }
  .reveal-actions-row {
    flex-direction: column;
  }
}
