/* ── Variables ── */
:root {
  --bg: #0f0520;
  --bg2: #1a0a2e;
  --bg3: #241340;
  --accent: #f5a623;
  --accent2: #e05c97;
  --text: #f0eaff;
  --text-muted: #9d89bf;
  --card-bg: #1e1035;
  --radius: 12px;
  --font: 'Noto Sans Telugu', 'Noto Sans', sans-serif;
  --bottom-nav-h: 64px;
  --player-h: 72px;
  --gradient: linear-gradient(135deg, #f5a623, #e05c97);
  --glass-bg: rgba(36, 19, 64, 0.6);
  --glass-border: rgba(245, 166, 35, 0.15);
  --glow: 0 0 20px rgba(245, 166, 35, 0.15);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ── Rich background with animated nebula ── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 10% 20%, rgba(245,166,35,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 60% at 90% 80%, rgba(224,92,151,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(100,60,200,0.05) 0%, transparent 70%);
  pointer-events: none;
  animation: nebula-drift 12s ease-in-out infinite alternate;
}
@keyframes nebula-drift {
  from { opacity: 0.7; transform: scale(1); }
  to   { opacity: 1;   transform: scale(1.05) translate(1%, 1%); }
}
.navbar, .main-content, .mini-player, .bottom-nav, footer { position: relative; z-index: 1; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font); }

/* ── Navbar ── */
.navbar {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg2);
  border-bottom: 1px solid var(--bg3);
  position: sticky; top: 0; z-index: 100;
}
/* In installed PWA standalone mode, push navbar below the notch */
@media (display-mode: standalone) {
  .navbar {
    padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
  }
}
.nav-brand { font-size: 1.2rem; font-weight: 700; color: var(--accent); white-space: nowrap; flex: 1; display: flex; align-items: center; gap: 0.5rem; }
.nav-logo { width: 28px; height: 28px; flex-shrink: 0; }
.nav-links { display: flex; gap: 1rem; align-items: center; }
.nav-links a { color: var(--text-muted); font-size: 0.9rem; transition: color .2s; white-space: nowrap; }
.nav-links a:hover { color: var(--text); }
.nav-user { display: flex; gap: 0.6rem; align-items: center; }
.btn-login, .btn-admin { background: var(--accent); color: #000; padding: 0.4rem 1rem; border-radius: 20px; font-weight: 600; font-size: 0.85rem; white-space: nowrap; }
.btn-lang { background: var(--bg3); color: var(--text); padding: 0.3rem 0.6rem; border-radius: 20px; font-size: 0.8rem; font-weight: 600; border: 1px solid var(--text-muted); transition: background .2s; white-space: nowrap; }
.btn-lang:hover { background: var(--accent); color: #000; border-color: var(--accent); }
.btn-logout { color: var(--text-muted); font-size: 0.85rem; white-space: nowrap; }

/* ── Main ── */
.main-content {
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  /* desktop: only mini-player padding */
  padding-bottom: calc(var(--player-h) + 1.5rem);
}

/* ── Hero ── */
.hero { text-align: center; padding: 3rem 1rem; }
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #fff8e7 0%, #f5a623 50%, #e05c97 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 2px 12px rgba(245,166,35,0.3));
}
.hero p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 1rem; }
.hero-about { font-size: 0.9rem; color: var(--text-muted); max-width: 480px; margin: 0 auto 1.25rem; line-height: 1.6; }
.hero-more-link { color: var(--accent); font-weight: 600; white-space: nowrap; }

/* ── Buttons ── */
.btn-primary {
  display: inline-block; background: var(--accent); color: #000;
  padding: 0.6rem 1.5rem; border-radius: 24px; font-weight: 700;
  border: none; font-size: 1rem; transition: opacity .2s;
  min-height: 44px; /* touch target */
}
.btn-primary:hover { opacity: 0.85; }
.btn-secondary { display: inline-block; border: 1px solid var(--accent); color: var(--accent); padding: 0.5rem 1.2rem; border-radius: 24px; font-size: 0.9rem; min-height: 44px; }
.btn-danger { background: #c0392b; color: #fff; padding: 0.5rem 1rem; border-radius: 6px; border: none; min-height: 44px; }
.btn-link { background: none; border: none; color: var(--accent); font-size: 0.9rem; padding: 0.25rem; }

/* ── Section ── */
.section { margin-bottom: 2.5rem; }
.section-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 1rem; }

/* ── Content Grid ── */
.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
.content-card { background: var(--card-bg); border-radius: var(--radius); overflow: hidden; transition: transform .2s; }
.content-card:hover { transform: translateY(-4px); }
.content-card img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.card-info { padding: 0.6rem; }
.card-title { font-weight: 600; font-size: 0.9rem; line-height: 1.3; }
.card-subtitle { color: var(--text-muted); font-size: 0.8rem; margin-top: 0.2rem; }
.card-meta { color: var(--text-muted); font-size: 0.75rem; margin-top: 0.3rem; }

