:root {
  --bg1: #0c2a52;
  --bg2: #050f22;
  --blue: #1fb4f0;
  --blue-d: #0a84d6;
  --red: #ff4a4a;
  --red-d: #d3121c;
  --text: #ffffff;
  --muted: #a9b8d6;
  --glass: rgba(255,255,255,.06);
  --line: rgba(255,255,255,.1);
  --tabs-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: radial-gradient(120% 70% at 50% 15%, var(--bg1) 0%, #081a38 45%, var(--bg2) 100%) fixed;
  -webkit-tap-highlight-color: transparent;
}

.shell { max-width: 480px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }

/* ---------- Barra superior ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(14px + env(safe-area-inset-top)) 20px 10px;
  background: linear-gradient(var(--bg2), rgba(5,15,34,0));
}
.top-actions { display: flex; gap: 8px; }

.live {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 800; letter-spacing: .14em;
  padding: 7px 12px; border-radius: 999px; background: var(--glass); color: var(--muted);
}
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.live.on { color: #fff; background: rgba(255,74,74,.18); }
.live.on .dot { background: var(--red); animation: blink 1.2s infinite; }

.install {
  border: 1px solid var(--blue); color: var(--blue); background: transparent;
  padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; cursor: pointer;
}
.donate-pill {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  color: #fff; font-weight: 700; font-size: 13px; padding: 7px 14px; border-radius: 999px;
  background: linear-gradient(135deg, var(--red), var(--red-d));
  box-shadow: 0 6px 18px rgba(211,18,28,.35);
}
.donate-pill svg { width: 15px; height: 15px; fill: currentColor; }

/* ---------- Vistas ---------- */
.view {
  flex: 1; width: 100%;
  padding: 8px 24px calc(var(--tabs-h) + 24px + env(safe-area-inset-bottom));
}
#view-live { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; }
#view-live[hidden], .view[hidden] { display: none; }

.cover { position: relative; width: min(86vw, 360px); display: grid; place-items: center; }
.logo { width: 100%; height: auto; position: relative; z-index: 1; filter: drop-shadow(0 18px 40px rgba(0,0,0,.45)); }
.rings { position: absolute; inset: 0; display: grid; place-items: center; }
.rings span {
  position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%;
  border: 2px solid var(--blue); opacity: 0;
}
.rings.on span { animation: ripple 3s infinite; }
.rings.on span:nth-child(2) { animation-delay: 1s; border-color: var(--red); }
.rings.on span:nth-child(3) { animation-delay: 2s; }

.status { color: var(--muted); font-size: 14px; text-align: center; min-height: 1.4em; }

.controls { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 24px; }

.play {
  width: 88px; height: 88px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--red), var(--red-d)); color: #fff;
  display: grid; place-items: center; position: relative;
  box-shadow: 0 12px 34px rgba(211,18,28,.45), inset 0 0 0 4px rgba(255,255,255,.15);
  transition: transform .15s;
}
.play:active { transform: scale(.94); }
.play svg { width: 40px; height: 40px; fill: currentColor; }
.spinner {
  position: absolute; inset: 8px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.25); border-top-color: #fff;
  animation: spin .9s linear infinite;
}

.volume { width: 100%; display: flex; align-items: center; gap: 12px; }
.volume button { background: none; border: none; color: var(--muted); cursor: pointer; padding: 4px; }
.volume svg { width: 24px; height: 24px; fill: currentColor; }
.volume input { flex: 1; accent-color: var(--blue); }

