/* Additions on top of styles.css (the original demo visual system). */

/* Marker layer: same footprint as #globeViz, but every marker is positioned
   by our own camera projection each frame, so points stay glued to the globe. */
#markerLayer {
  position: absolute;
  top: 0;
  left: 12%;
  width: 88%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}
#markerLayer .globe-marker { position: absolute; }

.globe-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-capsule);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 4px 12px;
}
.globe-search input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 13px;
  width: 150px;
}
.globe-search input::placeholder { color: var(--text-dim); }
.search-results {
  display: none;
  position: absolute;
  top: 38px;
  right: 0;
  width: 280px;
  max-height: 340px;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  backdrop-filter: blur(20px);
  z-index: 300;
}
.search-results.show { display: block; }
.search-result-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-main);
}
.search-result-item:hover { background: rgba(255, 255, 255, 0.07); }
.search-result-item small {
  display: block;
  color: var(--text-dim);
  font-size: 11px;
  margin-top: 3px;
}
.search-empty { padding: 14px; color: var(--text-dim); font-size: 12px; }

.chips-row { display: flex; align-items: center; gap: 6px; }
.capsule-pill { cursor: pointer; user-select: none; }
.capsule-pill.active { border-color: var(--border-glow); color: var(--text-main); }

/* Two equal-size rows with fixed prefixes. No horizontal scrolling: each row
   shows "All + current pick + top few", everything else lives in a popover. */
.bottom-dock-container {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: min(92vw, 1060px);
  overflow: visible;
  padding: 9px 12px;
  border-radius: 20px;
}
.chips-line { display: flex; align-items: center; gap: 9px; min-width: 0; }
.chips-line-label {
  flex: 0 0 auto; min-width: 44px; max-width: 82px;
  text-align: right; white-space: nowrap;
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  color: var(--text-muted); opacity: .9;
}
.chips-row {
  flex: 1 1 auto; min-width: 0; flex-wrap: nowrap;
  gap: 6px; padding: 1px 0;
}
.bottom-dock-container .capsule-pill {
  flex: 0 0 auto; font-size: 13.5px; font-weight: 500;
  padding: 7px 11px; border-color: rgba(255,255,255,.1);
  border-radius: 999px;
}
.bottom-dock-container .capsule-pill.active {
  background: rgba(255,255,255,.08);
  border-color: var(--border-glow); color: var(--text-main);
}
#subjectChips .capsule-pill.active {
  border-color: var(--accent-color); color: var(--accent-secondary);
}
.chips-more { opacity: .68; letter-spacing: .1em; }
.chips-more:hover { opacity: 1; }
.chips-row .capsule-pill.zero-count { opacity: .34; }
.opt-genre.og-active .og-name { color: var(--accent-color); }

/* iOS frosted-glass popover: full movement / subject list with live counts. */
.chips-popover {
  position: absolute; z-index: 80;
  left: 50%; bottom: 152px; transform: translate(-50%, 8px);
  width: min(92vw, 660px); max-height: min(62vh, 460px);
  display: none; flex-direction: column;
  padding: 12px 14px 10px;
  border-radius: 20px;
  background: rgba(20,26,34,.82);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  box-shadow: 0 18px 48px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.08);
  opacity: 0; transition: opacity .18s ease, transform .18s ease;
}
.chips-popover.open { display: flex; opacity: 1; transform: translate(-50%, 0); }
.cp-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 700; letter-spacing: .06em;
  color: var(--text-main); padding: 0 2px 10px;
}
.cp-close {
  background: transparent; border: 0; cursor: pointer;
  color: var(--text-muted); font-size: 12px; line-height: 1;
  padding: 3px 5px; border-radius: 6px;
}
.cp-close:hover { background: rgba(255,255,255,.1); color: var(--text-main); }
.cp-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 6px; overflow-y: auto; padding: 2px;
}
.cp-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; border-radius: 11px; cursor: pointer;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.07);
  font-size: 13px; color: var(--text-main);
  transition: background .16s, border-color .16s;
}
.cp-item:hover { background: rgba(255,255,255,.12); }
.cp-item.cp-active { border-color: var(--accent-color); background: rgba(56,189,248,.13); }
.cp-item.cp-zero { opacity: .34; cursor: default; }
.cp-item.cp-zero:hover { background: rgba(255,255,255,.045); }
.cp-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-item-count { flex: 0 0 auto; font-size: 10.5px; color: var(--text-muted); }
.cp-foot {
  font-size: 9.5px; color: var(--text-dim); text-align: center;
  padding: 9px 0 0; letter-spacing: .02em;
}
.theme-cream .chips-popover {
  background: rgba(252,250,246,.9); border-color: rgba(0,0,0,.12);
  box-shadow: 0 18px 42px rgba(0,0,0,.16);
}
.theme-cream .cp-item { background: rgba(0,0,0,.035); border-color: rgba(0,0,0,.09); }
.theme-cream .cp-item:hover { background: rgba(0,0,0,.08); }
.theme-cream .cp-item.cp-active { background: rgba(56,189,248,.16); }
@media (max-width: 700px) {
  .chips-popover { bottom: 160px; }
  .cp-grid { grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); }
}

