/* Hotline Miami Multiplayer - styles.css */

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

html, body {
  width: 100%;
  height: 100%;
  background: #0a0c0e;
  color: #e8eaf0;
  font-family: 'Courier New', Courier, monospace;
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: relative;
}

/* Lobby screen */
#lobby-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 520px;
  max-width: 98vw;
  padding: 24px;
  background: #111418;
  border: 1px solid #2a3040;
  border-radius: 8px;
}

#lobby-screen.hidden { display: none; }

#lobby-title {
  font-size: 28px;
  font-weight: bold;
  color: #ff3366;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-align: center;
  text-shadow: 0 0 20px #ff336688;
}

#lobby-subtitle {
  font-size: 12px;
  color: #607080;
  text-align: center;
  letter-spacing: 1px;
}

#connection-status {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 4px;
  background: #1a2030;
  border: 1px solid #2a3040;
}
#connection-status.connected { color: #00ff88; border-color: #00ff88; }
#connection-status.connecting { color: #ffcc00; border-color: #ffcc00; }
#connection-status.disconnected { color: #ff4444; border-color: #ff4444; }

#server-url-display {
  font-size: 10px;
  color: #405060;
  text-align: center;
}

.lobby-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lobby-section-title {
  font-size: 10px;
  color: #607080;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid #1e2838;
  padding-bottom: 4px;
}

.btn-row {
  display: flex;
  gap: 8px;
}

