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

body {
  background: #111;
  color: #eee;
  font-family: 'Courier New', monospace;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  user-select: none;
}

.screen {
  display: none;
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0; left: 0;
}
.screen.active { display: flex; }

/* ── MENU ── */
#menu-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  background: #111;
}
#menu-screen h1 {
  font-size: 54px;
  letter-spacing: 14px;
  color: #e94560;
}
#menu-screen .subtitle {
  color: #555;
  letter-spacing: 5px;
  font-size: 13px;
}
.score-banner {
  display: flex;
  gap: 32px;
  font-size: 20px;
  color: #aaa;
}
.score-banner .dim { color: #444; }
.gun-grid {
  display: grid;
  grid-template-columns: repeat(4, 176px);
  gap: 14px;
}
.gun-card {
  background: #181818;
  border: 1px solid #2a2a2a;
  padding: 22px 14px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.gun-card:hover { border-color: #e94560; background: #1e1010; }
.gun-card .gun-name { font-size: 16px; letter-spacing: 4px; margin-bottom: 10px; color: #fff; }
.gun-card .gun-stat { font-size: 11px; color: #555; line-height: 2; }
.sway-row { display: flex; gap: 4px; justify-content: center; margin-top: 10px; }
.sway-pip { width: 9px; height: 9px; border-radius: 50%; background: #2a2a2a; }
.sway-pip.on { background: #e94560; }
.sway-label { font-size: 9px; color: #444; letter-spacing: 2px; margin-top: 4px; }

/* ── ASSEMBLY ── */
#assembly-screen { flex-direction: column; background: #111; }

#hud {
  display: flex;
  align-items: center;
  padding: 0 20px;
  background: #0a0a0a;
  height: 50px;
  gap: 18px;
  flex-shrink: 0;
  z-index: 20;
  border-bottom: 1px solid #1a1a1a;
}
#score-hud { font-size: 13px; color: #666; white-space: nowrap; }
#countdown-wrap { flex: 1; display: flex; align-items: center; gap: 10px; }
#countdown-track {
  flex: 1;
  height: 6px;
  background: #1e1e1e;
  border-radius: 3px;
  overflow: hidden;
}
#countdown-fill {
  height: 100%;
  background: #e94560;
  border-radius: 3px;
  transition: width 0.1s linear, background 0.4s;
}
#countdown-text { font-size: 20px; color: #fff; min-width: 28px; text-align: right; }
#gun-label { font-size: 12px; color: #444; letter-spacing: 3px; white-space: nowrap; }

#parts-field { flex: 1; position: relative; overflow: hidden; }

.part {
  position: absolute;
  display: block;
  cursor: grab;
  border-radius: 3px;
  z-index: 15;
  transition: box-shadow 0.1s;
}
.part:hover { box-shadow: 0 0 14px rgba(200,50,72,0.55); }
.part.dragging { cursor: grabbing; z-index: 100; box-shadow: 0 6px 24px rgba(0,0,0,0.7); opacity: 0.92; }
.part.placed { display: none; }

#guide-area {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  z-index: 10;
}
#guide-label { font-size: 9px; letter-spacing: 4px; color: #333; }
#guide-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  background: #0d0d0d;
  border: 1px solid #1e1e1e;
  padding: 12px;
  max-width: 720px;
}
.guide-slot {
  display: block;
  border: 1px dashed #2a2a2a;
  border-radius: 3px;
  transition: border-color 0.15s;
}
.guide-slot.filled {
  border-color: #c83248;
  border-style: solid;
}
.guide-slot.snap-target {
  border-color: #f5c400;
  border-style: solid;
  outline: 2px solid rgba(245,196,0,0.3);
  box-shadow: 0 0 10px rgba(245,196,0,0.15);
}

#bot-panel {
  position: absolute;
  top: 12px;
  right: 18px;
  background: #0d0d0d;
  border: 1px solid #1e1e1e;
  padding: 10px 14px;
  min-width: 110px;
}
#bot-panel-label { font-size: 9px; color: #444; letter-spacing: 2px; margin-bottom: 8px; }
#bot-pips { display: flex; flex-wrap: wrap; gap: 5px; max-width: 100px; }
.bot-pip {
  width: 11px;
  height: 11px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 2px;
  transition: background 0.2s, border-color 0.2s;
}
.bot-pip.done { background: #c83248; border-color: #c83248; }

/* ── SHOOTING ── */
#shooting-screen { position: relative; background: #111; }
#shooting-canvas { position: absolute; top: 0; left: 0; cursor: none; }

/* ── LOBBY SCREENS ── */
#connecting-screen, #waiting-screen, #room-full-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: #111;
}
.lobby-status {
  font-size: 22px;
  letter-spacing: 8px;
  color: #666;
}
.lobby-sub {
  font-size: 11px;
  color: #333;
  letter-spacing: 3px;
}
.lobby-url {
  font-size: 13px;
  color: #e94560;
  letter-spacing: 2px;
  cursor: text;
  user-select: all;
  padding: 10px 18px;
  border: 1px solid #2a2a2a;
  max-width: 90vw;
  word-break: break-all;
  text-align: center;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
.dots { animation: blink 1.2s step-start infinite; }

/* ── OVERLAYS ── */
#round-end-screen, #game-end-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: rgba(8,8,8,0.97);
}
#round-result-text { font-size: 38px; letter-spacing: 6px; }
#round-score-text  { font-size: 54px; letter-spacing: 10px; }
#round-next-text   { font-size: 12px; color: #444; letter-spacing: 4px; }

#game-result-text { font-size: 40px; letter-spacing: 7px; }
#final-score-text { font-size: 58px; letter-spacing: 10px; }

.btn {
  background: #e94560;
  color: #fff;
  border: none;
  padding: 13px 42px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  letter-spacing: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover { background: #ff6070; }
