/* Aethelgaard MUD — Mobile & Touch Interface Styles */

/* Hide mobile nav bar on desktop */
.mobile-nav-bar {
  display: none;
}

/* Touch controls on terminal */
.touch-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
  background: rgba(10, 12, 16, 0.95);
  border-top: 1px solid var(--borderGothic);
  border-bottom: 1px solid var(--borderGothic);
  gap: 0.5rem;
}

/* D-Pad Compass */
.dpad-container {
  display: grid;
  grid-template-columns: repeat(3, 36px);
  grid-template-rows: repeat(3, 36px);
  gap: 3px;
  width: 114px;
  height: 114px;
  flex-shrink: 0;
}

.dpad-btn {
  background: rgba(20, 25, 35, 0.9);
  border: 1px solid var(--borderGothic);
  color: var(--accentGold);
  font-family: var(--fontHeading);
  font-size: 0.85rem;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  user-select: none;
  transition: all 0.15s ease;
}

.dpad-btn:active {
  background: var(--accentGold);
  color: #000;
  transform: scale(0.95);
}

.dpad-n { grid-column: 2; grid-row: 1; }
.dpad-w { grid-column: 1; grid-row: 2; }
.dpad-e { grid-column: 3; grid-row: 2; }
.dpad-s { grid-column: 2; grid-row: 3; }
.dpad-u { grid-column: 1; grid-row: 1; background: rgba(30, 40, 55, 0.9); color: var(--accentAurora); }
.dpad-d { grid-column: 3; grid-row: 3; background: rgba(30, 40, 55, 0.9); color: var(--accentAurora); }

/* Quick Action Buttons */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  flex: 1;
}

.action-btn {
  background: rgba(25, 30, 40, 0.85);
  border: 1px solid var(--borderGothic);
  color: var(--textPrimary);
  font-family: var(--fontHeading);
  font-size: 0.8rem;
  padding: 0.5rem 0.2rem;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  touch-action: manipulation;
  user-select: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.action-btn:active {
  background: var(--accentCrimson);
  color: #fff;
  transform: scale(0.95);
}

.action-danger {
  border-color: var(--accentCrimson);
  color: #ff8888;
}

.btn-send-cmd {
  display: none;
  background: var(--accentGold);
  color: #000;
  border: none;
  font-family: var(--fontHeading);
  font-weight: bold;
  padding: 0 1rem;
  height: 38px;
  border-radius: 4px;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════ */
/* MOBILE RESPONSIVE MEDIA QUERIES (max-width: 768px) */
/* ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  #view-game {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
  }

  .mobile-nav-bar {
    display: flex;
    height: 48px;
    background: rgba(10, 12, 16, 0.98);
    border-bottom: 2px solid var(--borderGothic);
    flex-shrink: 0;
    z-index: 100;
  }

  .mobile-nav-btn {
    flex: 1;
    background: none;
    border: none;
    border-right: 1px solid var(--borderGothic);
    color: var(--textMuted);
    font-family: var(--fontHeading);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
    transition: all 0.2s ease;
  }

  .mobile-nav-btn:last-child {
    border-right: none;
  }

  .mobile-nav-btn.active {
    color: var(--accentGold);
    background: rgba(212, 175, 55, 0.12);
    border-bottom: 3px solid var(--accentGold);
  }

  .game-grid {
    display: block;
    flex: 1;
    height: calc(100vh - 48px);
    position: relative;
    width: 100vw;
    background: var(--bgPrimary);
    overflow: hidden;
  }

  .panel {
    display: none !important;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background: var(--bgPanel);
    z-index: 10;
  }

  .panel.mobile-active {
    display: flex !important;
  }

  .panel-terminal {
    flex-direction: column;
  }

  .terminal-output {
    flex: 1;
    font-size: 0.9rem;
    padding: 0.75rem;
  }

  .input-row {
    padding: 0.5rem;
    background: #000;
    border-top: 1px solid var(--borderGothic);
    position: sticky;
    bottom: 0;
    z-index: 50;
  }

  .cmd-input {
    font-size: 16px !important;
    height: 40px;
  }

  .btn-send-cmd {
    display: block;
    margin-left: 0.5rem;
  }

  .panel-right {
    padding-bottom: 2rem;
  }

  .map-canvas {
    width: 100% !important;
    max-width: 320px;
    height: auto !important;
    margin: 0 auto;
  }

  #view-login {
    padding: 1rem;
  }

  .login-container {
    max-width: 100%;
  }

  .world-title {
    font-size: 2.2rem;
  }

  .game-logo-img {
    max-width: 180px;
  }

  #view-charcreate {
    padding: 0.5rem;
  }

  .charcreate-container {
    padding: 1.25rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .traits-grid, .branches-grid {
    grid-template-columns: 1fr;
  }
}
