html, body, #cesiumContainer {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: Roboto, Arial, sans-serif;
  background: #000;
}

:root { --accent: #4ade80; --accent-ink: #0b0f14; }

/* ---------- map tools ---------- */

#mapTools {
  position: absolute;
  bottom: 24px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  z-index: 30;
}

#mapTools button {
  box-sizing: border-box;
  padding: 0;
}

.mapBtn,
#popupStreetView,
#popupDelete,
#streetViewClose,
#browseBack {
  background: rgba(20, 24, 34, 0.85);
  color: #e8eaed;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.mapBtn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

#topTools {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 45; /* ponytail: panels/popups use z-index 50+ so their close buttons stay clickable */
}

.mapBtn:hover,
#popupStreetView:hover,
#popupDelete:hover,
#browseBack:hover { background: rgba(255, 255, 255, 0.2); }

.mapBtn.active { background: var(--accent); color: var(--accent-ink); }

#btnGames img { display: block; width: 24px; height: 24px; }

/* ---------- app panel ---------- */

#appPanel {
  position: absolute;
  left: 12px;
  bottom: 82px;
  width: 340px;
  max-height: calc(100% - 180px);
  overflow-y: auto;
  background: rgba(20, 24, 34, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px;
  color: #e8eaed;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  box-sizing: border-box;
  z-index: 50;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

#appPanel[hidden] { display: none; }

#panelClose {
  position: sticky;
  top: 0;
  z-index: 3;
  display: block;
  width: 26px;
  height: 26px;
  margin: 0 0 -26px auto;
  background: none;
  border: none;
  border-radius: 6px;
  color: #9aa0a6;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

#panelClose:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

body:has(#pageExplore:not([hidden]) #placeWrap:not([hidden])) #panelClose { display: none; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.45); }

body:has(#nowPlaying:not([hidden])) #appPanel { bottom: 229px; max-height: calc(100% - 241px); }

.page[hidden] { display: none; }

.pageTitle {
  font-size: 16px;
  font-weight: 700;
  margin: 2px 0 10px;
}

/* ---------- place card ---------- */

#placeHead {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -12px;
  padding: 0 12px 10px;
  background: #141822;
}

/* ponytail: masks the panel's 12px top padding so scrolled rows can't peek above the pinned head */
#placeHead::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
  background: #141822;
}

#placeBadge,
.badge {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

#placeBadge { width: 38px; height: 38px; font-size: 13px; }

.badge { width: 30px; height: 30px; font-size: 11px; }

#placeHeadText { flex: 1; min-width: 0; }

#placeTitle {
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#placeSub { font-size: 12px; color: #9aa0a6; margin-top: 1px; }

#placeClose {
  flex: none;
  background: none;
  border: none;
  color: #9aa0a6;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}

#placeClose:hover { color: #fff; }

#placeEmpty p { font-size: 13px; color: #9aa0a6; margin: 0 0 12px; }

#btnRandom {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

#btnRandom:hover { background: color-mix(in srgb, var(--accent) 85%, #000); }

/* ---------- sections & rows ---------- */

.pSec { margin-top: 14px; }

.pSec[hidden] { display: none; }

.pSec h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #9aa0a6;
  font-weight: 700;
  margin: 0 0 6px 2px;
}

.pSec h3 button {
  background: none;
  border: none;
  padding: 0;
  color: #9aa0a6;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.pSec h3 button:hover { color: #fff; }

.sList { list-style: none; margin: 0; padding: 0; }

.sRow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

.sRow:hover { background: rgba(255, 255, 255, 0.07); }

.sInfo { flex: 1; min-width: 0; }

.sNameRow { display: flex; align-items: center; gap: 7px; min-width: 0; }

.sName { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sSub {
  font-size: 11px;
  color: #9aa0a6;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sRow.playing { background: var(--accent); }
.sRow.playing:hover { background: color-mix(in srgb, var(--accent) 85%, #000); }
.sRow.playing .sName { color: var(--accent-ink); font-weight: 700; }
.sRow.playing .sSub { color: color-mix(in srgb, var(--accent-ink) 72%, transparent); }
.sRow.playing .heart { color: var(--accent-ink); }

.chev {
  flex: none;
  color: #5f6875;
  font-size: 18px;
  line-height: 1;
}

#goCountry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 8px;
  border-radius: 8px;
  color: var(--accent);
  font-size: 14px;
  cursor: pointer;
}

#goCountry:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
#goCountry[hidden] { display: none; }
#goCountry::after { content: "\203a"; font-size: 18px; line-height: 1; }

.moreRow { color: var(--accent); font-size: 14px; }
.moreRow .chev { color: var(--accent); }

.heart {
  flex: none;
  background: none;
  border: none;
  color: #5f6875;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}

.heart:hover { color: #f28b82; }
.heart.on { color: #f28b82; }

.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }

.eq i {
  width: 3px;
  height: 12px;
  background: var(--accent-ink);
  border-radius: 1px;
  transform-origin: bottom;
  animation: eq 0.7s ease-in-out infinite alternate;
}

.eq i:nth-child(1) { animation-delay: -0.15s; }
.eq i:nth-child(2) { animation-delay: -0.4s; }
.eq i:nth-child(3) { animation-delay: -0.65s; }

@keyframes eq {
  from { transform: scaleY(0.3); }
  to { transform: scaleY(1); }
}

.emptyNote { font-size: 12px; color: #9aa0a6; padding: 6px 2px; }

#favSongsPrint {
  float: right;
  margin-right: 32px;
  display: flex;
  align-items: center;
  background: none;
  border: none;
  color: #9aa0a6;
  cursor: pointer;
  padding: 2px;
}

#favSongsPrint:hover { color: #fff; }

#favSongsPrint svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- browse ---------- */

#browseFilter {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #e8eaed;
  font-size: 13px;
  box-sizing: border-box;
  outline: none;
  margin-bottom: 0;
}

#browseFilter:focus { border-color: var(--accent); }

#browseBack { font-size: 12px; margin-bottom: 8px; }

#browseGenreBack { font-size: 12px; margin-bottom: 8px; }

#browseTitle { font-size: 14px; font-weight: 700; margin: 0 2px 0; }

#browseGenreTitle { font-size: 14px; font-weight: 700; margin: 0 2px 0; text-transform: capitalize; }

#browseMode { display: flex; gap: 6px; margin-bottom: 8px; }

#browseMode .seg {
  flex: 1;
  padding: 5px 8px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(20, 24, 34, 0.85);
  color: #c8cdd4;
  cursor: pointer;
}

#browseMode .seg.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}

#browseGenres[hidden] { display: none; }

#browseGenreView[hidden] { display: none; }

/* ponytail: #panelClose now sits beside the title, so the head pins at the top;
   the ::before masks the panel's 12px top padding */
.browseHead {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 -12px;
  padding: 0 12px 8px;
  background: #141822;
}

.browseHead::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
  background: #141822;
}

.flag { flex: none; font-size: 18px; }

/* ---------- search ---------- */

#searchInput {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #e8eaed;
  font-size: 14px;
  box-sizing: border-box;
  outline: none;
}

#searchInput:focus { border-color: var(--accent); }

#searchResults { margin: 8px 0 0; padding: 0; list-style: none; }

/* ---------- settings panels ---------- */

details { margin-bottom: 10px; }

summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #9aa0a6;
}

details label {
  display: block;
  font-size: 13px;
  padding: 5px 6px;
  border-radius: 4px;
  cursor: pointer;
}

details label:hover { background: rgba(255, 255, 255, 0.06); }

details input[type="checkbox"], details input[type="radio"] { margin-right: 8px; accent-color: var(--accent); }

#accentColor {
  width: 40px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: none;
  cursor: pointer;
  vertical-align: middle;
}

#accentColor::-webkit-color-swatch-wrapper { padding: 2px; }
#accentColor::-webkit-color-swatch { border: none; border-radius: 4px; }

details .tNote { display: block; margin: 2px 0 0 20px; font-size: 11px; line-height: 1.35; color: rgba(255, 255, 255, 0.5); }

/* ---------- equalizer ---------- */

#eqPresets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

.eqPreset {
  background: rgba(255, 255, 255, 0.08);
  color: #c8cdd4;
  border: none;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
}

.eqPreset:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.eqPreset.active { background: var(--accent); color: var(--accent-ink); font-weight: 700; }

.eqRow { display: flex; align-items: center; gap: 10px; padding: 6px 2px; }

.eqName { flex: none; width: 52px; font-size: 12px; color: #9aa0a6; }

.eqVal { flex: none; width: 46px; text-align: right; font-size: 11px; color: #9aa0a6; }

/* ---------- placemark list ---------- */

#pinList { list-style: none; margin: 0; padding: 0; }

#pinList li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 13px;
}

#pinList li:hover { background: rgba(255, 255, 255, 0.06); }

#pinList li span { cursor: pointer; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#pinList li button {
  background: none;
  border: none;
  color: #9aa0a6;
  cursor: pointer;
  font-size: 13px;
}

#pinList li button:hover { color: #f28b82; }

#placesEmpty { font-size: 12px; color: #9aa0a6; padding: 6px; }

#pinSearch {
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  padding: 6px 9px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #e8eaed;
  font-size: 13px;
  outline: none;
}