/* ---- iOS-style 3D wheel picker for eras (native CSS 3D, no libraries) ---- */
.era-widget {
  position: absolute; left: 18px; top: 47%;
  transform: translateY(-50%); z-index: 50;
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 12px 10px 10px;
  width: 104px; border-radius: 24px;
  background: rgba(14,18,24,.66);
  border: 1px solid rgba(255,255,255,.15);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  box-shadow: 0 14px 40px rgba(0,0,0,.46),
              inset 0 1px 0 rgba(255,255,255,.12),
              inset 0 0 26px rgba(0,0,0,.24);
}
.era-title {
  font-size: 9.5px; font-weight: 700; letter-spacing: .18em;
  color: var(--text-muted); opacity: .8; text-transform: uppercase;
}
.era-hint {
  font-size: 8.5px; line-height: 1.35; letter-spacing: .04em;
  color: var(--text-dim); opacity: .82;
  text-align: center; max-width: 92px; min-height: 22px;
  overflow-wrap: anywhere;
}
/* Perspective lives on the viewport; the stage holds the cylinder. */
.era-wheel {
  position: relative; width: 100%; height: 208px;
  perspective: 420px; perspective-origin: 50% 50%;
  overflow: hidden; touch-action: none; user-select: none;
  cursor: grab;
}
.era-wheel.dragging { cursor: grabbing; }
.ew-stage {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}
.ew-item {
  position: absolute; left: 0; right: 0; top: 50%;
  height: 34px; margin-top: -17px;
  display: flex; align-items: center; justify-content: center;
  white-space: nowrap; font-variant-numeric: tabular-nums;
  font-weight: 500; letter-spacing: .01em;
  color: var(--text-muted);
  backface-visibility: hidden;
  transform-origin: 50% 50%;
  will-change: transform, opacity, filter;
  pointer-events: none;
}
.ew-item.ew-center {
  color: #fff; font-weight: 700;
  text-shadow: 0 0 16px rgba(255,255,255,.4);
}
/* Two hairline gold guides bracketing the selected row. */
.ew-cursor {
  position: absolute; left: 5px; right: 5px; top: 50%;
  height: 34px; margin-top: -17px; pointer-events: none; z-index: 5;
  border-top: 1px solid rgba(226,190,121,.62);
  border-bottom: 1px solid rgba(226,190,121,.62);
  background: rgba(255,255,255,.025);
  border-radius: 3px;
  box-shadow: 0 -6px 14px -8px rgba(226,190,121,.7),
              0 6px 14px -8px rgba(226,190,121,.7);
}
/* Top / bottom fade so distant rows dissolve, but keep the curve readable. */
.ew-fade { position: absolute; left: 0; right: 0; height: 34%; pointer-events: none; z-index: 3; }
.ew-fade-top { top: 0; background: linear-gradient(to bottom, rgba(12,16,21,.88), rgba(12,16,21,0)); }
.ew-fade-bottom { bottom: 0; background: linear-gradient(to top, rgba(12,16,21,.88), rgba(12,16,21,0)); }

