* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; background: #8fc7ff; font-family: -apple-system, Segoe UI, Roboto, sans-serif; }
#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; cursor: crosshair; }

#crosshair {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.8); font-size: 22px; font-weight: 300; pointer-events: none;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.6);
}

#flash {
  position: fixed; inset: 0; background: #e74c3c; opacity: 0; pointer-events: none;
  transition: opacity 0.15s ease; z-index: 5;
}

#prompt {
  position: fixed; left: 50%; bottom: 22%; transform: translateX(-50%);
  background: rgba(15, 20, 28, 0.82); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 15px; font-weight: 600; letter-spacing: 0.2px; pointer-events: none;
  opacity: 0; transition: opacity 0.15s ease; border: 1px solid rgba(255, 255, 255, 0.14);
}
#prompt.show { opacity: 1; }
#prompt b { color: #7ecbff; }

#presence {
  position: fixed; top: 14px; right: 14px; min-width: 180px;
  background: rgba(15, 20, 28, 0.7); color: #e7edf3; padding: 10px 14px; border-radius: 12px;
  font-size: 13px; line-height: 1.7; backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, 0.1);
}
#presence .phead { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; opacity: 0.6; margin-bottom: 4px; }

#legend {
  position: fixed; left: 14px; bottom: 14px; color: #e7edf3;
  background: rgba(15, 20, 28, 0.62); padding: 9px 13px; border-radius: 10px;
  font-size: 12px; line-height: 1.6; border: 1px solid rgba(255, 255, 255, 0.1);
}
#legend b { color: #7ecbff; }

#status {
  position: fixed; top: 14px; left: 14px; color: #cfe0ee;
  background: rgba(15, 20, 28, 0.62); padding: 6px 12px; border-radius: 999px; font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#chatlog {
  position: fixed; left: 14px; bottom: 70px; max-width: 42vw; max-height: 30vh; overflow: hidden;
  color: #eaf1f7; font-size: 13px; line-height: 1.5; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}
#chatlog b { color: #ffd479; }
#chatlog b.me { opacity: 0.8; }
#chatbox {
  position: fixed; left: 14px; bottom: 44px; width: 42vw; display: none;
  background: rgba(15, 20, 28, 0.9); color: #fff; border: 1px solid #3a4a5a;
  padding: 9px 12px; border-radius: 8px; font-size: 14px; outline: none;
}

#voicebadge {
  position: fixed; right: 14px; bottom: 14px; color: #cfe0ee;
  background: rgba(15, 20, 28, 0.62); padding: 7px 13px; border-radius: 999px; font-size: 12px;
  font-weight: 600; border: 1px solid rgba(255, 255, 255, 0.1);
}
#voicebadge.on { color: #12181f; background: #26de81; border-color: #26de81; }

#toasts { position: fixed; left: 50%; top: 66px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 6; }
.toast {
  background: rgba(20, 26, 34, 0.92); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 600; border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); transition: opacity 0.4s ease; max-width: 80vw; text-align: center;
}

#lockhint {
  position: fixed; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(10, 14, 20, 0.35); color: #fff; font-size: 20px; font-weight: 600; z-index: 7;
  pointer-events: none;
}
#lockhint div { background: rgba(15, 20, 28, 0.8); padding: 14px 26px; border-radius: 12px; }

#start {
  position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, #2c5a8f, #101826);
}
.card {
  background: rgba(18, 24, 33, 0.96); color: #e7edf3; width: min(440px, 90vw);
  padding: 30px 30px 26px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.card h1 { font-size: 30px; margin-bottom: 10px; }
.card p { font-size: 14px; line-height: 1.6; opacity: 0.85; margin-bottom: 20px; }
.card label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; opacity: 0.6; margin-bottom: 6px; }
.card input {
  width: 100%; background: #0e141c; color: #fff; border: 1px solid #3a4a5a; border-radius: 9px;
  padding: 12px 14px; font-size: 16px; outline: none; margin-bottom: 16px;
}
.card input:focus { border-color: #2e86de; }
.card button {
  width: 100%; background: linear-gradient(180deg, #3aa0ff, #2e86de); color: #fff; border: none;
  padding: 13px; border-radius: 9px; font-size: 16px; font-weight: 700; cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease;
}
.card button:hover { filter: brightness(1.08); }
.card button:active { transform: scale(0.98); }
.card .hint { font-size: 12px; opacity: 0.55; margin-top: 14px; text-align: center; line-height: 1.5; }
