*{
    box-sizing:border-box;
}
html{
    width:100%;
    max-width:100%;
    overflow-x:hidden;
    -webkit-text-size-adjust:100%;
}
body{
    width:100%;
    max-width:100%;
    min-height:100vh;
    margin:0;
    overflow-x:hidden;
    background:
        radial-gradient(circle at 50% -10%,rgba(125,0,10,.48),transparent 28%),
        repeating-linear-gradient(135deg,rgba(255,255,255,.016) 0 18px,transparent 18px 36px),
        #050506;
    color:#fff;
    font-family:Arial,Helvetica,sans-serif;
}
:root{
    --red:#f00012;
    --red-dark:#a9000c;
    --orange:#ff8700;
    --panel:#111116;
    --line:rgba(255,255,255,.14);
    --muted:#c3c3cb;
}
img,video{
    max-width:100%;
}
a{
    color:inherit;
}
.wrap{
    width:100%;
    max-width:1180px;
    margin:0 auto;
    padding-left:18px;
    padding-right:18px;
}

.public-header{
    width:100%;
    text-align:center;
    padding-top:28px;
    padding-bottom:18px;
}
.public-logo{
    display:block;
    width:min(560px,90%);
    height:auto;
    max-height:170px;
    object-fit:contain;
    margin:0 auto 14px;
}
.public-header h1{
    margin:0;
    font-size:clamp(26px,5vw,42px);
    line-height:1.15;
}
.public-header h1 strong{
    color:var(--red);
}

.search-box{
    width:100%;
    max-width:760px;
    margin:12px auto 30px;
}
.search-wrap{
    position:relative;
    width:100%;
}
.search-icon{
    position:absolute;
    left:20px;
    top:50%;
    transform:translateY(-50%);
    z-index:2;
    font-size:25px;
}
.search-box input{
    width:100%;
    height:58px;
    margin:0;
    padding:0 22px 0 55px;
    border:1px solid rgba(255,255,255,.25);
    border-radius:999px;
    background:linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,.015)),#101014;
    box-shadow:inset 0 1px rgba(255,255,255,.08),0 10px 26px rgba(0,0,0,.3);
    color:#fff;
    font-size:18px;
}
.search-box input:focus{
    outline:none;
    border-color:var(--red);
    box-shadow:0 0 0 3px rgba(240,0,18,.14);
}