.theme-cream .era-widget {
  background: rgba(255,255,255,.7); border-color: rgba(0,0,0,.12);
  box-shadow: 0 14px 32px rgba(0,0,0,.17), inset 0 1px 0 rgba(255,255,255,.75);
}
.theme-cream .era-title, .theme-cream .era-hint { color: #6a6a62; opacity: .9; }
.theme-cream .ew-item { color: #6b6b63; }
.theme-cream .ew-item.ew-center { color: #16232b; text-shadow: 0 0 12px rgba(0,0,0,.12); }
.theme-cream .ew-cursor {
  border-color: rgba(158,122,57,.5);
  box-shadow: 0 -6px 14px -8px rgba(158,122,57,.5), 0 6px 14px -8px rgba(158,122,57,.5);
}
.theme-cream .ew-fade-top { background: linear-gradient(to bottom, rgba(248,246,240,.88), rgba(248,246,240,0)); }
.theme-cream .ew-fade-bottom { background: linear-gradient(to top, rgba(248,246,240,.88), rgba(248,246,240,0)); }

/* Wheel now lives on the left edge (vertical center); the right-edge drawer
   never covers it, so it stays fully visible while the drawer is open. */
.era-widget { transition: opacity .22s ease; }
@media (max-height: 760px) {
  .era-wheel { height: 164px; }
  .era-widget { gap: 6px; padding: 9px 9px; }
}
@media (max-width: 900px) {
  .era-widget { left: 10px; top: 40%; width: 94px; }
  .bottom-dock-container { padding: 8px 10px; }
  .chips-line-label { min-width: 36px; font-size: 10.5px; }
  .bottom-dock-container .capsule-pill { font-size: 12px; padding: 6px 11px; }
}

/* ---- Horizontal decade scrubber for eras: its OWN frosted bar, floating
   above the chip dock (no shared container). JS positions it just above the
   dock via #timelineDock bottom; two independent bars, gap between. ---- */
.era-strip {
  position: fixed; left: 50%; transform: translateX(-50%);
  z-index: 45;
  display: flex; align-items: center; gap: 12px;
  width: min(92vw, 1060px);
  padding: 8px 16px;
  border-radius: 14px;
  background: rgba(14,18,24,.55);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 10px 30px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.1);
}
.theme-cream .era-strip {
  background: rgba(255,255,255,.62);
  border-color: rgba(0,0,0,.12);
  box-shadow: 0 10px 26px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.7);
}
/* Dedicated "All eras" reset button (left of the strip). Styled EXACTLY like the
   dock's "全部" chips below (same size/border), only with a subtle active state —
   no gold glow, so it doesn't grab attention. */
.era-all-btn {
  flex: 0 0 auto; min-width: 84px;
  font-size: 13.5px; font-weight: 500;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  color: var(--text-main); white-space: nowrap; user-select: none;
  background: transparent; border: 1px solid rgba(255,255,255,.1);
  transition: all .15s ease;
}
.era-all-btn:hover { border-color: rgba(255,255,255,.35); }
.era-all-btn.active {
  background: rgba(255,255,255,.08);
  border-color: var(--border-glow);
  box-shadow: none;
}
.theme-cream .era-all-btn { border-color: rgba(0,0,0,.14); }
.theme-cream .era-all-btn:hover { border-color: rgba(0,0,0,.32); }
.theme-cream .era-all-btn.active {
  background: rgba(0,0,0,.06);
  border-color: var(--border-glow);
}
.era-strip-count {
  flex: 0 0 auto; min-width: 52px; text-align: right;
  font-size: 11px; color: var(--text-dim); white-space: nowrap;
}
.era-strip-track {
  position: relative; flex: 1 1 auto; min-width: 0;
  height: 4px; border-radius: 2px;
  background: rgba(255,255,255,.18);
  cursor: pointer; touch-action: none; user-select: none;
}
.era-strip-handle {
  position: absolute; top: 50%; left: 0;
  width: 16px; height: 16px; border-radius: 50%;
  background: #e8c27a;
  box-shadow: 0 0 10px rgba(232,194,122,.75);
  transform: translate(-50%, -50%);
  cursor: grab;
}
.era-strip-handle:active { cursor: grabbing; }
.era-strip-handle.all {
  background: transparent;
  border: 2px solid rgba(232,194,122,.85);
  box-shadow: none;
}
@media (max-width: 900px) {
  .era-strip { gap: 8px; padding: 7px 12px; }
  .era-all-btn { min-width: 70px; font-size: 12px; padding: 5px 11px; }
}

/* Author drawer: waterfall of works + nearby radio */
#artistDrawer { width: 460px; right: -480px; }
#artistDrawer.open { right: 0; }
.drawer-artist-line {
  font-size: 13px;
  color: var(--text-muted);
  margin: 2px 0 14px;
  line-height: 1.6;
}
.works-grid { columns: 2; column-gap: 10px; }
.work-card {
  display: inline-block;
  width: 100%;
  break-inside: avoid;
  margin-bottom: 10px;
  background: var(--bg-capsule);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.work-card:hover { border-color: var(--border-glow); transform: translateY(-2px); }
.work-card img {
  width: 100%;
  display: block;
  background: rgba(255, 255, 255, 0.04);
}
.work-card .wc-body { padding: 8px 10px 10px; }
.work-card .wc-title {
  font-size: 12px;
  color: var(--text-main);
  line-height: 1.45;
}
.work-card .wc-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 5px;
}
.work-card .wc-fav {
  float: right;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
}
.work-card .wc-fav.on { color: var(--coral-orange); }

.nearby-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}
.nearby-title {
  font-size: 12px;
  color: var(--accent-color);
  font-weight: 600;
  margin-bottom: 4px;
}
.nearby-sub { font-size: 11px; color: var(--text-dim); margin-bottom: 10px; }
.radio-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 8px;
  background: var(--bg-capsule);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-main);
}
.radio-item:hover, .radio-item.playing { border-color: var(--border-glow); }
.radio-item .ri-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 250px;
}
.radio-item .ri-dist {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 11px;
  white-space: nowrap;
}

.hero-link-continue { cursor: pointer; }

/* Screensaver: radio picker + wake lock hint */
.ss-controls {
  position: absolute;
  bottom: 22px;
  left: 24px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}
.ss-controls select {
  background: var(--bg-capsule);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  max-width: 260px;
}
.ss-hint {
  position: absolute;
  top: 20px;
  left: 24px;
  z-index: 4;
  font-size: 12px;
  color: var(--text-dim);
}

