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

:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --bg-color: #0f172a;
  --container-bg: #1e293b;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --border-color: #334155;
  --success-color: #22c55e;
  --warning-color: #f59e0b;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-color);
}

body {
  display: flex;
  flex-direction: column;
}

.header {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 16px 24px;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.9) 100%);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  z-index: 100;
}

.header-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.fullscreen-btn {
  position: absolute;
  right: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fullscreen-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary-color);
  transform: scale(1.05);
}

.fullscreen-btn svg {
  width: 20px;
  height: 20px;
  fill: var(--text-secondary);
  transition: fill 0.2s ease;
}

.fullscreen-btn:hover svg {
  fill: var(--primary-color);
}

#unity-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
  overflow: hidden;
}

.unity-bg-left,
.unity-bg-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.unity-bg-left {
  left: 0;
}

.unity-bg-right {
  right: 0;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: float 15s infinite ease-in-out;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 12s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 18s; }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; animation-duration: 14s; }
.particle:nth-child(4) { left: 40%; animation-delay: 1s; animation-duration: 16s; }
.particle:nth-child(5) { left: 50%; animation-delay: 3s; animation-duration: 20s; }
.particle:nth-child(6) { left: 60%; animation-delay: 5s; animation-duration: 13s; }
.particle:nth-child(7) { left: 70%; animation-delay: 2.5s; animation-duration: 17s; }
.particle:nth-child(8) { left: 80%; animation-delay: 0.5s; animation-duration: 15s; }
.particle:nth-child(9) { left: 90%; animation-delay: 4.5s; animation-duration: 19s; }
.particle:nth-child(10) { left: 15%; animation-delay: 1.5s; animation-duration: 11s; }
.particle:nth-child(11) { left: 35%; animation-delay: 3.5s; animation-duration: 21s; }
.particle:nth-child(12) { left: 55%; animation-delay: 2.2s; animation-duration: 14s; }
.particle:nth-child(13) { left: 75%; animation-delay: 4.8s; animation-duration: 16s; }
.particle:nth-child(14) { left: 85%; animation-delay: 1.2s; animation-duration: 18s; }
.particle:nth-child(15) { left: 25%; animation-delay: 0.8s; animation-duration: 12s; }

.unity-bg-right .particle {
  animation-direction: reverse;
}

@keyframes float {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
    transform: translateY(80vh) scale(1);
  }
  90% {
    opacity: 1;
    transform: translateY(10vh) scale(1);
  }
  100% {
    transform: translateY(-10vh) scale(0);
    opacity: 0;
  }
}

#unity-container {
  position: relative;
  z-index: 2;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

#unity-canvas {
  display: block;
  background: #000;
}

#unity-loading-bar {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  z-index: 10;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-progress {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.loading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary-color), #8b5cf6, var(--success-color));
  border-radius: 2px;
  transition: width 0.3s ease;
}

.loading-text {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

#unity-warning {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--warning-color);
  border-radius: 8px;
  color: var(--warning-color);
  font-size: 13px;
  z-index: 20;
  display: none;
}

@media (max-width: 768px) {
  .header {
    padding: 12px 16px;
  }

  .header-title {
    font-size: 16px;
  }

  .fullscreen-btn {
    right: 16px;
    width: 36px;
    height: 36px;
  }

  .particle {
    width: 2px;
    height: 2px;
  }
}
