/* Webradios France — design sombre mobile-first */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #0f0f1a;
  color: #e8e8f0;
  font-size: 16px;          /* >= 16px mobile */
  line-height: 1.45;
  padding-bottom: 96px;     /* place pour le player sticky */
  -webkit-text-size-adjust: 100%;
}

/* ── Bannière ─────────────────────────────────────────── */
.banner {
  background: linear-gradient(160deg, #1b1b2f 0%, #14142a 55%, #101020 100%);
  border-bottom: 1px solid #2a2a44;
  padding: 22px 16px 18px;
  text-align: center;
}

.banner h1 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: 0.2px;
  color: #ffffff;
}

.banner .subtitle {
  margin: 8px 0 0;
  font-size: 0.95rem;
  color: #9a9ab8;
}

/* ── Contrôles (recherche + filtres) ──────────────────── */
.controls {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(15, 15, 26, 0.97);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #23233c;
  padding: 10px 12px 12px;
}

.search {
  width: 100%;
  min-height: 46px;                 /* cible tactile >= 44px */
  padding: 10px 14px;
  font-size: 16px;
  color: #f0f0f8;
  background: #1c1c30;
  border: 1px solid #34345a;
  border-radius: 12px;
  outline: none;
}

.search:focus { border-color: #6c6cf0; box-shadow: 0 0 0 3px rgba(108, 108, 240, 0.25); }

.search::placeholder { color: #7a7a9a; }

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pill {
  min-height: 40px;
  padding: 7px 14px;
  font-size: 15px;
  color: #c9c9e0;
  background: #1c1c30;
  border: 1px solid #34345a;
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pill.active {
  color: #ffffff;
  background: #4b4bd8;
  border-color: #4b4bd8;
}

/* ── Grille de tuiles ─────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);   /* 2 colonnes mobile */
  gap: 12px;
  padding: 16px 12px;
  max-width: 1080px;
  margin: 0 auto;
}

@media (min-width: 640px)  { .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 20px 20px; } }
@media (min-width: 960px)  { .grid { grid-template-columns: repeat(4, 1fr); } }

.tile {
  display: flex;
  flex-direction: column;
  min-height: 150px;
  padding: 0;
  background: #191928;
  border: 2px solid #26263f;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.tile:active { transform: scale(0.97); }

.tile:hover { border-color: #3d3d66; }

.tile.active {
  border-color: #6c6cf0;
  box-shadow: 0 0 0 3px rgba(108, 108, 240, 0.35), 0 4px 18px rgba(108, 108, 240, 0.25);
}

.tile-media {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 92px;
  background: #14142a;
}

.tile-media img {
  max-width: 56%;
  max-height: 56%;
  object-fit: contain;
}

.tile-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  background: hsl(220 45% 30%);
  user-select: none;
}

.tile-name {
  display: block;
  min-height: 44px;                 /* cible tactile */
  padding: 10px 8px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  color: #ffffff;
  background: linear-gradient(180deg, #1e1e33 0%, #16162a 100%);
  border-top: 1px solid #26263f;
}

.tile.active .tile-name { background: linear-gradient(180deg, #2a2a52 0%, #1e1e3d 100%); }

/* ── État vide ────────────────────────────────────────── */
.empty {
  text-align: center;
  color: #9a9ab8;
  padding: 40px 16px;
}

/* ── Footer ───────────────────────────────────────────── */
.footer {
  text-align: center;
  font-size: 0.85rem;
  color: #6a6a88;
  padding: 24px 16px 12px;
  border-top: 1px solid #1e1e33;
}

/* ── Player sticky ────────────────────────────────────── */
.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(23, 23, 40, 0.98);
  border-top: 1px solid #34345a;
  backdrop-filter: blur(8px);
}

.play-btn {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  font-size: 1.35rem;
  color: #ffffff;
  background: #4b4bd8;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.play-btn:active { transform: scale(0.94); }

.player-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.player-name {
  font-weight: 600;
  font-size: 1rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-status {
  font-size: 0.82rem;
  color: #8a8aaa;
}

.player-status.err { color: #ff8a8a; }

.player-status.ok { color: #7ee2a0; }