.apps-grid{
    display:grid;
    grid-template-columns:minmax(0,1fr);
    gap:24px;
    width:100%;
    max-width:100%;
    padding-bottom:40px;
}
.app-card{
    width:100%;
    min-width:0;
    max-width:100%;
    overflow:hidden;
    padding:14px;
    border:3px solid var(--red);
    border-radius:24px;
    background:linear-gradient(180deg,rgba(255,255,255,.025),rgba(255,255,255,.005)),#09090c;
    box-shadow:0 0 24px rgba(255,0,18,.34),0 18px 44px rgba(0,0,0,.36);
}
.app-banner{
    position:relative;
    display:block;
    width:100%;
    max-width:100%;
    aspect-ratio:16/9;
    margin-bottom:18px;
    overflow:hidden;
    border:1px solid rgba(255,255,255,.12);
    border-radius:15px;
    background:#000;
}
.app-banner img{
    display:block;
    width:100%;
    height:100%;
    object-fit:contain;
    background:#000;
}
.app-title{
    margin:0 0 10px;
    padding:0 4px;
    color:var(--red);
    text-align:center;
    font-size:clamp(25px,7vw,36px);
    line-height:1.15;
    overflow-wrap:anywhere;
}
.app-icon-row{
    display:flex;
    justify-content:center;
    margin-bottom:12px;
}
.app-icon{
    width:72px;
    height:72px;
    flex:0 0 72px;
    object-fit:cover;
    border:1px solid rgba(255,255,255,.14);
    border-radius:18px;
    background:#000;
}
.app-status{
    margin:0 0 12px;
    text-align:center;
    font-size:38px;
}
.app-size{
    margin-bottom:18px;
    color:#dddde4;
    text-align:center;
    font-size:18px;
    font-weight:800;
}
.actions{
    display:grid;
    grid-template-columns:minmax(0,1fr);
    gap:13px;
    width:100%;
}
.btn{
    display:flex;
    align-items:center;
    justify-content:center;
    width:100%;
    min-height:54px;
    padding:14px 16px;
    border:0;
    border-radius:15px;
    background:linear-gradient(135deg,var(--red),var(--red-dark));
    color:#fff;
    font-size:18px;
    font-weight:900;
    line-height:1.2;
    text-align:center;
    text-decoration:none;
    cursor:pointer;
}
.btn.gray{
    border:1px solid rgba(255,255,255,.08);
    background:#242428;
}
.btn.small{
    width:auto;
    min-height:0;
    padding:8px 11px;
    border-radius:10px;
    font-size:13px;
}
.code-box{
    display:flex;
    align-items:center;
    justify-content:center;
    width:100%;
    min-width:0;
    gap:10px;
    padding:15px 12px;
    border-radius:15px;
    background:linear-gradient(180deg,#ff9815,#ec7300);
}
.code-text{
    min-width:0;
    color:#fff;
    font-size:21px;
    font-weight:900;
    line-height:1.3;
    text-align:center;
    overflow-wrap:anywhere;
}
.copy-button{
    display:grid;
    flex:0 0 34px;
    width:34px;
    height:34px;
    place-items:center;
    border:1px solid rgba(255,255,255,.28);
    border-radius:9px;
    background:rgba(0,0,0,.15);
    color:#fff;
    cursor:pointer;
}
.store-footer{
    width:100%;
    padding:24px 18px 32px;
    border-top:1px solid rgba(255,255,255,.06);
    background:rgba(255,255,255,.025);
    color:#fff;
    text-align:center;
    font-size:15px;
}
.store-footer strong{
    color:var(--red);
}
.empty-state{
    padding:32px 15px;
    color:#c3c3cb;
    text-align:center;
    font-size:18px;
}

/* Admin */
input,select,textarea{
    width:100%;
    max-width:100%;
    padding:13px;
    margin:6px 0 12px;
    border:1px solid rgba(255,255,255,.19);
    border-radius:13px;
    background:#101014;
    color:#fff;
    font-size:15px;
}
input:focus,textarea:focus,select:focus{
    outline:none;
    border-color:var(--red);
    box-shadow:0 0 0 3px rgba(245,0,18,.12);
}
label{
    color:#e5e5ea;
    font-size:13px;
    font-weight:800;
}
.panel{
    width:100%;
    max-width:100%;
    padding:21px;
    margin-bottom:19px;
    overflow:hidden;
    border:1px solid rgba(255,255,255,.12);
    border-radius:21px;
    background:linear-gradient(180deg,#17171d,#111116);
}
.panel h1,.panel h2{
    margin-top:0;
}
.login-page{
    display:grid;
    min-height:100vh;
    place-items:center;
    padding:20px;
}
.login-card{
    width:min(430px,94vw);
    padding:28px;
    border:1px solid rgba(255,255,255,.12);
    border-radius:24px;
    background:#15151a;
}
.admin-layout{
    display:grid;
    grid-template-columns:250px minmax(0,1fr);
    min-height:100vh;
}
.sidebar{
    position:sticky;
    top:0;
    height:100vh;
    padding:22px;
    border-right:1px solid rgba(255,255,255,.12);
    background:#0c0c0f;
}
.sidebar h2{
    margin-top:0;
}
.sidebar a{
    display:block;
    padding:13px;
    margin-bottom:9px;
    border:1px solid rgba(255,255,255,.06);
    border-radius:13px;
    background:#18181e;
    text-decoration:none;
}
.sidebar a:hover,.sidebar a.active{
    background:linear-gradient(135deg,var(--red),var(--red-dark));
}
.admin-main{
    min-width:0;
    max-width:100%;
    padding:28px;
}
.admin-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    flex-wrap:wrap;
    margin-bottom:20px;
}
.admin-header h1{
    margin:0;
}
.form-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:15px;
}
.full{
    grid-column:1/-1;
}
.admin-list{
    display:grid;
    gap:12px;
}
.admin-row{
    display:grid;
    grid-template-columns:54px 66px minmax(0,1fr) auto;
    gap:13px;
    align-items:center;
    padding:13px;
    border:1px solid rgba(255,255,255,.12);
    border-radius:16px;
    background:#15151a;
}
.order-number{
    display:grid;
    width:44px;
    height:44px;
    place-items:center;
    border-radius:12px;
    background:#292930;
    font-weight:900;
}
.admin-thumb{
    width:58px;
    height:58px;
    object-fit:cover;
    border-radius:14px;
    background:#000;
}
.row-actions{
    display:flex;
    justify-content:flex-end;
    gap:7px;
    flex-wrap:wrap;
}
.notice{
    padding:12px;
    margin-bottom:14px;
    border-radius:12px;
}
.notice.error{
    border:1px solid #8a2835;
    background:#321015;
    color:#ffd8de;
}
.notice.success{
    border:1px solid #267a3f;
    background:#10301a;
    color:#d1ffdc;
}
.menu-button{
    display:none;
}
.toast{
    position:fixed;
    left:50%;
    bottom:20px;
    z-index:50;
    padding:11px 17px;
    opacity:0;
    border:1px solid var(--red);
    border-radius:999px;
    background:#15151a;
    transform:translateX(-50%) translateY(25px);
    transition:.2s;
}
.toast.show{
    opacity:1;
    transform:translateX(-50%) translateY(0);
}
.help-box{
    padding:12px 14px;
    border:1px solid rgba(255,255,255,.12);
    border-radius:12px;
    background:#101014;
    color:#c7c7cf;
    font-size:14px;
}

