@import url('https://fonts.googleapis.com/css2?family=Rye&family=Crimson+Text:ital@0;1&display=swap');

:root {
  --bg: #1a1208;
  --panel: #2a1f0e;
  --border: #8b6914;
  --gold: #c9a84c;
  --text: #e8d5a3;
  --muted: #9a8060;
  --red: #8b2020;
}

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

body {
  display: flex;
  height: 100vh;
  font-family: 'Crimson Text', serif;
  background: var(--bg);
  color: var(--text);
}

/* LANG SELECTOR */
#lang-selector {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-bottom: -10px;
}
.lang-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: 'Rye', serif;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.lang-btn:hover { background: #3a2a10; color: var(--text); }
.lang-btn.active { background: var(--gold); color: var(--bg); border-color: var(--gold); }

/* SIDEBAR */
#sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--panel);
  border-right: 2px solid var(--border);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

/* HEADER */
#site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

#site-logo {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid var(--border);
  object-fit: cover;
  object-position: 70% 15%;
  flex-shrink: 0;
}

h1 {
  font-family: 'Rye', serif;
  font-size: 1.5rem;
  color: var(--gold);
  text-align: center;
  letter-spacing: 2px;
  text-shadow: 0 2px 4px #000;
}

.subtitle {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  font-size: 0.9rem;
}

.section {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.section h2 {
  font-family: 'Rye', serif;
  font-size: 0.85rem;
  color: var(--gold);
  letter-spacing: 1px;
  margin-bottom: 10px;
}

label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 1rem;
}

input[type="checkbox"] {
  accent-color: var(--gold);
  width: 16px;
  height: 16px;
}

input[type="text"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  font-family: 'Crimson Text', serif;
  font-size: 1rem;
  border-radius: 2px;
}

input[type="text"]::placeholder { color: var(--muted); }
input[type="text"]:focus { outline: none; border-color: var(--gold); }

#poi-info { background: rgba(0,0,0,0.3); padding: 12px; border-radius: 4px; }
#poi-name { font-family: 'Rye', serif; font-size: 1rem; color: var(--gold); margin-bottom: 6px; }
#poi-desc { font-size: 0.95rem; color: var(--text); margin-bottom: 10px; line-height: 1.4; }

.map-disclaimer {
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 8px;
  line-height: 1.4;
}

.contact { text-align: center; }
.contact-text { font-size: 0.82rem; color: var(--muted); margin-bottom: 6px; }
.btn-discord {
  display: inline-block;
  background: #5865F2;
  color: #fff;
  font-family: 'Rye', serif;
  font-size: 0.82rem;
  padding: 7px 14px;
  border-radius: 3px;
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: background 0.2s;
}
.btn-discord:hover { background: #4752c4; }

.donate { margin-top: auto; text-align: center; }

.btn-donate {
  display: inline-block;
  background: var(--gold);
  color: var(--bg);
  font-family: 'Rye', serif;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 3px;
  text-decoration: none;
  letter-spacing: 1px;
  transition: background 0.2s;
}
.btn-donate:hover { background: #e0b85a; }
.donate-text { font-size: 0.8rem; color: var(--muted); margin-top: 6px; }

/* MAP */
#map {
  flex: 1;
  background: #0d0a05;
}

/* MAP SELECTOR */
#map-selector { display: flex; flex-direction: column; gap: 4px; }

.map-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Crimson Text', serif;
  font-size: 0.95rem;
  padding: 6px 10px;
  text-align: left;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.15s, color 0.15s;
}
.map-btn:hover { background: #3a2a10; }
.map-btn.active { background: var(--gold); color: var(--bg); font-weight: bold; border-color: var(--gold); }
.map-btn-locked { opacity: 0.4; cursor: not-allowed; }
.map-btn-locked::after { content: ' 🔒'; font-size: 0.75rem; }

/* LEAFLET OVERRIDES */
.leaflet-container { background: #0d0a05; }

.leaflet-popup-content-wrapper {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Crimson Text', serif;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.7);
}
.leaflet-popup-tip { background: var(--panel); }
.leaflet-popup-content { font-size: 1rem; margin: 10px 14px; }
.leaflet-popup-content b { display: block; color: var(--gold); font-family: 'Rye', serif; font-size: 0.85rem; margin-bottom: 4px; }
.leaflet-popup-content p { font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; line-height: 1.3; }
.leaflet-popup-content label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 0.95rem; }

/* FILTERS */
#filters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.filter-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  opacity: 1;
}
.filter-btn:hover { background: #3a2a10; }
.filter-btn.active { border-color: var(--gold); background: rgba(201,168,76,0.12); }
.filter-btn:not(.active) { opacity: 0.4; }

.filter-icon { font-size: 22px; line-height: 1; }
.filter-icon-img { width: 28px; height: 28px; display: block; }
.filter-label { font-family: 'Crimson Text', serif; font-size: 0.8rem; color: var(--text); }
.filter-counter { font-family: 'Crimson Text', serif; font-size: 0.75rem; color: var(--gold); line-height: 1; }
.marker-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.7);
}
.marker-mission { background: #3a2010; }
.marker-tomb    { background: #1a1a2e; }
.marker-npc     { background: #0d2010; }
.marker-done    { opacity: 0.45; }
.marker-img { width: 36px; height: 36px; display: block; }
.marker-img.marker-done { filter: grayscale(60%) brightness(0.5); }
.marker-secreto { background: #1a2e1a; width: 36px !important; height: 36px !important; }
.marker-secreto.marker-done { opacity: 0.45; }
.marker-img-circle { width: 30px; height: 30px; display: block; }
.marker-done { opacity: 0.45; }

/* ── MOBILE ─────────────────────────────────────────────────────────────── */
#sidebar-toggle {
  display: none;
}

@media (max-width: 600px) {
  body {
    flex-direction: column;
    overflow: hidden;
  }

  #map {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
  }

  #sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    width: 100%;
    min-width: unset;
    max-height: 70vh;
    border-right: none;
    border-top: 2px solid var(--border);
    border-radius: 16px 16px 0 0;
    padding: 16px;
    display: none;
    overflow-y: auto;
  }

  #sidebar.open {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  #sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: var(--gold);
    color: var(--bg);
    border: none;
    font-size: 1.4rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
  }

  #sidebar-toggle.open {
    bottom: calc(70vh + 12px);
  }
}