#pinSearch:focus { border-color: var(--accent); }

#pinSearchScope { display: flex; gap: 14px; margin: 6px 0 2px 4px; }

#pinSearchScope label { display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; font-size: 12px; }

#pinSearchScope input { margin-right: 0; }

#btnInstall {
  margin-top: 6px;
  padding: 6px 14px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

#btnInstall:hover { background: color-mix(in srgb, var(--accent) 85%, #000); }

#credits { font-size: 10px; color: rgba(255, 255, 255, 0.45); margin-top: 14px; }

/* ---------- tab bar ---------- */

#tabBar {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 6px;
  background: rgba(20, 24, 34, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 45;
}

.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 64px;
  padding: 6px 0 4px;
  background: none;
  border: none;
  border-radius: 10px;
  color: #9aa0a6;
  font-size: 10px;
  cursor: pointer;
}

.tab svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab:hover { color: #e8eaed; background: rgba(255, 255, 255, 0.06); }
.tab.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

#tabFavCount, #tabSongCount {
  position: absolute;
  top: 2px;
  right: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 9px;
  font-weight: 700;
  border-radius: 8px;
  padding: 0 4px;
}

#tabFavCount[hidden], #tabSongCount[hidden] { display: none; }

/* ---------- now playing ---------- */

#nowPlaying {
  position: absolute;
  bottom: 82px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  max-width: min(94%, 560px);
  background: rgba(20, 24, 34, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 8px 12px;
  color: #e8eaed;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 52;
}

