/* Hotline Miami Co-op - 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: 22px;
  font-weight: bold;
  color: #ff3366;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
}

#lobby-subtitle {
  font-size: 11px;
  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;
}

.controls-hint {
  font-size: 10px;
  color: #506070;
  line-height: 1.6;
}

.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: #4a1030;
  border-color: #ff3366;
  color: #ff6699;
}
button.btn-primary:hover { background: #5a1540; }

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;
  margin-left: 4px;
}

#lobby-status-text {
  font-size: 11px;
  color: #708090;
  text-align: center;
}

#lobby-error {
  font-size: 11px;
  color: #ff4444;
  text-align: center;
  min-height: 14px;
}

#lobby-room-code {
  font-size: 24px;
  font-weight: bold;
  color: #ff3366;
  text-align: center;
  letter-spacing: 6px;
  padding: 8px;
  background: #1a1020;
  border-radius: 4px;
}

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

#game-wrapper.visible { display: flex; align-items: center; justify-content: center; }

#game-canvas {
  background: #0d1a0d;
  display: block;
}

/* Countdown */
#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: #ff3366;
  text-shadow: 0 0 40px #ff336688, 0 0 80px #ff336644;
  display: none;
  animation: countPop 0.4s ease-out;
}

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

/* Network warning */
#net-warning {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: #ff440088;
  color: #fff;
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  display: none;
}
#net-warning.visible { display: block; }

/* HUD */
#hud {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  pointer-events: none;
}

#hud-top {
  display: flex;
  gap: 20px;
  font-size: 14px;
  font-weight: bold;
  color: #e8eaf0;
}

#room-info {
  color: #ff3366;
}

#kills-display {
  color: #ffcc44;
}

#enemies-display {
  color: #ff6644;
}

#player-hud {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: flex;
  gap: 20px;
}

.player-hud-block {
  background: #00000088;
  padding: 8px 12px;
  border-radius: 4px;
  border-left: 3px solid;
}

.player-hud-block.p1 { border-color: #00bfff; }
.player-hud-block.p2 { border-color: #ffaa22; }
.player-hud-block.p3 { border-color: #66dd66; }
.player-hud-block.p4 { border-color: #dd66dd; }

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

.hud-hp-bar {
  width: 100px;
  height: 8px;
  background: #333;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.hud-hp-fill {
  height: 100%;
  transition: width 0.1s;
}

.hud-weapon {
  font-size: 10px;
  color: #aaa;
}

.hud-ammo {
  font-size: 10px;
  color: #ffcc44;
}

/* Alert indicator */
#alert-indicator {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  background: #ff000088;
  color: #fff;
  padding: 8px 24px;
  font-size: 18px;
  font-weight: bold;
  border-radius: 4px;
  display: none;
  animation: alertPulse 0.5s infinite;
}
#alert-indicator.active { display: block; }

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

/* Disconnected overlay */
#disconnected-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000000dd;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
#disconnected-overlay.visible { display: flex; }

#dc-title {
  font-size: 28px;
  color: #ff4444;
}

#dc-message {
  font-size: 14px;
  color: #888;
}

/* Round over overlay */
#round-over-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000000dd;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
#round-over-overlay.visible { display: flex; }

#round-over-title {
  font-size: 48px;
  font-weight: bold;
}
#round-over-title.victory { color: #00ff88; }
#round-over-title.defeat { color: #ff4444; }

#round-over-stats {
  font-size: 14px;
  color: #aaa;
  text-align: center;
  line-height: 1.8;
}

.round-over-btns {
  display: flex;
  gap: 12px;
}

/* Mute button */
#mute-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 11px;
  padding: 6px 10px;
}
