@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700;800;900&family=Bebas+Neue&display=swap');

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

:root {
  --bg: #c2ede8;
  --header-bg: #ffffff;
  --surface: #ffffff;
  --teal: #2ec4b6;
  --accent: #2ec4b6;
  --text: #2d2d2d;
  --pink: #ff6b9d;
  --purple: #7c4dff;
  --orange: #ff9f43;
  --green: #2ecc71;
  --blue: #3498db;
  --dark: #2d2d2d;
  --muted: #888;
  --border: #e0e0e0;
  --panel-width: 360px;
  --header-height: 62px;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--dark);
  height: 100vh;
  overflow: hidden;
}

/* ─── HEADER ─────────────────────────────── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--header-height);
  background: var(--header-bg);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 0 20px;
  gap: 8px;
}

.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 0.08em;
  color: var(--dark);
  white-space: nowrap;
  text-decoration: none;
}

.logo span { color: var(--teal); }

.filters {
  display: flex;
  gap: 7px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  align-items: center;
}

.filters::-webkit-scrollbar { display: none; }

.filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: none;
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s, opacity 0.15s;
  color: #fff;
  opacity: 0.45;
}

.filter-btn:hover { opacity: 0.75; transform: scale(1.05); }
.filter-btn.active { opacity: 1; transform: scale(1.05); }

.filter-btn[data-type="all"]          { background: var(--dark); }
.filter-btn[data-type="Mural"]        { background: var(--pink); }
.filter-btn[data-type="Sculpture"]    { background: var(--purple); }
.filter-btn[data-type="Paste-up"]     { background: var(--orange); }
.filter-btn[data-type="Sticker"]      { background: var(--green); }
.filter-btn[data-type="Installation"] { background: var(--blue); }

/* ─── QUEST NAV BUTTON ──────────────────────────── */
.quest-nav-btn {
  background: var(--dark);
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: 20px;
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s, opacity 0.15s;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.quest-nav-btn:hover { opacity: 0.8; transform: scale(1.05); }

#quest-nav-score {
  background: var(--teal);
  color: #fff;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 900;
}

.add-btn {
  background: var(--teal);
  color: #fff;
  padding: 8px 18px;
  border-radius: 20px;
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s, opacity 0.15s;
  box-shadow: 0 4px 12px rgba(46,196,182,0.4);
  flex-shrink: 0;
}

.add-btn:hover { opacity: 0.9; transform: scale(1.05); }

/* ─── MAP ─────────────────────────────────── */
#map {
  position: fixed;
  top: var(--header-height); left: 0; right: 0; bottom: 0;
  z-index: 1;
}

/* ─── MARKERS ─────────────────────────────── */
.art-marker {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid #fff;
  cursor: pointer;
  transition: transform 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.art-marker:hover { transform: scale(1.7); }

.art-marker.Mural        { background: var(--pink); }
.art-marker.Sculpture    { background: var(--purple); }
.art-marker.Paste-up     { background: var(--orange); }
.art-marker.Sticker      { background: var(--green); }
.art-marker.Installation { background: var(--blue); }

.art-marker.found {
  opacity: 0.5;
  border-color: var(--teal);
}

/* ─── ARTWORK PANEL ───────────────────────────────── */
.panel {
  position: fixed;
  top: var(--header-height); right: -100%;
  width: var(--panel-width);
  bottom: 0;
  background: var(--surface);
  box-shadow: -4px 0 24px rgba(0,0,0,0.1);
  z-index: 999;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.panel.open { right: 0; }

.panel-close {
  position: absolute;
  top: 14px; right: 16px;
  background: rgba(0,0,0,0.08);
  border: none;
  color: var(--dark);
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 30px;
  text-align: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.15s;
}

.panel-close:hover { background: rgba(0,0,0,0.15); }

.panel-color-bar {
  height: 8px;
  width: 100%;
}

.panel-color-bar.Mural        { background: var(--pink); }
.panel-color-bar.Sculpture    { background: var(--purple); }
.panel-color-bar.Paste-up     { background: var(--orange); }
.panel-color-bar.Sticker      { background: var(--green); }
.panel-color-bar.Installation { background: var(--blue); }

.panel-photo-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.panel-photo img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}

.panel-body { padding: 22px; }

.panel-type-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.panel-type {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  color: #fff;
}

.panel-type.Mural        { background: var(--pink); }
.panel-type.Sculpture    { background: var(--purple); }
.panel-type.Paste-up     { background: var(--orange); }
.panel-type.Sticker      { background: var(--green); }
.panel-type.Installation { background: var(--blue); }

.panel-commissioned {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.panel-found-badge {
  font-size: 10px;
  font-weight: 800;
  color: var(--teal);
  letter-spacing: 0.06em;
}

.panel-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 46px;
  letter-spacing: 0.03em;
  line-height: 1;
  margin-bottom: 10px;
  color: var(--dark);
}

.panel-artist {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 3px;
}

.panel-artist strong { color: var(--dark); }

.panel-artist a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 700;
}

