/* ==========================================================================
   YOLO Live Chat - Stylesheet
   Design: Cyber-Glassmorphic Terminal & Uncensored Public HUD
   ========================================================================== */

:root {
  --bg-main: #070a12;
  --bg-card: rgba(14, 20, 36, 0.75);
  --bg-hud: rgba(11, 16, 28, 0.85);
  --bg-input: rgba(8, 12, 22, 0.9);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(0, 242, 254, 0.4);
  --border-focus: #00f2fe;
  
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --cyan-primary: #00f2fe;
  --cyan-glow: rgba(0, 242, 254, 0.35);
  --blue-accent: #3b82f6;
  --emerald-accent: #10b981;
  --amber-warning: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.25);
  --red-alert: #ef4444;
  --magenta-accent: #ec4899;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --font-arcade: 'Orbitron', sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* Ambient Background Glow */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.15;
}
.glow-cyan {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--cyan-primary), transparent 70%);
  top: -100px;
  right: -50px;
}
.glow-magenta {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--magenta-accent), transparent 70%);
  bottom: -150px;
  left: -100px;
}

/* ==========================================================================
   Mandatory Gate Modal Overlay
   ========================================================================== */
.gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(4, 7, 15, 0.88);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gate-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gate-modal {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 680px;
  background: rgba(13, 19, 33, 0.92);
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 40px var(--amber-glow);
  border-radius: 16px;
  padding: 2.25rem 2.25rem 2rem;
  animation: gateModalSlide 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gateModalSlide {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.gate-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.gate-icon-pulse {
  font-size: 2.4rem;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 20px var(--amber-glow);
}

.gate-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--amber-warning);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.gate-title {
  font-family: var(--font-arcade);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

.gate-warning-box {
  background: rgba(18, 14, 8, 0.65);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.warning-heading {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--amber-warning);
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.warning-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.warning-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #cbd5e1;
}

.warning-bullet {
  font-size: 1.1rem;
  flex-shrink: 0;
  line-height: 1.2;
}

.warning-item strong {
  color: #fff;
}

/* Scheduled Wipe Countdown Banner in Gate Modal */
.gate-wipe-countdown-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14) 0%, rgba(239, 68, 68, 0.12) 100%);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-left: 4px solid var(--amber-warning);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.15rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.wipe-banner-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.wipe-banner-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  animation: pulseIcon 2s infinite ease-in-out;
}

@keyframes pulseIcon {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.8; }
}

.wipe-banner-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.wipe-banner-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--amber-warning);
  text-transform: uppercase;
}

.wipe-banner-target {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
  word-break: break-word;
}

.wipe-banner-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: var(--amber-warning);
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 0 12px var(--amber-glow);
}

.warning-item-wipe {
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid var(--amber-warning);
  padding: 0.5rem 0.65rem;
  border-radius: 4px;
}

.wipe-inline-highlight {
  color: var(--amber-warning) !important;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

#sys-wipe-schedule {
  color: var(--amber-warning);
  font-family: var(--font-mono);
  font-weight: 600;
  display: inline-block;
  margin-top: 0.25rem;
}

/* Callsign Form Controls */
.gate-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #94a3b8;
  font-family: var(--font-mono);
}

.form-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: #64748b;
}

.input-with-prefix {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 1rem;
  color: var(--cyan-primary);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  pointer-events: none;
}

.gate-input {
  width: 100%;
  background: rgba(7, 10, 18, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.85rem 1rem 0.85rem 2.4rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: #fff;
  transition: all 0.2s ease;
}

.gate-input:focus {
  outline: none;
  border-color: var(--cyan-primary);
  box-shadow: 0 0 15px var(--cyan-glow);
}

.form-error {
  font-size: 0.8rem;
  color: var(--red-alert);
  font-family: var(--font-mono);
  min-height: 1.1rem;
}

/* Checkbox Style */
.form-group-checkbox {
  padding: 0.75rem 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.checkbox-container {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  cursor: pointer;
  user-select: none;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkmark {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: rgba(7, 10, 18, 0.9);
  border: 1.5px solid var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.2s ease;
}

.checkbox-container input:checked ~ .checkmark {
  background: var(--cyan-primary);
  border-color: var(--cyan-primary);
  box-shadow: 0 0 10px var(--cyan-glow);
}

.checkmark::after {
  content: "";
  display: none;
  width: 5px;
  height: 10px;
  border: solid #04070f;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.checkbox-container input:checked ~ .checkmark::after {
  display: block;
}

.checkbox-label {
  font-size: 0.85rem;
  line-height: 1.45;
  color: #cbd5e1;
}

/* Gate Actions */
.gate-actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.btn-gate-enter {
  flex: 1.6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  color: #030712;
  font-family: var(--font-arcade);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.95rem 1.25rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--cyan-glow);
  transition: all 0.2s ease;
}

.btn-gate-enter:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(0, 242, 254, 0.6);
  filter: brightness(1.1);
}

.btn-gate-enter:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(0.8);
  box-shadow: none;
}

