:root {
  --bg-body: #121212;
  --bg-surface: #1a1a1a;
  --bg-surface-elevated: #242424;
  --bg-input: #202020;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(99, 102, 241, 0.4);

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --accent-glow: rgba(99, 102, 241, 0.35);

  --text-primary: #f5f5f7;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-bg: rgba(239, 68, 68, 0.12);

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', sans-serif;
}

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

body {
  background-color: var(--bg-body);
  color: var(--text-primary);
  font-family: var(--font-sans);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  padding: 14px 18px;
  gap: 14px;
}

/* ==========================================================================
   Top Bar
   ========================================================================== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  background: var(--accent-gradient);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.brand-name span {
  color: var(--accent-primary);
}

/* Status Pill */
.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  transition: all 0.25s ease;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.3s ease;
}

.status-pill.idle .status-dot {
  background: var(--text-muted);
}

.status-pill.searching {
  background: var(--warning-bg);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fde68a;
}
.status-pill.searching .status-dot {
  background: var(--warning);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
  animation: pulse-dot 1.2s infinite;
}

.status-pill.connected {
  background: var(--success-bg);
  border-color: rgba(16, 185, 129, 0.35);
  color: #a7f3d0;
}
.status-pill.connected .status-dot {
  background: var(--success);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.status-pill.disconnected {
  background: var(--danger-bg);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}
.status-pill.disconnected .status-dot {
  background: var(--danger);
}

.badge-live {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #a5b4fc;
  padding: 5px 12px;
  background: rgba(99, 102, 241, 0.12);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(99, 102, 241, 0.28);
}

/* ==========================================================================
   Main Split Layout
   ========================================================================== */
.main-split {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
  min-height: 0;
}

/* ==========================================================================
   Video Section (Left)
   ========================================================================== */
.video-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.video-stage {
  flex: 1;
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.video-box {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000000;
}

.video-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.3s ease;
}

/* Stranger Video Auto-Moderation Blur */
#strangerVideo.nsfw-blurred {
  filter: blur(25px) brightness(0.6) !important;
}

/* Stranger Video Box (Large/Prominent) */
.stranger-box {
  width: 100%;
  height: 100%;
}

/* My Video Box (Picture-in-Picture feed) */
.my-box {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 220px;
  height: 145px;
  border-radius: var(--radius-md);
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 10;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.my-box:hover {
  border-color: var(--accent-primary);
  transform: scale(1.02);
}

/* Mirror the local user webcam so it looks natural */
#myVideo {
  transform: scaleX(-1);
}

/* Video Overlay / Placeholders */
.video-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 5;
}

.video-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.video-overlay h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

.video-overlay p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* NSFW Alert Overlay */
.nsfw-alert-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  pointer-events: none;
  animation: fadeIn 0.3s ease;
}

.nsfw-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  background: rgba(239, 68, 68, 0.9);
  color: #ffffff;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.6);
}

.nsfw-subtext {
  font-size: 0.85rem;
  color: #fecaca;
  font-weight: 500;
}

/* Radar Pulse Wave Animation */
.radar-container {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.radar-core {
  position: relative;
  z-index: 2;
  width: 58px;
  height: 58px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.radar-wave {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--accent-primary);
  opacity: 0;
}

.searching .radar-wave {
  animation: radar-ping 2s infinite cubic-bezier(0.1, 0.2, 0.4, 1);
}

.wave-2 {
  animation-delay: 0.6s !important;
}

.wave-3 {
  animation-delay: 1.2s !important;
}

@keyframes radar-ping {
  0% {
    width: 40px;
    height: 40px;
    opacity: 0.9;
  }
  100% {
    width: 140px;
    height: 140px;
    opacity: 0;
  }
}

/* Labels on Videos */
.video-label {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 6;
  background: rgba(18, 18, 18, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.label-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}

.label-dot.my-dot {
  background: var(--success);
}

/* Connection Health / Quality Badge */
.connection-quality-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: rgba(18, 18, 18, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text-primary);
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.quality-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warning);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.connection-quality-badge.direct .quality-dot {
  background: var(--success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
}

.connection-quality-badge.relay .quality-dot {
  background: var(--warning);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
}

.connection-quality-badge.unstable .quality-dot {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.7);
  animation: pulse-dot 1s infinite;
}

/* Video Toolbar */
.video-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.toolbar-secondary {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   Chat Section (Right)
   ========================================================================== */
.chat-section {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  min-height: 0;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.chat-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chat-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Scrollable Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

/* Message items */
.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: fadeIn 0.2s ease-out;
}

.chat-msg.mine {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-msg.theirs {
  align-self: flex-start;
  align-items: flex-start;
}

.msg-header {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  padding: 0 4px;
}

.msg-bubble {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-word;
}

.chat-msg.mine .msg-bubble {
  background: var(--accent-gradient);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.chat-msg.theirs .msg-bubble {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
}

/* System Notices */
.chat-notice {
  padding: 9px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  line-height: 1.4;
  text-align: center;
  align-self: center;
  margin: 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.2s ease-out;
}

.system-notice {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
}

.disconnect-notice {
  background: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

/* Chat Input Bar */
.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.015);
  flex-shrink: 0;
}

.chat-input-bar input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 11px 16px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.chat-input-bar input:focus {
  border-color: var(--accent-primary);
  background: #252525;
}

.chat-input-bar input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==========================================================================
   Modals (Age Gate & Report)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #18181b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 24px 24px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.modal-badge-icon {
  width: 52px;
  height: 52px;
  background: var(--accent-gradient);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  margin-bottom: 4px;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.modal-badge-icon.warning {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
}

.modal-header h2,
.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.modal-body {
  padding: 0 24px 20px;
}

.guidelines-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.guideline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.guideline-item strong {
  color: var(--text-primary);
}

.guide-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}

/* Custom Checkbox */
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  padding: 8px 4px;
}

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

.checkmark {
  height: 22px;
  width: 22px;
  background-color: var(--bg-surface-elevated);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  flex-shrink: 0;
  transition: all 0.2s ease;
  position: relative;
}

.checkbox-container:hover input ~ .checkmark {
  border-color: var(--accent-primary);
}

.checkbox-container input:checked ~ .checkmark {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 7px;
  top: 3px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

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

.checkbox-label {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.4;
}

/* Radio Options for Reporting */
.report-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.radio-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.radio-option:hover {
  background: var(--bg-surface-elevated);
  border-color: rgba(255, 255, 255, 0.18);
}

.radio-option input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.radio-circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
  transition: all 0.2s ease;
}

.radio-option input:checked ~ .radio-circle {
  border-color: var(--danger);
}

.radio-option input:checked ~ .radio-circle:after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}