#nowPlaying[hidden] { display: none; }

#viz {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 14px;
  opacity: 0.28;
  pointer-events: none;
  z-index: -1;
  border-radius: inherit;
}

#npTop, #npBottom { display: flex; align-items: center; gap: 10px; }

#npBottom { position: relative; z-index: 1; }

#npIcons {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
}

#npIcons button, #npIcons a {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 50%;
  color: #c8cdd4;
  cursor: pointer;
  padding: 0;
}

#npIcons button:hover, #npIcons a:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }

#npIcons svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#npSongFav { padding: 0; }
#npSongFav[hidden] { display: none; }

#npSite[hidden] { display: none; }

#npAvatar {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: #2b3444;
  cursor: pointer;
}

#npAvatar.art {
  background-size: cover;
  background-position: center;
  color: transparent;
}

#npSleep {
  margin-left: 8px;
  padding: 3px 4px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #c8cdd4;
  cursor: pointer;
}

#npSleep:focus { outline: none; border-color: var(--accent); }

/* ---------- share / art popups ---------- */

#sharePopup, #artPopup {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: 320px;
  max-width: calc(100vw - 32px);
  background: rgba(27, 33, 48, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
}

#artPopup {
  width: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#sharePopup[hidden], #artPopup[hidden] { display: none; }

#shareHead, #artHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

#artHead { width: 100%; }

#shareTitle, #artTitle {
  font-size: 13px;
  font-weight: 600;
  color: #e8eaed;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#shareClose, #artClose {
  flex: none;
  background: none;
  border: none;
  color: #9aa0a6;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

#shareClose:hover, #artClose:hover { color: #fff; }

#artBig {
  width: min(56vh, 240px);
  height: min(56vh, 240px);
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
  font-weight: 700;
  color: #fff;
  background-color: #2b3444;
}

#artBig.art { color: transparent; }