.btn-gate-decline {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.95rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s ease;
}

.btn-gate-decline:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* ==========================================================================
   Main Chat Container
   ========================================================================== */
.chat-app-container {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 0%, rgba(20, 30, 55, 0.3), transparent 75%);
}

/* Top HUD Bar */
.chat-hud {
  height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  background: var(--bg-hud);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hud-back-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}

.hud-back-link:hover {
  color: #fff;
  border-color: var(--cyan-primary);
  background: rgba(0, 242, 254, 0.1);
}

.hud-divider {
  width: 1px;
  height: 24px;
  background: var(--border-subtle);
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.hud-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--emerald-accent);
  box-shadow: 0 0 10px var(--emerald-accent);
}

.hud-status-dot.pulse {
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.hud-title {
  font-family: var(--font-arcade);
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
}

.hud-badge-unmoderated {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--amber-warning);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  letter-spacing: 0.06em;
}

/* Center HUD: Buffer Capacity */
.hud-center {
  display: flex;
  align-items: center;
}

.buffer-capacity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.85rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}

.buffer-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.buffer-text strong {
  color: var(--cyan-primary);
}

.buffer-unit {
  font-size: 0.65rem;
  color: var(--text-dim);
}

.buffer-bar-track {
  width: 140px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.buffer-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan-primary), var(--magenta-accent));
  transition: width 0.3s ease;
}

/* Right HUD */
.hud-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-callsign-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.pill-label {
  color: var(--text-dim);
  font-size: 0.68rem;
}

.pill-value {
  color: var(--cyan-primary);
  font-weight: 700;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-change-callsign {
  background: none;
  border: none;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}

.btn-change-callsign:hover {
  background: var(--cyan-primary);
  color: #030712;
}

.hud-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
}

.hud-wipe-pill {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--amber-warning);
}

.hud-icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hud-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--cyan-primary);
}

/* ==========================================================================
   Chat Messages Window (Scrollable, up to 10,000 lines)
   ========================================================================== */
.chat-window-wrapper {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  scroll-behavior: smooth;
  font-family: var(--font-mono);
}

/* Custom Scrollbar for 10,000 lines */
.chat-messages-container::-webkit-scrollbar {
  width: 8px;
}
.chat-messages-container::-webkit-scrollbar-track {
  background: rgba(5, 8, 16, 0.8);
}
.chat-messages-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
.chat-messages-container::-webkit-scrollbar-thumb:hover {
  background: var(--cyan-primary);
}

/* System Message Banner */
.system-message {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.9rem 1.1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.system-message.banner-notice {
  background: rgba(0, 242, 254, 0.05);
  border: 1px solid rgba(0, 242, 254, 0.25);
  color: #cbd5e1;
}

.system-message.wipe-notice {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
}

.sys-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.sys-title {
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  margin-bottom: 0.25rem;
}

/* Individual Chat Message Line */
.msg-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  font-size: 0.88rem;
  line-height: 1.45;
  transition: background-color 0.15s ease;
  word-break: break-word;
}

.msg-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.msg-row.own-message {
  background: rgba(0, 242, 254, 0.035);
  border-left: 2px solid var(--cyan-primary);
}

.msg-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.msg-seq {
  font-size: 0.7rem;
  color: var(--text-dim);
  user-select: none;
  width: 44px;
}

.msg-time {
  font-size: 0.72rem;
  color: #64748b;
  user-select: none;
}

/* Prepending Callsign Badge */
.msg-callsign-badge {
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  flex-shrink: 0;
  user-select: none;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
}

.msg-text {
  flex: 1;
  color: #f1f5f9;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-sans), 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  font-size: 0.92rem;
}