/* ---------- Nosotros ---------- */
.about h2 { font-size: 24px; font-weight: 800; margin: 12px 0 12px; }
.about h2:not(:first-child) { margin-top: 32px; }
.about p { color: #d6def0; line-height: 1.6; margin-bottom: 12px; font-size: 15px; }
.about strong { color: #fff; }

.cards { display: grid; gap: 12px; margin-top: 20px; }
.card {
  padding: 18px; border-radius: 18px; background: var(--glass);
  border: 1px solid var(--line); border-left: 4px solid var(--blue);
}
.card.red { border-left-color: var(--red); }
.card h3 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 8px; color: var(--blue); }
.card.red h3 { color: var(--red); }
.card p { margin: 0; font-size: 14px; }

.donate-big {
  margin-top: 24px; display: flex; align-items: center; justify-content: center; gap: 10px;
  text-decoration: none; color: #fff; font-weight: 800; font-size: 16px;
  padding: 16px; border-radius: 16px;
  background: linear-gradient(135deg, var(--red), var(--red-d));
  box-shadow: 0 10px 28px rgba(211,18,28,.35);
}
.donate-big svg { width: 20px; height: 20px; fill: currentColor; }

.contact { list-style: none; display: grid; gap: 10px; }
.contact a {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border-radius: 14px; background: var(--glass); border: 1px solid var(--line);
  color: #fff; text-decoration: none; font-size: 15px; line-height: 1.35;
}
.contact svg { width: 22px; height: 22px; fill: var(--blue); flex: none; }

.foot { color: var(--muted); font-size: 12px; text-align: center; margin-top: 32px; line-height: 1.6; }

/* ---------- Pestañas ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  max-width: 480px; margin: 0 auto;
  display: flex; height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(5,15,34,.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1; background: none; border: none; color: var(--muted); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 700;
}
.tab svg { width: 24px; height: 24px; fill: currentColor; }
.tab.active { color: var(--blue); }

[hidden] { display: none !important; }

@keyframes blink { 50% { opacity: .3; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ripple {
  0% { transform: scale(.85); opacity: .55; }
  100% { transform: scale(1.45); opacity: 0; }
}

/* Install guide */
.install { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; background: rgba(31,180,240,.12); white-space: nowrap; }
.install svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.install-guide { position: fixed; inset: 0; margin: auto; width: min(90vw, 400px); max-height: 85dvh; overflow: auto; padding: 24px; background: #10233e; color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 22px; box-shadow: 0 18px 60px #0008; }
.install-guide::backdrop { background: rgba(0,0,0,.65); }
.install-guide h2 { font-size: 22px; margin-bottom: 10px; }
.install-guide p { color: #d6def0; line-height: 1.5; }
.install-guide ol { padding-left: 22px; margin: 18px 0; }
.install-guide li { margin: 10px 0; line-height: 1.5; }
.install-guide button { width: 100%; padding: 12px; border: 0; border-radius: 12px; background: #1fb4f0; color: #05152c; font-weight: 800; cursor: pointer; }
@media(max-width:350px) { .top { padding-left: 10px; padding-right: 10px; } .install,.donate-pill { padding-left: 9px; padding-right: 9px; } }

/* Grand Rapids: full-screen video behind the radio, with a navy overlay. */
:root { --city-overlay: .60; }
body { isolation: isolate; }
.city-background {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: center 46% / cover no-repeat url("/media/grand-rapids-bg.jpg");
}
.city-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  object-position: center 46%; opacity: 0; transition: opacity .7s ease;
}
.city-video.has-frame { opacity: 1; }
.city-background::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5,15,34,.82) 0%, rgba(7,26,51,var(--city-overlay)) 36%, rgba(5,15,34,.73) 73%, #050f22 100%);
}
.shell { position: relative; z-index: 1; }
.status { color: #e4edf9; text-shadow: 0 2px 10px #050f22; }
.logo { filter: drop-shadow(0 4px 20px rgba(5,15,34,.82)); }
.top { background: linear-gradient(rgba(5,15,34,.92),rgba(5,15,34,0)); }
.city-toggle { background: rgba(5,15,34,.55); color: #d6def0; border: 1px solid rgba(255,255,255,.22); border-radius: 999px;
  font: inherit; font-size: 12px; padding: 8px 14px; cursor: pointer; }
body.about-open .city-background::after { background: rgba(5,15,34,.91); }
@media (prefers-reduced-motion: reduce) {
  .city-video { transition: none; }
  .rings.on span { animation: none; }
}

/* Keep Safari's initial paint simple; no live video layer until explicitly requested. */
html { background-color: #050f22; }
.city-background { display: block; }
body { background-attachment: scroll; }
body.ios-safe { isolation: auto; }
body.ios-safe .logo { filter: none; }
body.ios-safe .tabs { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(5,15,34,.96); }
body.ios-safe .rings.on span { animation: none; }
.city-video { top:0; left:0; right:0; bottom:0; }
