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

body {
  overflow: hidden;
  background: #000;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #e8e8ff;
}

#scene {
  display: block;
  width: 100vw;
  height: 100vh;
}

#webcam {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 200px;
  height: 150px;
  border-radius: 12px;
  border: 2px solid rgba(100, 180, 255, 0.4);
  object-fit: cover;
  transform: scaleX(-1);
  z-index: 10;
  opacity: 0.85;
}

#hand-overlay {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 200px;
  height: 150px;
  border-radius: 12px;
  pointer-events: none;
  z-index: 11;
  transform: scaleX(-1);
}

#crosshair {
  position: fixed;
  width: 320px;
  height: 320px;
  border: 2px dashed rgba(255, 200, 50, 0.35);
  border-radius: 50%;
  pointer-events: none;
  z-index: 15;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.2s, border-color 0.2s, box-shadow 0.2s;
}

#crosshair::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  background: rgba(255, 200, 50, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 200, 50, 0.6);
}

#crosshair.visible {
  opacity: 1;
}

#crosshair.has-target {
  border-color: rgba(255, 200, 50, 0.85);
  border-style: solid;
  box-shadow: 0 0 30px rgba(255, 200, 50, 0.25);
}

#crosshair.has-target::after {
  background: rgba(255, 120, 50, 1);
  box-shadow: 0 0 16px rgba(255, 120, 50, 0.8);
}

#crosshair.locked {
  border-color: rgba(80, 255, 120, 0.9);
  border-style: solid;
  box-shadow: 0 0 24px rgba(80, 255, 120, 0.4);
  opacity: 0;
}

#ui {
  position: fixed;
  top: 20px;
  left: 20px;
  max-width: 320px;
  z-index: 20;
  background: rgba(8, 12, 30, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(100, 150, 255, 0.25);
  border-radius: 16px;
  padding: 20px 24px;
  transition: opacity 0.4s;
}

#ui.dimmed {
  opacity: 0.4;
}

#ui h1 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #ffd700, #ff8c00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#mode-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(80, 120, 255, 0.25);
  color: #aad;
  margin-bottom: 8px;
}

#mode-badge.aiming { background: rgba(255, 200, 50, 0.25); color: #fd6; }
#mode-badge.locked { background: rgba(80, 255, 120, 0.2); color: #8f8; }
#mode-badge.info { background: rgba(180, 100, 255, 0.25); color: #c8f; }

#status {
  font-size: 0.85rem;
  color: #8af;
  margin-bottom: 4px;
}

#planet-name {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 16px;
}

.controls h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8899bb;
  margin-bottom: 10px;
}

.controls ul {
  list-style: none;
}

.controls li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #ccd;
  margin-bottom: 8px;
}

.controls li span {
  flex-shrink: 0;
  font-size: 1rem;
}

#start-btn {
  margin-top: 12px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #3366ff, #6633ff);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

#start-btn:hover {
  opacity: 0.85;
}

/* ─── Bento Card ─── */
#bento {
  position: fixed;
  top: 72px;
  right: 20px;
  width: 380px;
  z-index: 30;
  background: rgba(10, 14, 35, 0.88);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(120, 160, 255, 0.3);
  border-radius: 20px;
  padding: 24px;
  transform: translateX(120%);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

#bento.open {
  transform: translateX(0);
}

#bento.hidden {
  pointer-events: none;
}

.bento-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.bento-header img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 200, 80, 0.4);
  box-shadow: 0 0 20px rgba(255, 180, 50, 0.2);
}

.bento-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.bento-header p {
  font-size: 0.85rem;
  color: #8899cc;
  margin-top: 2px;
}

.bento-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.bento-cell {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
}

.bento-cell.wide {
  grid-column: 1 / -1;
}

.bento-cell .label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #667799;
  margin-bottom: 4px;
}

.bento-cell p {
  font-size: 0.9rem;
  color: #dde;
  line-height: 1.45;
}

#peace-bar {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(120, 255, 80, 0.08);
  border: 1px solid rgba(120, 255, 80, 0.25);
  border-radius: 12px;
}

#peace-label {
  display: block;
  font-size: 0.82rem;
  color: #9fdf8a;
  margin-bottom: 8px;
}

.peace-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

#peace-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6f6, #af4);
  border-radius: 3px;
  transition: width 0.08s linear;
}

#peace-bar.active {
  border-color: rgba(120, 255, 80, 0.7);
  box-shadow: 0 0 16px rgba(120, 255, 80, 0.2);
}

#site-nav {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 45;
  display: flex;
  gap: 6px;
  padding: 5px;
  background: rgba(10, 14, 35, 0.85);
  border: 1px solid rgba(140, 170, 255, 0.4);
  border-radius: 14px;
  backdrop-filter: blur(12px);
}

#site-nav a {
  padding: 8px 12px;
  border-radius: 10px;
  color: #bcd;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

#site-nav a:hover {
  background: rgba(80, 110, 220, 0.25);
  color: #eef;
}

#site-nav a.active {
  background: linear-gradient(135deg, #3355ff, #6633ff);
  color: #fff;
  box-shadow: 0 0 16px rgba(100, 120, 255, 0.35);
}

@media (max-width: 860px) {
  #site-nav {
    top: 10px;
    right: 10px;
    left: 10px;
    justify-content: center;
    flex-wrap: wrap;
  }
}

#version-tag {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 25;
  padding: 6px 12px;
  background: rgba(10, 14, 35, 0.85);
  border: 1px solid rgba(120, 160, 255, 0.35);
  border-radius: 8px;
  font-size: 0.75rem;
  color: #8af;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.bento-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.bento-actions button {
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.bento-actions button:hover { opacity: 0.85; }

#bento-next {
  background: linear-gradient(135deg, #3366ff, #6633ff);
  color: #fff;
}

#bento-back {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ccd;
}

.bento-hint {
  margin-top: 12px;
  text-align: center;
  font-size: 0.78rem;
  color: #667799;
}

#start-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

#loading {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #050510;
  z-index: 100;
  transition: opacity 0.5s;
}

#loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(100, 150, 255, 0.2);
  border-top-color: #66aaff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#loading p {
  color: #8899bb;
  font-size: 0.9rem;
}