button {
  background: #1a2a3a;
  color: #c8d8e8;
  border: 1px solid #2a4060;
  border-radius: 4px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
  text-transform: uppercase;
  letter-spacing: 1px;
}
button:hover { background: #253545; border-color: #4080c0; }
button:active { background: #162030; }
button:disabled { opacity: 0.4; cursor: not-allowed; }

button.btn-primary {
  background: #4a0020;
  border-color: #ff3366;
  color: #ff6688;
}
button.btn-primary:hover { background: #600030; }

button.btn-ready {
  flex: 1;
  padding: 12px;
  font-size: 14px;
  background: #0a3020;
  border-color: #00aa44;
  color: #00ff88;
}
button.btn-ready:hover { background: #0a4028; border-color: #00dd66; }
button.btn-ready.is-ready {
  background: #1a4010;
  border-color: #88ff44;
  color: #aaffaa;
}

input[type="text"] {
  background: #0e1620;
  border: 1px solid #2a4060;
  border-radius: 4px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  color: #c8d8e8;
  flex: 1;
}
input[type="text"]:focus {
  outline: none;
  border-color: #ff3366;
}
input[type="text"]::placeholder { color: #405060; }

/* Player slots */
.player-slots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.player-slot {
  padding: 10px;
  background: #0c1420;
  border: 1px solid #1e2838;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.player-slot.connected { border-color: #2a5070; }
.player-slot.p1-color { border-left: 3px solid #00bfff; }
.player-slot.p2-color { border-left: 3px solid #ffaa22; }
.player-slot.p3-color { border-left: 3px solid #66dd66; }
.player-slot.p4-color { border-left: 3px solid #dd66dd; }

.slot-label {
  font-size: 11px;
  color: #607080;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.slot-name { font-size: 13px; font-weight: bold; }
.slot-name.p1 { color: #00bfff; }
.slot-name.p2 { color: #ffaa22; }
.slot-name.p3 { color: #66dd66; }
.slot-name.p4 { color: #dd66dd; }
.slot-status { font-size: 10px; color: #607080; }
.slot-ping { font-size: 10px; color: #4080a0; }
.slot-host-badge {
  font-size: 9px;
  color: #00ff88;
  border: 1px solid #00ff88;
  border-radius: 3px;
  padding: 1px 5px;
  display: inline-block;
  width: fit-content;
}
.slot-ready-badge {
  font-size: 9px;
  color: #88ff44;
  border: 1px solid #88ff44;
  border-radius: 3px;
  padding: 1px 5px;
  display: inline-block;
  width: fit-content;
}

#lobby-status-text {
  font-size: 12px;
  color: #88aacc;
  text-align: center;
  min-height: 18px;
}

#lobby-error {
  font-size: 12px;
  color: #ff6644;
  text-align: center;
  min-height: 18px;
}

#lobby-room-code {
  font-size: 24px;
  font-weight: bold;
  color: #ff3366;
  letter-spacing: 6px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Game canvas wrapper */
#game-wrapper {
  position: relative;
  display: none;
  width: 100%;
  height: 100%;
}
#game-wrapper.visible { display: block; }

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #111;
}

/* Countdown overlay */
#countdown-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#countdown-number {
  font-size: 120px;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 0 0 20px #ff3366, 0 0 60px #ff336680;
  display: none;
  animation: countPop 0.4s ease-out;
}

@keyframes countPop {
  0%   { transform: scale(1.5); opacity: 0; }
  60%  { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1);   opacity: 1; }
}

/* Network warning */
#net-warning {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: #aa0000cc;
  border: 1px solid #ff4444;
  color: #ff8888;
  padding: 4px 16px;
  font-size: 12px;
  border-radius: 4px;
  display: none;
  pointer-events: none;
  z-index: 100;
}
#net-warning.visible { display: block; }

/* HUD */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 50;
}

#hud-left, #hud-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

#kill-counter, #enemy-counter {
  font-size: 16px;
  font-weight: bold;
  color: #ffcc44;
  text-shadow: 0 0 8px #00000088;
}

.player-hud {
  background: #00000088;
  border-radius: 4px;
  padding: 8px 12px;
  min-width: 140px;
}

.player-hud-name {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 4px;
}

.player-hud-hp {
  height: 8px;
  background: #333;
  border-radius: 2px;
  margin-bottom: 4px;
}

.player-hud-hp-fill {
  height: 100%;
  background: #ff4444;
  border-radius: 2px;
  transition: width 0.1s;
}

.player-hud-ammo {
  font-size: 11px;
  color: #88aacc;
}

.player-hud-status {
  font-size: 10px;
  color: #ff6644;
}

/* Alert indicator */
#alert-indicator {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 24px;
  font-weight: bold;
  color: #ff0000;
  text-shadow: 0 0 10px #ff0000;
  display: none;
  animation: alertPulse 0.5s infinite;
  z-index: 60;
}
#alert-indicator.active { display: block; }

@keyframes alertPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Mute button */
#mute-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: #1a2030cc;
  border: 1px solid #2a4060;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  color: #607080;
  cursor: pointer;
  z-index: 100;
}
#mute-btn:hover { color: #c8d8e8; border-color: #4080c0; }

/* Disconnected overlay */
#disconnected-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000000cc;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  z-index: 300;
}
#disconnected-overlay.visible { display: flex; }
#disconnected-overlay h2 { color: #ff4444; font-size: 24px; }
#disconnected-overlay p { color: #8898a8; font-size: 14px; text-align: center; }

/* Round-over overlay */
#round-over-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #0a1420ee;
  border: 2px solid #2a4060;
  border-radius: 8px;
  padding: 28px 40px;
  text-align: center;
  display: none;
  flex-direction: column;
  gap: 14px;
  z-index: 250;
  min-width: 320px;
}
#round-over-overlay.visible { display: flex; }
#round-over-title { font-size: 40px; font-weight: bold; letter-spacing: 3px; }
#round-over-title.victory { color: #00ff88; text-shadow: 0 0 20px #00ff88; }
#round-over-title.defeat  { color: #ff4444; text-shadow: 0 0 20px #ff4444; }
#round-over-stats { font-size: 15px; color: #8898a8; line-height: 2; }
.round-over-btns { display: flex; gap: 10px; justify-content: center; margin-top: 6px; }
