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

html, body { height: 100%; overflow: hidden; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(ellipse at 30% 20%, #1b2740 0%, #0b1020 55%, #070a14 100%);
  color: #e8ecf4;
}

#scene {
  position: fixed;
  inset: 0;
  cursor: grab;
  touch-action: none;
  perspective: 900px;
}
#scene.dragging { cursor: grabbing; }

#cloud {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
}

.tag {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 0 18px rgba(0, 0, 0, 0.55);
  transition: opacity 0.3s;
  will-change: transform, opacity;
  user-select: none;
}
.tag.flash { animation: flash 1.6s ease-out; }
@keyframes flash {
  0%   { color: #fff; text-shadow: 0 0 26px rgba(120, 200, 255, 0.95); }
  100% { text-shadow: 0 0 18px rgba(0, 0, 0, 0.55); }
}

#hint {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(232, 236, 244, 0.35);
  font-size: 14px;
  pointer-events: none;
}

#toolbar {
  position: fixed;
  top: 18px;
  right: 22px;
  display: flex;
  gap: 8px;
}
#toolbar button {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(13, 20, 36, 0.82);
  color: #9fb2d0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
}
#toolbar button:hover:not(:disabled) { color: #e8ecf4; }
#toolbar button:disabled { opacity: 0.4; cursor: default; }

#panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(13, 20, 36, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  backdrop-filter: blur(8px);
}
#qr { width: 110px; height: 110px; display: block; background: #fff; padding: 7px; border-radius: 8px; }
#qr img, #qr canvas { display: block; width: 96px; height: 96px; }
.panel-title { font-size: 14px; color: #9fb2d0; margin-bottom: 4px; }
#add-url { font-size: 13px; color: #7fb4ff; word-break: break-all; max-width: 180px; display: inline-block; }

#toggle-qr {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(13, 20, 36, 0.82);
  color: #9fb2d0;
  font-size: 18px;
  cursor: pointer;
  display: none;
}
#toggle-qr:hover { color: #e8ecf4; }
body.qr-hidden #panel { display: none; }
body.qr-hidden #toggle-qr { display: block; }

@media (max-width: 700px) {
  #panel { right: 12px; bottom: 12px; padding: 10px 12px; gap: 10px; }
  #qr { width: 84px; height: 84px; }
  #add-url { max-width: 120px; }
}
