@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

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

:root {
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --blue: #3b82f6;
}

body {
  background: #000;
  color: #fff;
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* ---- Start ---- */
.start-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
  z-index: 100;
  gap: 16px;
}

.start-logo {
  font-size: 48px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

.camera-select-wrap {
  margin-bottom: 4px;
}

.camera-select {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: inherit;
  outline: none;
  min-width: 220px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' fill='none' stroke='%23666' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.camera-select:hover {
  border-color: rgba(255,255,255,0.2);
}

.camera-select option {
  background: #1a1a1a;
  color: #ccc;
}

.start-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  padding: 14px 48px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.start-btn:hover {
  background: rgba(255,255,255,0.14);
  transform: translateY(-1px);
}

.start-hint {
  font-size: 12px;
  color: #444;
  letter-spacing: 0.05em;
}

/* ---- App ---- */
.app {
  position: relative;
  width: 100vw;
  height: 100vh;
}

/* Fullscreen camera */
#camera {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  z-index: 0;
}

#overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* ---- HUD ---- */
.hud {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hud > * {
  pointer-events: auto;
}

/* Top bar */
.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
}

.hud-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 8px 16px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.08);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #444;
  transition: all 0.3s;
}

.status-dot.active {
  background: var(--green);
  box-shadow: 0 0 10px rgba(34,197,94,0.5);
  animation: dot-pulse 2s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hud-title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: rgba(255,255,255,0.8);
}

.hud-badges-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.hud-pill {
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.08);
}

#face-count {
  color: var(--green);
  font-weight: 600;
}

/* Camera switch in HUD */
.camera-switch {
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  font-size: 11px;
  padding: 6px 28px 6px 10px;
  border-radius: 20px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2.5 3.5L5 6.5L7.5 3.5' fill='none' stroke='%23666' stroke-width='1.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  max-width: 160px;
}

.camera-switch option {
  background: #1a1a1a;
  color: #ccc;
}

/* ---- Gaze ring ---- */
.gaze-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 15;
  transition: top 0.12s ease-out, left 0.12s ease-out;
  opacity: 0;
}

.gaze-ring.visible {
  opacity: 1;
}

.gaze-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(59, 130, 246, 0.7);
  background: rgba(59, 130, 246, 0.15);
  box-shadow:
    0 0 20px rgba(59, 130, 246, 0.2),
    inset 0 0 8px rgba(59, 130, 246, 0.1);
  position: relative;
}

.gaze-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.9);
}

/* ---- Bottom HUD ---- */
.hud-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 16px;
  gap: 6px;
}

/* Attention bar — centered, not full width */
.attention-track {
  width: auto;
  min-width: 200px;
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  align-self: center;
}

.attention-fill {
  height: 100%;
  width: 0%;
  background: var(--green);
  border-radius: 2px;
  transition: width 0.3s ease-out, background 0.3s;
  box-shadow: 0 0 8px rgba(34,197,94,0.2);
}

.attention-fill.medium {
  background: var(--amber);
  box-shadow: 0 0 8px rgba(245,158,11,0.2);
}

.attention-fill.low {
  background: var(--red);
  box-shadow: 0 0 8px rgba(239,68,68,0.2);
}

/* Bottom floating island */
.bottom-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 12px 20px;
  width: auto;
  max-width: 90vw;
}

.synth-block {
  display: flex;
  align-items: center;
  padding-right: 14px;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.synth-text {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255,255,255,0.9);
  letter-spacing: -0.01em;
  line-height: 1.4;
  max-width: 260px;
}

.sense-chips {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
}

.chip-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.chip-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.25);
  white-space: nowrap;
}

.chip-val {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  white-space: nowrap;
}

/* ---- Timeline float — top right ---- */
.timeline-float {
  position: absolute;
  top: 56px;
  right: 20px;
  max-width: 240px;
  max-height: 120px;
  overflow-y: auto;
}

.timeline-entries {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-entry {
  font-size: 10px;
  display: flex;
  gap: 6px;
  padding: 3px 8px;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(8px);
  border-radius: 4px;
}

.timeline-entry .time {
  color: rgba(255,255,255,0.25);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.timeline-entry .event {
  color: rgba(255,255,255,0.4);
}

/* Responsive */
@media (max-width: 600px) {
  .bottom-row {
    flex-wrap: wrap;
    justify-content: center;
  }
  .synth-block {
    border-right: none;
    padding-right: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 8px;
    width: 100%;
    justify-content: center;
  }
  .sense-chips {
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Scrollbar */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
