#trace-panel {
  position: fixed;
  top: 12px;
  right: 12px;
  background: rgba(18, 21, 30, 0.95);
  border: 1px solid #2a3040;
  border-radius: 6px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: monospace;
  min-width: 200px;
}

#trace-title {
  color: #fff;
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
}

#trace-subtitle {
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.05em;
}

#trace-input {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid #2a3040;
  border-radius: 4px;
  color: #FFD43B;
  font: 13px/1 'Courier New', monospace;
  padding: 6px 8px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

#trace-input:focus {
  border-color: #FFD43B;
}

#trace-db-toggle {
  background: transparent;
  border: none;
  height: auto;
  padding: 0;
  font: 10px/1.6 monospace;
  letter-spacing: 0.05em;
}

#trace-db-toggle label {
  color: #fff;
  cursor: pointer;
}

#trace-db-toggle input {
  accent-color: #FFD43B;
  width: 11px;
  height: 11px;
}

.trace-dot {
  position: fixed;
  width: 22px;
  height: 22px;
  background: radial-gradient(circle at 35% 35%, #ffe066, #f39c12);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10000;
  box-shadow: 0 0 18px 6px rgba(243, 156, 18, 0.6), 0 0 6px 2px rgba(255, 212, 59, 0.9);
  animation: trace-dot-pulse 0.3s ease-in-out infinite alternate;
}

@keyframes trace-dot-pulse {
  from { transform: translate(-50%, -50%) scale(1);   box-shadow: 0 0 18px 6px rgba(243, 156, 18, 0.6); }
  to   { transform: translate(-50%, -50%) scale(1.35); box-shadow: 0 0 28px 10px rgba(243, 156, 18, 0.35); }
}

#trace-error {
  color: #e74c3c;
  font-size: 11px;
  max-width: 180px;
}

body {
  background: transparent;
  overflow: hidden;
  padding: 0;
  max-width: none;
}

#cy {
  width: 100vw;
  height: 100vh;
}

#info {
  position: fixed;
  bottom: 12px;
  left: 12px;
  color: #aaa;
  font: 13px/1.6 monospace;
  background: rgba(18, 21, 30, 0.8);
  padding: 6px 10px;
  border-radius: 4px;
}

#strategy-panel {
  position: fixed;
  top: 12px;
  left: 12px;
  background: rgba(18, 21, 30, 0.9);
  border: 1px solid #2a3040;
  border-radius: 6px;
  padding: 10px 14px;
  font: 12px/1.8 monospace;
  color: #aaa;
  min-width: 190px;
}

#strategy-panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #666;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

#strategy-panel-toggle {
  cursor: pointer;
  color: #555;
  font-size: 22px;
  line-height: 1;
  user-select: none;
}

#strategy-panel-toggle:hover {
  color: #aaa;
}

#strategy-panel.collapsed .strategy-row {
  display: none;
}

#strategy-panel.collapsed #strategy-panel-title {
  margin-bottom: 0;
}

.strategy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.strategy-row input[type="checkbox"] {
  accent-color: #5dade2;
  cursor: pointer;
  width: 13px;
  height: 13px;
}

.strategy-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.strategy-label {
  color: #ccc;
}

#char-popup {
  position: fixed;
  display: none;
  background: rgba(18, 21, 30, 0.96);
  border: 1px solid #FFD43B;
  border-radius: 10px;
  padding: 18px 22px;
  font: 15px/1.8 'Courier New', monospace;
  color: #ccc;
  z-index: 9999;
  pointer-events: none;
  max-width: 340px;
  transform: translate(-50%, calc(-100% - 18px));
}

#char-popup .char-glyph {
  font-size: 44px;
  color: #FFD43B;
  display: block;
  margin-bottom: 6px;
  text-align: center;
}

#char-popup .char-name {
  color: #888;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#edge-tooltip {
  position: fixed;
  display: none;
  font: bold 15px/1 'Courier New', monospace;
  padding: 8px 16px;
  border-radius: 8px;
  background: #fff;
  border: 2px solid currentColor;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
  transform: translate(-50%, -160%);
  letter-spacing: 0.02em;
}

#home-link {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  color: #ccc;
  font: 12px monospace;
  text-decoration: none;
  background: rgba(18, 21, 30, 0.7);
  padding: 6px 12px;
  border-radius: 8px;
  transition: opacity 0.15s;
}
#home-link:hover { opacity: 0.7; }

#back-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(18, 21, 30, 0.95);
  border: 1px solid #4a5568;
  border-radius: 6px;
  color: #ccc;
  font: 45px/1 monospace;
  padding: 36px 72px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

#back-btn:hover:not(:disabled) {
  border-color: #5dade2;
  color: #5dade2;
  background: rgba(93, 173, 226, 0.08);
}

#back-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

#sound-panel {
  position: fixed;
  top: 12px;
  left: 214px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(18, 21, 30, 0.9);
  border: 1px solid #2a3040;
  border-radius: 6px;
  padding: 6px 10px;
}

#mute-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.85;
  transition: opacity 0.15s;
}

#mute-btn:hover { opacity: 1; }

#mute-btn.muted { opacity: 0.35; }

#volume-slider {
  width: 80px;
  accent-color: #5dade2;
  cursor: pointer;
}