#artSub {
  width: 100%;
  margin-top: 6px;
  font-size: 12px;
  color: #9aa0a6;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#shareUrl {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #e8eaed;
  padding: 5px 8px;
  font-size: 12px;
}

#shareUrl:focus { outline: none; border-color: var(--accent); }

#shareActions { display: flex; gap: 6px; margin-top: 8px; }

#shareCopy, #shareNative {
  flex: 1;
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #e8eaed;
}

#shareCopy {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 600;
}

#shareCopy:hover { background: color-mix(in srgb, var(--accent) 85%, #000); }

#shareNative:hover { background: rgba(255, 255, 255, 0.2); }

#shareNative[hidden] { display: none; }

#npText { flex: 1; min-width: 0; }

#npTitleRow { display: flex; align-items: center; gap: 6px; }

#npTitle {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#npSub {
  font-size: 13px;
  color: #9aa0a6;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#npTrack {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--accent);
  margin: 0 2px;
}

#npTrack[hidden] { display: none; }

#npTrack.unknown { color: #9aa0a6; }

#npTrackClip { flex: 1; min-width: 0; overflow: hidden; }

#npTrackClip > span {
  display: inline-block;
  white-space: nowrap;
}

#npTrack.scroll #npTrackClip > span {
  padding-right: 48px;
  animation: npScroll linear infinite;
}

#npTrack.scroll #npTrackClip > span::after {
  content: attr(data-text);
  padding-left: 48px;
}

@keyframes npScroll {
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  #npTrack.scroll #npTrackClip > span { animation: none; }
}

#npCtrl { flex: none; display: flex; align-items: center; gap: 2px; }

#npCtrl button {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 50%;
  color: #c8cdd4;
  cursor: pointer;
  padding: 0;
}

#npCtrl button:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
#npCtrl svg { width: 27px; height: 27px; }
#npStop { color: var(--accent); }
#npStop svg { width: 36px; height: 36px; }

#npVol,
.eqSlider {
  flex: 1;
  width: auto;
  min-width: 60px;
  height: 4px;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
}

#npVol::-webkit-slider-thumb,
.eqSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}

#npVol::-moz-range-thumb,
.eqSlider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
}

#npVol::-moz-range-track,
.eqSlider::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
}

#npVol { height: 6px; }

#npVol::-webkit-slider-thumb { width: 18px; height: 18px; }

#npVol::-moz-range-thumb { width: 18px; height: 18px; }

#npVol::-moz-range-track { height: 6px; }

/* ---------- center target & loaders ---------- */

#centerCircle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 91px;
  height: 91px;
  margin: -45.5px 0 0 -45.5px;
  border: 3px solid color-mix(in srgb, var(--accent) 85%, transparent);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(11, 15, 20, 0.3), 0 0 20px color-mix(in srgb, var(--accent) 30%, transparent);
  pointer-events: none;
  z-index: 8;
}

#centerCircle[hidden] { display: none; }

body:has(#pegman.picking) #centerCircle { display: none; }

body.view-locked #centerCircle { display: none; }

.spinner {
  width: 96px;
  height: 96px;
  animation: spin 1.1s linear infinite;
}

.spinner circle {
  fill: none;
  stroke: #fff;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 25 25.26;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#appLoader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: #04080c;
  color: #e8eaed;
  font-size: 14px;
  z-index: 100;
}

#appLoader[hidden] { display: none; }

#streamSpinner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 91px;
  height: 91px;
  margin: -45.5px 0 0 -45.5px;
  display: none;
  pointer-events: none;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
  z-index: 9;
}

#streamSpinner .spinner { width: 100%; height: 100%; }

body.buffering #streamSpinner { display: block; }
body.buffering #centerCircle { display: none; }

/* ---------- pin popup ---------- */

#pinPopup {
  position: absolute;
  left: 0;
  top: 0;
  margin-left: -90px;
  width: 180px;
  margin-top: -112px;
  background: rgba(27, 33, 48, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px;
  z-index: 50;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
}

#popupName, #popupNote {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #e8eaed;
  padding: 5px 24px 5px 8px;
  font-size: 13px;
}

#popupNote {
  padding: 5px 8px;
  margin-bottom: 6px;
  min-height: 30px;
  resize: vertical;
  font-family: inherit;
  display: block;
}

