/* Vollbild, responsiv */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  /* Sternenhintergrund */
  background: #000 url("../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;
}

/* Linke Bedienfelder: Grundstück oben, Details darunter */
#left-panels {
  position: absolute;
  left: 12px;
  top: 60px;
  z-index: 18;
  width: min(360px, 80vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#user-area {
  width: 100%;
  box-sizing: border-box;
}

.mc-wallet {
  margin: 0 0 8px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 205, 72, .38);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(45, 31, 7, .64), rgba(15, 11, 4, .72));
}

.mc-wallet-main {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff3bf;
}

.mc-coin {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(255, 205, 72, .72)) drop-shadow(0 2px 3px rgba(0, 0, 0, .58));
}

.mc-wallet-balance {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mc-wallet-balance strong {
  color: #fff4c5;
  font-size: 16px;
  line-height: 1;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .7);
}

.mc-wallet-name {
  color: #ddca8f;
  font-size: 10px;
  line-height: 1.2;
}

.mc-wallet-reward {
  margin: 5px 0 0 53px;
  color: #ffe08a;
  font-size: 11px;
}

.mc-wallet-reward span {
  display: block;
  color: #d6c99e;
  font-size: 10px;
}

/* Ein Grundstück pro User */
#btn-claim:disabled {
  opacity: .55;
  cursor: not-allowed !important;
  filter: saturate(.65);
}

#parcel-ui.claim-complete {
  border: 1px solid rgba(45, 211, 111, .45);
}

.user-parcel-link {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid rgba(45, 211, 111, .45);
  border-radius: 7px;
  background: rgba(45, 211, 111, .12);
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.user-parcel-link:hover,
.user-parcel-link:focus-visible {
  background: rgba(45, 211, 111, .22);
  outline: none;
}

.user-parcel-link span {
  color: #ccc;
  font-size: 11px;
}

#parcel-detail-panel {
  position: static;
  display: none;
  width: 100%;
  max-width: none;
  max-height: calc(100vh - 175px);
  background: rgba(0,0,0,0.7);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
  box-sizing: border-box;
  overflow-y: auto;
}

#parcel-detail-panel.is-visible {
  display: block;
}

#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 {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 18;
    width: 100%;
    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(8, 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(8, minmax(24px, 1fr));
  grid-template-rows: repeat(8, minmax(24px, 1fr));
  width: 90vmin;
  height: 90vmin;
  margin: 0 auto;
  /* Marsähnliche Oberfläche als feste Stadtfläche (Top-Down) */
  background: #d8a98a url("../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);
  }
}

/* === Grundstück bearbeiten: klarer Vollbildmodus mit 8x8-Raster === */
body.city-editing {
  overflow: hidden;
}

body.city-editing > h1,
body.city-editing #user-bar,
body.city-editing #left-panels,
body.city-editing #parcel-info,
body.city-editing #parcel-ui {
  display: none !important;
}

#city-view-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  background:
    linear-gradient(rgba(54, 18, 10, .16), rgba(20, 7, 4, .28)),
    #a9502d url("../city/mars_city_grid_bg.png") center / cover no-repeat;
  color: #fff;
}

#city-view-overlay.active {
  display: block;
}

#city-view-inner {
  position: relative;
  inset: auto;
  width: 100%;
  max-width: none;
  height: 100dvh;
  min-height: 100%;
  margin: 0;
  transform: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: stretch;
  justify-content: normal;
  overflow: hidden;
  background: transparent;
}

#city-view-header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin: 0;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  border: 0;
  border-radius: 0;
  background: rgba(13, 8, 13, .82);
  backdrop-filter: blur(10px);
}

#city-view-header > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#city-view-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

#city-view-status {
  color: #d7d7df;
  font-size: 11px;
}

#city-view-status[data-tone="success"] { color: #75f0aa; }
#city-view-status[data-tone="warning"] { color: #ffd479; }
#city-view-status[data-tone="error"] { color: #ff8e8e; }

#city-view-close,
#city-toolbar button {
  min-height: 42px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  background: rgba(13, 8, 13, .76);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

