:root {
  --bg: #0a1628;
  --bg-secondary: #0d1b2e;
  --surface: #132744;
  --surface-hover: #1a3358;
  --surface-active: #214165;
  --text: #e0f2fe;
  --text-secondary: #bae6fd;
  --text-muted: #7dd3fc;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-glow: rgba(59, 130, 246, 0.4);
  --success: #22d3ee;
  --danger: #f87171;
  --warning: #fbbf24;
  --border: #1e3a5f;
  --border-light: #2563eb;
  --glow: 0 0 30px rgba(59, 130, 246, 0.25);
  --shadow-sm: 0 2px 8px rgba(37, 99, 235, 0.15);
  --shadow-md: 0 8px 30px rgba(37, 99, 235, 0.2);
  --shadow-lg: 0 20px 50px rgba(37, 99, 235, 0.3);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #0a1628 0%, #1e3a8a 50%, #1e40af 100%);
  background-attachment: fixed;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Animated background particles */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(37, 99, 235, 0.15) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 32px;
  background: rgba(10, 14, 23, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.logo {
  height: 48px;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(59, 130, 246, 0.3));
  transition: var(--transition);
}

.logo:hover {
  filter: drop-shadow(0 4px 20px rgba(59, 130, 246, 0.5));
  transform: scale(1.05);
}

.title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #e0f2fe 0%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Shell Container */
.shell {
  max-width: 1400px;
  margin: 32px auto;
  padding: 0 32px 32px 32px;
}

/* Buttons */
.btn {
  appearance: none;
  border: 1px solid var(--border-light);
  background: var(--surface);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.btn:active {
  transform: translateY(0);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent) 0%, #2563eb 100%);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn.primary:hover {
  box-shadow: 0 0 30px var(--accent-glow), var(--shadow-md);
}

.btn.danger {
  background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
  border-color: var(--danger);
  color: white;
}

.btn.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Inputs */
.input, .select {
  background: var(--surface);
  border: 1px solid var(--border-light);
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  min-width: 240px;
  font-size: 15px;
  transition: var(--transition);
}

.input:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.checkbox {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Cards */
.card {
  background: rgba(22, 27, 38, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: var(--transition);
}

.card:hover::before {
  opacity: 0.5;
}

.card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-lg);
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

/* Rows */
.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* Labels */
.label {
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.2px;
}

.small {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.mini {
  font-size: 13px;
  color: var(--text-muted);
}

/* Banner */
.banner {
  padding: 16px 20px;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.05);
  margin-bottom: 16px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.tab {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
}

.tab:hover {
  background: var(--surface-hover);
  border-color: var(--border-light);
}

.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 0 20px var(--accent-glow);
}

/* Angle Buttons */
.listAngles {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.angleBtn {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
  font-size: 15px;
  position: relative;
}

.angleBtn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.angleBtn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 0 25px var(--accent-glow);
}

/* Video Elements */
video.vid {
  width: 100%;
  max-height: 200px;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: #000;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

video.vid:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

video.viewer {
  width: 100%;
  border-radius: var(--radius);
  background: #000;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

/* Player Wrapper */
.playerWrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 400px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-lg);
}

.playerWrap > video.viewer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Holding Screen */
.hold {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  background: linear-gradient(135deg, rgba(10, 22, 40, 0.95) 0%, rgba(30, 58, 138, 0.85) 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text-secondary);
  position: relative;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.hold:hover {
  background: linear-gradient(135deg, rgba(13, 27, 46, 0.95) 0%, rgba(30, 64, 175, 0.85) 100%);
}

.playerWrap > .hold {
  position: absolute;
  inset: 0;
}

.hold .hold-inner {
  text-align: center;
  padding: 32px 24px;
}

.hold .hold-inner img {
  height: 80px;
  margin-bottom: 20px;
  opacity: 0.9;
  filter: drop-shadow(0 4px 12px rgba(59, 130, 246, 0.3));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.hold .title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  font-size: 18px;
}

.hold .desc, .hold .p {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.hold.hidden, .hidden {
  display: none !important;
}

/* Map */
.mapWrap {
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  min-height: 400px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.mapWrap img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* Markers */
.marker {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid white;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
  cursor: move;
  transition: box-shadow 0.3s ease, filter 0.3s ease;
  z-index: 10;
  user-select: none;
  -webkit-user-select: none;
  margin-left: -10px; /* Center horizontally (half of width) */
  margin-top: -20px;  /* Position at bottom (full height) */
}

.marker:hover {
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.8);
  z-index: 20;
  filter: brightness(1.2);
}

.marker.active {
  animation: pulse 2s infinite;
  box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(59, 130, 246, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
}

.markerTag {
  position: absolute;
  transform: translate(-50%, -4px);
  top: -12px;
  left: 50%;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  pointer-events: none;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transition: var(--transition);
}

.marker:hover .markerTag {
  opacity: 1;
  transform: translate(-50%, -8px);
}

/* Marker Row */
.markerRow {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

/* Range Slider */
.range {
  width: 160px;
  height: 6px;
  border-radius: 3px;
  background: var(--surface);
  outline: none;
  accent-color: var(--accent);
}

/* Splash (Landing) */
.splash {
  max-width: 1100px;
  margin: 60px auto;
  padding: 48px 40px;
  background: rgba(22, 27, 38, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.splash .bigLogo {
  height: 120px;
  margin: 12px auto 24px auto;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(59, 130, 246, 0.4));
  animation: float 4s ease-in-out infinite;
}

.splash h1 {
  margin: 16px 0 12px 0;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.splash p {
  color: var(--text-secondary);
  max-width: 800px;
  margin: 0 auto 24px auto;
  line-height: 1.7;
  font-size: 16px;
}

/* Landing Page Styles */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  padding: 48px 32px;
}

.hero .brand {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .tagline {
  color: var(--text-secondary);
  max-width: 800px;
  line-height: 1.7;
  font-size: 17px;
}

.brandLogo {
  height: 96px;
  filter: drop-shadow(0 8px 24px rgba(59, 130, 246, 0.4));
  animation: float 4s ease-in-out infinite;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.role {
  cursor: pointer;
  transition: var(--transition);
}

.role:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.role h3 {
  margin: 8px 0 8px 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.chip {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}

.chip:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.roomRow {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 32px;
}

.footer {
  margin-top: 32px;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  opacity: 0.7;
}

/* Kbd */
.kbd {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Courier New', monospace;
  background: var(--surface);
  border: 1px solid var(--border-light);
  color: var(--accent);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--surface);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--surface-hover);
}

/* Responsive */
@media (max-width: 768px) {
  .shell {
    padding: 0 16px 16px 16px;
    margin: 16px auto;
  }

  .header {
    padding: 16px 20px;
  }

  .logo {
    height: 40px;
  }

  .title {
    font-size: 18px;
  }

  .card {
    padding: 16px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .hero .brand, .splash h1 {
    font-size: 28px;
  }

  .playerWrap {
    min-height: 280px;
  }
}

/* Animation for new elements */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeInUp 0.5s ease-out;
}
