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

body {
  background: linear-gradient(135deg, #0a0012 0%, #1a0030 50%, #0d001a 100%);
  color: #fff;
  font-family: 'Courier New', monospace;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

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

#smokeCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Lobby */
#lobby {
  position: relative;
  z-index: 10;
  text-align: center;
  padding-top: 15vh;
}

#lobby h1 {
  font-size: 4rem;
  color: #00ff88;
  text-shadow: 0 0 20px #00ff88, 0 0 40px #00ff8855;
  letter-spacing: 0.2em;
}

.subtitle {
  color: #ff69b4;
  font-size: 1.1rem;
  margin: 0.5rem 0 2rem;
}

button {
  background: linear-gradient(135deg, #00ff88, #00cc66);
  color: #000;
  border: none;
  padding: 12px 28px;
  font-size: 1.1rem;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  margin: 6px;
  text-transform: uppercase;
}

button:active {
  transform: scale(0.95);
}

#input-code {
  background: #1a0030;
  border: 2px solid #00ff88;
  color: #00ff88;
  padding: 10px 14px;
  font-size: 1.2rem;
  font-family: 'Courier New', monospace;
  text-align: center;
  text-transform: uppercase;
  border-radius: 8px;
  width: 140px;
}

#room-info {
  margin-top: 2rem;
}

#room-code {
  color: #00ff88;
  font-size: 2rem;
  font-weight: bold;
  letter-spacing: 0.15em;
}

#room-status {
  color: #ff69b4;
  margin: 0.5rem 0;
}

/* HUD */
#hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.7);
  font-size: 1.2rem;
}

#hud-p1 { color: #00ff88; }
#hud-p2 { color: #ff8800; }
#hud-timer {
  color: #fff;
  font-size: 1.5rem;
  font-weight: bold;
}

/* Canvas */
#gameCanvas {
  position: relative;
  z-index: 5;
  margin-top: 44px;
}

/* D-pad */
#dpad {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: 160px;
  height: 160px;
  display: grid;
  grid-template-areas:
    ". up ."
    "left . right"
    ". down .";
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  gap: 4px;
}

.dpad-btn {
  background: rgba(0, 255, 136, 0.25);
  border: 2px solid #00ff8866;
  color: #00ff88;
  font-size: 1.8rem;
  border-radius: 12px;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  min-height: 50px;
}

.dpad-btn:active {
  background: rgba(0, 255, 136, 0.5);
}

.dpad-up { grid-area: up; }
.dpad-left { grid-area: left; }
.dpad-right { grid-area: right; }
.dpad-down { grid-area: down; }

/* Game Over */
#game-over {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  text-align: center;
  background: rgba(10, 0, 20, 0.95);
  padding: 2rem 3rem;
  border-radius: 16px;
  border: 2px solid #00ff88;
}

#game-over h2 {
  font-size: 2rem;
  color: #00ff88;
  margin-bottom: 1rem;
}

#game-over p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}
