:root {
  --bg: #0a0a0a;
  --panel: #111;
  --panel-2: #171717;
  --text: #eee;
  --muted: #aaa;
  --accent: #f39c12; /* Halloween-ish */
  --visited: #6b7280;
  --unvisited: #22c55e;
  --border: #2a2a2a;
  --shadow: 0 6px 18px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: linear-gradient(180deg, #0b0b0b, #151515);
  color: var(--text);
  font: 16px system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.app-header, .app-footer {
  padding: 10px 14px;
  background: #0c0c0c;
  border-bottom: 1px solid var(--border);
}
.app-footer { border-top: 1px solid var(--border); border-bottom: none; }

h1 {
  font-size: 18px;
  margin: 0 0 6px 0;
  letter-spacing: 0.3px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;    /* <--- this keeps items from stretching vertically */
  gap: 8px;
  margin: 10px 0;
}

.controls button,
.controls select {
  height: auto;           /* let content decide height */
  padding: 6px 10px;      /* balanced padding */
  font-size: 14px;
  line-height: 1.2;
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
}

.controls button:hover,
.controls select:hover {
  border-color: var(--accent);
}

.controls button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button, select {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
button:hover, select:hover { border-color: var(--accent); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 10px;
  height: calc(100vh - 110px);
  padding: 10px;
}

.panel {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: #0f0f0f;
}

#houseList {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow: auto;
  flex: 1 1 auto;
}
#houseList li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  background: #121212;
}
#houseList li.visited { opacity: 0.6; }
#houseList .meta {
  color: var(--muted);
  font-size: 12px;
}
#houseList .actions button {
  padding: 6px 8px;
}

.legend {
  width: 100%;
  margin-bottom: 10px;
  flex: 0 0 100%;
}
.legend-dot {
  display: inline-block;
  width: 22px;
  height: 22px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  margin-right: 6px;
  margin-left: 12px;
  vertical-align: middle;
}
.legend-dot:first-child { margin-left: 0; }

.legend .unvisited {
  background-image: url("assets/house.png");
}
.legend .visited {
  background-image: url("assets/house-visited.png");
}
.legend span {
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

.map {
  background: #0e0e0e;
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 300px;
}

/* Leaflet overrides for dark UI */
.leaflet-container {
  font: 14px system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
.leaflet-control-attribution {
  background: rgba(0,0,0,0.5);
  color: #ddd;
}
.leaflet-bar a, .leaflet-bar a:hover {
  background: rgba(20,20,20,0.9);
  color: #fff;
  border-bottom: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; height: auto; }
  .map { height: 60vh; }
}

/* Popup actions */
.leaflet-popup-content .pp-actions {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.leaflet-popup-content .pp-actions button {
  background: #111;
  color: #eee;
  border: 1px solid #2a2a2a;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.leaflet-popup-content .pp-actions button:disabled {
  opacity: 0.5; cursor: not-allowed;
}

/* Make the fullscreen button clearly visible and styled */
.leaflet-control-fullscreen.fullscreen-icon,
.leaflet-control-zoom-fullscreen.fullscreen-icon {
  background-color: rgba(255, 255, 255, 0.9) !important;
  background-image: none !important; /* clear default sprite */
  color: #000 !important;
  font-size: 18px !important;
  font-weight: bold;
  line-height: 26px;
  text-align: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid #333;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  position: relative;
}

/* add an emoji icon (looks like 🗖 / ⛶) */
.leaflet-control-fullscreen.fullscreen-icon::after,
.leaflet-control-zoom-fullscreen.fullscreen-icon::after {
  content: "⛶";  /* you can also use "🗖" or "🔲" */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* hover / active feedback */
.leaflet-control-fullscreen.fullscreen-icon:hover,
.leaflet-control-zoom-fullscreen.fullscreen-icon:hover {
  background-color: #f39c12 !important; /* your orange accent */
  color: #fff !important;
}

