/* PikeMark — dark travel app prototype. Palette pulled from the design mocks:
   near-black teal ground, teal chips, gold section titles, warm route accent. */
:root {
  --bg: #0c1210;
  --bg-2: #0f1715;
  --card: #14201d;
  --card-2: #1a2926;
  --teal: #2f6169;
  --teal-2: #37727b;
  --teal-nav: #2b5a62;
  --gold: #e7b23c;
  --accent: #f2a51e;
  --text: #f3f2ee;
  --muted: #93a49f;
  --line: #22322e;
  --like: #ff5a7a;
  --radius: 16px;
  --nav-h: 76px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%;
  background: #060a09;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
}
body { display: flex; align-items: center; justify-content: center; }

/* Phone frame */
.phone {
  position: relative;
  width: 100%; max-width: 420px; height: 100vh; max-height: 920px;
  background: radial-gradient(120% 80% at 50% 0%, #101a17 0%, var(--bg) 55%);
  overflow: hidden;
  display: flex; flex-direction: column;
}
@media (min-width: 460px) {
  .phone { border-radius: 34px; box-shadow: 0 24px 80px rgba(0,0,0,.6), 0 0 0 10px #000, 0 0 0 11px #1c1c1c; }
}

/* Status bar */
.statusbar {
  flex: 0 0 auto; height: 40px; padding: 8px 24px 0;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; font-weight: 600; letter-spacing: .3px;
  position: relative; z-index: 30;
}
.status-icons { display: flex; align-items: center; gap: 6px; opacity: .95; }
.bars, .wifi, .batt { display: inline-block; }
.bars { width: 17px; height: 11px;
  background:
    linear-gradient(#fff,#fff) 0 100%/3px 4px no-repeat,
    linear-gradient(#fff,#fff) 5px 100%/3px 7px no-repeat,
    linear-gradient(#fff,#fff) 10px 100%/3px 9px no-repeat,
    linear-gradient(#fff,#fff) 15px 100%/3px 11px no-repeat; }
.wifi { width: 16px; height: 11px; -webkit-mask: radial-gradient(circle at 50% 100%, #000 32%, transparent 33%); background:#fff;
  clip-path: polygon(50% 0, 100% 45%, 82% 62%, 50% 32%, 18% 62%, 0 45%); }
.batt { width: 24px; height: 12px; border: 1.5px solid #fff; border-radius: 3px; position: relative; }
.batt::after { content:""; position:absolute; inset:2px; right:5px; background:#fff; border-radius:1px; }
.batt::before { content:""; position:absolute; right:-3px; top:3px; width:2px; height:6px; background:#fff; border-radius:2px; }

/* Top bar with logo */
.topbar {
  flex: 0 0 auto; height: 74px; position: relative; z-index: 25;
  display: flex; align-items: center; justify-content: center;
}
.topbar .logo { width: 62px; height: 48px; filter: drop-shadow(0 2px 10px rgba(0,0,0,.5)); }
.back-btn {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: none; background: transparent; color: var(--text);
  font-size: 34px; line-height: 1; cursor: pointer; font-weight: 300;
}
.topbar.floating { position: absolute; top: 40px; left: 0; right: 0; }

/* View area */
.view { flex: 1 1 auto; position: relative; overflow-y: auto; overflow-x: hidden;
  padding-bottom: calc(var(--nav-h) + 16px); scrollbar-width: none; }
.view::-webkit-scrollbar { display: none; }
.view.map-view { overflow: hidden; padding: 0; }

/* ---- Bottom nav pill ---- */
.navbar {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 18px; z-index: 40;
  width: min(360px, calc(100% - 36px)); height: 58px;
  background: rgba(43, 90, 98, .82); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 30px; box-shadow: 0 12px 30px rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: space-around; padding: 0 8px;
}
.nav-btn {
  width: 44px; height: 44px; border: none; background: transparent; cursor: pointer;
  display: grid; place-items: center; border-radius: 50%; color: #dfeeec; opacity: .85;
  transition: background .15s, opacity .15s;
}
.nav-btn svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-btn[data-nav="timecapsule"] svg { fill: currentColor; stroke-width: 1; }
.nav-btn.active { background: rgba(255,255,255,.16); opacity: 1; color: #fff; }

/* ---- Profile screen ---- */
.p-name { font-size: 22px; font-weight: 700; padding: 4px 20px 2px; }
.section-head {
  display: flex; align-items: center; gap: 10px; padding: 16px 20px 10px;
}
.section-head .plus {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  color: var(--text); font-size: 18px; font-weight: 400; border: 0;
  background: transparent;
}
.section-head .plus svg { width: 22px; height: 22px; stroke: currentColor; }
.section-head .label { font-size: 15px; font-weight: 600; }
.section-head .spacer { flex: 1; }
.badges-pill {
  background: #16211f; border: 1px solid var(--line); color: var(--muted);
  padding: 7px 16px; border-radius: 18px; font-size: 13px; font-weight: 600;
  margin-right: 20px; cursor: pointer;
}
.section-title-gold { color: var(--gold); font-weight: 700; font-size: 15px; padding: 20px 20px 4px; }

/* Favorite trips row (flag chips) */
.chip-row { display: flex; gap: 12px; overflow-x: auto; padding: 4px 20px 6px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.trip-chip { flex: 0 0 auto; width: 84px; text-align: center; cursor: pointer; }
.trip-chip .disc {
  width: 84px; height: 96px; border-radius: 44px;
  background: linear-gradient(160deg, var(--teal-2), var(--teal));
  display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
  position: relative; overflow: hidden;
}
.trip-chip .flag {
  width: 58px; height: 58px; border-radius: 50%; object-fit: cover;
  font-size: 40px; display: grid; place-items: center; line-height: 1;
  background: #0d1412; box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.trip-chip .cap { margin-top: -26px; position: relative; font-size: 13px; font-weight: 700; padding-bottom: 8px; }

/* Favorite markers row (photo thumbs) */
.marker-row { display: flex; gap: 10px; overflow-x: auto; padding: 4px 20px 6px; scrollbar-width: none; }
.marker-row::-webkit-scrollbar { display: none; }
.fav-marker { flex: 0 0 auto; width: 96px; cursor: pointer; }
.fav-marker .thumb {
  width: 96px; height: 74px; border-radius: 12px; object-fit: cover; display: block;
  background: var(--card-2);
}
.fav-marker .cap { font-size: 12px; font-weight: 700; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Feed cards */
.feed { padding: 4px 16px 0; display: flex; flex-direction: column; gap: 4px; }
.post { padding: 14px 4px 6px; }
.post-head { display: flex; align-items: center; gap: 8px; padding: 0 4px 10px; }
.post-head .route-ico { width: 26px; height: 18px; opacity: .85; }
.post-head .route-ico svg { width: 26px; height: 18px; stroke: var(--text); fill: none; stroke-width: 2; stroke-dasharray: 3 3; stroke-linecap: round; }
.post-title { font-size: 15px; font-weight: 700; }
.post-photo {
  width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: var(--radius);
  background: var(--card-2); display: block;
}
.post-actions { display: flex; align-items: center; gap: 20px; padding: 12px 6px 6px; }
.act { background: none; border: none; cursor: pointer; color: var(--text); display: grid; place-items: center; }
.act svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.act.liked svg { fill: var(--like); stroke: var(--like); }
.liked-by { font-size: 12.5px; color: var(--muted); padding: 2px 6px 4px; }
.liked-by b { color: var(--text); font-weight: 700; }

/* Two-up marker cards */
.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 6px 4px; }
.mini-card .mini-title { font-size: 14px; font-weight: 700; padding: 4px 2px 8px; }
.mini-photo-wrap { position: relative; border-radius: var(--radius); overflow: hidden; }
.mini-photo { width: 100%; aspect-ratio: 4/3.2; object-fit: cover; display: block; background: var(--card-2); }
.mini-actions {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px;
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
}
.mini-actions .act svg { width: 19px; height: 19px; }
.mini-actions .pin { margin-left: auto; }

/* ---- Journey map view ---- */
#map { position: absolute; inset: 0; background: var(--bg); }
.map-stop-card {
  width: 128px; border-radius: 10px; overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,.5);
  border: 2px solid #e9e6dd; background: #e9e6dd; cursor: pointer;
}
.map-stop-card img { width: 100%; height: 84px; object-fit: cover; display: block; }
.stop-label { color: #fff; font-weight: 700; font-size: 15px; text-shadow: 0 1px 6px rgba(0,0,0,.9); white-space: nowrap; }
.stop-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(242,165,30,.3); }
.stop-dot.plain { width: 11px; height: 11px; background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.25); }
.maplibregl-popup { max-width: none !important; }

/* ---- Generic list screens (feed / geoboard / timecapsule) ---- */
.screen-title { font-size: 20px; font-weight: 700; padding: 4px 20px 8px; }
.screen-sub { font-size: 13px; color: var(--muted); padding: 0 20px 10px; }

/* Geoboard */
.gb-list { padding: 4px 16px; display: flex; flex-direction: column; gap: 12px; }
.gb-post { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.gb-top { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.gb-top img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.gb-name { font-size: 13px; font-weight: 700; }
.gb-meta { font-size: 11px; color: var(--muted); }
.gb-body { font-size: 14.5px; line-height: 1.4; }
.gb-pin { margin-left: auto; font-size: 11px; color: var(--accent); font-weight: 700; display: flex; align-items: center; gap: 3px; }
.gb-cell { font-size: 11px; color: var(--muted); margin-top: 8px; display: flex; align-items: center; gap: 5px; }
.gb-compose { display: flex; gap: 8px; padding: 8px 16px 12px; }
.gb-compose input { flex: 1; background: var(--card); border: 1px solid var(--line); color: var(--text);
  border-radius: 20px; padding: 11px 16px; font-size: 14px; outline: none; }
.gb-compose button { background: var(--teal); border: none; color: #fff; border-radius: 20px; padding: 0 18px; font-weight: 700; cursor: pointer; }

/* Timecapsule */
.tc-places { padding: 4px 16px; display: flex; flex-direction: column; gap: 14px; }
.tc-place { position: relative; border-radius: var(--radius); overflow: hidden; cursor: pointer; }
.tc-place img { width: 100%; height: 150px; object-fit: cover; display: block; filter: saturate(.85) brightness(.8); }
.tc-place .tc-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px; background: linear-gradient(transparent, rgba(0,0,0,.8)); }
.tc-place .tc-name { font-size: 17px; font-weight: 700; }
.tc-place .tc-span { font-size: 12px; color: #cfd8d5; margin-top: 2px; }
.tc-timeline { padding: 4px 16px; display: flex; flex-direction: column; gap: 18px; }
.tc-entry { display: flex; gap: 12px; align-items: flex-start; }
.tc-entry img { width: 108px; height: 84px; object-fit: cover; border-radius: 10px; flex: 0 0 auto; background: var(--card-2); }
.tc-year { font-size: 20px; font-weight: 800; color: var(--gold); min-width: 54px; }
.tc-cap { font-size: 13.5px; line-height: 1.35; }
.tc-src { display: inline-block; margin-top: 6px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  padding: 3px 8px; border-radius: 10px; }
.tc-src.exif { background: rgba(47,97,105,.4); color: #7fd0da; }
.tc-src.user { background: rgba(231,178,60,.18); color: var(--gold); }

/* Discover map */
.discover-fab { position: absolute; z-index: 30; }
.discover-legend {
  position: absolute; top: 12px; left: 12px; z-index: 20;
  background: rgba(10,16,14,.8); backdrop-filter: blur(8px); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; font-size: 12px; color: var(--muted); max-width: 190px;
}
.discover-legend b { color: var(--text); display: block; margin-bottom: 3px; font-size: 13px; }
.dm-marker { width: 30px; height: 30px; border-radius: 50% 50% 50% 2px; transform: rotate(45deg);
  background: linear-gradient(var(--teal-2), var(--teal)); border: 2px solid #cfe6e2; box-shadow: 0 3px 10px rgba(0,0,0,.5); cursor: pointer; }
.dm-marker span { display: block; width: 100%; height: 100%; transform: rotate(-45deg); background-size: cover; background-position: center; border-radius: 50%; opacity: .0; }

/* Badges overlay */
.overlay { position: absolute; inset: 0; z-index: 60; background: rgba(4,8,7,.72); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; }
.sheet { background: var(--bg-2); border-top-left-radius: 22px; border-top-right-radius: 22px;
  border-top: 1px solid var(--line); width: 100%; max-height: 78%; overflow-y: auto; padding: 8px 20px 30px; animation: rise .22s ease; }
@keyframes rise { from { transform: translateY(40px); opacity: .4; } to { transform: translateY(0); opacity: 1; } }
.sheet .grabber { width: 40px; height: 4px; background: #34433f; border-radius: 3px; margin: 8px auto 14px; }
.sheet h3 { margin: 0 0 14px; font-size: 18px; }
.badge-item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.badge-item:last-child { border-bottom: none; }
.badge-ico { font-size: 26px; width: 46px; height: 46px; border-radius: 12px; background: var(--card); display: grid; place-items: center; }
.badge-name { font-weight: 700; font-size: 15px; }
.badge-desc { font-size: 12.5px; color: var(--muted); }
.badge-item.locked { opacity: .4; }

.loading { padding: 40px; text-align: center; color: var(--muted); font-size: 14px; }
.country-flags { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 20px 0; }
.country-flags span { font-size: 22px; }
.stat-row { display: flex; gap: 22px; padding: 6px 20px 2px; color: var(--muted); font-size: 13px; }
.stat-row b { color: var(--text); }