#city-view-close {
  flex: 0 0 auto;
  padding: 8px 12px;
}

#city-view-stage {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 10px;
  overflow: auto;
}

#city-view-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  width: min(70vmin, 720px);
  height: auto;
  aspect-ratio: 1 / 1;
  margin: 0;
  overflow: visible;
  border: 2px solid rgba(105, 255, 186, .8);
  border-radius: 12px;
  background: rgba(122, 49, 28, .34);
  box-shadow: 0 18px 55px rgba(0,0,0,.45), inset 0 0 35px rgba(80,20,9,.28);
}

#city-view-grid[aria-busy="true"] {
  opacity: .55;
  pointer-events: none;
}

#city-view-grid > .city-cell {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(255,255,255,.20);
  border-radius: 0;
  background: rgba(94, 39, 24, .10);
  appearance: none;
  cursor: pointer;
  overflow: visible;
}

#city-view-grid > .city-cell:hover,
#city-view-grid > .city-cell:focus-visible {
  z-index: 4;
  outline: 2px solid rgba(125,255,189,.95);
  outline-offset: -2px;
  box-shadow: inset 0 0 12px rgba(110,255,175,.42);
}

#city-view-grid > .tile-road {
  background: transparent;
}

.road-network {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.road-verge {
  fill: #718b50;
}

.road-sidewalk {
  fill: none;
  stroke: #d8c8aa;
  stroke-width: 76;
  stroke-linecap: butt;
  stroke-linejoin: round;
}

.road-sidewalk-center {
  fill: #d8c8aa;
}

.road-curb {
  fill: none;
  stroke: #817a70;
  stroke-width: 64;
  stroke-linecap: butt;
  stroke-linejoin: round;
}

.road-curb-center {
  fill: #817a70;
}

.road-asphalt {
  fill: none;
  stroke: #41424a;
  stroke-width: 52;
  stroke-linecap: butt;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 1px rgba(0,0,0,.35));
}

.road-asphalt-center {
  fill: #41424a;
}

.road-marking {
  fill: none;
  stroke: #f4d46d;
  stroke-width: 4;
  stroke-dasharray: 11 12;
  stroke-linecap: butt;
  opacity: .92;
}

#city-view-grid > .tile-house,
#city-view-grid > .tile-house-a,
#city-view-grid > .tile-house-b,
#city-view-grid > .tile-house-c,
#city-view-grid > .tile-house-part {
  background: transparent;
}

.city-house-lot {
  position: absolute;
  z-index: 3;
  width: 25%;
  height: 25%;
  overflow: hidden;
  border: 0;
  border-radius: 2px;
  pointer-events: none;
  user-select: none;
}

.city-house-lot::before {
  content: "";
  position: absolute;
  left: 43%;
  right: 3%;
  bottom: 43%;
  height: 18%;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at 23% 68%,
    rgba(30,19,13,.27),
    rgba(30,19,13,.12) 50%,
    rgba(30,19,13,0) 78%
  );
  transform: rotate(-15deg);
}

.city-house-lot::after {
  content: "";
  position: absolute;
  left: 26%;
  right: 26%;
  bottom: 28%;
  height: 12%;
  border-radius: 50%;
  background: radial-gradient(
    ellipse,
    rgba(30,19,13,.44),
    rgba(30,19,13,.20) 56%,
    rgba(30,19,13,0) 82%
  );
}