/* Floating Jump to Bottom Button */
.btn-jump-bottom {
  position: absolute;
  bottom: 1rem;
  right: 1.5rem;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--cyan-primary);
  color: #fff;
  padding: 0.55rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 15px var(--cyan-glow);
  animation: bounceIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bounceIn {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.jump-unread-pill {
  background: var(--cyan-primary);
  color: #030712;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
}

/* ==========================================================================
   Chat Input Bar
   ========================================================================== */
.chat-input-bar {
  flex-shrink: 0;
  padding: 0.85rem 1.25rem 0.75rem;
  background: var(--bg-input);
  border-top: 1px solid var(--border-subtle);
  backdrop-filter: blur(16px);
  z-index: 10;
}

.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 0.85rem;
}

.input-callsign-prefix {
  display: flex;
  align-items: center;
  padding: 0.8rem 0.75rem;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.35);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--cyan-primary);
  user-select: none;
  flex-shrink: 0;
  max-width: 170px;
}

.prefix-bracket {
  color: var(--text-dim);
}

.prefix-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
}

.chat-textarea {
  width: 100%;
  min-height: 46px;
  max-height: 120px;
  resize: none;
  background: rgba(4, 7, 15, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.75rem 6.25rem 0.75rem 1rem;
  font-family: var(--font-sans), 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  font-size: 0.92rem;
  color: #fff;
  line-height: 1.4;
  outline: none;
  transition: all 0.2s ease;
}

.chat-textarea:focus {
  border-color: var(--cyan-primary);
  box-shadow: 0 0 15px var(--cyan-glow);
}

.chat-textarea::placeholder {
  color: #475569;
  font-size: 0.85rem;
}

.input-actions-strip {
  position: absolute;
  right: 0.65rem;
  bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-emoji-trigger {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.btn-emoji-trigger:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--cyan-primary);
  transform: scale(1.1);
  box-shadow: 0 0 10px var(--cyan-glow);
}

.btn-emoji-trigger:active {
  transform: scale(0.95);
}

.input-char-counter {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  pointer-events: none;
  user-select: none;
}

/* ==========================================================================
   Emoji Picker Popover
   ========================================================================== */
.emoji-picker-popover {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 1.25rem;
  width: 340px;
  max-width: calc(100vw - 2.5rem);
  background: rgba(11, 16, 28, 0.96);
  border: 1px solid rgba(0, 242, 254, 0.4);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 25px var(--cyan-glow);
  border-radius: 12px;
  padding: 0.75rem;
  z-index: 50;
  backdrop-filter: blur(16px);
  animation: emojiPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes emojiPop {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.emoji-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border-subtle);
}

.emoji-tabs {
  display: flex;
  gap: 0.35rem;
}

.emoji-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.emoji-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.emoji-tab.active {
  color: var(--cyan-primary);
  background: rgba(0, 242, 254, 0.1);
  border-color: rgba(0, 242, 254, 0.3);
}

.emoji-picker-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.25rem;
  transition: color 0.15s ease;
}

.emoji-picker-close:hover {
  color: var(--red-alert);
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  max-height: 190px;
  overflow-y: auto;
  padding: 2px;
}

.emoji-grid::-webkit-scrollbar {
  width: 4px;
}
.emoji-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.emoji-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 1.35rem;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s ease;
}

.emoji-btn:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: rgba(0, 242, 254, 0.35);
  transform: scale(1.22);
}

.emoji-btn:active {
  transform: scale(0.95);
}

.btn-send-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  color: #030712;
  border: none;
  border-radius: 8px;
  height: 46px;
  padding: 0 1.25rem;
  font-family: var(--font-arcade);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 2px 12px var(--cyan-glow);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.btn-send-message:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(0, 242, 254, 0.55);
}

.btn-send-message:active {
  transform: translateY(0);
}

.send-icon {
  width: 15px;
  height: 15px;
}

/* Bottom Disclaimer Strip */
.chat-footer-strip {
  margin-top: 0.45rem;
  text-align: center;
  font-size: 0.72rem;
  color: #64748b;
  font-family: var(--font-mono);
  user-select: none;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 820px) {
  .hud-center {
    display: none;
  }
  .hud-wipe-pill {
    display: none;
  }
}

@media (max-width: 640px) {
  .chat-hud {
    padding: 0 0.75rem;
  }
  .hud-title {
    font-size: 0.82rem;
  }
  .input-callsign-prefix {
    display: none;
  }
  .send-btn-label {
    display: none;
  }
  .btn-send-message {
    padding: 0 0.85rem;
  }
  .gate-modal {
    padding: 1.5rem 1.25rem;
  }
  .gate-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .gate-actions {
    flex-direction: column;
  }
  .gate-wipe-countdown-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }
  .msg-seq {
    display: none;
  }
}
