:root {
  --bg: #0f172a;
  --card: #111827;
  --muted: #94a3b8;
  --text: #e5e7eb;
  --brand: #38bdf8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, 'Helvetica Neue', sans-serif;
  background: linear-gradient(180deg, #0b1220, #0f172a 40%);
  color: var(--text);
}

.wrap {
  max-width: 1100px;
  margin: auto;
  padding: 16px;
}

h1 {
  margin: 8px 0 0;
  font-weight: 700;
  font-size: clamp(20px, 3vw, 28px);
  display: flex;
  align-items: center;
  gap: 10px;
}
/* Botón fijo (siempre visible) */
.install-fixed{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1000;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  width: 190px;
  height: 70px;
}
.install-fixed img{
  width: 190px;
  height: 70px;
  object-fit: contain;
}

.sub {
  color: var(--muted);
  margin: 4px 0 12px;
}

.topbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

input[type="search"] {
  flex: 1;
  min-width: 180px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #1f2937;
  background: #0b1220;
  color: var(--text);
}

.select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #1f2937;
  background: #0b1220;
  color: var(--text);
}

.btn {
  appearance: none;
  border: 1px solid #1f2937;
  background: #0b1220;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
}

.btn:hover {
  border-color: #334155;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  padding: 16px 0;
}

.card {
  background: linear-gradient(180deg, #0b1220, #0e1527);
  border: 1px solid #1f2937;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.flag {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid #1f2937;
}

.name {
  font-weight: 600;
}

.meta {
  font-size: 12px;
  color: var(--muted);
}

.controls {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.small {
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
}

footer {
  border-top: 1px solid #1f2937;
  margin-top: 8px;
}

audio {
  width: 100%;
  max-width: 1100px;
  margin: 8px auto 16px;
  display: block;
}

.now {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ef4444;
  display: inline-block;
}

.install {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #0b1220;
  border: 1px solid #1f2937;
  border-radius: 14px;
  padding: 10px 14px;
}

.donate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.flagbar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 8px;
  margin: 0;
  background: #0b1220;
  border-bottom: 1px solid #1f2937;
}

.flagbtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  border: 1px solid #1f2937;
  border-radius: 10px;
  background: #0e1527;
  color: var(--text);
  font-size: 10px;
  cursor: pointer;
  user-select: none;
}

.flagbtn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.flagbtn span {
  white-space: nowrap;
}

.flagbtn.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2) inset;
}

.install-box {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.install-fab {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 1000;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  width: 190px;
  height: 70px;
}

.install-fab img {
  width: 190px;
  height: 70px;
  object-fit: contain;
}

.star-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: 6px;
  display: flex;
  align-items: center;
}

.star-btn:hover {
  transform: scale(1.2);
}

.site-logo {
  height: 80px !important;
  width: auto;
  max-height: none !important;
  object-fit: contain;
  padding-bottom: 10px;
}

.mini-player {
  display: flex;
  align-items: center;
  gap: 8px;
  position: absolute;
  right: 12px;
  top: 12px;
  background: #0b1220;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #1f2937;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  z-index: 999;
}

.mini-logo {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 50%;
}

.mini-name {
  font-size: 14px;
  font-weight: bold;
  color: white;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.mini-btn img {
  width: 24px;
  height: 24px;
}

/* Parte superior que queda fija */
.sticky-header {
  position: sticky;
  top: 0;
  background-color: #0f172a;
  z-index: 999;
  padding-top: 8px;
  padding-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid #1f2937;
}

/* Parte inferior del header que se mueve con el scroll */
.scrollable-header {
  padding-top: 8px;
  padding-bottom: 8px;
}
.donate-fixed {
  position: fixed;
  bottom: 80px; /* justo encima del botón instalar */
  left: 16px;
  z-index: 999;
}

.donate-fixed img {
  width: 160px;
  height: auto;
  border: none;
}
/* Estilos para el div de publicidad */


.ad-container {
  margin: 20px auto;
  padding: 10px;
  text-align: center;
  max-width: 100%;
  overflow-x: auto;
}



@media (max-width: 600px) {
  .site-logo {
    height: 30px;
  }

  .card {
    padding: 8px;
    gap: 6px;
    flex-direction: row;
    align-items: center;
  }

  .card .flag {
    width: 32px;
    height: 32px;
  }

  .card .name {
    font-size: 14px;
  }

  .card .meta {
    font-size: 12px;
  }

  .card .btn {
    font-size: 12px;
    padding: 4px 8px;
  }

  .star-btn img {
    width: 18px;
    height: 18px;
  }

  .controls {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
  }

  .card > div {
    flex: 1;
    min-width: 0;
  }
   .ad-container {
    padding: 5px;
    margin: 10px auto;
  }

  .ad-container iframe,
  .ad-container img {
    max-width: 100% !important;
    height: auto !important;
  }
}