.city-house-lot-house-a {
  background:
    linear-gradient(90deg, transparent 43%, rgba(210,190,145,.92) 43% 57%, transparent 57%) 50% 100% / 100% 38% no-repeat,
    linear-gradient(145deg, #748e54, #627f4a);
}

.city-house-lot-house-b {
  background:
    linear-gradient(90deg, transparent 42%, rgba(205,178,139,.90) 42% 58%, transparent 58%) 50% 100% / 100% 36% no-repeat,
    linear-gradient(145deg, #748e54, #627f4a);
}

.city-house-lot-house-c {
  background:
    linear-gradient(90deg, transparent 43%, rgba(214,150,78,.92) 43% 57%, transparent 57%) 50% 100% / 100% 37% no-repeat,
    linear-gradient(145deg, #748e54, #627f4a);
}

.city-house-sprite {
  position: absolute;
  z-index: 9;
  width: 25%;
  height: 25%;
  box-sizing: border-box;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
  user-select: none;
  transform-origin: 50% 88%;
  filter: drop-shadow(8px -5px 6px rgba(25,11,7,.30));
}

.city-house-sprite-house-a {
  transform: translate(-12%, -13%) scale(1.24);
}

.city-house-sprite-house-b {
  transform: translate(-8%, -23%) scale(1.58);
}

.city-house-sprite-house-c {
  transform: translate(0, -35%) scale(1.86);
}

.city-house-sprite.selected {
  filter:
    drop-shadow(8px -5px 6px rgba(25,11,7,.30))
    drop-shadow(0 0 5px rgba(117,240,170,.95));
}

#city-view-grid > .neighbor-road-connector::after {
  content: "";
  position: absolute;
  z-index: 3;
  width: 22%;
  height: 22%;
  border: 2px solid #75f0aa;
  border-radius: 50%;
  background: rgba(31,139,87,.70);
  box-shadow: 0 0 10px #75f0aa;
  animation: neighbor-road-pulse 1.25s ease-in-out infinite alternate;
}

#city-view-grid > [data-connectors*="N"]::after { left: 39%; top: -11%; }
#city-view-grid > [data-connectors*="E"]::after { right: -11%; top: 39%; }
#city-view-grid > [data-connectors*="S"]::after { left: 39%; bottom: -11%; }
#city-view-grid > [data-connectors*="W"]::after { left: -11%; top: 39%; }

@keyframes neighbor-road-pulse {
  from { transform: scale(.78); opacity: .62; }
  to { transform: scale(1); opacity: 1; }
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

#city-house-picker[hidden] {
  display: none !important;
}

#city-house-picker {
  position: absolute;
  left: 50%;
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 8;
  width: min(420px, calc(100% - 20px));
  padding: 10px;
  transform: translateX(-50%);
  box-sizing: border-box;
  border: 1px solid rgba(117,240,170,.55);
  border-radius: 14px;
  background: rgba(13,8,13,.94);
  box-shadow: 0 12px 35px rgba(0,0,0,.55);
  backdrop-filter: blur(12px);
  text-align: center;
}

#city-house-picker > strong {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
}

.city-house-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.city-house-options button {
  min-width: 0;
  padding: 4px 4px 6px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  background: rgba(255,255,255,.07);
  color: #fff;
  cursor: pointer;
}

.city-house-options button.selected {
  border-color: #75f0aa;
  background: rgba(31,139,87,.35);
  box-shadow: inset 0 0 0 1px rgba(117,240,170,.25);
}

.city-house-options img {
  display: block;
  width: 100%;
  height: 74px;
  object-fit: contain;
  filter: drop-shadow(0 4px 3px rgba(0,0,0,.4));
}

.city-house-options span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

#city-toolbar {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, 58px);
  justify-content: center;
  gap: 8px;
  width: min(680px, calc(100% - 24px));
  margin: 0 auto;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

#city-toolbar button {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 54px;
  padding: 7px;
}

#city-toolbar svg {
  width: 30px;
  height: 30px;
  overflow: visible;
}

.tool-icon-fill {
  fill: #f3f1f7;
  stroke: #16121d;
  stroke-width: 2;
  stroke-linejoin: round;
}

.tool-icon-line,
.tool-icon-stroke {
  fill: none;
  stroke: #ffd86f;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-icon-window {
  fill: #5bd9f1;
  stroke: #16121d;
  stroke-width: 2;
}

.tool-icon-line-fill {
  fill: #ffd86f;
}

#city-toolbar button.active {
  border-color: #75f0aa;
  background: rgba(31, 139, 87, .92);
  box-shadow: 0 0 0 2px rgba(117,240,170,.20);
}