#popupClose {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: #9aa0a6;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

#popupClose:hover { color: #fff; }

#popupCoords { font-size: 11px; color: #9aa0a6; margin: 6px 0; }

#popupStreetView, #popupDelete { margin-right: 4px; }

#popupDelete:hover { background: rgba(242, 139, 130, 0.3); }

/* ---------- street view ---------- */

#pegman {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ff9800;
  color: #fff;
  border: none;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

#pegman:hover { background: #f57c00; }

#pegman.picking {
  background: #fff;
  color: #ff9800;
  box-shadow: 0 0 0 4px rgba(255, 152, 0, 0.45);
}

#streetViewPanel {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 420px;
  max-width: calc(100% - 24px);
  background: rgba(20, 24, 34, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  overflow: hidden;
  z-index: 54;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

#streetViewHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

#streetViewFrame {
  width: 100%;
  height: 320px;
  border: none;
  display: block;
}

#streetViewLink {
  display: block;
  padding: 8px 12px;
  font-size: 12px;
  color: #8ab4f8;
  text-decoration: none;
}

#streetViewLink:hover { text-decoration: underline; }

#tokenWarning {
  margin-top: 10px;
  padding: 10px;
  background: rgba(242, 139, 130, 0.15);
  border: 1px solid #f28b82;
  border-radius: 8px;
  font-size: 12px;
  color: #f28b82;
}

/* ---------- cesium credits ---------- */

/* ion logo must stay visible per ion ToS; shown at 50% size */
.cesium-credit-logoContainer img {
  width: 69px;
  height: 14px;
  vertical-align: -3.5px !important; /* beats Cesium's inline -7px */
}

/* ---------- mobile ---------- */

@media (max-width: 768px) {
  #mapTools { bottom: 140px; right: 8px; }

  #tabBar {
    bottom: 8px;
    left: 8px;
    right: 8px;
    width: auto;
    transform: none;
    justify-content: space-around;
  }

  .tab { flex: 1; width: auto; }

  #appPanel {
    left: 8px;
    right: 8px;
    bottom: 74px;
    width: auto;
    max-height: 46vh;
  }

  body:has(#nowPlaying:not([hidden])) #appPanel { bottom: 221px; }

  #nowPlaying { bottom: 74px; max-width: calc(100% - 16px); border-radius: 14px; }

  #pinPopup { width: 150px; margin-left: -75px; }

  #centerCircle { width: 78px; height: 78px; margin: -39px 0 0 -39px; }
  #streamSpinner { width: 78px; height: 78px; margin: -39px 0 0 -39px; }

  #streetViewPanel {
    top: auto;
    bottom: 170px;
    left: 8px;
    right: 8px;
    width: auto;
    max-width: none;
    border-radius: 12px;
  }

  #streetViewFrame { height: 45vh; }
}

/* ---------- geo games ---------- */

#gsBox {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.gsRow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.gsLabel { font-size: 12px; color: #9aa0a6; }

.segGroup { display: flex; gap: 4px; }

.segGroup .seg {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #e8eaed;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.segGroup .seg.active { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

#gsInits { display: flex; gap: 6px; }

#gsInits input {
  width: 100%;
  min-width: 0;
  padding: 5px 6px;
  background: rgba(0, 0, 0, 0.3);
  color: #e8eaed;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
  text-transform: uppercase;
}

#gsInits input[hidden] { display: none; }

.gsCheck { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #c7cbd1; }

#gsClear {
  align-self: flex-start;
  padding: 4px 8px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  color: #9aa0a6;
  font-size: 11px;
  cursor: pointer;
}

#gsClear:hover { color: #fff; border-color: rgba(255, 255, 255, 0.3); }

.gCard {
  padding: 10px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.gHead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }

.gName { font-size: 14px; font-weight: 600; }

.gBest { font-size: 11px; color: var(--accent); }

