* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #0b1220;
  color: #f0f0f0;
  font-family: 'Courier New', monospace;
  overflow: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}

#wrap {
  position: relative;
  max-width: 100%;
}

canvas#game {
  display: block;
  max-width: 100vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  background: #000;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
  border: 2px solid #2a3a5a;
  border-radius: 4px;
  image-rendering: -webkit-optimize-contrast;
  cursor: pointer;
}

h1 {
  font-size: 14px;
  letter-spacing: 2px;
  opacity: 0.6;
  margin: 0;
  text-transform: uppercase;
}

.hidden {
  display: none !important;
}

/* ---- Versus multiplayer HUD (below the canvas) ---- */

#mpHud {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(20, 26, 46, 0.9);
  border: 1px solid #2a3a5a;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 12px;
  max-width: 100%;
}

#mpAtkGold {
  color: #ffd166;
  white-space: nowrap;
}

#mpSendRow {
  display: flex;
  gap: 6px;
}

.mpSendBtn {
  font-family: inherit;
  font-size: 10px;
  line-height: 1.4;
  color: #f0f0f0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 5px;
  padding: 4px 8px;
  cursor: pointer;
}

.mpSendBtn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
}

.mpSendBtn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.mpSendBtn small {
  color: #ffd166;
}

#mpOpponentPanel {
  color: #b3c6ff;
  white-space: nowrap;
  margin-left: auto;
}

/* ---- Versus lobby modal ---- */

#mpPanel {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
}

#mpBox {
  background: #141a2e;
  border: 2px solid #2a3a5a;
  border-radius: 8px;
  padding: 24px 28px;
  width: 320px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#mpBox h2 {
  margin: 0 0 4px;
  font-size: 15px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #8aff8a;
}

#mpBox label {
  font-size: 11px;
  opacity: 0.7;
}

#mpBox input {
  font-family: inherit;
  font-size: 13px;
  background: #0b1220;
  border: 1px solid #2a3a5a;
  color: #f0f0f0;
  border-radius: 4px;
  padding: 6px 8px;
  width: 100%;
}

#mpBox button {
  font-family: inherit;
  font-size: 13px;
  color: #f0f0f0;
  background: #2a4a2a;
  border: 1px solid #3a6a3a;
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
}

#mpBox button:hover:not(:disabled) {
  background: #3a6a3a;
}

#mpBox button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#mpBackBtn {
  background: rgba(255, 85, 102, 0.15) !important;
  border-color: rgba(255, 85, 102, 0.5) !important;
}

#mpBackBtn:hover {
  background: rgba(255, 85, 102, 0.3) !important;
}

#mpStep1, #mpStep2, #mpStep3 {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#mpJoinRow {
  display: flex;
  gap: 6px;
}

#mpJoinRow input {
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
}

#mpRoomCodeDisplay {
  font-size: 22px;
  letter-spacing: 4px;
  text-align: center;
  color: #ffd166;
}

#mpStatusText {
  font-size: 12px;
  text-align: center;
  opacity: 0.8;
}

#mpError {
  font-size: 11px;
  color: #ff5566;
  min-height: 14px;
  text-align: center;
}
