* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #12151c;
  --card: #1c2230;
  --card2: #242c3f;
  --text: #e8ecf5;
  --muted: #93a0b8;
  --accent: #ffc93c;
  --green: #3ddc84;
  --red: #ff5d6c;
  --blue: #4da3ff;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0,0,0,.45);
  font-size: 15px;
}

html, body { height: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  background: rgba(18, 21, 28, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #2b3347;
  flex-wrap: wrap;
}
.hud-brand { font-weight: 800; font-size: 1.1rem; letter-spacing: .3px; }
.hud-stat { display: flex; flex-direction: column; line-height: 1.15; }
.hud-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.hud-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.hud-value.accent { color: var(--accent); }
.hud-spacer { flex: 1; }
.hud-player { color: var(--muted); font-size: .85rem; }
.hud-player b { color: var(--text); }
.hud-mode { font-size: .7rem; padding: 3px 8px; border-radius: 20px; background: var(--card2); color: var(--muted); }
.hud-mode.online { color: var(--green); border: 1px solid var(--green); }

/* ---------- Buttons ---------- */
.btn {
  border: 1px solid #38415a;
  background: var(--card2);
  color: var(--text);
  padding: 7px 13px;
  border-radius: 10px;
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
  transition: transform .08s, background .15s;
}
.btn:hover { background: #2e3850; }
.btn:active { transform: scale(.96); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #1a1508; }
.btn-accent:hover { background: #ffd76b; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #ff7c88; }
.btn-big { padding: 11px 20px; font-size: 1rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ---------- Map ---------- */
#map { position: fixed; inset: 0; z-index: 1; background: #f2efe9; }
.leaflet-container { font: inherit; }

#map-controls {
  position: fixed;
  bottom: 22px; left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  display: flex;
  gap: 10px;
}
#map-controls .btn { box-shadow: var(--shadow); }

/* ---------- Property markers ---------- */
.prop-marker {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  font-size: 19px;
  background: var(--card);
  border: 2px solid #55617f;
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(0,0,0,.5);
  cursor: pointer;
  transition: transform .1s;
}
.prop-marker:hover { transform: scale(1.15); }
.prop-marker.mine { border-color: var(--green); background: #14301f; }
.prop-marker.theirs { border-color: var(--red); background: #331419; }

/* ---------- "You are here" marker ---------- */
.you-dot {
  width: 16px; height: 16px;
  background: var(--blue);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(77,163,255,.55);
  animation: you-pulse 2s infinite;
}
@keyframes you-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(77,163,255,.55); }
  70%  { box-shadow: 0 0 0 18px rgba(77,163,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(77,163,255,0); }
}

/* ---------- Cards / modals ---------- */
.card {
  background: var(--card);
  border: 1px solid #2b3347;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  position: relative;
}
.card h2 { margin-bottom: 6px; font-size: 1.15rem; }
.card p { color: var(--muted); font-size: .9rem; margin: 8px 0 14px; }
.card-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; color: var(--muted);
  font-size: 1rem; cursor: pointer;
}
.card-close:hover { color: var(--text); }

.modal {
  position: fixed; inset: 0;
  z-index: 2000;
  background: rgba(5,7,12,.6);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.modal .card { width: 100%; max-width: 440px; max-height: 80vh; overflow-y: auto; }

.hidden { display: none !important; }

/* ---------- Property panel ---------- */
#panel {
  position: fixed;
  bottom: 22px; left: 22px;
  z-index: 1500;
  width: 320px;
  max-width: calc(100vw - 44px);
}
.panel-emoji { font-size: 2.2rem; }
.panel-sub { color: var(--muted); font-size: .82rem; margin-bottom: 12px; }
.panel-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.row {
  display: flex; justify-content: space-between;
  font-size: .9rem;
  padding: 6px 10px;
  background: var(--card2);
  border-radius: 8px;
}
.row span { color: var(--muted); }
.row b { font-variant-numeric: tabular-nums; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.panel-actions .btn { flex: 1; min-width: 120px; }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.list-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--card2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: .9rem;
  cursor: pointer;
}
.list-item:hover { background: #2e3850; }
.list-item .li-emoji { font-size: 1.4rem; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-main .li-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .li-main .li-sub { color: var(--muted); font-size: .78rem; }
.list-item .li-value { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-item.me { outline: 1px solid var(--accent); }
.list-empty { color: var(--muted); text-align: center; padding: 18px 0; }
.rank { width: 26px; text-align: center; font-weight: 800; color: var(--muted); }
.rank.top { color: var(--accent); }

/* ---------- Login & prompt inputs ---------- */
#login .card, #amount .card { max-width: 360px; text-align: center; }
.modal input {
  width: 100%;
  padding: 11px 14px;
  margin: 4px 0 12px;
  border-radius: 10px;
  border: 1px solid #38415a;
  background: var(--card2);
  color: var(--text);
  font-size: 1rem;
  text-align: center;
}
.modal input:focus { outline: 2px solid var(--accent); border-color: transparent; }
#login .btn { width: 100%; }
#login .btn + .btn { margin-top: 8px; }
.modal input.hidden { display: none; }

/* ---------- Offers / market extras ---------- */
.badge {
  display: inline-block;
  background: var(--red);
  color: #fff;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: .7rem;
  margin-left: 6px;
  vertical-align: 1px;
}
.modal h3 {
  margin: 16px 0 4px;
  font-size: .78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .7px;
}
.li-actions { display: flex; gap: 6px; }
.li-actions .btn { padding: 5px 10px; font-size: .8rem; }
.error { color: var(--red) !important; min-height: 1em; }

/* ---------- Toast ---------- */
#toast {
  position: fixed;
  top: 70px; left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  background: var(--card);
  border: 1px solid #38415a;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  max-width: 90vw;
  text-align: center;
}
#toast.show { opacity: 1; }

@media (max-width: 640px) {
  :root { font-size: 14px; }
  .hud-player { display: none; }
  #panel { left: 10px; right: 10px; bottom: 80px; width: auto; }
}
