/* NewsRadio — dark, mobile-first player UI */

:root {
  --bg: #0f1115;
  --bg-elev: #171a21;
  --bg-elev2: #1e222b;
  --text: #e8eaed;
  --text-dim: #9aa0a6;
  --accent: #1a73e8;
  --accent-dim: #11519b;
  --danger: #e3746f;
  --new: #f9ab00;
  --radius: 14px;
  --tap: 48px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 14px calc(env(safe-area-inset-bottom) + 24px);
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0 10px;
  background: linear-gradient(var(--bg) 82%, transparent);
}

.logo {
  display: block;
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 4px 10px rgba(39, 142, 255, 0.28));
}

.title {
  font-size: 20px;
  font-weight: 750;
  margin: 0;
  letter-spacing: 0.2px;
  background: linear-gradient(100deg, #f4f8ff 15%, #78c8ff 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.header-live {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: #4ade80;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- Now playing card ---------- */

.player {
  position: sticky;
  top: 46px;
  z-index: 4;
  background: var(--bg-elev);
  border: 1px solid #252a35;
  border-radius: var(--radius);
  padding: 14px;
  margin: 6px 0 18px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

.player-now-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 6px;
}

.player-title {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 600;
}

.player-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.player-show { color: var(--text-dim); font-size: 13px; }

.player-updated {
  font-size: 12px;
  color: #4ade80;
  font-weight: 600;
}

.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #1a1a1a;
  background: var(--new);
  border-radius: 5px;
  padding: 2px 6px;
  vertical-align: middle;
}

.player-note, .player-error {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.4;
}

.player-error { color: var(--danger); font-weight: 600; }
.player-note { color: var(--text-dim); }

.progress {
  height: 6px;
  background: var(--bg-elev2);
  border-radius: 3px;
  margin: 12px 0;
  overflow: hidden;
}

.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s linear;
}

/* ---------- Controls ---------- */

.controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.ctrl-btn {
  min-height: var(--tap);
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-elev2);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, transform 0.05s ease;
}

.ctrl-btn:active { transform: scale(0.97); }

.ctrl-play { background: var(--accent); color: #fff; }
.ctrl-play:hover { background: var(--accent-dim); }

.ctrl-active {
  border: 2px solid var(--accent);
  background: rgba(26, 115, 232, 0.12);
  color: var(--text);
}

.auto-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 5px 10px;
  border: 1px solid #252a35;
  border-radius: 999px;
  background: var(--bg-elev2);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.auto-toggle.is-on { color: var(--text); border-color: #2a3a55; }

.auto-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6b7280;
}

.auto-toggle.is-on .auto-dot { background: #4ade80; }

/* ---------- Show list ---------- */

.show-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.show-row {
  display: flex;
  align-items: stretch;
  background: var(--bg-elev);
  border: 1px solid #252a35;
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.show-row.is-current { border-color: var(--accent); }

.show-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  padding: 12px 14px;
  min-height: 84px;
  background: transparent;
  border: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.show-main:active { background: var(--bg-elev2); }

.show-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

.show-name {
  font-size: 14px;
  font-weight: 600;
}

.show-ep {
  font-size: 13px;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
}

.show-pub {
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.85;
}

.show-offline {
  font-size: 11px;
  font-weight: 600;
  color: var(--danger);
}

.show-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  border-left: 1px solid #252a35;
  background: var(--bg-elev2);
}

.play-mini {
  min-width: 44px;
  min-height: 44px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.play-mini:active { background: var(--accent-dim); }

.yt {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--text-dim);
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.yt svg { width: 22px; height: 22px; }
.yt:hover { color: var(--text); }

.footnote {
  margin-top: 20px;
  padding: 0 4px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-dim);
  text-align: center;
}

.visit-counter {
  margin-top: 10px;
  color: #6f7d91;
  letter-spacing: 0.35px;
}

.visit-counter strong {
  color: #a9cfff;
  font-weight: 700;
}