.panel-artist a:hover { text-decoration: underline; }

.panel-address {
  font-size: 12px;
  color: var(--muted);
  margin-top: 14px;
  padding-top: 14px;
  border-top: 2px dashed var(--border);
  font-weight: 600;
}

/* ─── QUEST PANEL (left) ─────────────────────────── */
.quest-panel {
  position: fixed;
  top: var(--header-height); left: -340px;
  width: 320px;
  bottom: 0;
  background: var(--surface);
  box-shadow: 4px 0 24px rgba(0,0,0,0.1);
  z-index: 999;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.quest-panel.open { left: 0; }

.quest-panel-header {
  display: flex;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}

.quest-panel-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 0.08em;
  flex: 1;
}

.quest-panel-score {
  font-size: 12px;
  font-weight: 800;
  color: var(--teal);
}

.quest-panel-close {
  background: rgba(0,0,0,0.08);
  border: none;
  color: var(--dark);
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 28px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s;
}

.quest-panel-close:hover { background: rgba(0,0,0,0.15); }

.quest-list { overflow-y: auto; flex: 1; }

.quest-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  gap: 14px;
  transition: background 0.15s;
}

.quest-item:hover { background: var(--bg); }

.quest-item.completed { opacity: 0.6; }

.quest-item-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--dark);
  flex-shrink: 0;
}

.quest-item.completed .quest-item-num {
  background: var(--teal);
  color: #fff;
}

.quest-item-info { flex: 1; }

.quest-item-type {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dark);
  margin-bottom: 2px;
}

.quest-item-area {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.quest-item-arrow { color: var(--muted); font-size: 14px; }

.quest-item-done-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--teal);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ─── QUEST CARD (modal) ─────────────────────────── */
.quest-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1099;
}

.quest-backdrop.hidden { display: none; }

.quest-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 340px;
  max-height: 85vh;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.25);
  z-index: 1100;
  overflow-y: auto;
  padding-bottom: 28px;
}

.quest-card.hidden { display: none; }

.quest-card-close {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(0,0,0,0.08);
  border: none;
  color: var(--dark);
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 28px;
  text-align: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.15s;
}

.quest-card-close:hover { background: rgba(0,0,0,0.15); }

.quest-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 12px;
}

.quest-card-type {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  color: #fff;
}

.quest-card-type.Mural        { background: var(--pink); }
.quest-card-type.Sculpture    { background: var(--purple); }
.quest-card-type.Paste-up     { background: var(--orange); }
.quest-card-type.Sticker      { background: var(--green); }
.quest-card-type.Installation { background: var(--blue); }

.quest-card-found-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--teal);
  letter-spacing: 0.06em;
}

.quest-photo { width: 100%; aspect-ratio: 16/9; }
.quest-photo img { width: 100%; height: 100%; object-fit: cover; }

.quest-mini-map {
  width: 100%;
  aspect-ratio: 16/9;
  min-height: 160px;
}

.quest-photo-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 72px;
  color: rgba(0,0,0,0.1);
}

.quest-card-hint {
  padding: 18px 20px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--dark);
  font-weight: 600;
}

.checkin-btn {
  display: block;
  margin: 0 20px;
  width: calc(100% - 40px);
  padding: 14px;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: opacity 0.15s;
}

.checkin-btn:hover { opacity: 0.85; }
.checkin-btn:disabled { opacity: 0.5; cursor: wait; }

.gps-status {
  margin: 10px 20px 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.quest-revealed {
  padding: 0 20px;
  text-align: center;
}

.quest-revealed-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 38px;
  letter-spacing: 0.05em;
  color: var(--dark);
  line-height: 1;
}

.quest-revealed-artist {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 4px;
}

/* ─── USER LOCATION ─────────────────────────── */
.user-dot {
  width: 18px;
  height: 18px;
  background: #4285f4;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 6px rgba(66,133,244,0.5);
  position: relative;
}

.user-dot::after {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  background: rgba(66,133,244,0.18);
  animation: loc-pulse 2s ease-out infinite;
}