.gBlurb { margin: 4px 0 8px; font-size: 12px; line-height: 1.45; color: #b6bcc4; }

.gLast { margin-bottom: 8px; font-size: 11px; color: #8a9098; }

.gMode { margin-bottom: 8px; }

.gRow { display: flex; gap: 8px; align-items: center; }

.gPlay {
  padding: 7px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.gTop {
  padding: 6px 10px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #c7cbd1;
  font-size: 12px;
  cursor: pointer;
}

.gScores { display: flex; flex-direction: column; gap: 4px; list-style: none; margin: 8px 0 0; padding: 0; }

.gScores li { display: flex; align-items: center; gap: 8px; font-size: 12px; }

.gScores li b { width: 38px; color: #e8eaed; letter-spacing: 1px; }

.gScores li span { flex: 1; color: var(--accent); }

.gScores li em { font-style: normal; color: #8a9098; font-size: 11px; }

.gScores li.gEmpty { color: #8a9098; }

.flagImg { height: 1em; vertical-align: -0.12em; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2); }

body.gaming #tabBar,
body.gaming #topTools,
body.gaming #centerCircle { display: none; }

#gameHud { position: absolute; inset: 0; z-index: 40; pointer-events: none; }

#gameHud[hidden] { display: none; }

#hudCard {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(92%, 460px);
  padding: 10px 12px;
  background: rgba(20, 24, 34, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  color: #e8eaed;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
}

#hudHead { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #9aa0a6; }

#hudRound { flex: 1; }

#hudQuit { padding: 0 4px; background: none; border: none; color: #9aa0a6; font-size: 14px; cursor: pointer; }

#hudQuit:hover { color: #fff; }

#hudSkip {
  padding: 3px 8px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  color: #c7cbd1;
  font-size: 11px;
  cursor: pointer;
}

#hudPrompt { margin-top: 6px; font-size: 15px; line-height: 1.4; }

#hudFeedback { margin-top: 6px; font-size: 13px; color: var(--accent); }

#hudInputs { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }

#hudInputs[hidden] { display: none; }

#hudInputs input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #fff;
  font: inherit;
  font-size: 14px;
}

#hudInputs input::placeholder { color: #8a9098; }

#hudInputs input:focus { outline: none; border-color: var(--accent); }

#hudPlayers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.hudP {
  display: flex;
  gap: 8px;
  min-width: 86px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 12px;
  color: #c7cbd1;
}

.hudP.active { border-color: var(--accent); color: #fff; }

.hudP b { letter-spacing: 1px; }

.hudP span { margin-left: auto; }

#hudActions {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  pointer-events: auto;
}

.hudBtn {
  padding: 9px 16px;
  background: rgba(20, 24, 34, 0.94);
  color: #e8eaed;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.hudBtn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }

.hudBtn:disabled { opacity: 0.45; cursor: default; }

#gameModal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none; /* map stays explorable behind reveal cards */
}

#gameModal[hidden] { display: none; }

#ggSplash {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 1;
  transition: opacity 2s ease;
}

#ggSplash[hidden] { display: none; }

#ggSplash.fade { opacity: 0; }

#ggSplash img {
  width: min(62vmin, 460px);
  height: auto;
  filter: drop-shadow(0 10px 40px rgba(0, 0, 0, 0.55));
}

#gmCard {
  width: min(92%, 360px);
  padding: 16px;
  background: rgba(20, 24, 34, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  color: #e8eaed;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  pointer-events: auto;
}

#gmTitle { margin-bottom: 10px; font-size: 15px; font-weight: 700; }

#gmBody { font-size: 13px; line-height: 1.5; color: #c7cbd1; }

.gmTarget { margin-bottom: 8px; color: #e8eaed; }

.gmWinner { margin-bottom: 8px; font-size: 15px; font-weight: 700; color: var(--accent); }

.gmRows { display: flex; flex-direction: column; gap: 6px; list-style: none; margin: 0; padding: 0; }

.gmRows li { display: flex; gap: 10px; }

.gmRows li b { letter-spacing: 1px; }

.gmRows li span:last-child { margin-left: auto; text-align: right; }

.gmRows small { color: #8a9098; }

#gmActions { display: flex; gap: 8px; margin-top: 14px; }

.gmBtn {
  flex: 1;
  padding: 9px 12px;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 768px) {
  #hudCard { top: 8px; width: calc(100% - 16px); }

  #hudActions { bottom: 12px; width: calc(100% - 16px); }

  .hudBtn { flex: 1; padding: 10px 8px; }

  #hudInputs input { font-size: 16px; } /* ponytail: keeps iOS from zooming the page on focus */
}