.loading-note {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.loading-spinner {
  width: 80px;
  height: 80px;
}
.loading-spinner svg {
  width: 100%;
  height: 100%;
}
.loading-text {
  color: var(--text-muted);
  font-size: 13px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 20px;
}

/* Native fullscreen: the UA sizes the fullscreen element itself. */
.screensaver-overlay:fullscreen {
  width: 100vw;
  height: 100vh;
  background: #020603;
}

/* A painting should be shown whole, not cropped like a photo wallpaper. */
.screensaver-image {
  object-fit: contain !important;
  background: #020603;
  transition: opacity 0.8s ease;
}
.screensaver-exit-btn, .screensaver-hud { transition: opacity 0.8s ease; }
.ss-controls { z-index: 20; opacity: 1; }

/* Clickable HTML markers. Replaces globe.gl 3D points, which are actually
   extruded cylinders: raising pointAltitude made them look like pillars. */
.globe-marker {
  position: relative;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  transition: opacity 0.16s ease;
}
.globe-marker .gm-dot {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e7fff4;
  border: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 3px rgba(5, 13, 8, 0.18), 0 0 12px rgba(52, 211, 153, 0.75);
  transition: transform 0.15s ease, background 0.15s ease;
}
.globe-marker.radio .gm-dot {
  width: 9px;
  height: 9px;
  background: #fde68a;
  box-shadow: 0 0 0 2px rgba(5, 13, 8, 0.18), 0 0 9px rgba(251, 191, 36, 0.6);
}
.globe-marker:hover .gm-dot { transform: scale(1.6); }
.globe-marker.era-past .gm-dot { opacity: 0.4; box-shadow: none; }
/* Decades not yet reached stay fully hidden and non-interactive, so picking an
   early era shows only that era's painters instead of a field of stray dots. */
.globe-marker.era-off { opacity: 0; pointer-events: none; }
.globe-marker.era-hi .gm-dot {
  background: #f3d489; border-color: #7a5a16;
  box-shadow: 0 0 0 4px rgba(232,194,122,0.22), 0 0 16px rgba(232,194,122,0.9);
}
.globe-marker.active .gm-dot {
  width: 17px;
  height: 17px;
  background: #ff5b36;
  border-color: #7f1d1d;
  box-shadow: 0 0 0 4px rgba(255, 91, 54, 0.25), 0 0 16px rgba(255, 91, 54, 0.9);
}
.globe-marker .gm-label {
  position: absolute;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-main);
  background: var(--bg-capsule);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 3px 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.globe-marker:hover .gm-label,
.globe-marker.active .gm-label { opacity: 1; }
/* ---------------------------------------------------------------------------
   Gallery Cream: the globe keeps the public-domain NASA night texture in both
   themes - the texture cannot be swapped inside one WebGL canvas, and filtering
   it into "paper" flattened the sphere into a washed-out disc. What changes in
   the ivory theme is only the scene around it: the canvas background becomes
   ivory and the atmosphere turns warm beige (see setAppTheme in app.js), so the
   night globe reads as a dark marble set on a cream page.
   --------------------------------------------------------------------------- */
body.theme-cream .globe-marker .gm-dot {
  border-color: rgba(255, 255, 255, .45);
  box-shadow: 0 0 0 3px rgba(245, 243, 236, .22), 0 0 10px rgba(52, 211, 153, .7);
}
body.theme-cream .globe-marker.active .gm-dot { border-color: rgba(255, 255, 255, .5); }

/* Country name hint directly under the logo */
.country-badge {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  width: max-content;
  max-width: 330px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-capsule);
  border: 1px solid var(--border-glow);
  border-radius: 999px;
  padding: 5px 10px 5px 14px;
  pointer-events: auto;
}
.country-badge.show { display: flex; }
.country-badge strong {
  color: var(--text-main);
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.country-badge button {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
}

/* Globe / Options switch + options drawer */
.segmented-switch { flex-shrink: 0; }
#txtViewGlobe, #txtViewOptions { white-space: nowrap; }
#optionsDrawer { width: 400px; right: -420px; z-index: 110; }
#optionsDrawer.open { right: 0; }
.opt-group { margin-bottom: 22px; }
.opt-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-color);
  margin: 2px 0 4px;
}
.opt-sub { font-size: 11px; color: var(--text-dim); margin-bottom: 12px; line-height: 1.5; }
.opt-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
  background: var(--bg-capsule);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-main);
}
.opt-item:hover, .opt-item.active { border-color: var(--border-glow); }
.opt-item .oi-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-item .oi-count { margin-left: auto; color: var(--text-dim); font-size: 12px; white-space: nowrap; }
.opt-item .oi-arrow { color: var(--text-dim); font-size: 12px; }

/* Reference-style category drawer: tabs, station rows with favicons, genre bars */
#optionsDrawer { width: 420px; right: -440px; }
#optionsTitle { display: flex; flex-direction: column; gap: 2px; }
.opt-brand { font-size: 11px; font-weight: 400; color: var(--text-muted); }
.opt-heading { font-size: 19px; font-weight: 600; color: var(--text-main); line-height: 1.25; }

.opt-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  background: var(--bg-capsule);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
}
.opt-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  padding: 7px 4px;
  border-radius: 999px;
  cursor: pointer;
}
.opt-tab.active { background: rgba(255, 255, 255, 0.12); color: var(--text-main); font-weight: 600; }

.opt-searchwrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--coral-orange);
  border-radius: 10px;
  color: var(--text-dim);
}
.opt-search {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 13px;
}
.opt-search::placeholder { color: var(--text-dim); }
.opt-filter { font-size: 12px; color: var(--text-muted); padding: 4px 2px 14px; cursor: pointer; }
.opt-filter:hover { color: var(--text-main); }
.opt-count { font-size: 12px; color: var(--text-dim); margin: 4px 0 10px; }
.opt-empty { font-size: 12px; color: var(--text-dim); line-height: 1.7; padding: 18px 4px; }

