/* ============================================
   MapleClaw - Overlay CSS
   Mobile-friendly input overlays for canvas game
   ============================================ */

/* --- Container --- */
.overlay-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
  font-family: monospace;
  display: none; /* Hidden by default - only shown when overlays are active */
}

.overlay-container.show-login,
.overlay-container.show-chat {
  display: flex;
}

/* --- Login Panel --- */
.overlay-login {
  pointer-events: auto;
  background: #0a0a1a;
  border: 2px solid #ffcc33;
  padding: 20px 30px;
  max-width: 320px;
  width: 90%;
  box-sizing: border-box;
}

/* When login/char panels are visible, center them */
.overlay-container.show-login {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* When chat input is visible, position at bottom */
.overlay-container.show-chat {
  display: block;
}

/* --- Form Fields --- */
.overlay-field {
  margin-bottom: 12px;
}

.overlay-field label {
  display: block;
  color: #888;
  font-size: 11px;
  font-family: monospace;
  margin-bottom: 4px;
}

/* --- Text Inputs --- */
.overlay-input {
  width: 100%;
  background: #111122;
  border: 1px solid #333355;
  color: #fff;
  font: 12px monospace;
  padding: 8px 10px;
  box-sizing: border-box;
}

.overlay-input:focus {
  border-color: #ffcc33;
  outline: none;
}

/* --- Buttons --- */
.overlay-btn {
  display: block;
  width: 100%;
  background: #1a1a3a;
  border: 2px solid #ffcc33;
  color: #ffcc33;
  font: bold 13px monospace;
  padding: 10px;
  cursor: pointer;
  text-transform: uppercase;
  margin-top: 10px;
  box-sizing: border-box;
}

.overlay-btn:hover {
  background: #2a2a4a;
}

.overlay-btn-active {
  background: #ffcc33;
  color: #0a0a1a;
}

.overlay-btn-secondary {
  border-color: #444;
  color: #888;
}

/* --- Tabs --- */
.overlay-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
}

.overlay-tab {
  flex: 1;
  padding: 8px;
  text-align: center;
  font: bold 12px monospace;
  cursor: pointer;
  border-bottom: 2px solid #333;
  color: #666;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.overlay-tab.active {
  color: #ffcc33;
  border-bottom-color: #ffcc33;
}

/* --- Chat Input Bar --- */
.overlay-chat-input {
  pointer-events: auto;
  position: absolute;
  bottom: 10%;
  left: 5%;
  right: 5%;
  display: flex;
  gap: 8px;
}

.overlay-chat-input .overlay-input {
  flex: 1;
}

.overlay-chat-input .overlay-btn {
  width: auto;
  padding: 8px 16px;
  margin-top: 0;
}

/* --- Messages --- */
.overlay-error {
  color: #ff4444;
  font-size: 10px;
  margin-top: 4px;
  text-align: center;
  font-family: monospace;
}

.overlay-hint {
  color: #444;
  font-size: 9px;
  text-align: right;
  margin-top: 2px;
  font-family: monospace;
}

/* --- Mobile --- */
@media (max-width: 768px), (pointer: coarse) {
  .overlay-input {
    font-size: 16px;
    padding: 12px;
  }

  .overlay-btn {
    padding: 14px;
    font-size: 15px;
  }

  .overlay-login {
    padding: 16px 20px;
  }
}

/* --- Landscape Lock Prompt --- */
.rotate-prompt {
  position: fixed;
  inset: 0;
  background: #0a0a1a;
  color: #fff;
  display: none;
  z-index: 1000;
  font-family: monospace;
  text-align: center;
}

.rotate-prompt .rotate-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.rotate-prompt .rotate-text {
  font-size: 14px;
  color: #888;
  max-width: 260px;
}

@media (orientation: portrait) and (max-width: 768px) {
  .rotate-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
  }
}

/* --- Character Select/Create panels on mobile --- */
@media (max-width: 768px), (pointer: coarse) {
  .overlay-login {
    max-width: 360px;
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .overlay-chat-input {
    bottom: 5%;
    left: 2%;
    right: 2%;
  }

  .overlay-chat-input .overlay-btn {
    padding: 12px 20px;
    min-width: 60px;
    min-height: 44px;
  }
}
