/* Tema común de la portada (/) y las páginas de categoría (/apps/). Claro y cálido, con modo oscuro. */
:root {
  --bg: #fffaf4;
  --bg2: #fff3e6;
  --card: #ffffff;
  --line: #f0e4d6;
  --line2: #e6d5c2;
  --text: #2b2140;
  --text2: #6b6080;
  --text3: #a097b0;
  --brand: #ff6b5b;
  --brand2: #7c5cff;
  --shadow: 0 2px 6px rgba(80, 50, 20, .05), 0 10px 28px -12px rgba(80, 50, 20, .16);
  --shadow-up: 0 4px 10px rgba(80, 50, 20, .06), 0 22px 44px -16px rgba(80, 50, 20, .26);
  --radius: 22px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17131f; --bg2: #1f1a2a; --card: #231d30; --line: #322a42; --line2: #43395a;
    --text: #f5efff; --text2: #b9aed0; --text3: #7f7496;
    --shadow: 0 2px 6px rgba(0,0,0,.25), 0 10px 28px -12px rgba(0,0,0,.6);
    --shadow-up: 0 4px 10px rgba(0,0,0,.3), 0 22px 44px -16px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17131f; --bg2: #1f1a2a; --card: #231d30; --line: #322a42; --line2: #43395a;
  --text: #f5efff; --text2: #b9aed0; --text3: #7f7496;
  --shadow: 0 2px 6px rgba(0,0,0,.25), 0 10px 28px -12px rgba(0,0,0,.6);
  --shadow-up: 0 4px 10px rgba(0,0,0,.3), 0 22px 44px -16px rgba(0,0,0,.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--bg); }
body { font-family: 'Nunito', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }

/* manchas de color de fondo */
.blobs { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.blobs i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .45; }
.blobs i:nth-child(1) { width: 420px; height: 420px; background: #ffd6c9; top: -120px; left: -100px; }
.blobs i:nth-child(2) { width: 380px; height: 380px; background: #dcd3ff; top: 10%; right: -120px; }
.blobs i:nth-child(3) { width: 340px; height: 340px; background: #c8f1e3; bottom: -120px; left: 30%; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .blobs i { opacity: .14; } }
:root[data-theme="dark"] .blobs i { opacity: .14; }

/* barra superior */
.top { position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 12px; height: 62px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 900; font-size: 1.15rem; letter-spacing: -.01em; }
.logo-mark { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff; font-size: 1rem; box-shadow: 0 6px 16px -6px var(--brand); }
.top nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.top nav a { font-weight: 700; font-size: .92rem; color: var(--text2); padding: 8px 12px; border-radius: 12px; transition: background .2s, color .2s; }
.top nav a:hover { background: var(--bg2); color: var(--text); }
.theme-btn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text2); cursor: pointer; font-size: 1rem; display: grid; place-items: center; }
.theme-btn:hover { color: var(--text); border-color: var(--line2); }
@media (max-width: 760px) { .top nav a.hide-m { display: none; } .top nav a { padding: 8px 9px; font-size: .88rem; } }

/* tarjetas de app */
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
@media (max-width: 420px) { .apps { grid-template-columns: 1fr; } }
.app { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s, border-color .2s; }
.app:hover { transform: translateY(-3px); box-shadow: var(--shadow-up); border-color: color-mix(in srgb, var(--c) 45%, var(--line)); }
.app-ico { position: relative; flex: none; width: 56px; height: 56px; border-radius: 17px; display: grid; place-items: center; font-size: 1.75rem; background: color-mix(in srgb, var(--c) 14%, var(--card)); border: 1px solid color-mix(in srgb, var(--c) 22%, transparent); }
.app-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.app-name { font-weight: 800; font-size: 1.02rem; line-height: 1.3; }
.app-desc { color: var(--text2); font-size: .9rem; line-height: 1.5; }
.app-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.app-chips i { font-style: normal; font-size: .72rem; font-weight: 700; color: var(--text2); background: var(--bg2); border: 1px solid var(--line); padding: 2px 8px; border-radius: 999px; }
.app-chips i.also { color: var(--c); background: color-mix(in srgb, var(--c) 9%, var(--card)); border-color: color-mix(in srgb, var(--c) 22%, transparent); }
.app-go { flex: none; align-self: center; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: var(--c); background: color-mix(in srgb, var(--c) 10%, var(--card)); transition: transform .2s, background .2s, color .2s; }
.app:hover .app-go { transform: translateX(3px); background: var(--c); color: #fff; }
.badge-new, .badge-live { display: inline-block; vertical-align: 2px; font-size: .64rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; }
.badge-new { background: #ffe066; color: #5c4400; }
.badge-live { background: #ffd9d4; color: #b4231a; }
.svc { position: absolute; right: -3px; bottom: -3px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--card); background: #c9c2d6; }
.svc.online { background: #22c55e; }
.svc.offline { background: #f59e0b; }

/* aviso al despertar una app */
.app-toast { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 10000; color: #fff; padding: 18px 26px; border-radius: 18px; box-shadow: 0 18px 50px rgba(0,0,0,.3); font-weight: 800; display: flex; align-items: center; gap: 12px; }
.app-toast-spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* buscador */
.search { position: relative; display: flex; align-items: center; background: var(--card); border: 2px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); transition: border-color .2s, box-shadow .2s; }
.search:focus-within { border-color: var(--brand2); box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand2) 16%, transparent), var(--shadow); }
.search span { padding-left: 18px; font-size: 1.1rem; }
.search input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; color: var(--text); font: 600 1.02rem 'Nunito', sans-serif; padding: 16px 14px; }
.search input::placeholder { color: var(--text3); }
.search button { margin-right: 8px; border: none; background: var(--bg2); color: var(--text2); width: 32px; height: 32px; border-radius: 10px; cursor: pointer; font-weight: 900; display: none; }
.search.has button { display: block; }

.empty { text-align: center; color: var(--text2); padding: 40px 16px; font-weight: 600; }
.empty b { display: block; font-size: 2.4rem; margin-bottom: 6px; }

/* pie */
.foot { margin-top: 70px; padding: 34px 0 calc(env(safe-area-inset-bottom) + 34px); border-top: 1px solid var(--line); background: var(--bg2); text-align: center; color: var(--text2); font-size: .9rem; }
.srv { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 16px; }
.srv span { background: var(--card); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; color: var(--text2); }
.srv b { color: var(--text); }
.srv .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c9c2d6; margin-left: 4px; vertical-align: 1px; }
.foot small { display: block; color: var(--text3); margin-top: 6px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