.opt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
}
.opt-row:hover { background: rgba(255, 255, 255, 0.035); }
.opt-logo {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.opt-logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ol-fallback { font-size: 15px; font-weight: 600; }
.opt-main { flex: 1; min-width: 0; }
.opt-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.opt-line {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.opt-act { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 13px; padding: 4px; }
.opt-act:hover, .opt-act.on { color: var(--coral-orange); }
/* Low-key source attribution link (station's own website). */
.opt-src {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--border-subtle);
  cursor: pointer;
}
.opt-src:hover { color: var(--accent-color); border-bottom-color: var(--accent-color); }
.active-source {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--border-subtle);
  cursor: pointer;
  align-self: flex-start;
}
.active-source:hover { color: var(--accent-color); border-bottom-color: var(--accent-color); }

.opt-genre {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 4px 18px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.opt-genre:hover .og-name { color: var(--accent-color); }
.og-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.og-name { font-size: 14px; font-weight: 600; color: var(--text-main); }
.og-count { margin-left: auto; font-size: 13px; color: var(--text-muted); }
.og-bar { position: absolute; left: 4px; bottom: 9px; height: 2px; border-radius: 2px; opacity: 0.75; }


/* Unified line icons and the two-row player action bar (no more emoji). */
.ico { width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }
.ico .ico-fill, .ico polygon.ico-fill, .ico rect.ico-fill { fill:currentColor; stroke:none; }
.act-btn { display:inline-flex; align-items:center; gap:7px; background:none; border:none; color:var(--text-muted); font-size:13px; cursor:pointer; padding:6px 2px; }
.act-btn:hover, .act-btn.on { color:var(--text-main); }
.act-btn.on .ico { fill:var(--coral-orange); stroke:var(--coral-orange); }
.act-divider { width:1px; height:22px; background:var(--border-subtle); }
.hero-actions-primary { display:flex; align-items:center; gap:16px; margin-top:22px; flex-wrap:wrap; }
.hero-actions-secondary { display:flex; align-items:center; gap:16px; margin-top:16px; flex-wrap:wrap; }
.vol-wrap { display:inline-flex; align-items:center; gap:9px; }
.vol-slider { -webkit-appearance:none; appearance:none; width:104px; height:3px; border-radius:3px; background:rgba(255,255,255,0.28); outline:none; }
.vol-slider::-webkit-slider-thumb { -webkit-appearance:none; appearance:none; width:12px; height:12px; border-radius:50%; background:var(--text-main); cursor:pointer; }
.vol-slider::-moz-range-thumb { width:12px; height:12px; border:none; border-radius:50%; background:var(--text-main); cursor:pointer; }
.active-status { display:flex; align-items:center; gap:8px; font-size:12px; color:var(--text-muted); margin-bottom:14px; }
.active-status .status-dot-active { width:6px; height:6px; border-radius:50%; background:var(--coral-orange); }
.active-status.paused .status-dot-active { background:var(--text-dim); }
.active-station-geo { display:flex; align-items:center; gap:8px; }
.listening-timer-pill { display:inline-flex; align-items:center; gap:8px; }
.btn-play-circle-large { display:inline-flex; align-items:center; justify-content:center; }
#btnActivePlay .ico { width:20px; height:20px; }

.btn-roam-next { display:inline-flex; align-items:center; gap:8px; margin-top:12px; padding:9px 16px; border-radius:999px; border:1px solid var(--border-glow); background:transparent; color:var(--text-main); font-size:13px; cursor:pointer; }
.btn-roam-next:hover { background:rgba(168,133,255,0.14); border-color:#a885ff; }
.toast { position:fixed; left:50%; bottom:34px; transform:translate(-50%,20px); z-index:500; max-width:76vw; display:none; flex-direction:column; gap:6px; padding:12px 18px; border-radius:12px; background:var(--bg-panel); border:1px solid var(--border-glow); color:var(--text-main); font-size:13px; box-shadow:0 8px 30px rgba(0,0,0,.45); }
.toast.show { display:flex; transform:translate(-50%,0); }
.toast code { display:block; max-width:70vw; overflow:auto; white-space:nowrap; font-size:12px; color:var(--accent-color); user-select:all; }

/* Hero: one primary action, one quiet text link - no two equal-size buttons. */
.btn-inspect-art { display:inline-flex; align-items:center; gap:7px; margin-top:14px; padding:0; border:none; background:transparent; color:var(--text-muted); font-size:12px; cursor:pointer; }
.btn-inspect-art .ico { width:14px; height:14px; }
.btn-inspect-art:hover { color:var(--text-main); }
.btn-roam-next { padding:11px 20px; font-size:14px; font-weight:600; border-color:var(--coral-orange); }
/* Saved rows use an orange outline bookmark, not a delete cross. Clicking it
   removes the item; the icon is the same one used to save it. */
.opt-act.opt-bookmark { display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px; border-radius:7px; }
.opt-act.opt-bookmark .ico { width:17px; height:17px; }
.opt-act.opt-bookmark.on { color:var(--coral-orange); }
.opt-act.opt-bookmark.on .ico { fill:rgba(255,91,54,0.12); stroke:var(--coral-orange); stroke-width:1.9; }
.opt-act.opt-bookmark:hover { background:rgba(255,91,54,0.10); }

/* Clock: solid light typography instead of the hollow neon outline. */
.top-right-clock { top:72px; right:52px; }
.clock-digits {
  font-family:"Helvetica Neue", "Inter", "Segoe UI", Arial, sans-serif;
  font-size:70px;
  font-weight:200;
  letter-spacing:-1.5px;
  line-height:1;
  color:var(--text-main);
  -webkit-text-stroke:0;
  text-shadow:0 2px 26px rgba(255,255,255,0.10);
  font-variant-numeric:tabular-nums;
  font-feature-settings:"tnum" 1;
}
body.theme-cream .clock-digits { -webkit-text-stroke:0; text-shadow:none; }
.clock-location { font-size:11px; letter-spacing:1.8px; color:var(--text-dim); text-transform:uppercase; margin-top:8px; }

/* The hero is a flex column, so buttons were being stretched to the width of
   the longest child (the artist name). Pin the primary action instead. */
.btn-roam-next {
  width: 200px;
  min-width: 200px;
  max-width: 200px;
  align-self: flex-start;
  justify-content: center;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-inspect-art { align-self: flex-start; }

/* Artist rows read as a person, not a framed painting. */
.opt-logo-artist { border-radius:50%; border:1px solid rgba(255,255,255,0.14); }
.opt-logo-artist .ol-fallback { font-size:17px; font-weight:300; }

/* Clock: bigger, lighter, more presence. */
.clock-digits {
  font-size:94px;
  font-weight:200;
  letter-spacing:-3px;
  text-shadow:0 6px 46px rgba(255,255,255,0.16);
}
.clock-location { font-size:12px; letter-spacing:2.4px; margin-top:10px; }

/* ---------- Settings gear ---------- */
.settings-panel { position:absolute; top:64px; right:48px; width:318px; max-height:calc(100vh - 96px); overflow-y:auto; z-index:120; display:none; padding:18px 18px 14px; border-radius:14px; background:#0b1310; border:1px solid var(--border-glow); box-shadow:0 18px 54px rgba(0,0,0,.65); }
.settings-panel.show { display:block; }
.sp-head { display:flex; align-items:center; justify-content:space-between; font-size:14px; font-weight:600; color:var(--text-main); padding-bottom:12px; border-bottom:1px solid var(--border-subtle); }
.sp-close { background:none; border:none; color:var(--text-dim); cursor:pointer; font-size:14px; }
.sp-group { padding:14px 0; border-bottom:1px solid var(--border-subtle); }
.sp-label { font-size:11px; letter-spacing:1.6px; text-transform:uppercase; color:var(--text-dim); margin-bottom:10px; }
.sp-row { display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:12.5px; color:var(--text-muted); margin:8px 0; }
.sp-row select { flex:0 0 158px; max-width:158px; background:rgba(255,255,255,0.06); color:var(--text-main); border:1px solid var(--border-subtle); border-radius:7px; padding:5px 7px; font-size:12px; cursor:pointer; }
.sp-row select option { background:#101a16; color:#f8fafc; }
.sp-check { display:flex; align-items:center; gap:8px; font-size:12px; color:var(--text-muted); margin-top:10px; cursor:pointer; }
.sp-note { font-size:11.5px; line-height:1.5; color:var(--text-dim); margin-top:9px; }
.settings-panel .theme-segmented-switch { width:100%; justify-content:flex-start; }
.settings-panel .sp-lang-btn { width:100%; justify-content:center; }
.settings-panel .lang-dropdown-menu { width:100%; }
.settings-panel .sp-flag { display:none; }
.sp-saved { display:flex; align-items:center; justify-content:center; gap:8px; width:100%; margin-top:14px; padding:9px; border-radius:9px; background:rgba(255,91,54,0.10); border:1px solid rgba(255,91,54,0.35); color:var(--text-main); font-size:12.5px; cursor:pointer; }
.sp-saved .ico { width:14px; height:14px; }
.sp-saved:hover { background:rgba(255,91,54,0.20); }

/* ---------- Screensaver: show the whole painting, no cropping ---------- */
.screensaver-image {
  min-width:0 !important; min-height:0 !important;
  width:100% !important; height:100% !important;
  object-fit:contain !important;
  animation:none !important; transform:none !important;
  transition:opacity .8s ease;
}
.screensaver-backdrop { position:absolute; inset:0; display:block; width:100%; height:100%; object-fit:cover; filter:blur(60px) brightness(.58) saturate(.9); transform:scale(1.25); opacity:1; }
.screensaver-overlay { background:#050907; }
.ss-step { background:rgba(255,255,255,0.09); border:1px solid var(--border-subtle); color:var(--text-main); width:26px; height:26px; border-radius:50%; cursor:pointer; font-size:16px; line-height:1; }
.ss-step:hover { background:rgba(255,91,54,.35); }


/* ---------- Ambient Gallery: fill the screen without cropping the work ---------- */
.screensaver-motion-layer { width:100vw; height:100vh; }
.screensaver-image {
  width:100vw !important; height:100vh !important;
  max-width:100vw !important; max-height:100vh !important;
  min-width:0 !important; min-height:0 !important;
  display:block !important;
  object-fit:contain !important;
  object-position:center center !important;
  animation:none !important; transform:none !important;
}
/* Lift the blurred copy out of near-black so the letterboxing reads as a room,
   not a hole. The painting itself is still shown whole and uncropped. */
.screensaver-backdrop { filter:blur(48px) brightness(.74) saturate(1.05); opacity:.92; }

/* ---------- Settings: calmer spacing, unified controls, no loud CTA ---------- */
.settings-panel {
  width:344px;
  padding:22px 22px 20px;
  border-radius:16px;
  background:rgba(8,15,12,.96);
  border:1px solid rgba(255,255,255,.10);
  box-shadow:0 24px 70px rgba(0,0,0,.72);
}
.sp-head { font-size:15px; letter-spacing:.4px; padding-bottom:16px; margin-bottom:2px;
  border-bottom:1px solid rgba(255,255,255,.07); }
.sp-close { font-size:15px; line-height:1; padding:4px 7px; border-radius:7px; }
.sp-close:hover { color:var(--text-main); background:rgba(255,255,255,.07); }
.sp-group { padding:18px 0 8px; border-bottom:1px solid rgba(255,255,255,.06); }
.sp-group:last-of-type { border-bottom:none; }
.sp-label { font-size:10px; letter-spacing:2px; color:var(--text-dim); margin-bottom:14px; }
.sp-row { margin:12px 0; gap:16px; font-size:13px; color:var(--text-main); }
.sp-row select { flex:0 0 164px; max-width:164px; padding:8px 10px; font-size:12.5px;
  border:1px solid rgba(255,255,255,.10); border-radius:8px;
  background:rgba(255,255,255,.04); }
.sp-check { margin-top:14px; font-size:12.5px; }
.sp-check input { accent-color:var(--coral-orange); width:14px; height:14px; }
.sp-note { font-size:11.5px; line-height:1.6; }
.settings-panel .theme-segmented-switch { width:100%; justify-content:space-around; padding:4px; }
.settings-panel .sp-lang-btn { width:100%; justify-content:center; padding:9px 12px;
  border-radius:9px; border:1px solid rgba(255,255,255,.10); background:rgba(255,255,255,.04); }


/* ---------- Museum wall: the letterboxing reads as a gallery ---------- */
.screensaver-overlay,
.screensaver-overlay:fullscreen {
  background:
    radial-gradient(ellipse 68% 48% at 50% 6%, rgba(255,246,226,.13), transparent 72%),
    linear-gradient(180deg, #1c2420 0%, #151c18 45%, #0d1210 100%) !important;
}
.screensaver-overlay::before {
  content:''; position:absolute; inset:0; z-index:0; pointer-events:none;
  background:radial-gradient(ellipse 92% 82% at 50% 46%, transparent 38%, rgba(0,0,0,.50) 100%);
}
/* The blurred copy of the painting looked like a phone wallpaper. Drop it;
   the wall is pure CSS, so no extra image request and no invented content. */
.screensaver-backdrop { display:none !important; }
.screensaver-motion-layer { z-index:1; }
.screensaver-image {
  width:auto !important; height:auto !important;
  max-width:88vw !important; max-height:76vh !important;
  min-width:0 !important; min-height:0 !important;
  object-fit:contain !important;
  border:1px solid rgba(255,255,255,.14);
  box-shadow:0 30px 80px rgba(0,0,0,.78), 0 4px 16px rgba(0,0,0,.60);
  background:#111614;
}
/* Museum label: a hairline, a modest title, small caps metadata. */
.screensaver-hud { z-index:10; bottom:38px; right:56px; }
.screensaver-hud::before {
  content:''; display:block; width:190px; height:1px; margin:0 0 14px auto;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.38));
}
.ss-title { font-size:20px !important; font-weight:400; letter-spacing:.4px; color:#f2eee5; }
.ss-meta { font-size:11px !important; letter-spacing:1.05px; text-transform:uppercase;
  color:#9ba79e; margin-top:8px !important; }
.ss-controls { opacity:.55; }

/* Keep the museum label clear of the painting: bounded width so long titles
   wrap, and enough wall below the (76vh) artwork to sit without overlapping. */
.screensaver-hud { bottom:3.5vh !important; right:4vw !important; width:min(38vw,480px); }
.ss-title { font-size:19px !important; line-height:1.35; }


/* Saved points are the SAME dot in a different colour - no offset badge.
   Orange stays "currently selected"; violet means "in my collection". */
.globe-marker.saved:not(.active) .gm-dot {
  background:#c4b5fd;
  border-color:#6d5b97;
  box-shadow:0 0 0 3px rgba(196,181,253,.20), 0 0 14px rgba(196,181,253,.85);
}
.globe-marker.radio.saved:not(.active) .gm-dot {
  background:#c4b5fd;
  box-shadow:0 0 0 2px rgba(196,181,253,.22), 0 0 11px rgba(196,181,253,.75);
}
.globe-marker.dim.saved:not(.active) .gm-dot { opacity:.35; box-shadow:none; }


/* Fallback when WebGL is unavailable: the real earth texture as a flat map,
   so the screen is never black and every marker still sits on its country. */
#globeViz.flat-globe {
  background:
    radial-gradient(ellipse 90% 90% at 50% 50%, transparent 42%, rgba(2,6,5,.72) 100%),
    url('assets/earth-night.jpg') center center / 100% 100% no-repeat,
    #0a1310;
}
.globe-diag {
  display:none; position:absolute; left:50%; top:96px; transform:translateX(-50%);
  z-index:260; max-width:min(88vw,720px); padding:12px 18px; border-radius:10px;
  background:rgba(10,18,15,.94); border:1px solid rgba(255,140,90,.45);
  color:#f2eee5; font-size:13px; line-height:1.55; text-align:center;
  box-shadow:0 10px 32px rgba(0,0,0,.5);
}
.globe-diag.show { display:block; }
.globe-diag small { display:block; margin-top:6px; font-size:10.5px;
  letter-spacing:.4px; color:#8fa79a; word-break:break-all; }


/* Settings panel: a fixed slate-green palette, independent of the page theme.
   Using --text-* variables here was the bug: in the light theme they turn
   near-black while the panel stays dark, so every label disappeared. */
.settings-panel {
  background:#16211d !important;
  border:1px solid rgba(186,214,201,.22) !important;
  color:#f1f5f2 !important;
  box-shadow:0 24px 70px rgba(0,0,0,.72) !important;
}
.settings-panel .sp-head { color:#f1f5f2 !important; border-bottom-color:rgba(255,255,255,.11) !important; }
.settings-panel .sp-close { color:#aabdb3 !important; }
.settings-panel .sp-close:hover { color:#f1f5f2 !important; background:rgba(255,255,255,.10) !important; }
.settings-panel .sp-group { border-bottom-color:rgba(255,255,255,.09) !important; }
.settings-panel .sp-label { color:#9db4a9 !important; }
.settings-panel .sp-row { color:#e9f0ec !important; }
.settings-panel .sp-row select {
  background:#22302a !important;
  color:#f1f5f2 !important;
  border:1px solid rgba(186,214,201,.26) !important;
}
.settings-panel .sp-row select option { background:#16211d !important; color:#f1f5f2 !important; }
.settings-panel .sp-check { color:#cfddd6 !important; }
.settings-panel .sp-check input { accent-color:#ff8a65 !important; }
.settings-panel .sp-note { color:#9db4a9 !important; }
.settings-panel .sp-lang-btn {
  background:#22302a !important; color:#f1f5f2 !important;
  border:1px solid rgba(186,214,201,.24) !important;
}
.settings-panel .lang-dropdown-menu { background:#16211d !important; border-color:rgba(186,214,201,.22) !important; }
.settings-panel .lang-item-btn { color:#e9f0ec !important; }
.settings-panel .lang-item-btn:hover { background:rgba(255,255,255,.08) !important; }
/* The theme switch used to flip to a white capsule in the light theme. */
.settings-panel .theme-segmented-switch {
  background:#22302a !important;
  border:1px solid rgba(186,214,201,.24) !important;
}
.settings-panel .theme-seg-btn { color:#b9ccc2 !important; }
.settings-panel .theme-seg-btn:hover { color:#ffffff !important; }
.settings-panel .theme-seg-btn.active {
  background:#f1f5f2 !important; color:#16211d !important;
  box-shadow:0 1px 5px rgba(0,0,0,.4) !important;
}

/* Feedback button - fixed bottom-right */
.feedback-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 60;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.feedback-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.3);
}
@media (max-width: 900px) {
  .feedback-btn {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
  }
}

.same-movement { margin-top:24px; padding-top:18px; border-top:1px solid var(--border-subtle); }
.sm-head { display:flex; align-items:center; gap:10px; cursor:pointer; padding-bottom:6px; }
.sm-title { flex:1; font-size:13px; font-weight:600; color:var(--accent-color); }
.sm-count { font-size:11px; color:var(--text-dim); white-space:nowrap; }
.sm-toggle { font-size:11px; color:var(--text-muted); border:1px solid var(--border-subtle); border-radius:999px; padding:3px 11px; white-space:nowrap; }
.sm-toggle:hover { color:var(--text-main); border-color:var(--accent-color); }
.sm-artist { display:flex; align-items:baseline; gap:10px; margin:18px 0 10px; cursor:pointer; }
.sm-artist:hover .sm-artist-name { text-decoration:underline; }
.sm-artist-name { font-size:13px; color:var(--text-main); }
.sm-artist-meta { font-size:11px; color:var(--text-dim); }

/* Each peer folds independently; click the name to travel to that artist. */
.sm-head { cursor:default; }
.sm-artist-name { cursor:pointer; }
.sm-artist .sm-toggle { margin-left:auto; }
