/* style.css */

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

body {
  background: radial-gradient(circle at 20% 30%, #0a0f1a, #030507);
  min-height: 100vh;
  font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
}

#app {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

canvas#game {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
}

/* HUD */
.hud {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  z-index: 10;
}

.brand {
  background: rgba(5, 15, 20, 0.7);
  backdrop-filter: blur(8px);
  padding: 8px 18px;
  border-radius: 40px;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 2px;
  color: #5cf0c8;
  text-shadow: 0 0 8px rgba(92, 240, 200, 0.4);
  border: 1px solid rgba(92, 240, 200, 0.3);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(5, 15, 20, 0.65);
  backdrop-filter: blur(8px);
  padding: 6px 16px;
  border-radius: 40px;
  border: 1px solid rgba(92, 240, 200, 0.2);
}

.stats span {
  font-size: 0.8rem;
  color: #a0ccd9;
}

.stats strong {
  font-size: 1.1rem;
  font-weight: 700;
  margin-left: 6px;
  color: #5cf0c8;
}

/* Size selector - positioned below HUD */
.size-selector {
  position: absolute;
  top: 80px;
  left: 16px;
  background: rgba(5, 15, 20, 0.8);
  backdrop-filter: blur(12px);
  padding: 8px 16px;
  border-radius: 40px;
  border: 1px solid rgba(92, 240, 200, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
  pointer-events: auto;
  font-size: 0.8rem;
}

.size-selector label {
  color: #a0ccd9;
}

.size-selector select {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #5cf0c8;
  color: #5cf0c8;
  padding: 6px 10px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.8rem;
  outline: none;
}

.size-selector select option {
  background: #0a0f1a;
  color: #5cf0c8;
}

#reset-size {
  background: rgba(92, 240, 200, 0.2);
  border: 1px solid #5cf0c8;
  color: #5cf0c8;
  padding: 6px 14px;
  border-radius: 24px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
}

#reset-size:hover {
  background: #5cf0c8;
  color: #0a0f1a;
}

/* Piece dock */
.piece-dock {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10;
  pointer-events: auto;
}

.piece-card {
  background: rgba(5, 15, 20, 0.8);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 12px;
  border: 1px solid rgba(92, 240, 200, 0.3);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.piece-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #5cf0c8;
  margin-bottom: 8px;
  text-align: center;
}

.piece-slot canvas {
  width: 80px;
  height: 80px;
  display: block;
  background: rgba(0,0,0,0.3);
  border-radius: 12px;
}

.camera-card {
  background: rgba(5, 15, 20, 0.8);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 12px;
  border: 1px solid rgba(92, 240, 200, 0.3);
}

.camera-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.orbit-ball {
  width: 48px;
  height: 48px;
  background: rgba(30, 50, 60, 0.8);
  border-radius: 50%;
  border: 2px solid #5cf0c8;
  position: relative;
  cursor: grab;
  transition: transform 0.1s;
}

.orbit-ball:active {
  cursor: grabbing;
}

#orbit-knob {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #5cf0c8;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px #5cf0c8;
  pointer-events: none;
}

#view-reset {
  background: rgba(92, 240, 200, 0.2);
  border: 1px solid #5cf0c8;
  color: #5cf0c8;
  padding: 6px 12px;
  border-radius: 24px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
}

#view-reset:hover {
  background: #5cf0c8;
  color: #0a0f1a;
}

/* Panel commandes */
.panel {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(5, 15, 20, 0.85);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 12px;
  border: 1px solid rgba(92, 240, 200, 0.3);
  z-index: 10;
  pointer-events: auto;
  max-width: 280px;
}

.panel h1 {
  font-size: 0.85rem;
  color: #5cf0c8;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.keys {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  font-size: 0.7rem;
}

.keys span {
  color: #a0ccd9;
}

.keys b {
  color: #5cf0c8;
  font-weight: 500;
}

/* Banner */
.banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(16px);
  padding: 20px 32px;
  border-radius: 32px;
  text-align: center;
  z-index: 100;
  border: 2px solid #5cf0c8;
  box-shadow: 0 0 40px rgba(92, 240, 200, 0.3);
  pointer-events: auto;
}

.banner strong {
  display: block;
  font-size: 1.6rem;
  color: #ff4f6d;
  margin-bottom: 8px;
}

.banner span {
  color: #fff;
  font-size: 0.9rem;
}

.is-hidden {
  display: none;
}

/* Responsive */
@media (max-width: 900px) {
  .brand { font-size: 1rem; padding: 6px 14px; }
  .stats span { font-size: 0.7rem; }
  .stats strong { font-size: 0.95rem; }
  .size-selector { top: 72px; padding: 6px 12px; font-size: 0.7rem; }
  .piece-slot canvas { width: 60px; height: 60px; }
  .panel { max-width: 240px; }
}

@media (max-width: 640px) {
  .hud { flex-direction: column; align-items: flex-start; gap: 8px; top: 8px; left: 8px; right: 8px; }
  .brand { font-size: 0.85rem; padding: 4px 12px; }
  .stats { gap: 8px; padding: 4px 12px; }
  .stats span { font-size: 0.6rem; }
  .stats strong { font-size: 0.85rem; }
  .size-selector { top: 100px; left: 8px; padding: 5px 10px; font-size: 0.6rem; }
  .piece-dock { bottom: 8px; right: 8px; gap: 8px; }
  .piece-card { padding: 8px; }
  .piece-slot canvas { width: 48px; height: 48px; }
  .panel { max-width: 200px; padding: 8px; }
  .keys { font-size: 0.55rem; gap: 3px 6px; }
}