/* Vollbild, responsiv */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  /* Sternenhintergrund */
  background: #000 url("assets/space_bg.jpg?v=3") center center / cover no-repeat fixed;
  color: #eaeaea;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Canvas-Container füllt den Screen */
#mars-container {
  position: absolute;
  inset: 0;
}

/* Überschrift nur klein oben */
h1 {
  position: absolute;
  top: 8px;
  right: 12px;
  margin: 0;
  font-size: 14px;
  opacity: .7;
  z-index: 20;
}

/* Canvas-Container füllt den Screen */
#mars-container {
  position: absolute;
  inset: 0;
}

/* Info unten als Overlay */
#parcel-info {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 15;
  background: rgba(0,0,0,.55);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  max-width: min(420px, 80vw);
  line-height: 1.4;
}

/* Lade-/Fehlerstatus oben links */
#status {
  position: absolute;
  top: 8px;
  left: 12px;
  z-index: 20;
  background: rgba(0,0,0,.55);
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  max-width: 60vw;
  line-height: 1.4;
  pointer-events: none;
  white-space: pre-line;
}


/* === Input Portal (prevents page zoom/shift when keyboard opens) === */
#input-portal {
  position: fixed;
  left: 0; right: 0;
  bottom: env(safe-area-inset-bottom);
  z-index: 9999;
  display: none;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
}
#input-portal.show { display: block; }
#input-portal .input-portal-inner {
  max-width: 720px;
  margin: 0 auto;
}
#ownerName-portal {
  width: 100%;
  font-size: 18px;
  line-height: 1.2;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid rgba(126,76,255,0.6);
  background: rgba(20,20,28,0.95);
  color: #fff;
  outline: none;
}


/* === Mobile iOS zoom prevention for input fields === */
#parcel-ui input[type="text"],
#ownerName,
#np-input {
  font-size: 16px !important;
}

/* User-Bar oben rechts */
#user-bar {
  position: absolute;
  top: 8px;
  right: 120px;
  z-index: 25;
  background: rgba(0,0,0,.55);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
}

#user-bar form {
  display: inline-block;
  margin-left: 8px;
}

#user-bar input,
#user-bar button {
  font-size: 11px;
  padding: 4px 6px;
  margin: 2px 0;
}

#user-bar details summary {
  cursor: pointer;
}

#user-bar .auth-forms {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

#user-bar .auth-forms form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#parcel-detail-panel {
  position: absolute;
  left: 12px;
  top: 60px;
  z-index: 18;
  max-width: min(320px, 70vw);
  background: rgba(0,0,0,0.7);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
}

#parcel-detail-panel img {
  max-width: 100%;
  border-radius: 6px;
  margin: 4px 0;
}


/* Prevent mobile browsers from auto-zooming on auth forms after login */
#login-form input,
#login-form button,
#register-form input,
#register-form button,
#forgot-form input,
#forgot-form button {
  font-size: 16px;
}


/* Mobile Bottom-Sheet für Grundstück-Details */
@media (max-width: 640px) {
  #parcel-detail-panel {
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    max-width: 100%;
    max-height: 40vh;
    background: rgba(0,0,0,0.85);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-radius: 12px 12px 0 0;
    font-size: 13px;
    overflow-y: auto;
  }
}

/* City-View Overlay (Gebiet / Schachbrett) */
#city-view-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  /* Mars nicht abdunkeln: Overlay-Hintergrund transparent */
  background: transparent;
  color: #f5f5f5;
  font-size: 12px;
}

#city-view-overlay.active {
  display: flex;
  flex-direction: column;
}

#city-view-inner {
  position: absolute;
  flex: 1;
  max-width: 960px;
  margin: 0;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  /* Mars nicht abdunkeln */
  background: transparent;
  overflow: hidden;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

#city-view-header {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

#city-view-header button {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

#city-view-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(16, minmax(20px, 1fr));
  width: 90vmin;
  height: 90vmin;
  margin: 0 auto;
  /* Hintergrund transparent lassen, damit Mars sichtbar bleibt */
  background: transparent;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 0 20px rgba(0,0,0,0.8);
}


.city-cell {
  border: 1px solid rgba(255,255,255,0.12);
  box-sizing: border-box;
  background-color: rgba(0,0,0,0.1);
}

/* Mobile: Overlay füllt den Bildschirm */
@media (max-width: 640px) {
  #city-view-inner {
    margin: 0;
    border-radius: 0;
  }

  #city-view-header {
    font-size: 12px;
  }
}


/* === City-View Layout Override (SimCity-like grid) === */
#city-view-inner {
  position: absolute;
  flex: 1;
  margin: 0;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

#city-view-header {
  margin-bottom: 8px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(0,0,0,0.85);
}

#city-view-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(16, minmax(24px, 1fr));
  grid-template-rows: repeat(16, minmax(24px, 1fr));
  width: 90vmin;
  height: 90vmin;
  margin: 0 auto;
  /* Marsähnliche Oberfläche als feste Stadtfläche (Top-Down) */
  background: #d8a98a url("assets/city/mars_city_grid_bg.png") center center / cover no-repeat;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 0 20px rgba(0,0,0,0.8);
}

#city-view-grid::before {
  /* Deaktiviert, damit der echte Mars-Hintergrund sichtbar bleibt */
  content: none;
}

#city-view-grid > .city-cell {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255,255,255,0.1);
  box-sizing: border-box;
  background: rgba(0,0,0,0.1);
  cursor: pointer;
  aspect-ratio: 1 / 1;
  transition: background 0.12s, box-shadow 0.12s;
}


#city-view-grid > .city-cell:hover {
  background: rgba(120,255,120,0.35);
  box-shadow: inset 0 0 4px rgba(0,0,0,0.6);
}

/* Mobile: City-View full screen */
@media (max-width: 640px) {
  #city-view-inner {
    margin: 0;
  }
  #city-view-grid {
    width: min(90vmin, 360px);
    height: min(90vmin, 360px);
  }
}


/* === MarsClaims Header & Footer === */

.mc-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10; /* unter dem User-Bar-Overlay */
  background: transparent;
  backdrop-filter: none;
  pointer-events: none; /* klicks nicht blockieren */
}

.mc-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.mc-logo-link {
  display: inline-flex;
  align-items: center;
  pointer-events: auto; /* Logo bleibt klickbar */
}

.mc-logo {
  height: 100px;
  display: block;
}
/* Footer */

.mc-footer {
  position: fixed;
  bottom: -40px; /* etwas weiter nach unten, damit der Button frei bleibt */
  left: 0;
  right: 0;
  z-index: 5;
  background: linear-gradient(to top,
    rgba(3, 5, 20, 0.95),
    rgba(3, 5, 20, 0.6),
    transparent
  );
  backdrop-filter: blur(8px);
  font-size: 13px;
  padding-bottom: 32px; /* zusätzlicher Abstand zum unteren Rand */
}


.mc-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 24px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #9ba3d9;
}

.mc-footer-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mc-footer-link {
  color: #b3bbff;
  text-decoration: none;
}

.mc-footer-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.mc-footer-sep {
  opacity: 0.6;
}
