/* web/css/chat.css - In-Lobby Chat and Voice Chat Styling */
/* Strictly <= 200 lines, <= 100 chars per line. */

.lobby-comms-box {
  margin: 0.9rem 0; padding: 0.9rem 0.8rem;
  background: rgba(245, 242, 235, 0.7);
  border: 1px solid var(--brush-border); border-radius: 12px;
  text-align: left;
}

.voice-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding-bottom: 0.75rem; margin-bottom: 0.75rem;
  border-bottom: 1px dashed var(--brush-border);
}

.voice-status-wrap {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.84rem; font-weight: 700; color: var(--sumi-ink);
}

.voice-indicator {
  width: 10px; height: 10px; border-radius: 50%;
  background: #9e9e9e; display: inline-block; flex-shrink: 0;
  will-change: transform, opacity; transform: translateZ(0);
}

.voice-indicator.waiting {
  background: #f57c00;
  animation: voicePulse 1.2s infinite ease-in-out;
}

.voice-indicator.live {
  background: #2e7d32;
  box-shadow: 0 0 8px rgba(46, 125, 50, 0.7);
  animation: voiceLive 1.5s infinite ease-in-out;
}

.voice-controls { display: flex; gap: 6px; }

.btn-voice {
  font-size: 0.8rem; font-weight: 800;
  min-height: 44px; padding: 0.45rem 1rem;
  border-radius: 8px; border: 1px solid var(--sumi-ink);
  background: #fff; color: var(--sumi-ink); cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn-voice:hover { background: #f0ece1; }
.btn-voice:active { transform: scale(0.97); }

.btn-voice.active {
  background: var(--sumi-ink); color: #fff;
}
.btn-voice.active:hover { background: #2a2a2a; }

.btn-mute {
  font-size: 0.8rem; min-height: 44px; padding: 0.45rem 0.9rem;
  border-radius: 8px; border: 1px solid var(--brush-border);
  background: #fff; cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn-mute:hover { background: #f0ece1; }
.btn-mute:active { transform: scale(0.97); }

.chat-box { margin-top: 0.25rem; }

.chat-header {
  font-size: 0.78rem; font-weight: 800; color: var(--sumi-faded);
  letter-spacing: 0.8px; text-transform: uppercase; margin-bottom: 0.5rem;
}

.chat-history {
  height: 220px; min-height: 180px; max-height: 320px;
  overflow-y: auto; padding: 10px 12px;
  background: #fff; border: 1px solid var(--brush-border);
  border-radius: 8px; display: flex; flex-direction: column; gap: 8px;
}

.chat-bubble {
  font-size: 0.88rem; padding: 6px 12px; border-radius: 8px;
  max-width: 85%; word-break: break-word; line-height: 1.4;
}

.chat-bubble.self {
  align-self: flex-end; background: var(--sumi-ink); color: #fff;
}

.chat-bubble.opp {
  align-self: flex-start; background: #f0ece1;
  color: var(--sumi-ink); border: 1px solid var(--brush-border);
}

.chat-bubble.system {
  align-self: center; font-size: 0.78rem;
  color: var(--sumi-faded); font-style: italic; padding: 4px 8px;
}

.chat-pills {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 8px 0 4px; scrollbar-width: none;
}
.chat-pills::-webkit-scrollbar { display: none; }

.chat-pill {
  font-size: 0.82rem; font-weight: 700;
  min-height: 44px; display: inline-flex; align-items: center;
  padding: 0.4rem 1.1rem; background: #fff;
  border: 1px solid var(--brush-border); border-radius: 16px;
  cursor: pointer; white-space: nowrap;
  transition: transform 0.15s ease, background 0.15s ease;
}
.chat-pill:hover { background: #f0ece1; }
.chat-pill:active { transform: scale(0.96); }

.chat-input-row { display: flex; gap: 6px; margin-top: 6px; }

.chat-input {
  flex: 1; font-size: 0.92rem; min-height: 48px;
  padding: 0.5rem 0.9rem; border: 1px solid var(--brush-border);
  border-radius: 8px; background: #fff; color: var(--sumi-ink);
  transition: border-color 0.15s ease;
}
.chat-input:focus { border-color: var(--sumi-ink); outline: none; }

.btn-chat-send {
  font-size: 0.88rem; font-weight: 800; min-height: 48px;
  padding: 0.5rem 1.35rem; background: var(--hanko-red);
  color: #fff; border: none; border-radius: 8px; cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn-chat-send:hover { opacity: 0.9; }
.btn-chat-send:active { transform: scale(0.97); }

@media (min-height: 720px) {
  .chat-history {
    height: 270px; max-height: 380px;
  }
}

@keyframes voicePulse {
  0%, 100% { opacity: 0.5; transform: translateZ(0) scale(0.9); }
  50% { opacity: 1; transform: translateZ(0) scale(1.15); }
}

@keyframes voiceLive {
  0%, 100% { transform: translateZ(0) scale(1); }
  50% { transform: translateZ(0) scale(1.2); }
}
