* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #0a0a1a;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #fff;
  overflow: hidden;
}

.game-wrapper {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.side-panel {
  width: 160px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel-box {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.panel-box h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 8px;
}

.panel-box .value {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}

#next-canvas {
  display: block;
  margin: 8px auto 0;
}

.board-container {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(100, 100, 255, 0.15), 0 0 120px rgba(100, 100, 255, 0.05);
  border: 2px solid rgba(255,255,255,0.1);
}

#game-canvas {
  display: block;
  background: #0f0f2a;
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  backdrop-filter: blur(4px);
  z-index: 10;
}

.overlay.hidden { display: none; }

.overlay h1 {
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.overlay p {
  color: rgba(255,255,255,0.5);
  font-size: 14px;
}

.btn {
  padding: 12px 32px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.controls-info {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  line-height: 1.8;
}

.controls-info kbd {
  background: rgba(255,255,255,0.1);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 11px;
}

.particle {
  position: absolute;
  pointer-events: none;
  border-radius: 2px;
  animation: particleFade 0.6s ease-out forwards;
}

@keyframes particleFade {
  0% { opacity: 1; transform: translate(0,0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0); }
}