:root {
    --primary: #f7073b;
    --primary-soft: color-mix(in srgb, var(--primary) 14%, transparent);
    --bg: #080a10;
    --surface: #11141d;
    --surface-2: #181c27;
    --text: #f8fafc;
    --muted: #9aa3b5;
    --line: rgba(255, 255, 255, .09);
    --shadow: 0 22px 70px rgba(0, 0, 0, .32);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% -8%, var(--primary-soft), transparent 34rem),
        radial-gradient(circle at 92% 16%, rgba(91, 106, 255, .1), transparent 28rem),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    padding: 10px clamp(18px, 4vw, 60px);
    border-bottom: 1px solid var(--line);
    background: rgba(8, 10, 16, .78);
    backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 750; }
.brand img { width: 118px; height: 48px; object-fit: contain; object-position: left center; }
.brand span { display: none; }
.admin-link {
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    transition: .2s ease;
}
.admin-link:hover { border-color: var(--primary); color: #fff; }

main { width: min(1380px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 68px; }
.store-logo-showcase {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: clamp(150px, 20vw, 250px);
    padding: 14px 20px 10px;
}
.store-logo-showcase img {
    display: block;
    width: min(100%, 520px);
    max-height: 230px;
    object-fit: contain;
    filter: drop-shadow(0 18px 38px rgba(0, 0, 0, .34));
}

.toolbar { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin: 30px 0 22px; }
.search-box {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 560px;
    height: 52px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    transition: .2s ease;
}
.search-box:focus-within { border-color: color-mix(in srgb, var(--primary) 65%, #fff); box-shadow: 0 0 0 4px var(--primary-soft); }
.search-box svg { width: 21px; fill: none; stroke: var(--muted); stroke-width: 2; }
.search-box input { width: 100%; border: 0; outline: 0; padding: 0 12px; color: var(--text); background: transparent; }
.search-box input::placeholder { color: #737d90; }
.filters { display: flex; gap: 8px; }
.filter { min-height: 43px; padding: 0 16px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: var(--surface); cursor: pointer; transition: .2s ease; }
.filter:hover { color: #fff; border-color: rgba(255,255,255,.2); }
.filter.active { border-color: transparent; color: #fff; background: var(--primary); box-shadow: 0 10px 26px var(--primary-soft); }

.catalog { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.section-title { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin: 18px 0 0; }
.section-title h2 { margin: 0; font-size: 22px; }
.section-title span { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; color: #fff; background: var(--primary); font-size: 12px; font-weight: 800; }
.app-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255,255,255,.03), transparent 46%), var(--surface);
    box-shadow: 0 14px 34px rgba(0,0,0,.18);
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.app-card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--primary) 48%, transparent); box-shadow: 0 24px 50px rgba(0,0,0,.28); }
.app-cover { position: relative; overflow: hidden; aspect-ratio: 16 / 10; background: #0c0e14; }
.app-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.app-card:hover .app-cover img { transform: scale(1.035); }
.category-pill { position: absolute; left: 12px; top: 12px; padding: 7px 10px; border-radius: 999px; color: #fff; background: rgba(8,10,16,.75); backdrop-filter: blur(8px); font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.app-body { display: flex; flex-direction: column; flex: 1; padding: 18px; }
.app-title-row { display: flex; gap: 10px; justify-content: space-between; align-items: start; }
.app-title-row h3 { overflow: hidden; margin: 0; font-size: 18px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.rating { flex: none; color: #ffd166; font-size: 13px; font-weight: 800; }
.developer { overflow: hidden; margin: 7px 0 12px; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.description { display: -webkit-box; overflow: hidden; margin: 0 0 18px; color: #b6bdca; font-size: 13px; line-height: 1.6; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; }
.meta span { padding: 6px 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: rgba(255,255,255,.025); font-size: 11px; }
.card-actions { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin-top: 16px; }
.download-btn, .details-btn { min-height: 44px; border-radius: 12px; cursor: pointer; font-weight: 800; transition: .2s ease; }
.download-btn { border: 0; color: #fff; background: var(--primary); }
.download-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.details-btn { width: 44px; border: 1px solid var(--line); color: #fff; background: var(--surface-2); }
.details-btn:hover { border-color: var(--primary); }

.loading-grid[hidden] { display: none !important; }
.loading-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.skeleton-card { overflow: hidden; min-height: 330px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.skeleton-card span, .skeleton-card i { display: block; background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.1), rgba(255,255,255,.04)); background-size: 220% 100%; animation: shimmer 1.25s infinite; }
.skeleton-card span { height: 180px; }
.skeleton-card i { height: 14px; margin: 20px 18px 0; border-radius: 999px; }
.skeleton-card i:nth-child(3) { width: 64%; }
.skeleton-card i:nth-child(4) { width: 44%; }
@keyframes shimmer { to { background-position: -220% 0; } }

.store-alert, .empty-state { padding: 28px; border: 1px solid var(--line); border-radius: 20px; text-align: center; background: var(--surface); }
.store-alert { margin-bottom: 20px; color: #ffd5dc; border-color: rgba(247,7,59,.32); }
.empty-state { margin-top: 20px; }
.empty-state h2 { margin: 8px 0; }
.empty-state p { margin: 0; color: var(--muted); }
.empty-icon { font-size: 42px; color: var(--primary); }

footer { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between; padding: 26px clamp(18px, 4vw, 60px); border-top: 1px solid var(--line); color: var(--muted); background: #07090e; font-size: 13px; }
.whatsapp { position: fixed; z-index: 30; right: 20px; bottom: 20px; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: #25d366; box-shadow: 0 16px 34px rgba(37,211,102,.3); }
.whatsapp svg { width: 29px; fill: #fff; }

.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(7px); }
.modal-card { position: relative; z-index: 1; overflow: auto; width: min(820px, 100%); max-height: min(88vh, 900px); border: 1px solid var(--line); border-radius: 26px; background: #11141d; box-shadow: var(--shadow); }
.modal-close { position: absolute; z-index: 2; right: 14px; top: 14px; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; color: #fff; background: rgba(8,10,16,.78); font-size: 27px; cursor: pointer; }
.modal-gallery { position: relative; height: min(360px, 44vw); min-height: 230px; background: #090b10; }
.modal-gallery img { width: 100%; height: 100%; object-fit: contain; }
.modal-copy { padding: 26px; }
.modal-copy h2 { margin: 0 0 6px; font-size: clamp(25px, 4vw, 38px); }
.modal-copy p { color: #bdc4d0; line-height: 1.7; white-space: pre-line; }
.modal-meta { display: flex; flex-wrap: wrap; gap: 9px; margin: 16px 0 22px; }
.modal-meta span { padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 12px; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
.code-box { padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025); }
.code-box small { display: block; color: var(--muted); }
.code-box strong { display: block; margin-top: 4px; word-break: break-all; }
.modal-download { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border: 0; border-radius: 14px; color: #fff; background: var(--primary); font-weight: 850; cursor: pointer; }
body.modal-open { overflow: hidden; }

@media (min-width: 700px) { .brand span { display: block; } }
@media (max-width: 1100px) { .catalog, .loading-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) {
    main { width: min(100% - 24px, 1380px); padding-top: 18px; }
    .toolbar { align-items: stretch; flex-direction: column; }
    .search-box { max-width: none; }
    .filters { overflow-x: auto; padding-bottom: 2px; }
    .catalog, .loading-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
    .topbar { min-height: 64px; padding: 8px 14px; }
    .brand img { width: 96px; height: 42px; }
    .brand span { display: none; }
    main { width: min(100% - 18px, 1380px); }
    .store-logo-showcase { min-height: 128px; padding: 8px 10px 4px; }
    .store-logo-showcase img { width: min(100%, 320px); max-height: 155px; }
    .catalog, .loading-grid { grid-template-columns: 1fr; }
    .app-cover { aspect-ratio: 16 / 9; }
    .modal { padding: 8px; }
    .modal-card { border-radius: 20px; }
    .modal-copy { padding: 22px 18px; }
    .codes { grid-template-columns: 1fr; }
    footer { padding: 22px 16px 86px; }
}

.protected-brand-credit {
    color: #a7afbd;
    font-weight: 800;
    letter-spacing: .025em;
    white-space: nowrap;
}