.radio-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.radio-text strong {
  font-size: 0.92rem;
  color: var(--text-primary);
}

.radio-text small {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.modal-footer {
  padding: 16px 24px 24px;
  border-top: 1px solid var(--border-color);
}

.modal-footer.split {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast-notification {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #27272a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-16px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-notification.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ==========================================================================
   Buttons & UI Elements
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 9px 16px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.loading {
  opacity: 0.65;
  cursor: wait !important;
  pointer-events: none;
  filter: saturate(0.8);
  position: relative;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  padding: 10px 22px;
  font-size: 0.95rem;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.5);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-full {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
}

.btn-icon {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-icon:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.btn-icon.active-danger {
  background: var(--danger-bg);
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--danger);
}

.btn-report {
  color: var(--text-secondary);
}

.btn-report:hover:not(:disabled) {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.4);
  background: var(--danger-bg);
}

.btn-send {
  background: var(--accent-primary);
  color: #ffffff;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn-send:hover:not(:disabled) {
  background: var(--accent-primary-hover);
}

.kbd-hint {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 2px;
}

.hidden {
  display: none !important;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.55; }
}

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

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 900px) {
  .app-layout {
    padding: 10px;
    height: 100dvh;
  }

  .main-split {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 300px;
    gap: 10px;
  }

  .my-box {
    width: 150px;
    height: 100px;
    bottom: 12px;
    right: 12px;
  }
}

/* ==========================================================================
   Floating On-Screen Debug HUD (Mobile & Desktop)
   ========================================================================== */
.debug-hud {
  position: fixed;
  top: 12px;
  left: 140px;
  z-index: 9999;
  background: rgba(18, 18, 22, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 11px;
  width: 250px;
  color: #e4e4e7;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.debug-hud.collapsed {
  width: auto;
  border-radius: 20px;
  background: rgba(18, 18, 22, 0.82);
}

.debug-hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  gap: 8px;
}

.debug-hud.collapsed .debug-hud-header {
  padding: 4px 10px;
  border-bottom: none;
}

.debug-hud-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.debug-hud-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.7);
  animation: pulse-dot 1.8s infinite;
}

.debug-hud-title {
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #f4f4f5;
  font-size: 11px;
}

.debug-hud-toggle {
  background: none;
  border: none;
  color: #a1a1aa;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.debug-hud-toggle:hover {
  color: #ffffff;
}

.debug-hud-body {
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: max-height 0.2s ease, opacity 0.2s ease;
}

.debug-hud.collapsed .debug-hud-body {
  display: none;
}

.debug-hud-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.debug-label {
  color: #a1a1aa;
  font-weight: 500;
  flex-shrink: 0;
}

.debug-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10.5px;
  color: #38bdf8;
  text-align: right;
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .debug-hud {
    top: 54px;
    left: 10px;
    width: 230px;
    font-size: 10px;
  }

  .debug-hud.collapsed {
    top: 54px;
    left: 10px;
    width: auto;
  }

  .debug-value {
    font-size: 9.5px;
    max-width: 130px;
  }
}