#city-view-save {
  background: #734bd8 !important;
}

#city-view-save.has-changes {
  box-shadow: 0 0 0 2px rgba(255,212,121,.55);
}

#city-view-save:disabled {
  opacity: .55;
  cursor: wait;
}

@media (max-width: 640px) {
  #city-view-header {
    padding-left: 10px;
    padding-right: 10px;
  }

  #city-view-stage {
    padding: 8px;
  }

  #city-view-grid {
    width: min(calc(100vw - 16px), calc(100dvh - 174px));
    height: auto;
  }

  #city-toolbar {
    width: 100%;
    gap: 6px;
    padding-left: 8px;
    padding-right: 8px;
    background: rgba(13, 8, 13, .82);
    backdrop-filter: blur(10px);
  }

  #city-toolbar button {
    min-width: 48px;
    min-height: 48px;
    padding: 6px;
  }

  #city-toolbar svg {
    width: 27px;
    height: 27px;
  }

  #city-house-picker {
    bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .city-house-options img {
    height: 64px;
  }
}

/* === MarsClaims Spiel-HUD v1.7.0 === */
html,
body {
  overflow: hidden;
}

body {
  min-height: 100dvh;
}

/* Der Mars bleibt mittig in seiner eigenen, nicht überdeckten Spielfläche. */
#mars-container {
  position: fixed;
  inset: 0 0 104px;
}

h1 {
  position: fixed;
  top: 10px;
  left: 14px;
  right: auto;
  z-index: 85;
  padding: 5px 9px;
  border: 1px solid rgba(255, 213, 113, .22);
  border-radius: 10px;
  background: rgba(10, 7, 14, .48);
  color: #ffe7a0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  opacity: .92;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(255, 178, 55, .38);
  backdrop-filter: blur(8px);
}

#user-bar {
  position: fixed;
  top: 10px;
  right: 14px;
  z-index: 85;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(560px, calc(100vw - 160px));
  padding: 5px 7px 5px 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: rgba(10, 7, 14, .56);
  box-shadow: 0 7px 20px rgba(0, 0, 0, .24);
  backdrop-filter: blur(9px);
}

#user-bar:empty {
  display: none;
}

#user-bar form {
  margin: 0;
}

#user-bar .user-greeting,
#user-bar .user-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#user-bar .user-greeting {
  color: #ddd7e8;
}

#user-bar .user-greeting strong {
  color: #fff;
}

#user-bar .user-email {
  color: #aaa2b6;
  font-size: 10px;
}

#user-bar .logout-button {
  margin: 0;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: #e9e5ee;
  cursor: pointer;
}

#game-hud {
  position: fixed;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 80;
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.25fr);
  gap: 8px;
  width: min(980px, calc(100vw - 28px));
  padding: 7px;
  box-sizing: border-box;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 211, 115, .27);
  border-radius: 17px;
  background:
    linear-gradient(115deg, rgba(255, 192, 66, .08), transparent 29%),
    linear-gradient(180deg, rgba(31, 23, 38, .91), rgba(12, 8, 18, .94));
  box-shadow:
    0 14px 38px rgba(0, 0, 0, .58),
    inset 0 1px 0 rgba(255, 255, 255, .08),
    0 0 24px rgba(170, 75, 29, .12);
  backdrop-filter: blur(15px) saturate(1.12);
}

#game-hud.has-claim {
  grid-template-columns: 1fr;
  width: min(720px, calc(100vw - 28px));
}

#game-hud.is-guest {
  grid-template-columns: 1fr;
  width: min(620px, calc(100vw - 28px));
}

#game-hud.has-claim #parcel-ui {
  display: none;
}

#user-area {
  display: grid;
  grid-template-columns: minmax(0, .75fr) minmax(0, 1fr);
  gap: 7px;
  min-width: 0;
  width: auto;
}

