:root {
  --bg: #0e1116;
  --panel: #161b22;
  --line: #2a313b;
  --text: #e6e8eb;
  --muted: #8b949e;
  --accent: #e3b341;
  --silver: #c9ced4;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}


#map { position: fixed; inset: 0; }

#lead {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

#cell { fill: rgba(227, 179, 65, 0.18); stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 3; }
#dots circle { fill: #2b3038; fill-opacity: 0.7; }
#dots circle.mine { fill: var(--accent); fill-opacity: 1; stroke: #0e1116; stroke-width: 2; }

#title {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 12px;
  z-index: 2;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(14, 17, 22, 0.78);
  backdrop-filter: blur(6px);
  font-weight: 650;
  letter-spacing: 0.02em;
  pointer-events: none;
}
#title small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
#title small:empty { display: none; }

/* Handy: Karte füllt den Bildschirm, das Panel ist ein hochziehbares Blatt darüber. */
#panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  height: 36dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 18px calc(28px + env(safe-area-inset-bottom));
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
  transition: height 0.25s ease;
}
#panel.dragging { transition: none; }

#handle {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 30px;
  margin: 0 -18px 6px;
  background: var(--panel);
  cursor: grab;
  touch-action: none;
}
#handle::before { content: ""; width: 42px; height: 5px; border-radius: 3px; background: #48505a; }

@media (min-width: 900px) {
  #map { right: 400px; }
  #panel { top: 0; left: auto; width: 400px; height: auto !important; padding-top: 18px; border-radius: 0; border-top: 0; border-left: 1px solid var(--line); box-shadow: none; transition: none; }
  #handle { display: none; }
}

h1, h2, h3 { margin: 0 0 8px; line-height: 1.2; }
h1 { font-size: 24px; }
h2 { font-size: 19px; }
h3 { font-size: 15px; color: var(--muted); font-weight: 600; margin-top: 22px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

button, .btn {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #21262d;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button.primary { background: linear-gradient(135deg, #f0f2f4, #9aa1a9 55%, #e4e7ea); color: #111; border: 0; }
button:disabled { opacity: 0.45; cursor: default; }

input[type="text"], input[type="search"] {
  width: 100%;
  margin: 6px 0 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tabs button { margin: 0; padding: 9px 10px; font-size: 14px; }
.tabs button.active { background: var(--text); color: var(--bg); }


ul.who { margin: 0; padding-left: 22px; }
ul.who li { padding: 2px 0; }
ul.who li.mine { color: var(--accent); font-weight: 600; }

dl { margin: 10px 0 0; }
dt { font-weight: 650; margin-top: 10px; }
dd { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

.countdown { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 10px 0 14px; }
.error { color: #ff7b72; }

.demo-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.demo-row input[type="range"] { flex: 1; }
.demo-row label { white-space: nowrap; }

.maplibregl-ctrl-attrib { font-size: 11px; }

.credit { margin: 28px 0 0; font-size: 11px; color: #6e7681; }
.credit a { color: inherit; }
dt .alias { font-weight: 400; color: var(--muted); font-size: 13px; }
.exotic { margin-top: 20px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 14px; }
.exotic a { color: var(--accent); }
button.hint { margin: -6px 0 14px; padding: 6px 0; border: 0; background: none; color: var(--muted); font-size: 14px; font-weight: 500; }
@media (min-width: 900px) { button.hint { display: none; } }
