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

body {
  background: #0a0018;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Segoe UI', sans-serif;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#canvas-wrap {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#gacha-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── Overlay ──────────────────────────────────────── */
#overlay-container {
  position: absolute;
  top: 8px;
  left: 0;
  width: 100%;
  padding: 0 8px;
  pointer-events: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.player-overlay {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: opacity 0.5s;
}

.player-overlay.fade-out { opacity: 0; }

.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

.nickname {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  max-width: 80px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.timer {
  color: #fff;
  font-family: monospace;
  font-size: 14px;
  font-weight: bold;
  min-width: 28px;
  text-align: right;
}

.timer.urgent {
  color: #ff4444;
  animation: blink 0.5s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── Loading dim ──────────────────────────────────── */
#loading-dim {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  transition: opacity 0.5s;
}
#loading-dim.hide {
  opacity: 0;
  pointer-events: none;
}
#loading-dim p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  letter-spacing: 2px;
}
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── QR panel ──────────────────────────────────────── */
#qr-panel {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 10;
}

#qr-box {
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

#qr-box p {
  font-size: 11px;
  color: #444;
  margin-top: 5px;
}

/* ── Status bar ───────────────────────────────────── */
#status-bar {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 10;
  display: flex;
  gap: 16px;
}

#status-bar span {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  background: rgba(0,0,0,0.5);
  padding: 3px 10px;
  border-radius: 10px;
}
