:root {
  --bg: #f4f7fd;
  --surface: #ffffff;
  --surface-2: #eaf0fb;
  --text: #0b1430;
  --muted: #5d6a85;
  --line: #dde5f3;
  --brand: #0d4fe0;
  --brand-ink: #ffffff;
  --accent: #ff6a00;
  --ok: #15803d;
  --err: #b91c1c;
  --warn: #a16207;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(23, 20, 31, .06), 0 8px 24px rgba(23, 20, 31, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f1e; --surface: #111a2e; --surface-2: #1a2540; --text: #eef3ff; --muted: #9aa6c2;
    --line: #26324f; --brand: #5c9dff; --brand-ink: #04122e; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0f1e; --surface: #111a2e; --surface-2: #1a2540; --text: #eef3ff; --muted: #9aa6c2;
  --line: #26324f; --brand: #5c9dff; --brand-ink: #04122e; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 Outfit, system-ui, sans-serif; }
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { line-height: 1.15; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; margin: 0 0 14px; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Barra superior */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 20px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.topnav { display: flex; gap: 4px; }
.topnav a { color: var(--muted); padding: 8px 12px; border-radius: 999px; font-weight: 500; }
.topnav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 999px; padding: 0 14px; max-width: 460px; margin-left: auto; }
.search svg { width: 20px; height: 20px; fill: var(--muted); flex: none; }
.search input { border: 0; background: transparent; color: var(--text); font: inherit; padding: 10px 0; width: 100%; outline: none; }
.search:focus-within { box-shadow: 0 0 0 2px var(--brand); }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 999px; padding: 10px 20px; font: 600 1rem Outfit, sans-serif; cursor: pointer; text-decoration: none; transition: filter .15s; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-lg { padding: 13px 28px; font-size: 1.05rem; }
.btn-ghost { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.link-danger { background: none; border: 0; color: var(--err); font: inherit; cursor: pointer; padding: 0; }

/* Portada */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; margin: 24px 0 8px; padding: 36px; border-radius: 28px; color: #fff;
  background: radial-gradient(120% 140% at 100% 100%, #ff6a00 0%, transparent 42%), radial-gradient(90% 120% at 100% 0%, #18b4ff 0%, transparent 50%), linear-gradient(135deg, #051a5c, #0d4fe0 65%, #1677ff); }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin: 6px 0 12px; }
.hero p { margin: 0 0 22px; max-width: 52ch; opacity: .92; }
.hero .btn { background: #ff6a00; color: #fff; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; opacity: .8; margin: 0 !important; }
.hero-art { display: flex; justify-content: center; }
.phone { width: 150px; height: 270px; border-radius: 28px; background: #12091f; padding: 10px; box-shadow: 0 20px 50px rgba(0,0,0,.35); transform: rotate(6deg); }
.phone-screen { height: 100%; border-radius: 20px; background: linear-gradient(180deg, #0d4fe0, #ff6a00); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; font-size: .8rem; letter-spacing: .15em; }
.eq { display: flex; gap: 4px; align-items: flex-end; height: 40px; }
.eq i { width: 7px; background: #fff; border-radius: 3px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.2s } .eq i:nth-child(3) { animation-delay: -.4s } .eq i:nth-child(4) { animation-delay: -.6s } .eq i:nth-child(5) { animation-delay: -.8s }
@keyframes eq { 0%, 100% { height: 20% } 50% { height: 100% } }
@media (prefers-reduced-motion: reduce) { .eq i { animation: none; height: 60%; } }
@media (max-width: 720px) { .hero { grid-template-columns: 1fr; padding: 26px 22px; } .hero-art { display: none; } }

.chips { display: flex; gap: 8px; margin: 22px 0 6px; flex-wrap: wrap; }
.chip { padding: 7px 16px; border-radius: 999px; border: 1.5px solid var(--line); color: var(--text); font-weight: 500; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip:hover { text-decoration: none; border-color: var(--muted); }

.shelf { margin: 30px 0; }
.shelf-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.row-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 170px); gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.row-scroll > * { scroll-snap-align: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.grid.ranked { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* Tarjeta */
.card { position: relative; display: flex; flex-direction: column; gap: 10px; color: var(--text); padding: 10px; border-radius: var(--radius); transition: background .15s; min-width: 0; }
.card:hover { background: var(--surface); text-decoration: none; box-shadow: var(--shadow); }
.card-icon { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 22%; background: var(--surface-2); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { color: var(--muted); font-size: .85rem; display: flex; gap: 8px; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranked .card, .list .card { flex-direction: row; align-items: center; }
.ranked .card-icon, .list .card-icon { width: 64px; flex: none; }
.rank { width: 22px; text-align: center; color: var(--muted); font-weight: 600; flex: none; }
.tag { font-size: .72rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tag-radio { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); }
.tag-tv { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.tag-ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.score { color: var(--text); font-weight: 500; }

.feature { position: relative; display: block; aspect-ratio: 16/10; border-radius: var(--radius); overflow: hidden; color: #fff; background: linear-gradient(135deg, var(--tc), #111); }
.row-scroll:has(.feature) { grid-auto-columns: minmax(260px, 300px); }
.feature-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feature::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.75)); }
.feature-in { position: absolute; z-index: 1; left: 14px; right: 14px; bottom: 12px; display: flex; gap: 12px; align-items: center; }
.feature-in img { width: 48px; height: 48px; border-radius: 12px; }
.feature-in b { display: block; } .feature-in small { opacity: .85; }
.feature:hover { text-decoration: none; }

.empty { text-align: center; padding: 60px 16px; color: var(--muted); }
.page-title { margin: 28px 0 6px; }

/* Ficha */
.detail { padding-top: 28px; }
.app-head { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: start; }
.app-icon { width: 160px; height: 160px; border-radius: 24%; object-fit: cover; box-shadow: var(--shadow); background: var(--surface-2); }
.app-id h1 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.4rem); }
.dev { color: var(--brand); font-weight: 600; margin: 4px 0 0; }
.app-id .muted { margin: 2px 0 0; }
.facts { list-style: none; display: flex; gap: 0; padding: 0; margin: 18px 0; }
.facts li { padding: 0 20px; border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.facts li:first-child { padding-left: 0; border-left: 0; }
.facts b { font-size: 1.05rem; } .facts span { color: var(--muted); font-size: .82rem; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions .btn:not(.btn-ghost) { background: var(--tc, var(--brand)); color: #fff; }
.hint { background: var(--surface); border: 1px solid var(--line); padding: 12px 16px; border-radius: 14px; max-width: 520px; }
.app-cover { margin: 28px 0 0; } .app-cover img { width: 100%; max-height: 360px; object-fit: cover; border-radius: var(--radius); }
.detail-cols { display: grid; grid-template-columns: 1fr 340px; gap: 40px; margin-top: 12px; }
.block { margin: 28px 0; }
.desc { white-space: normal; }
.links { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.list { display: grid; gap: 4px; }
@media (max-width: 860px) { .detail-cols { grid-template-columns: 1fr; gap: 0; } }
@media (max-width: 560px) {
  .app-head { grid-template-columns: 1fr; gap: 16px; }
  .app-icon { width: 96px; height: 96px; }
  .facts li { padding: 0 12px; }
  .actions .btn { flex: 1 1 auto; }
}

/* Valoraciones */
.rating-summary { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; margin-bottom: 18px; }
.rating-big { display: flex; flex-direction: column; align-items: flex-start; }
.rating-big b { font-size: 3.2rem; line-height: 1; }
.stars { color: var(--line); letter-spacing: 1px; }
.star.on { color: #f59e0b; } .star.half { color: #fbbf24; opacity: .6; }
.bars { display: grid; gap: 4px; max-width: 380px; }
.bar { display: grid; grid-template-columns: 14px 1fr; gap: 10px; align-items: center; font-size: .82rem; color: var(--muted); }
.bar i { height: 9px; background: var(--surface-2); border-radius: 9px; overflow: hidden; }
.bar em { display: block; height: 100%; background: var(--brand); border-radius: 9px; }
.review-form { margin: 8px 0 20px; }
.review-form summary { list-style: none; }
.review-form summary::-webkit-details-marker { display: none; }
.review-form form { display: grid; gap: 12px; margin-top: 14px; padding: 18px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); max-width: 560px; }
.review { padding: 14px 0; border-top: 1px solid var(--line); }
.review header { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.review p { margin: 6px 0 0; }
.star-input { border: 0; padding: 0; margin: 0; display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.star-input legend { width: 100%; margin-bottom: 4px; font-weight: 500; float: left; }
.star-input input { position: absolute; opacity: 0; }
.star-input label { font-size: 2rem; color: var(--line); cursor: pointer; line-height: 1; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: #f59e0b; }
.star-input input:focus-visible + label { outline: 2px solid var(--brand); border-radius: 4px; }

/* Formularios */
label { display: grid; gap: 6px; font-weight: 500; }
input, textarea, select { font: inherit; color: var(--text); background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); }
input[type="checkbox"], input[type="radio"] { width: auto; }
input[type="color"] { width: 64px; height: 40px; padding: 2px; }
small { color: var(--muted); font-weight: 400; }
.notice { padding: 12px 16px; border-radius: 12px; margin: 12px 0; }
.notice-ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.notice-error { background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err); }
.notice-warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }

/* Pie */
.footer { margin-top: 60px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-in { display: flex; justify-content: space-between; gap: 24px; padding-top: 28px; padding-bottom: 36px; flex-wrap: wrap; }
.footer p { color: var(--muted); max-width: 52ch; margin: 6px 0 0; }
.footer-links { display: grid; gap: 8px; align-content: start; }

/* Panel */
.admin-main { padding-top: 24px; padding-bottom: 60px; }
.admin-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-head h1 { margin: 0; margin-right: auto; font-size: 1.6rem; }
.inline input { width: 220px; }
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 14px; white-space: nowrap; }
.wrap-text { max-width: 380px; }
.auth { max-width: 420px; margin: 40px auto; }
.form { display: grid; gap: 14px; }
.form-grid fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 22px; margin: 0 0 18px; background: var(--surface); display: grid; gap: 14px; }
.form-grid legend { font-weight: 700; padding: 0 6px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .two { grid-template-columns: 1fr; } }
.prefix { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); }
.prefix span { padding: 0 4px 0 12px; color: var(--muted); font-weight: 400; white-space: nowrap; font-size: .9rem; }
.prefix input { border: 0; border-radius: 0; padding-left: 0; }
.prefix:focus-within { border-color: var(--brand); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 400; }
.color { display: flex; align-items: center; gap: 12px; }
.preview-icon { width: 96px; height: 96px; border-radius: 22%; object-fit: cover; }
.preview-cover { max-height: 120px; border-radius: 12px; object-fit: cover; }
.form-actions { display: flex; gap: 18px; align-items: center; }

/* Marca RadioProMedia: logo horizontal en claro; icono + nombre en oscuro (el texto del logo es azul marino) */
.brand-logo { height: 48px; width: auto; }
.brand-dark { display: none; align-items: center; gap: 8px; font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; }
.brand-dark b { color: #ff6a00; font-weight: 800; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo { display: none; }
  :root:not([data-theme="light"]) .brand-dark { display: inline-flex; }
}
:root[data-theme="dark"] .brand-logo { display: none; }
:root[data-theme="dark"] .brand-dark { display: inline-flex; }
@media (max-width: 420px) { .brand-logo { height: 36px; } }