@keyframes loc-pulse {
  0%   { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* ─── LOCATE BUTTON ─────────────────────────── */
.locate-btn {
  position: fixed;
  right: 16px;
  bottom: 72px;
  z-index: 990;
  width: 44px;
  height: 44px;
  background: #fff;
  border: none;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark);
  transition: transform 0.15s, box-shadow 0.15s, color 0.2s;
}

.locate-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.locate-btn.active { color: #4285f4; }

.locate-btn.locating {
  animation: btn-spin 1s linear infinite;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* ─── COUNT BAR ─────────────────────────────── */
.count-bar {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 998;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  pointer-events: none;
  white-space: nowrap;
}

.count-bar strong { color: var(--teal); }

/* ─── LEAFLET OVERRIDES ─────────────────────── */
.leaflet-popup-content-wrapper { display: none; }

.leaflet-control-zoom {
  border: none !important;
  border-radius: 12px !important;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12) !important;
}

.leaflet-control-zoom a {
  background: var(--surface) !important;
  color: var(--dark) !important;
  border-bottom: 1px solid var(--border) !important;
  width: 34px !important;
  height: 34px !important;
  line-height: 34px !important;
  font-size: 16px !important;
}

.leaflet-control-zoom a:hover { background: var(--bg) !important; }

.leaflet-control-attribution {
  background: rgba(255,255,255,0.85) !important;
  color: #aaa !important;
  font-size: 9px !important;
  border-radius: 8px 0 0 0 !important;
}

/* ─── MASCOT ─────────────────────────────────── */
.mascot {
  position: fixed;
  bottom: 80px;
  left: 16px;
  z-index: 990;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  animation: mascot-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.mascot.hidden { display: none; }

@keyframes mascot-in {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.mascot-character {
  font-size: 42px;
  line-height: 1;
  animation: mascot-bob 3s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes mascot-bob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

.mascot-bubble {
  background: #fff;
  border-radius: 16px 16px 16px 4px;
  padding: 12px 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.13);
  max-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.mascot-bubble strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--dark);
  display: block;
}

.mascot-bubble span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.5;
}

.mascot-dismiss {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--dark);
  color: #fff;
  border: none;
  font-size: 13px;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.mascot-dismiss:hover { opacity: 1; }

/* ─── WELCOME MODAL ─────────────────────────── */
.welcome-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.welcome-backdrop.hidden { display: none; }

.welcome-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 32px 28px 24px;
  max-width: 340px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  text-align: center;
}

.welcome-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 30px;
  letter-spacing: 0.08em;
  color: var(--dark);
  margin-bottom: 4px;
}

.welcome-logo span { color: var(--teal); }

.welcome-city {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 26px;
}

.welcome-steps {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 26px;
  text-align: left;
}

.welcome-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.welcome-step-icon {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1.2;
}

.welcome-step-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.welcome-step-text strong {
  display: block;
  color: var(--dark);
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 2px;
}

.welcome-start {
  width: 100%;
  padding: 14px;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  box-shadow: 0 4px 16px rgba(46,196,182,0.4);
  margin-bottom: 14px;
}

.welcome-start:hover { opacity: 0.9; transform: scale(1.02); }

.welcome-hint {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.welcome-hint strong { color: var(--dark); }

/* ─── QUEST BUTTON PULSE ─────────────────────── */
@keyframes quest-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(46,196,182,0.8); }
  70%  { box-shadow: 0 0 0 10px rgba(46,196,182,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,196,182,0); }
}

.quest-nav-btn.pulsing {
  animation: quest-pulse 1.8s ease-out infinite;
}

/* ─── RESPONSIVE ─────────────────────────────── */
@media (max-width: 600px) {
  :root {
    --panel-width: 100vw;
    --header-height: 96px;
  }

  header {
    height: var(--header-height);
    padding: 0 12px;
    gap: 6px;
    align-items: center;
  }

  /* Row 1: logo + action buttons */
  .logo {
    font-size: 16px;
    order: 1;
    flex: 1;
  }

  .quest-nav-btn {
    order: 2;
    flex-shrink: 0;
  }

  .add-btn {
    order: 2;
    flex-shrink: 0;
  }

  /* Row 2: filters full-width */
  .filters {
    order: 3;
    width: 100%;
    flex-basis: 100%;
    padding-bottom: 8px;
    gap: 6px;
    mask-image: linear-gradient(to right, black 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 80%, transparent 100%);
  }

  .filter-btn {
    padding: 5px 12px;
    font-size: 10px;
    flex-shrink: 0;
  }

  .quest-panel { width: 100vw; left: -100vw; }
  .quest-card { width: calc(100vw - 32px); }
}
