:root {
  --bg: #08121b;
  --bg-soft: #0f1d2a;
  --card: rgba(15, 29, 42, 0.88);
  --card-strong: #112334;
  --line: rgba(255, 255, 255, 0.08);
  --text: #e9f1f7;
  --muted: #a9bccd;
  --gold: #ffcc66;
  --mint: #6de0b0;
  --accent: #6fc5ff;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(111, 197, 255, 0.18), transparent 32%),
    radial-gradient(circle at 80% 20%, rgba(109, 224, 176, 0.12), transparent 22%),
    linear-gradient(180deg, #071018 0%, #0b1621 100%);
  color: var(--text);
}

.site-shell {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 28px;
}

.hero-copy,
.showcase-card,
.map-panel,
.list-panel,
.sidebar-card,
.admin-dialog .dialog-content {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-copy {
  padding: 34px;
}

.eyebrow,
.panel-eyebrow,
.small-label,
.stat-label {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  color: var(--gold);
  font-weight: 700;
}

h1, h2, h3 { margin: 0; }

h1 {
  font-size: clamp(2.4rem, 4vw, 4.5rem);
  line-height: 0.98;
  margin-top: 12px;
  margin-bottom: 18px;
}

.hero-text, .accent-copy, .muted, li {
  color: var(--muted);
  line-height: 1.6;
}

.hero-actions,
.hero-stats,
.toolbar,
.panel-header,
.form-actions,
.dialog-actions,
.admin-list-header {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-actions { margin: 28px 0 26px; }
.hero-stats { gap: 14px; }
.stat-card {
  min-width: 150px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
}
.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.15rem;
}

.hero-art {
  display: grid;
  gap: 20px;
}

.showcase-card {
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.floating-card::after,
.accent-card::after {
  content: '';
  position: absolute;
  inset: auto -40px -40px auto;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255, 204, 102, 0.18), transparent 70%);
}

.dog-badge {
  width: 70px;
  height: 70px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  background: linear-gradient(135deg, rgba(111, 197, 255, 0.24), rgba(109, 224, 176, 0.18));
  border: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 16px;
}

.button,
.icon-button {
  border: 0;
  cursor: pointer;
  font: inherit;
  transition: transform 0.16s ease, opacity 0.16s ease, background 0.16s ease;
}
.button:hover,
.icon-button:hover { transform: translateY(-1px); }

.button {
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}
.button.primary {
  background: linear-gradient(135deg, var(--accent), #4ca6f0);
  color: #061018;
}
.button.secondary,
.button.tertiary {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}
.button.tertiary { color: var(--muted); }

.map-panel,
.list-panel { padding: 24px; margin-bottom: 24px; }
.panel-header { justify-content: space-between; align-items: end; margin-bottom: 18px; }
.list-header { align-items: center; }

.toolbar input,
.stack-form input,
.stack-form textarea,
.stack-form select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(4, 9, 15, 0.4);
  color: var(--text);
  font: inherit;
}
.toolbar input { min-width: min(320px, 100%); }
.stack-form textarea { resize: vertical; }

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
}
.map-frame {
  min-height: 560px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}
#map { width: 100%; height: 100%; min-height: 560px; }
.sidebar-card { padding: 22px; }
.sidebar-card ul { padding-left: 18px; }

.status-banner,
.inline-message {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
}
.inline-message.error { border-color: rgba(255, 97, 97, 0.35); color: #ffb8b8; }
.inline-message.success { border-color: rgba(109, 224, 176, 0.35); color: #c8ffe8; }

.sale-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.sale-card,
.admin-sale-card {
  border-radius: 22px;
  padding: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}

.sale-card h3,
.admin-sale-card h4 { margin-bottom: 8px; }
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
  font-size: 0.88rem;
}

.admin-dialog {
  width: min(1180px, calc(100% - 20px));
  border: 0;
  padding: 0;
  background: transparent;
}
.admin-dialog::backdrop { background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(4px); }
.dialog-content { padding: 24px; }
.dialog-content h2,
.dialog-content h3,
.dialog-content h4,
.admin-form-card h3,
.admin-list-card h3,
.admin-sale-card h4,
.dialog-content label span {
  color: #ffffff !important;
}
.hidden { display: none; }
.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 16px;
}
.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 1.5rem;
}
.stack-form {
  display: grid;
  gap: 14px;
}
.stack-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
}
.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
}
.admin-form-card,
.admin-list-card {
  padding: 20px;
  border-radius: 22px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}
.admin-sale-list {
  display: grid;
  gap: 12px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}
.admin-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.maplibregl-popup-content {
  background: #102132;
  color: var(--text);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: var(--shadow);
  padding: 16px;
}

.maplibregl-popup-close-button {
  color: #ffffff;
  font-size: 1.4rem;
  line-height: 1;
  padding: 6px 10px;
  background: transparent;
  border: 0;
}
.maplibregl-popup-close-button:hover,
.maplibregl-popup-close-button:focus {
  color: #ffffff;
  background: rgba(255,255,255,0.08);
  outline: none;
}
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.maplibregl-popup-anchor-top .maplibregl-popup-tip,
.maplibregl-popup-anchor-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-right .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
  border-top-color: #102132;
  border-bottom-color: #102132;
}

.melon-marker {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.96), rgba(255,255,255,0.92));
  border: 3px solid rgba(215, 75, 90, 0.92);
  box-shadow: 0 10px 20px rgba(0,0,0,0.25);
  background-image: url('/melon-man-marker.png');
  background-size: cover;
  background-position: center;
}

.melon-badge {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: rgba(255,255,255,0.08) url('/melon-man-marker.png') center / cover no-repeat;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 18px 40px rgba(0,0,0,0.25);
  margin-bottom: 16px;
}

.empty-state {
  padding: 24px;
  border-radius: 20px;
  text-align: center;
  color: var(--muted);
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.16);
}

@media (max-width: 1080px) {
  .hero, .map-layout, .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-shell { width: min(100% - 18px, 100%); padding-top: 18px; }
  .hero-copy, .showcase-card, .map-panel, .list-panel { padding: 18px; }
  .panel-header { align-items: stretch; }
  .toolbar { width: 100%; }
  .toolbar input { min-width: 0; }
  .grid-two { grid-template-columns: 1fr; }
  #map, .map-frame { min-height: 430px; }
  h1 { font-size: 2.35rem; }
}