.hud-wallet-slot,
.hud-parcel-slot,
#parcel-ui {
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 11px;
  background: rgba(255, 255, 255, .045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.hud-wallet-slot,
.hud-parcel-slot {
  display: flex;
  align-items: center;
  padding: 6px 9px;
}

.hud-parcel-slot {
  align-items: stretch;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.hud-label {
  color: #a79caf;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .09em;
  line-height: 1.1;
  text-transform: uppercase;
}

.mc-wallet {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.mc-wallet-main {
  gap: 8px;
}

.mc-coin {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  filter:
    drop-shadow(0 0 4px rgba(255, 218, 100, .85))
    drop-shadow(0 3px 4px rgba(0, 0, 0, .7));
}

.mc-wallet-balance {
  gap: 2px;
}

.mc-wallet-balance strong {
  color: #fff4c5;
  font-size: 17px;
}

.mc-wallet-name {
  color: #d6bd76;
  font-size: 10px;
  font-weight: 700;
}

.mc-wallet-reward {
  margin: 3px 0 0 50px;
  color: #ffe18c;
  font-size: 9px;
  line-height: 1.2;
}

.mc-wallet-reward span {
  display: inline;
  margin-left: 3px;
  font-size: 9px;
}

#user-parcels-list {
  min-width: 0;
  color: #d6d1db;
  font-size: 11px;
}

.user-parcel-link {
  min-height: 38px;
  padding: 5px 8px;
  border-color: rgba(117, 240, 170, .32);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(44, 158, 98, .19), rgba(40, 92, 77, .10));
}

.user-parcel-link strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#parcel-ui {
  position: static;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 8px 7px 12px;
  border-color: rgba(112, 92, 153, .35);
}

#parcel-ui.claim-complete {
  border-color: rgba(117, 240, 170, .32);
}

.hud-claim-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  min-width: 0;
}

.hud-claim-copy > strong {
  overflow: hidden;
  color: #f5effc;
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-coordinate {
  color: #ffd86f;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#parcel-info,
.hud-message {
  position: static;
  left: auto;
  bottom: auto;
  z-index: auto;
  max-width: none;
  padding: 0;
  transform: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #aaa3b2;
  font-size: 10px;
  line-height: 1.25;
}

.hud-message {
  overflow: hidden;
  color: #c3bdca;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#btn-claim {
  min-width: 150px;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 225, 139, .48);
  border-radius: 10px;
  background: linear-gradient(180deg, #9b6320, #663715);
  color: #fff7d6;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .19),
    0 4px 12px rgba(0, 0, 0, .28);
  cursor: pointer;
}

#btn-claim:not(:disabled):hover,
#btn-claim:not(:disabled):focus-visible {
  background: linear-gradient(180deg, #bd812c, #774019);
  outline: 2px solid rgba(255, 222, 124, .36);
  outline-offset: 2px;
}

#parcel-detail-panel {
  position: fixed;
  left: 50%;
  right: auto;
  top: auto;
  bottom: calc(104px + env(safe-area-inset-bottom));
  z-index: 90;
  display: none;
  width: min(520px, calc(100vw - 28px));
  max-width: 520px;
  max-height: min(62vh, 560px);
  padding: 0;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 214, 120, .28);
  border-radius: 15px;
  background: rgba(17, 11, 22, .96);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .72);
  overflow: hidden;
  backdrop-filter: blur(18px);
}

#parcel-detail-panel.is-visible {
  display: flex;
  flex-direction: column;
}

.hud-detail-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px 9px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  background: linear-gradient(90deg, rgba(149, 91, 28, .22), rgba(255, 255, 255, .025));
}

.hud-detail-header > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-detail-header strong {
  color: #fff1c7;
  font-size: 14px;
}

#hud-details-close {
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  color: #eee9f1;
  font-size: 10px;
  cursor: pointer;
}

#parcel-detail-content {
  padding: 10px 13px 13px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#parcel-detail-content p {
  margin: 7px 0;
}

#parcel-detail-content input,
#parcel-detail-content textarea {
  width: 100%;
  box-sizing: border-box;
}

body.city-editing #game-hud,
body.city-editing #parcel-detail-panel {
  display: none !important;
}