@media(min-width:900px){
    .apps-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}

@media(max-width:980px){
    .admin-layout{
        display:block;
    }
    .sidebar{
        position:fixed;
        left:0;
        top:0;
        bottom:0;
        z-index:40;
        width:min(82vw,300px);
        height:100dvh;
        transform:translateX(-105%);
        transition:.22s;
    }
    .sidebar.open{
        transform:translateX(0);
    }
    .menu-button{
        position:fixed;
        left:14px;
        top:14px;
        z-index:45;
        display:block;
        width:48px;
        height:48px;
        border:0;
        border-radius:50%;
        background:#bbb;
        color:#fff;
        font-size:25px;
    }
    .admin-main{
        padding:78px 15px 20px;
    }
    .form-grid{
        grid-template-columns:minmax(0,1fr);
    }
    .full{
        grid-column:auto;
    }
}

@media(max-width:650px){
    .wrap{
        padding-left:12px;
        padding-right:12px;
    }
    .public-header{
        padding-top:22px;
    }
    .public-logo{
        width:92%;
        max-height:135px;
    }
    .public-header h1{
        font-size:25px;
    }
    .search-box{
        margin-bottom:24px;
    }
    .search-box input{
        height:56px;
        font-size:17px;
    }
    .app-card{
        padding:10px;
        border-width:2px;
        border-radius:19px;
    }
    .app-banner{
        margin-bottom:15px;
        border-radius:12px;
    }
    .app-title{
        font-size:27px;
    }
    .app-icon{
        width:64px;
        height:64px;
        flex-basis:64px;
        border-radius:15px;
    }
    .app-size{
        margin-bottom:15px;
        font-size:16px;
    }
    .btn{
        min-height:52px;
        padding:13px 12px;
        font-size:17px;
    }
    .code-text{
        font-size:18px;
    }
    .admin-row{
        grid-template-columns:44px 58px minmax(0,1fr);
    }
    .row-actions{
        grid-column:1/-1;
        justify-content:flex-start;
    }
}
