/* Trippr Travel Radio · a Trippr Travel experiment by Maya Labs
   Layout idea: a dark globe fills the screen; a single glass panel on the left holds brand, search, list and player.
   Single theme by choice, matching tripprtravel.com's dark "art" skin: warm near-black, fire orange, gold. */
:root {
  --ink: #0c0a09;          /* page and globe background: Trippr header black */
  --panel: rgba(28, 25, 23, 0.86);
  --panel-solid: #1c1917;
  --line: rgba(214, 200, 190, 0.14);
  --text: #f4f2f1;
  --muted: #a8a29e;
  --signal: #e8640c;       /* Trippr "fire": a station transmitting */
  --signal-soft: rgba(232, 100, 12, 0.18);
  --gold: #f59f0a;         /* Trippr gold: the current station */
  --live: #84cc16;         /* semantic: stream is up (Trippr lime) */
  --warn: #f59f0a;         /* semantic: reconnecting */
  --font-display: "Bebas Neue", "Barlow Condensed", Impact, sans-serif;
  --font-body: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
  --side-w: 380px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.4;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg { width: 20px; height: 20px; display: block; }

/* ---------- splash ---------- */
.splash {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(ellipse at 50% 40%, #2a1d12 0%, var(--ink) 65%);
  transition: opacity .6s ease;
}
.splash.is-gone { opacity: 0; pointer-events: none; }
.splash-mark { width: 84px; height: 84px; border-radius: 26px; background: var(--panel-solid); border: 1px solid var(--line); display: grid; place-items: center; margin-bottom: 8px; }
.splash-mark .pulse, .brand-mark span {
  width: 18px; height: 18px; border-radius: 50%; background: var(--signal);
  box-shadow: 0 0 0 0 rgba(232,100,12,.6);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(232,100,12,.55); } 100% { box-shadow: 0 0 0 22px rgba(232,100,12,0); } }
.splash-logo { width: 240px; max-width: 70vw; height: auto; margin-bottom: 2px; filter: brightness(0) invert(1); }
.radio-word { font-family: var(--font-display); font-weight: 400; letter-spacing: .14em; color: var(--gold); line-height: 1; }
.splash .radio-word { font-size: 34px; }
.splash-name { font-family: var(--font-display); font-weight: 400; font-size: 28px; letter-spacing: .04em; }
.splash-sub { color: var(--muted); }
.splash-bar { width: 140px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 8px; }
.splash-bar span { display: block; height: 100%; width: 8%; background: var(--signal); transition: width .4s ease; }
.splash-foot { position: absolute; bottom: 22px; color: var(--muted); font-size: 12px; letter-spacing: .04em; }

/* ---------- map ---------- */
#map { position: fixed; inset: 0; background: var(--ink); }
.maplibregl-ctrl-attrib { background: rgba(11,15,26,.6) !important; color: var(--muted); font-size: 11px; }
.maplibregl-ctrl-attrib a { color: var(--muted); }
.maplibregl-ctrl-group { background: var(--panel-solid) !important; border: 1px solid var(--line); box-shadow: none !important; }
.maplibregl-ctrl-group button { filter: invert(1) brightness(1.6); }
.maplibregl-canvas:focus { outline: none; }
.maplibregl-popup-content { background: var(--panel-solid); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-family: var(--font-body); font-size: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.maplibregl-popup-tip { border-top-color: var(--panel-solid) !important; }

/* ---------- side panel ---------- */
.side {
  position: fixed; top: 14px; left: 14px; bottom: 14px; width: var(--side-w); z-index: 10;
  display: flex; flex-direction: column;
  background: var(--panel); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  overflow: hidden;
}
.brand { display: flex; flex-direction: column; gap: 6px; padding: 16px 16px 10px; }
.eyebrow { display: flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.eyebrow .live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 0 rgba(232,100,12,.6); animation: pulse 2.4s ease-out infinite; }
.brand-row { display: flex; align-items: center; gap: 10px; }
.brand-logo { height: 30px; width: auto; display: block; filter: brightness(0) invert(1); }  /* same trick tripprtravel.com uses on its header */
.brand h1 { font-family: var(--font-display); font-weight: 400; font-size: 26px; margin: 0; line-height: 1; letter-spacing: .14em; color: var(--gold); padding-top: 2px; }
.brand-sub { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

.search-wrap { position: relative; margin: 4px 16px 10px; }
.search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
#q {
  width: 100%; height: 42px; padding: 0 36px 0 40px; border-radius: 12px;
  background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--text); font: inherit;
}
#q::placeholder { color: var(--muted); }
#q::-webkit-search-cancel-button { display: none; }
.q-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; color: var(--muted); font-size: 18px; line-height: 1; }
.q-clear:hover { background: rgba(255,255,255,.08); color: var(--text); }