/* ── Category Grid ── */
.category-grid { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.category-card {
  background: var(--bg3); padding: 0.6rem 1.1rem; border-radius: 24px;
  font-weight: 600; display: flex; align-items: center; gap: 0.5rem;
  transition: background .2s; font-size: 0.9rem; min-height: 44px;
}
.category-card:hover { background: var(--accent); color: #000; }

/* ── Content Detail ── */
.content-detail { max-width: 860px; }
.detail-header { display: flex; gap: 1.5rem; margin-bottom: 2rem; }
.detail-thumb { width: 180px; height: 180px; object-fit: cover; border-radius: var(--radius); flex-shrink: 0; }
.detail-meta { flex: 1; min-width: 0; }
.detail-meta h1 { font-size: 1.5rem; margin: 0.4rem 0; line-height: 1.3; }
.detail-meta .subtitle { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 0.5rem; }
.detail-meta .artist { color: var(--accent); margin-bottom: 0.75rem; }
.detail-meta .description { color: var(--text-muted); line-height: 1.6; margin-bottom: 0.75rem; font-size: 0.95rem; }
.detail-meta .play-count { font-size: 0.85rem; color: var(--text-muted); }
.badge { display: inline-block; background: var(--bg3); padding: 0.2rem 0.6rem; border-radius: 12px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .05em; }
.btn-bookmark { margin-top: 0.75rem; background: var(--bg3); border: 1px solid var(--accent2); color: var(--accent2); padding: 0.5rem 1rem; border-radius: 20px; font-size: 0.9rem; min-height: 44px; }

/* ── Episode list ── */
.episode-list { margin-top: 1.5rem; }
.episode-list h3 { font-size: 1.1rem; margin-bottom: 0.75rem; }
.episode-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem;
  background: linear-gradient(135deg, rgba(36,19,64,0.8), rgba(26,10,46,0.9));
  border: 1px solid rgba(245,166,35,0.08);
  border-radius: 10px; margin-bottom: 0.5rem;
  flex-wrap: wrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.ep-info { display: flex; align-items: center; gap: 0.5rem; flex: 1; min-width: 0; }
.ep-num { background: var(--bg3); width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; flex-shrink: 0; }
.ep-title { flex: 1; font-size: 0.9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-duration { color: var(--text-muted); font-size: 0.8rem; white-space: nowrap; }
.btn-play { background: var(--accent); color: #000; border: none; padding: 0.4rem 0.9rem; border-radius: 20px; font-weight: 600; font-size: 0.85rem; white-space: nowrap; min-height: 36px; flex-shrink: 0; }
.resume-badge { font-size: 0.75rem; color: var(--accent2); white-space: nowrap; }
.ep-active { background: #2a1a4a; border-left: 3px solid var(--accent); }

/* ── Search filters ── */
.search-form-full { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
.search-main-row { display: flex; gap: 0.75rem; }
.search-main-row input { flex: 1; background: var(--bg3); border: 1px solid var(--bg3); color: var(--text); padding: 0.6rem 1rem; border-radius: 24px; font-family: var(--font); font-size: 1rem; min-height: 44px; }
.search-main-row input:focus { outline: none; border-color: var(--accent); }
.filter-panel { background: var(--bg2); border: 1px solid var(--bg3); border-radius: var(--radius); }
.filter-panel summary { padding: 0.75rem 1rem; cursor: pointer; font-weight: 600; color: var(--text-muted); list-style: none; min-height: 44px; display: flex; align-items: center; }
.filter-panel summary::-webkit-details-marker { display: none; }
.filter-panel[open] summary { color: var(--text); border-bottom: 1px solid var(--bg3); }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem; padding: 1rem; }

/* ── Tags ── */
.tag-list { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.4rem; }
.tag { background: var(--bg3); color: var(--text-muted); font-size: 0.7rem; padding: 0.15rem 0.5rem; border-radius: 10px; }
.tag:hover { background: var(--accent); color: #000; }

/* ── Preferences ── */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.5rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; font-size: 0.95rem; min-height: 44px; }
.checkbox-label input { accent-color: var(--accent); width: 18px; height: 18px; }

/* ── Login ── */
.login-page { display: flex; justify-content: center; padding: 2rem 1rem; }
.login-box { background: var(--bg2); border-radius: var(--radius); padding: 2rem; width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 0.75rem; }
.login-box h1 { font-size: 1.5rem; text-align: center; }
.login-box p { text-align: center; color: var(--text-muted); }
.btn-oauth { display: flex; align-items: center; gap: 0.75rem; background: var(--bg3); border: 1px solid var(--bg3); color: var(--text); padding: 0.75rem 1rem; border-radius: 8px; font-size: 0.95rem; justify-content: center; width: 100%; min-height: 48px; }
.btn-oauth img { width: 20px; height: 20px; }
.btn-google { border-color: #4285f4; }
.btn-facebook { border-color: #1877f2; }
.login-box input[type=tel],
.login-box input[type=text],
.login-box input[type=email],
.login-box input[type=password] {
  background: var(--bg3); border: 1px solid var(--bg3); color: var(--text);
  padding: 0.75rem 1rem; border-radius: 8px; font-family: var(--font); font-size: 1rem; width: 100%; min-height: 48px;
}
.login-box input:focus { outline: none; border-color: var(--accent); }
.divider { text-align: center; color: var(--text-muted); font-size: 0.85rem; position: relative; padding: 0 3rem; }
.divider::before, .divider::after { content: ''; position: absolute; top: 50%; width: 35%; height: 1px; background: var(--bg3); }
.divider::before { left: 0; } .divider::after { right: 0; }
.error-msg { background: #4a1020; border: 1px solid #c0392b; padding: 0.5rem 0.75rem; border-radius: 6px; font-size: 0.85rem; color: #ff7675; }

/* ── Mini player ── */
.mini-player {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg2); border-top: 1px solid var(--bg3);
  padding: 0.5rem 1rem; z-index: 200;
  display: flex; align-items: center; gap: 0.75rem;
  min-height: var(--player-h);
}
.mini-player.hidden { display: none; }
.player-info { display: flex; align-items: center; gap: 0.6rem; flex: 1; min-width: 0; }
.player-info img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.player-text { min-width: 0; }
.player-title { font-weight: 600; font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-subtitle { color: var(--text-muted); font-size: 0.7rem; display: flex; align-items: center; gap: 0.35rem; overflow: hidden; }
.player-chapter-badge { background: var(--accent); color: #000; font-size: 0.6rem; font-weight: 700; padding: 0.1rem 0.4rem; border-radius: 8px; white-space: nowrap; flex-shrink: 0; }
#player-subtitle-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-controls { display: flex; gap: 0.25rem; align-items: center; flex-shrink: 0; }
.player-controls button { background: none; border: none; color: var(--text); font-size: 0.85rem; padding: 0.3rem 0.4rem; min-width: 32px; min-height: 32px; }
#btn-prev, #btn-next { font-size: 1rem; color: var(--text-muted); transition: color .2s, opacity .2s; }
#btn-prev:hover, #btn-next:hover { color: var(--accent); }
#btn-play-pause { background: var(--accent); color: #000; border-radius: 50%; width: 40px; height: 40px; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; }
.player-progress { display: flex; align-items: center; gap: 0.4rem; flex: 2; min-width: 0; }
.player-progress span { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; }
#player-seek { flex: 1; accent-color: var(--accent); min-width: 0; }
.player-extras { display: flex; gap: 0.4rem; align-items: center; flex-shrink: 0; }
.player-extras select { background: var(--bg3); color: var(--text); border: none; border-radius: 4px; font-family: var(--font); font-size: 0.75rem; padding: 0.2rem 0.3rem; }
.player-extras button { background: none; border: none; color: var(--text-muted); font-size: 0.9rem; padding: 0.3rem; }

/* ── Full Screen Player ── */
.full-player {
  position: fixed; inset: 0; z-index: 500;
  background: #0a0318;
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
  transition: transform .35s cubic-bezier(0.4, 0, 0.2, 1);
}
.full-player.hidden { display: none; }

.fp-header {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1rem 0;
}
.fp-btn-back, .fp-btn-menu {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.3rem; padding: 0.4rem; line-height: 1;
  flex-shrink: 0;
}
.fp-header-title { flex: 1; text-align: center; }
.fp-content-title { font-size: 0.82rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fp-artwork-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem 2rem 1rem;
  min-height: 0;
}
.fp-artwork {
  width: 100%; max-width: 320px; aspect-ratio: 1;
  object-fit: cover; border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7);
}

.fp-info {
  padding: 0 1.5rem 0.5rem;
}
.fp-title {
  font-size: 1.2rem; font-weight: 700; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fp-remaining { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.2rem; }

.fp-seek-wrap { padding: 0.5rem 1.5rem 0; }
.fp-seek {
  width: 100%; appearance: none; -webkit-appearance: none;
  height: 4px; border-radius: 2px;
  background: rgba(255,255,255,0.15); cursor: pointer;
  accent-color: var(--accent);
}
.fp-seek::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px;
  border-radius: 50%; background: #fff;
  box-shadow: 0 0 6px rgba(245,166,35,0.5);
}
.fp-times {
  display: flex; justify-content: space-between;
  font-size: 0.75rem; color: var(--text-muted); margin-top: 0.35rem;
}

.fp-controls {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
}
.fp-speed-btn {
  background: rgba(255,255,255,0.1); border: none; color: var(--text);
  font-size: 0.85rem; font-weight: 700; font-family: var(--font);
  padding: 0.35rem 0.65rem; border-radius: 20px; min-width: 52px;
}
.fp-ctrl-btn {
  background: none; border: none; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  padding: 0.4rem;
}
.fp-play-pause {
  width: 68px; height: 68px; border-radius: 50%;
  background: #fff; border: none; color: #000;
  font-size: 1.6rem; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 24px rgba(255,255,255,0.2);
  transition: transform .2s cubic-bezier(0.34,1.56,0.64,1);
  will-change: transform;
}
.fp-play-pause:active { transform: scale(0.9); }
.fp-sleep { font-size: 1.2rem; opacity: 0.6; }
.fp-sleep.active { opacity: 1; }

.fp-actions {
  display: flex; justify-content: space-between;
  padding: 0 1.5rem 1rem;
}
.fp-action-btn {
  background: none; border: none; color: var(--text-muted);
  font-size: 0.85rem; font-family: var(--font); padding: 0.4rem;
}
.fp-action-btn:disabled { opacity: 0.3; }

.fp-sleep-indicator {
  text-align: center; color: var(--accent);
  font-size: 0.8rem; padding: 0 1rem 0.5rem;
}
.fp-extras {
  display: flex; align-items: center; gap: 2rem;
  justify-content: center; padding: 0 1.5rem 0.75rem;
}
.fp-extra-btn {
  background: none; border: none; color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
  font-size: 1.3rem; font-family: var(--font); cursor: pointer;
  transition: color .2s, transform .2s;
}
.fp-extra-btn span:last-child { font-size: 0.72rem; }
.fp-extra-btn:active { transform: scale(0.88); }
.fp-share-copied {
  font-size: 0.75rem; color: var(--accent); align-self: center;
}

/* Expand button on mini-player */
.btn-expand-player {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.1rem; padding: 0.3rem;
}

/* ── Bottom navigation (mobile only) ── */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg2); border-top: 1px solid var(--bg3);
  z-index: 199;
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  justify-content: space-around; align-items: center;
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  color: var(--text-muted); font-size: 0.65rem; flex: 1;
  padding: 0.5rem 0; transition: color .2s; text-decoration: none;
}
.bottom-nav a .bn-icon { font-size: 1.3rem; line-height: 1; }
.bottom-nav a.active, .bottom-nav a:hover { color: var(--accent); }

/* ── Admin ── */
.admin-section h1 { margin-bottom: 1.5rem; }
.stat-cards { display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.stat-card { background: var(--card-bg); padding: 1rem 1.5rem; border-radius: var(--radius); min-width: 100px; }
.stat-num { font-size: 2rem; font-weight: 700; color: var(--accent); }
.stat-label { color: var(--text-muted); font-size: 0.85rem; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 1.5rem; font-size: 0.9rem; min-width: 500px; }
.admin-table th, .admin-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--bg3); text-align: left; white-space: nowrap; }
.admin-table th { color: var(--text-muted); font-weight: 600; }
.badge-green { background: #1a4a2e; color: #4caf50; }
.badge-gray { background: var(--bg3); color: var(--text-muted); }
.upload-form { max-width: 860px; display: flex; flex-direction: column; gap: 1rem; }
.upload-hint { color: var(--text-muted); margin-bottom: 0.5rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-divider { display: flex; align-items: center; gap: 1rem; color: var(--text-muted); font-size: 0.9rem; font-weight: 600; margin: 0.5rem 0; }
.form-divider::before, .form-divider::after { content: ''; flex: 1; height: 1px; background: var(--bg3); }
.part-row { background: var(--bg3); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.part-header { display: flex; align-items: center; justify-content: space-between; }
.part-label { font-weight: 600; color: var(--accent); }
.btn-remove-part { background: none; border: 1px solid #c0392b; color: #c0392b; padding: 0.2rem 0.6rem; border-radius: 6px; font-size: 0.8rem; cursor: pointer; }
.form-actions { display: flex; gap: 1rem; align-items: center; margin-top: 0.5rem; flex-wrap: wrap; }
.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-group label { font-size: 0.9rem; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea {
  background: var(--bg3); border: 1px solid var(--bg3); color: var(--text);
  padding: 0.6rem 0.75rem; border-radius: 8px; font-family: var(--font); font-size: 0.95rem;
  min-height: 44px;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); }
.edit-actions { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.content-info { background: var(--card-bg); padding: 1rem; border-radius: var(--radius); margin-bottom: 1.5rem; }
.content-info p { margin-bottom: 0.4rem; }

/* ── Footer ── */
.footer { text-align: center; color: var(--text-muted); font-size: 0.8rem; padding: 1rem; border-top: 1px solid var(--bg3); }

/* ── Continue Listening ── */
.continue-grid {
  display: flex; gap: 0.75rem; overflow-x: auto;
  padding-bottom: 0.5rem; scrollbar-width: none;
}
.continue-grid::-webkit-scrollbar { display: none; }
.continue-card {
  flex-shrink: 0; width: 140px; cursor: pointer;
  background: linear-gradient(145deg, rgba(42,20,70,0.9), rgba(30,16,53,0.95));
  border: 1px solid rgba(245,166,35,0.15);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .3s cubic-bezier(0.34,1.56,0.64,1), box-shadow .3s;
  will-change: transform;
}
.continue-card:active { transform: scale(0.95); }
.continue-thumb-wrap { position: relative; }
.continue-thumb { width: 140px; height: 140px; object-fit: cover; display: block; }
.continue-play-btn {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.35);
  font-size: 1.8rem; color: #fff;
  opacity: 0; transition: opacity .2s;
}
.continue-card:hover .continue-play-btn { opacity: 1; }
.continue-info { padding: 0.5rem 0.6rem 0.6rem; }
.continue-title { font-size: 0.82rem; font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.continue-sub  { font-size: 0.72rem; color: var(--accent); margin-top: 0.15rem; }
.continue-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.25rem; }
.continue-bar-wrap { background: rgba(255,255,255,0.1); border-radius: 2px; height: 3px; margin-top: 0.3rem; }
.continue-bar  { background: linear-gradient(90deg, #f5a623, #e05c97); height: 3px; border-radius: 2px; min-width: 4px; }

@media (hover: hover) and (pointer: fine) {
  .continue-card:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
  .continue-card:hover .continue-play-btn { opacity: 1; }
}

/* ── Top loading bar ── */
#loading-bar {
  position: fixed; top: 0; left: 0; z-index: 9999;
  height: 3px;
  background: linear-gradient(90deg, #f5a623, #e05c97);
  width: 0%;
  transition: width 0.3s ease;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(245,166,35,0.6);
}
#loading-bar.loading { animation: loading-bar-grow 1.5s ease forwards; }
#loading-bar.done    { width: 100% !important; opacity: 0; transition: opacity 0.3s ease; }
@keyframes loading-bar-grow {
  0%   { width: 0%; }
  30%  { width: 40%; }
  70%  { width: 70%; }
  100% { width: 85%; }
}

/* ── Play button loading state ── */
.btn-play.loading {
  opacity: 0.7;
  pointer-events: none;
  position: relative;
}
.btn-play.loading::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent 25%, rgba(255,255,255,0.15) 50%, transparent 75%);
  background-size: 200% 100%;
  animation: btn-shimmer 0.8s infinite;
}
@keyframes btn-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ── About page ── */
.about-hero { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; }
.about-logo  { width: 56px; height: 56px; flex-shrink: 0; }
.about-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700;
  background: var(--gradient); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.about-body { line-height: 1.85; font-size: 1.02rem; }
.about-body p { margin-bottom: 1.1rem; color: var(--text); }
.about-greeting { font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.about-subtitle { font-weight: 700; color: var(--accent); font-size: 1.05rem; margin-bottom: 0.5rem !important; }
.about-closing { font-weight: 600; color: var(--text); }
.about-tagline { font-size: 1.1rem; font-weight: 700; background: var(--gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.about-list { list-style: none; padding: 0; margin: 0 0 1.1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.about-list li { background: rgba(36,19,64,0.6); border: 1px solid rgba(245,166,35,0.12);
  border-radius: 10px; padding: 0.6rem 0.9rem; color: var(--text); }
.about-divider { height: 1px; background: linear-gradient(90deg, transparent, rgba(245,166,35,0.3), transparent);
  margin: 1.5rem 0; }

/* ── Profile ── */
.profile-card {
  display: flex; align-items: center; gap: 1rem;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.profile-avatar {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(245,166,35,0.3); flex-shrink: 0;
}
.profile-avatar-placeholder {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  background: var(--gradient); display: flex; align-items: center;
  justify-content: center; font-size: 1.4rem; font-weight: 700; color: #000;
}
.profile-name  { font-weight: 700; font-size: 1rem; }
.profile-email { color: var(--text-muted); font-size: 0.82rem; margin-top: 0.15rem; }

/* Nav avatar */
.btn-profile { display: flex; align-items: center; }
.nav-avatar  {
  width: 30px; height: 30px; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(245,166,35,0.4);
  transition: border-color .2s, transform .2s;
}
.nav-avatar:hover { border-color: var(--accent); transform: scale(1.08); }
.nav-avatar-initials {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--gradient); display: flex; align-items: center;
  justify-content: center; font-size: 0.8rem; font-weight: 700; color: #000;
  border: 2px solid rgba(245,166,35,0.4);
  transition: border-color .2s, transform .2s;
}
.nav-avatar-initials:hover { border-color: var(--accent); transform: scale(1.08); }

/* ── Welcome toast ── */
.welcome-toast {
  position: fixed; top: 1rem; left: 50%; transform: translateX(-50%);
  z-index: 9998;
  background: linear-gradient(135deg, rgba(36,19,64,0.97), rgba(26,10,46,0.99));
  border: 1px solid rgba(245,166,35,0.35);
  border-radius: 2rem;
  padding: 0.65rem 1.1rem 0.65rem 1.25rem;
  display: flex; align-items: center; gap: 0.75rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(245,166,35,0.08);
  font-size: 0.95rem; font-weight: 600; white-space: nowrap;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.welcome-toast-in  { animation: toast-in  .4s cubic-bezier(0.34,1.56,0.64,1) forwards; }
.welcome-toast-out { animation: toast-out .35s ease forwards; }
@keyframes toast-in  { from { opacity:0; transform:translateX(-50%) translateY(-16px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }
@keyframes toast-out { from { opacity:1; transform:translateX(-50%) translateY(0); } to { opacity:0; transform:translateX(-50%) translateY(-12px); } }
.welcome-toast-close { background:none; border:none; color:var(--text-muted); font-size:0.85rem; padding:0.1rem 0.2rem; line-height:1; }

/* ── Install PWA popup ── */
.install-popup {
  position: fixed; bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 0.75rem);
  left: 1rem; right: 1rem;
  background: linear-gradient(135deg, rgba(36,19,64,0.97), rgba(26,10,46,0.99));
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(245,166,35,0.3);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(245,166,35,0.08);
  z-index: 300;
  display: flex; flex-direction: column; gap: 0.6rem;
  animation: popup-slide-up .4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  max-width: 480px; margin: 0 auto;
}
.install-popup.hiding {
  animation: popup-slide-down .25s ease forwards;
}
@keyframes popup-slide-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes popup-slide-down {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(24px); }
}
.install-popup-header {
  display: flex; align-items: center; gap: 0.75rem;
}
.install-popup-icon {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  border: 1px solid rgba(245,166,35,0.2);
}
.install-popup-title { font-weight: 700; font-size: 0.95rem; }
.install-popup-sub { color: var(--text-muted); font-size: 0.8rem; margin-top: 0.1rem; }
.install-popup-ios-hint {
  background: rgba(245,166,35,0.08);
  border: 1px solid rgba(245,166,35,0.15);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.install-popup-ios-hint strong { color: var(--text); }
.install-popup-actions {
  display: flex; gap: 0.6rem; justify-content: flex-end; align-items: center;
}
.install-popup-actions .btn-install {
  background: linear-gradient(135deg, #f5a623, #e05c97);
  color: #000; border: none; padding: 0.5rem 1.2rem;
  border-radius: 20px; font-weight: 700; font-size: 0.88rem;
  cursor: pointer; font-family: var(--font);
  transition: transform .2s, opacity .2s;
}
.install-popup-actions .btn-install:active { transform: scale(0.95); }
.install-popup-actions .btn-dismiss {
  background: none; border: none; color: var(--text-muted);
  font-size: 0.82rem; cursor: pointer; font-family: var(--font); padding: 0.4rem;
}
.install-popup-actions .btn-dismiss:active { color: var(--text); }

/* ── Result count ── */
.result-count { color: var(--text-muted); margin-bottom: 1rem; font-size: 0.9rem; }
.empty-msg { color: var(--text-muted); font-size: 1rem; padding: 2rem 0; text-align: center; }

/* ── Utilities ── */
.hidden { display: none !important; }

/* ════════════════════════════════════════════
   MOBILE  (≤ 640px)
   ════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* Hide desktop nav links — bottom nav takes over */
  .nav-links { display: none; }
  /* Hide less important user actions in navbar */
  .btn-logout { display: none; }

  /* Navbar: brand + lang toggle + login only */
  .navbar { padding: 0.6rem 1rem; gap: 0.5rem; }
  .nav-brand { font-size: 1.05rem; }

  /* Main content: account for bottom nav + player */
  .main-content {
    padding: 1rem;
    padding-bottom: calc(var(--bottom-nav-h) + var(--player-h) + 1rem);
  }

  /* Show bottom navigation */
  .bottom-nav { display: flex; }

  /* Mini player sits above bottom nav */
  .mini-player {
    bottom: var(--bottom-nav-h);
    padding: 0.4rem 0.75rem;
    gap: 0.5rem;
  }
  /* Mobile player: wrap into two rows */
  .mini-player { flex-wrap: wrap; height: auto; padding: 0.5rem 0.75rem; gap: 0.4rem; }
  .player-info { flex: 1; min-width: 0; }
  .player-controls { flex-shrink: 0; }
  .player-controls button:not(#btn-play-pause):not(#btn-prev):not(#btn-next) { display: none; }
  /* Speed selector compact */
  .player-extras button { display: none; }
  .player-extras select { font-size: 0.7rem; padding: 0.15rem 0.25rem; }
  /* Seek bar: full width on second row */
  .player-progress { display: flex; width: 100%; order: 10; gap: 0.4rem; }
  .player-progress span { font-size: 0.65rem; }
  /* Adjust bottom padding for taller player */
  .main-content { padding-bottom: calc(var(--bottom-nav-h) + 100px); }

  /* Content grid: 2 columns on mobile */
  .content-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }

  /* Hero */
  .hero { padding: 2rem 0.5rem; }

  /* Content detail: stack thumb above meta */
  .detail-header { flex-direction: column; gap: 1rem; }
  .detail-thumb { width: 100%; max-width: 240px; height: auto; margin: 0 auto; }
  .detail-meta h1 { font-size: 1.3rem; }

  /* Episode rows: keep tighter */
  .episode-row { gap: 0.4rem; padding: 0.6rem; }
  .ep-info { width: 100%; }
  .ep-title { font-size: 0.85rem; white-space: normal; }
  .btn-play { width: 100%; justify-content: center; display: flex; }
  .resume-badge { width: 100%; }

  /* Admin table: horizontal scroll */
  .admin-table { font-size: 0.8rem; }
  .admin-section { overflow-x: hidden; }

  /* Form rows: single column */
  .form-row { grid-template-columns: 1fr; }

  /* Filter grid: single column */
  .filter-grid { grid-template-columns: 1fr 1fr; }

  /* Stat cards: smaller */
  .stat-card { padding: 0.75rem 1rem; }
  .stat-num { font-size: 1.5rem; }

  /* Section titles */
  .section-title { font-size: 1.1rem; }
}

/* ════════════════════════════════════════════
   TABLET  (641px – 900px)
   ════════════════════════════════════════════ */
@media (min-width: 641px) and (max-width: 900px) {
  .content-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .nav-links { gap: 0.6rem; }
  .nav-links a { font-size: 0.85rem; }
}

/* ════════════════════════════════════════════
   HIGH-IMPACT UI ENHANCEMENTS
   ════════════════════════════════════════════ */

/* 1 ── Glassmorphism content cards */
.content-card {
  background: linear-gradient(145deg, rgba(42,20,70,0.9), rgba(30,16,53,0.95));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(245,166,35,0.12);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.content-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 0 24px rgba(245,166,35,0.2), 0 16px 40px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.08);
  border-color: rgba(245,166,35,0.45);
}

/* 2 ── Gradient accent on buttons */
.btn-primary {
  background: var(--gradient);
  border: none;
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.08);
  opacity: 0;
  transition: opacity .2s;
}
.btn-primary:hover::after { opacity: 1; }
.btn-primary:hover { opacity: 1; }

.btn-play {
  background: var(--gradient);
}

#btn-play-pause {
  background: var(--gradient);
}

/* 3 ── Animated sound wave logo when playing */
.nav-logo { animation: none; }
body.is-playing .nav-logo .wave-bar { animation: wave-bounce 0.8s ease-in-out infinite alternate; }
body.is-playing .nav-logo .wave-bar:nth-child(1) { animation-delay: 0s; }
body.is-playing .nav-logo .wave-bar:nth-child(2) { animation-delay: 0.15s; }
body.is-playing .nav-logo .wave-bar:nth-child(3) { animation-delay: 0.3s; }
body.is-playing .nav-logo .wave-bar:nth-child(4) { animation-delay: 0.15s; }
body.is-playing .nav-logo .wave-bar:nth-child(5) { animation-delay: 0s; }

@keyframes wave-bounce {
  from { transform: scaleY(0.4); }
  to   { transform: scaleY(1.0); }
}

/* 4 ── Smooth page fade-in */
@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.main-content {
  animation: page-fade-in 0.35s ease forwards;
}

/* 5 ── Gradient glow on cards hover */
.content-card img {
  transition: transform .3s ease;
}
.content-card:hover img {
  transform: scale(1.04);
}

/* ── Gradient accents on other elements ── */
.nav-brand-text { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.section-title { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; display: inline-block; }
.player-chapter-badge { background: var(--gradient); }
.ep-active { background: rgba(245,166,35,0.08); border-left: 3px solid transparent; border-image: var(--gradient) 1; }
.badge-green { background: linear-gradient(135deg, #1a4a2e, #1a3a1a); }

/* ── Glassmorphism mini-player ── */
.mini-player {
  background: linear-gradient(135deg, rgba(26,10,46,0.95), rgba(20,8,36,0.98));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(245,166,35,0.2);
  box-shadow: 0 -4px 32px rgba(0,0,0,0.5);
}

/* ── Glassmorphism navbar ── */
.navbar {
  background: linear-gradient(135deg, rgba(26,10,46,0.97), rgba(22,8,40,0.98));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(245,166,35,0.15);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

/* ── Gradient seek bar ── */
#player-seek {
  height: 4px;
  border-radius: 2px;
}

/* ── Glowing active episode row ── */
.episode-row {
  transition: background .2s, border-color .2s;
}

/* ── Category card gradient on hover ── */
.category-card {
  transition: background .25s, color .25s, box-shadow .25s;
}
.category-card:hover {
  background: var(--gradient);
  color: #000;
  box-shadow: var(--glow);
}

/* ── Stat card glow ── */
.stat-num {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Bottom nav gradient active ── */
.bottom-nav a.active { color: var(--accent); }
.bottom-nav a .bn-icon { transition: transform .2s; }
.bottom-nav a:hover .bn-icon { transform: translateY(-2px); }

/* ════════════════════════════════════════════
   MEDIUM-IMPACT UI ENHANCEMENTS (6–12)
   ════════════════════════════════════════════ */

/* 6 ── Hero animated gradient background */
.hero {
  position: relative;
  overflow: hidden;
  padding: 3.5rem 1rem;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(245,166,35,0.12) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 50%, rgba(224,92,151,0.10) 0%, transparent 60%);
  animation: hero-pulse 6s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes hero-pulse {
  from { opacity: 0.6; transform: scale(1); }
  to   { opacity: 1;   transform: scale(1.05); }
}
.hero h1, .hero p, .hero a { position: relative; }

/* 7 ── Thicker glowing seek bar */
#player-seek {
  appearance: none;
  -webkit-appearance: none;
  height: 5px;
  border-radius: 3px;
  background: var(--bg3);
  cursor: pointer;
  flex: 1;
}
#player-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 8px rgba(245,166,35,0.6);
  cursor: pointer;
  transition: transform .15s;
}
#player-seek::-webkit-slider-thumb:hover { transform: scale(1.3); }
#player-seek::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

/* 8 ── Category pills gradient fill on hover */
.category-card {
  background: var(--bg3);
  border: 1px solid transparent;
  transition: background .25s, color .25s, box-shadow .25s, border-color .25s;
}
.category-card:hover {
  background: var(--gradient);
  color: #000;
  box-shadow: var(--glow);
  border-color: transparent;
}

/* 9 ── Skeleton loading shimmer */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, #2e1a50 50%, var(--bg3) 75%);
  background-size: 400px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
}

/* 10 ── Rounder thumbnail corners */
.content-card img {
  border-radius: 0;
}
.detail-thumb {
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.player-info img {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* 11 ── Content type badge colors per type */
.badge-music    { background: rgba(245,166,35,0.15); color: #f5a623; border: 1px solid rgba(245,166,35,0.3); }
.badge-podcast  { background: rgba(100,149,237,0.15); color: #6495ed; border: 1px solid rgba(100,149,237,0.3); }
.badge-audiobook{ background: rgba(80,200,120,0.15); color: #50c878; border: 1px solid rgba(80,200,120,0.3); }
.badge-story    { background: rgba(224,92,151,0.15); color: #e05c97; border: 1px solid rgba(224,92,151,0.3); }

/* 12 ── Active nav links on desktop */
.nav-links a {
  position: relative;
  padding-bottom: 2px;
}
.nav-links a::after {
  content: '';
  position: absolute; bottom: -2px; left: 0; right: 0;
  height: 2px;
  background: var(--gradient);
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform .2s ease;
}
.nav-links a:hover::after,
.nav-links a.nav-active::after { transform: scaleX(1); }
.nav-links a:hover { color: var(--text); }

/* ── Episode row polish ── */
.episode-row {
  border: 1px solid transparent;
  transition: background .2s, border-color .2s;
}
.episode-row:hover {
  background: rgba(245,166,35,0.05);
  border-color: var(--glass-border);
}

/* ── Login box glass ── */
.login-box {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

/* ════════════════════════════════════════════
   BOUNCY & FANCY ENHANCEMENTS
   ════════════════════════════════════════════ */

/* ── will-change for GPU compositing on animated elements ── */
.content-card, .btn-play, #btn-play-pause, #btn-prev, #btn-next,
.btn-primary, .btn-lang, .btn-login, .btn-oauth, .category-card,
.bottom-nav a .bn-icon, .btn-bookmark {
  will-change: transform;
}

/* ── Spring card bounce ── */
.content-card {
  transition: transform .35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .35s ease, border-color .35s ease;
}
.content-card:active {
  transform: translateY(-2px) scale(0.97);
  transition-duration: .1s;
}

/* ── Elastic play button ── */
.btn-play {
  transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .3s ease;
}
.btn-play:active {
  transform: scale(0.92);
  transition-duration: .1s;
}

/* ── Pulsing play/pause button in player ── */
@keyframes player-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(245,166,35,0.5); }
  70%  { box-shadow: 0 0 0 10px rgba(245,166,35,0); }
  100% { box-shadow: 0 0 0 0 rgba(245,166,35,0); }
}
body.is-playing #btn-play-pause {
  animation: player-pulse 1.8s ease-out infinite;
}
#btn-play-pause {
  transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#btn-play-pause:active { transform: scale(0.88); transition-duration: .1s; }

/* ── Bouncy prev/next chapter buttons ── */
#btn-prev, #btn-next {
  transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1), color .2s;
}
#btn-prev:active, #btn-next:active { transform: scale(0.9); transition-duration: .1s; }

/* ── Bouncy primary button ── */
.btn-primary {
  transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .3s ease;
}
.btn-primary:active { transform: scale(0.94); transition-duration: .1s; }

/* ── Bouncy bookmark button ── */
@keyframes heart-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  70%  { transform: scale(0.88); }
  100% { transform: scale(1); }
}
.btn-bookmark {
  transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color .2s, color .2s;
}
.btn-bookmark:active { animation: heart-pop .4s ease forwards; }

/* ── Bouncy bottom nav icons ── */
.bottom-nav a .bn-icon {
  transition: transform .35s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}
.bottom-nav a.active .bn-icon { transform: translateY(-4px) scale(1.2); }
.bottom-nav a:active .bn-icon { transform: scale(0.85); transition-duration: .1s; }

/* ── Bouncy category pills ── */
.category-card {
  transition: transform .35s cubic-bezier(0.34, 1.56, 0.64, 1), background .25s, color .25s, box-shadow .25s;
}
.category-card:active { transform: scale(0.94); transition-duration: .1s; }

/* ── Floating hero title ── */
@keyframes hero-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}
.hero h1 { animation: hero-float 4s ease-in-out infinite; }

/* ── Bouncy lang toggle ── */
.btn-lang {
  transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1), background .2s, color .2s;
}
.btn-lang:active { transform: scale(0.9); transition-duration: .1s; }

/* ── Bouncy login button ── */
.btn-login {
  transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity .2s;
}
.btn-login:active { transform: scale(0.93); transition-duration: .1s; }

/* ── Bouncy OAuth buttons ── */
.btn-oauth {
  transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .3s ease;
}
.btn-oauth:active { transform: scale(0.97); transition-duration: .1s; }

/* ── Sparkle shimmer on cards ── */
.content-card::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.06) 50%, transparent 60%);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.content-card { position: relative; }

/* ── Seek thumb spring ── */
#player-seek::-webkit-slider-thumb {
  transition: transform .25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .2s;
}
#player-seek:active::-webkit-slider-thumb { transform: scale(1.5); }

/* ── Hover effects — only on real pointer devices (not touch) ── */
@media (hover: hover) and (pointer: fine) {
  .content-card:hover {
    transform: translateY(-10px) scale(1.03);
  }
  .content-card:hover::after { opacity: 1; }
  .btn-play:hover {
    transform: scale(1.12);
    box-shadow: 0 0 18px rgba(245,166,35,0.5);
  }
  #btn-play-pause:hover { transform: scale(1.15); }
  #btn-prev:hover { transform: scale(1.2) translateX(-2px); color: var(--accent); }
  #btn-next:hover { transform: scale(1.2) translateX(2px); color: var(--accent); }
  .btn-primary:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 24px rgba(245,166,35,0.35);
  }
  .btn-bookmark:hover { transform: scale(1.07); box-shadow: 0 0 16px rgba(224,92,151,0.35); }
  .bottom-nav a:hover .bn-icon { transform: translateY(-4px) scale(1.2); }
  .category-card:hover { transform: scale(1.08) translateY(-2px); }
  .btn-lang:hover { transform: scale(1.12) rotate(-3deg); }
  .btn-login:hover { transform: scale(1.08); box-shadow: 0 4px 16px rgba(245,166,35,0.4); }
  .btn-oauth:hover { transform: scale(1.03) translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.3); }
}

/* ── SVG wave-bar transform-origin (CSS, not SVG attribute) ── */
.nav-logo .wave-bar { transform-box: fill-box; transform-origin: center bottom; }

/* ── Safe area insets for notched iPhones ── */
.bottom-nav {
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  height: auto;
  min-height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
}
.mini-player {
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
}

/* ════════════════════════════════════════════════════════
   Feature additions: Replace, Feedback, Ratings, Share
   ════════════════════════════════════════════════════════ */

/* ── Star Rating ── */
.rating-block {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
.stars-row {
  display: flex;
  gap: 0.15rem;
}
.star-btn {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color .15s, transform .15s;
}
.star-btn.star-filled,
.star-btn:hover {
  color: var(--accent);
}
.star-btn:active { transform: scale(1.3); }
.rating-summary {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Share button ── */
.btn-share {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.6rem;
  background: var(--bg3);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.btn-share:hover { background: var(--bg2); transform: scale(1.04); }
.btn-share:active { transform: scale(0.96); }
.share-copied-tip {
  font-size: 0.8rem;
  color: #4caf50;
  margin-left: 0.4rem;
  animation: fadeIn .2s ease;
}

/* ── Feedback section (content page) ── */
.feedback-section {
  margin-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1rem;
}
.btn-feedback-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.3rem 0;
  transition: color .2s;
}
.btn-feedback-toggle:hover { color: var(--accent); }
.feedback-form-inline {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.feedback-form-inline textarea {
  background: var(--bg3);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: var(--text);
  padding: 0.6rem 0.8rem;
  font-family: var(--font);
  font-size: 0.9rem;
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
}
.feedback-form-inline textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── Standalone feedback page ── */
.feedback-page {
  max-width: 600px;
  margin: 2rem auto;
  padding: 0 1rem;
}
.feedback-page h1 { margin-bottom: 0.4rem; }
.feedback-subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.feedback-form textarea {
  background: var(--bg3);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: var(--text);
  padding: 0.8rem 1rem;
  font-family: var(--font);
  font-size: 1rem;
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
}
.feedback-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.feedback-success {
  background: rgba(76, 175, 80, 0.15);
  border: 1px solid rgba(76, 175, 80, 0.4);
  color: #81c784;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