@media (max-width: 640px) {
  #mars-container {
    inset: 44px 0 calc(124px + env(safe-area-inset-bottom));
  }

  body[data-has-claim="1"] #mars-container {
    bottom: calc(72px + env(safe-area-inset-bottom));
  }

  h1 {
    top: 7px;
    left: 8px;
    padding: 4px 7px;
    border-radius: 8px;
    font-size: 10px;
  }

  #user-bar {
    top: 7px;
    right: 8px;
    gap: 5px;
    max-width: calc(100vw - 112px);
    min-height: 27px;
    padding: 2px 3px 2px 8px;
    box-sizing: border-box;
  }

  #user-bar .user-email {
    display: none;
  }

  #user-bar .user-greeting {
    max-width: min(42vw, 150px);
    font-size: 10px;
  }

  #user-bar .logout-button {
    padding: 4px 7px;
    font-size: 9px;
  }

  #user-bar #auth-box {
    margin-top: 0 !important;
  }

  #user-bar #auth-box > div:first-child {
    gap: 5px !important;
    margin-bottom: 0 !important;
  }

  #user-bar #auth-box > div:first-child button {
    padding: 5px 7px !important;
    font-size: 10px !important;
  }

  #game-hud,
  #game-hud.has-claim,
  #game-hud.is-guest {
    left: 7px;
    right: 7px;
    bottom: calc(6px + env(safe-area-inset-bottom));
    grid-template-columns: 1fr;
    gap: 5px;
    width: auto;
    max-width: none;
    padding: 5px;
    transform: none;
    border-radius: 13px;
  }

  #user-area {
    grid-template-columns: minmax(132px, .72fr) minmax(0, 1fr);
    gap: 5px;
  }

  body[data-has-claim="0"] #user-area {
    grid-template-columns: 1fr;
  }

  body[data-has-claim="0"] .hud-parcel-slot {
    display: none;
  }

  .hud-wallet-slot,
  .hud-parcel-slot {
    min-height: 52px;
    padding: 4px 6px;
    border-radius: 9px;
  }

  .hud-label {
    font-size: 8px;
  }

  .mc-coin {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .mc-wallet-main {
    gap: 6px;
  }

  .mc-wallet-balance strong {
    font-size: 15px;
  }

  .mc-wallet-name {
    font-size: 9px;
  }

  .mc-wallet-reward {
    margin: 2px 0 0 46px;
    font-size: 8px;
  }

  .mc-wallet-reward span {
    display: none;
  }

  #user-parcels-list {
    font-size: 9px;
  }

  .user-parcel-link {
    min-height: 34px;
    padding: 4px 6px;
    font-size: 10px;
  }

  .user-parcel-link span {
    display: none;
  }

  #parcel-ui {
    grid-template-columns: minmax(0, 1fr) minmax(116px, auto);
    gap: 6px;
    min-height: 56px;
    padding: 5px 5px 5px 8px;
    border-radius: 9px;
  }

  .hud-claim-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .hud-claim-copy > strong {
    font-size: 11px;
  }

  .hud-coordinate {
    font-size: 9px;
  }

  #parcel-info {
    display: none;
  }

  .hud-message {
    max-width: 38vw;
    font-size: 8px;
    text-align: left;
  }

  #btn-claim {
    min-width: 116px;
    min-height: 42px;
    padding: 6px 8px;
    font-size: 10px;
  }

  #parcel-detail-panel {
    left: 7px;
    right: 7px;
    bottom: calc(6px + env(safe-area-inset-bottom));
    z-index: 92;
    width: auto;
    max-width: none;
    max-height: 52dvh;
    padding: 0;
    transform: none;
    border-radius: 15px;
  }

  .hud-detail-header {
    padding: 8px 8px 8px 11px;
  }

  #parcel-detail-content {
    padding: 8px 11px calc(11px + env(safe-area-inset-bottom));
    font-size: 12px;
  }

  body.mars-hud-details-open #game-hud {
    opacity: .18;
    pointer-events: none;
  }
}