.chips { display: flex; gap: 6px; padding: 0 16px 10px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--text); white-space: nowrap;
}
.chip.is-on { background: var(--signal); border-color: var(--signal); color: #fff; font-weight: 600; }

.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 16px 12px; }
.quick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 12px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line); font-size: 12.5px; color: var(--text);
}
.quick-btn svg { width: 22px; height: 22px; color: var(--signal); }
.quick-btn:hover { background: rgba(255,255,255,.08); }
.quick-btn[aria-pressed="true"] { background: var(--signal-soft); border-color: var(--signal); }

.list-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.list-head { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 16px 6px; }
.list-head h2 { font-family: var(--font-display); font-size: 19px; font-weight: 400; letter-spacing: .06em; margin: 0; text-wrap: balance; }
.list-count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.list { flex: 1; overflow-y: auto; padding: 0 8px 8px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.row {
  display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px;
  width: 100%; padding: 8px; border-radius: 12px; text-align: left; border: 1px solid transparent;
}
.row:hover { background: rgba(255,255,255,.05); }
.row.is-cur { background: var(--signal-soft); border-color: rgba(232,100,12,.35); }
.row .art { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 400; font-size: 15px; letter-spacing: .04em; color: #fff; overflow: hidden; }
.row .art img { width: 100%; height: 100%; object-fit: cover; }
.row .t { min-width: 0; }
.row .n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .m { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .heart { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.row .heart:hover { color: var(--text); background: rgba(255,255,255,.08); }
.row .heart.is-on { color: var(--signal); }
.row .heart.is-on svg path { fill: var(--signal); }
.country-row { grid-template-columns: 36px 1fr auto; }
.country-row .art { background: rgba(255,255,255,.06); font-size: 18px; }
.country-row .cnt { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; padding-right: 8px; }
.empty { padding: 28px 16px; color: var(--muted); text-align: center; }
.empty strong { display: block; color: var(--text); margin-bottom: 4px; font-weight: 600; }
.about { padding: 8px 12px 16px; color: var(--muted); font-size: 13px; }
.about p { margin: 0 0 10px; }
.about a { color: var(--signal); }
.about h3 { font-family: var(--font-display); color: var(--gold); font-size: 16px; letter-spacing: .08em; margin: 14px 0 6px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--signal); font-size: 12.5px; font-weight: 600; padding: 4px 8px; margin: 2px 8px 6px; border-radius: 8px; }
.back:hover { background: rgba(255,255,255,.06); }

.tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 8px; font-size: 11px; color: var(--muted); }
.tab svg { width: 20px; height: 20px; }
.tab.is-on { color: var(--signal); }

/* ---------- player ---------- */
.player { border-top: 1px solid var(--line); background: rgba(11,15,26,.55); padding: 10px 12px 12px; }
.np { display: flex; align-items: center; gap: 10px; }
.np-art { width: 40px; height: 40px; border-radius: 11px; background: rgba(255,255,255,.06); display: grid; place-items: center; font-family: var(--font-display); font-weight: 400; font-size: 16px; letter-spacing: .04em; color: #fff; overflow: hidden; flex: 0 0 auto; }
.np-art img { width: 100%; height: 100%; object-fit: cover; }
.np-text { flex: 1; min-width: 0; }
.np-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-meta { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.np-meta .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.np-meta .track { color: var(--text); font-weight: 500; }
.np-meta.has-track { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.np-meta.has-track .dot { display: inline-block; vertical-align: middle; margin-right: 5px; }
.np-meta.is-live .dot { background: var(--live); box-shadow: 0 0 8px var(--live); }
.np-meta.is-busy .dot { background: var(--warn); }
.np-meta.is-err .dot { background: var(--signal); }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.icon-btn:hover:not(:disabled) { color: var(--text); background: rgba(255,255,255,.08); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.is-on { color: var(--signal); }
.icon-btn.is-on svg path { fill: var(--signal); }
.controls { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.play {
  width: 50px; height: 50px; border-radius: 50%; background: var(--signal); color: #fff; display: grid; place-items: center; position: relative;
  box-shadow: 0 6px 18px rgba(232,100,12,.35); transition: transform .12s ease;
}
.play:hover:not(:disabled) { transform: scale(1.05); }
.play:disabled { opacity: .4; box-shadow: none; cursor: default; }
.play svg { width: 24px; height: 24px; }
.play .ico-stop, .play .spinner { display: none; }
.play.is-playing .ico-play { display: none; }
.play.is-playing .ico-stop { display: block; }
.play.is-busy .ico-play, .play.is-busy .ico-stop { display: none; }
.play.is-busy .spinner { display: block; width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 22px; margin-left: 8px; flex: 1; opacity: .25; }
.bars i { width: 4px; height: 20%; background: var(--signal); border-radius: 2px; transform-origin: bottom; }
.bars.is-on { opacity: 1; }
.bars.is-on i { animation: bar 1s ease-in-out infinite alternate; }
.bars.is-on i:nth-child(2) { animation-duration: .7s; } .bars.is-on i:nth-child(3) { animation-duration: 1.3s; }
.bars.is-on i:nth-child(4) { animation-duration: .9s; } .bars.is-on i:nth-child(5) { animation-duration: 1.1s; }
.bars.is-on i:nth-child(6) { animation-duration: .6s; } .bars.is-on i:nth-child(7) { animation-duration: 1.2s; }
.bars.is-on i:nth-child(8) { animation-duration: .8s; }
@keyframes bar { from { height: 15%; } to { height: 100%; } }
.vol { display: flex; align-items: center; width: 90px; }
#vol { width: 100%; accent-color: var(--signal); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 60;
  background: var(--panel-solid); border: 1px solid var(--line); color: var(--text);
  padding: 10px 16px; border-radius: 12px; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.5);
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- phone: the globe is the stage, the panel is a draggable bottom sheet ---------- */
.mobile-bar, .sheet-handle { display: none; }
/* phones, and tablets held upright: the sheet layout gives the globe the full width */
@media (max-width: 760px), (max-width: 1024px) and (orientation: portrait) {
  :root { --side-w: auto; }
  body { overscroll-behavior: none; }
  .side {
    top: auto; left: 0; right: 0; bottom: 0; height: 56vh;
    border-radius: 22px 22px 0 0; border-bottom: 0; box-shadow: 0 -12px 40px rgba(0,0,0,.5);
    transition: height .38s cubic-bezier(.2,.8,.2,1);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .side.is-dragging { transition: none; }
  .sheet-handle { display: grid; place-items: center; height: 28px; flex: 0 0 auto; order: 0; cursor: grab; touch-action: none; }
  .sheet-handle span { width: 44px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.22); }
  .sheet-handle:focus-visible span { background: var(--signal); }
  /* order inside the sheet: handle, player, tabs, then the explore content */
  .player { order: 1; border-top: 0; border-bottom: 1px solid var(--line); padding: 2px 14px 10px; background: transparent; }
  .tabs { order: 2; border-top: 0; border-bottom: 1px solid var(--line); }
  .brand { display: none; }
  .search-wrap { order: 3; margin-top: 12px; }
  .chips { order: 4; }
  .quick { order: 5; }
  .list-wrap { order: 6; border-top: 0; }
  .mobile-bar {
    position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 12px; z-index: 10;
    display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 11px; border-radius: 999px;
    background: var(--panel); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line);
    pointer-events: none;
  }
  .mobile-logo { height: 20px; width: auto; filter: brightness(0) invert(1); }
  .mobile-bar .radio-word { font-size: 19px; padding-top: 2px; }
  .mobile-sub { color: var(--muted); font-size: 11px; margin-left: 2px; font-variant-numeric: tabular-nums; }
  .maplibregl-ctrl-bottom-right { display: none; }   /* pinch to zoom, drag to spin */
  .maplibregl-ctrl-bottom-left { display: none; }
  .maplibregl-ctrl-top-right .maplibregl-ctrl-attrib { display: none; }
  /* touch targets */
  .chip { padding: 9px 14px; font-size: 13.5px; }
  .quick-btn { padding: 11px 4px; font-size: 12.5px; }
  .row { padding: 10px 8px; }
  .row .heart { width: 40px; height: 40px; }
  .play { width: 56px; height: 56px; }
  .icon-btn { width: 40px; height: 40px; }
  .controls { margin-top: 8px; }
  .vol { display: none; }
  .tab { padding: 10px 4px 9px; font-size: 11.5px; }
  .list { padding-bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .splash-mark .pulse, .eyebrow .live-dot, .bars.is-on i, .play .spinner { animation: none; }
  .splash, .toast, .play { transition: none; }
}
