:root {
    --bg-deep-dark: #04060b;
    --panel-glass: rgba(10, 15, 30, 0.75);
    --border-neon: rgba(139, 92, 246, 0.12);
    --primary-neon: #a855f7;
    --secondary-neon: #00ffcc;
    --text-main: #f8fafc;
    --text-ghost: #94a3b8;
    --android-color: #2ecc71;
    --ios-color: #007aff;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Poppins', sans-serif; -webkit-tap-highlight-color: transparent; }
h1, h2, .site-logo { font-family: 'Montserrat', sans-serif; }

body {
    background-color: var(--bg-deep-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: ""; position: absolute; width: 320px; height: 320px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.12) 0%, rgba(0,0,0,0) 70%);
    top: -50px; right: -50px; z-index: -1;
}

.container { max-width: 800px; margin: 0 auto; padding: 0 14px; }

.site-brand-header {
    display: flex; align-items: center; justify-content: center;
    padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,0.03);
    background: rgba(4, 6, 11, 0.8); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    position: sticky; top: 0; z-index: 100;
}
.site-logo {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    font-size: 1.5rem; font-weight: 800; letter-spacing: -1px;
    background: linear-gradient(135deg, #fff 50%, var(--secondary-neon));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.site-logo i {
    font-size: 1.4rem; background: linear-gradient(135deg, var(--primary-neon), var(--secondary-neon));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px rgba(0,255,204,0.4));
}

.hero-section { padding: 30px 0 20px; text-align: center; }
.hero-title { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.5px; color: #fff; margin-bottom: 8px; }
.hero-description { color: var(--text-ghost); font-size: 0.92rem; max-width: 450px; margin: 0 auto 24px; line-height: 1.4; padding: 0 8px; }

.search-box { position: relative; max-width: 100%; margin: 0 auto; }
.search-input {
    width: 100%; padding: 14px 16px 14px 44px; border-radius: 12px;
    background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.05);
    color: #fff; font-size: 0.92rem; transition: all 0.25s ease;
}
.search-input:focus { outline: none; border-color: var(--primary-neon); background: rgba(168, 85, 247, 0.02); }
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-ghost); font-size: 0.95rem; }

.section-heading { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-ghost); margin: 25px 0 16px; display: flex; align-items: center; gap: 10px; }
.section-heading::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,0.05); }

.cards-grid { display: grid; grid-template-columns: 1fr; gap: 12px; width: 100%; }

.app-card {
    background: var(--panel-glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-radius: 16px; padding: 12px; border: 1px solid rgba(255, 255, 255, 0.02);
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%; min-width: 0; transition: transform 0.2s ease; cursor: pointer;
}
.app-card:active { transform: scale(0.98); background: rgba(255,255,255,0.02); }

.app-header { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.app-thumb { width: 50px; height: 50px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }

.app-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }

.app-title { font-size: 0.88rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.app-author { font-size: 0.72rem; color: var(--primary-neon); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }

.app-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.meta-container { display: flex; align-items: center; gap: 3px; font-size: 0.72rem; font-weight: 600; color: #ffb703; }

.btn-action-install {
    background: linear-gradient(135deg, var(--primary-neon), #7c3aed);
    color: #fff;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.72rem;
    border: none;
    text-transform: uppercase;
    flex-shrink: 0;
    min-width: 55px;
    text-align: center;
}

/* ===== DETAILS PAGE ===== */
#game-details-page { display: none; padding: 20px 0 40px; animation: mobileSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes mobileSlideIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.nav-back-button { display: inline-flex; align-items: center; gap: 6px; color: var(--text-ghost); font-weight: 500; margin-bottom: 16px; cursor: pointer; font-size: 0.85rem; }

.detail-architecture {
    background: rgba(16, 22, 42, 0.6); border-radius: 18px; padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.03); display: flex; gap: 14px; align-items: center; margin-bottom: 16px;
}
.detail-icon-large { width: 80px; height: 80px; border-radius: 16px; object-fit: cover; border: 1px solid rgba(255,255,255,0.05); }
.detail-meta-specs { flex: 1; min-width: 0; }
.detail-main-title { font-size: 1.3rem; font-weight: 700; color: #fff; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-sub-author { color: var(--primary-neon); font-weight: 600; font-size: 0.8rem; margin-bottom: 6px; }
.detail-badges { display: flex; gap: 6px; }
.badge-pill { padding: 4px 8px; border-radius: 8px; font-size: 0.68rem; font-weight: 600; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); }

.technical-specs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.spec-item-box { background: rgba(255,255,255,0.01); border: 1px solid rgba(255,255,255,0.02); border-radius: 10px; padding: 10px 4px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.spec-label { font-size: 0.65rem; color: var(--text-ghost); text-transform: uppercase; }
.spec-value { font-size: 0.8rem; font-weight: 600; color: var(--secondary-neon); }

.desc-box-panel { background: rgba(255,255,255,0.01); border-radius: 14px; padding: 16px; border: 1px solid rgba(255,255,255,0.02); margin-bottom: 20px; }
.panel-heading-title { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; margin-bottom: 8px; color: var(--text-ghost); display: flex; align-items: center; gap: 6px; }
.panel-body-text { color: #cbd5e1; font-size: 0.85rem; line-height: 1.5; }

.dual-platform-gateways { display: flex; flex-direction: column; gap: 10px; }
.gateway-trigger-btn {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 15px; border-radius: 12px; font-weight: 700; font-size: 0.92rem; color: #fff;
    border: none; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.2); position: relative; overflow: hidden;
}
.btn-platform-android { background: linear-gradient(135deg, #1b743d, var(--android-color)); animation: pulseGlowAndroid 2s infinite; }
.btn-platform-ios { background: linear-gradient(135deg, #003b87, var(--ios-color)); }

.cdkey-preview {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
    user-select: none;
    pointer-events: none;
}
.cdkey-visible {
    color: rgba(255, 255, 255, 0.85);
}
.cdkey-blur {
    filter: blur(4px);
    color: rgba(255, 255, 255, 0.7);
}
.admin-reveal .cdkey-blur {
    filter: none;
}
.admin-reveal .cdkey-visible {
    color: var(--secondary-neon);
    font-weight: 600;
}

@keyframes pulseGlowAndroid { 0%, 100% { box-shadow: 0 4px 10px rgba(46,204,113,0.15); } 50% { box-shadow: 0 4px 18px rgba(46,204,113,0.35); } }

/* ===== MODERN DOWNLOAD MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(10, 11, 18, 0.98); backdrop-filter: blur(15px); display: none; place-items: center; z-index: 99999; padding: 16px; }
.modal-overlay.active { display: grid; }

.premium-verification-hub { background: #111422; border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 24px; width: 100%; max-width: 380px; padding: 24px 20px; text-align: center; box-shadow: 0 20px 40px rgba(0,0,0,0.5); }
.hub-title-label { font-size: 1.3rem; font-weight: 700; color: #fff; margin-bottom: 4px; }
.hub-status-log { color: #fff; font-size: 1.1rem; font-weight: 600; margin-bottom: 20px; }

.modal-app-box { display: flex; align-items: center; gap: 14px; background: rgba(255,255,255,0.02); padding: 12px; border-radius: 16px; margin-bottom: 24px; border: 1px solid rgba(255,255,255,0.03); text-align: left; }
.modal-app-icon { width: 55px; height: 55px; border-radius: 12px; object-fit: cover; }
.modal-app-details h4 { font-size: 0.95rem; font-weight: 600; color: #fff; margin-bottom: 2px; }
.modal-app-details span { font-size: 0.75rem; color: var(--text-ghost); display: block; }
.modal-platform-badge { display: inline-block; padding: 2px 8px; font-size: 0.65rem; font-weight: 700; border-radius: 6px; margin-top: 4px; text-transform: uppercase; }
.badge-android { background: rgba(46,204,113,0.15); color: var(--android-color); }
.badge-ios { background: rgba(0,122,255,0.15); color: var(--ios-color); }

.download-timeline { display: flex; justify-content: space-between; position: relative; margin-bottom: 12px; padding: 0 10px; }
.download-timeline::before { content: ''; position: absolute; top: 12px; left: 24px; right: 24px; height: 2px; background: rgba(255,255,255,0.08); z-index: 1; }
.timeline-line-progress { position: absolute; top: 12px; left: 24px; width: 0%; height: 2px; background: var(--primary-neon); z-index: 2; transition: width 0.3s ease; }
.step-node { width: 26px; height: 26px; border-radius: 50%; background: #1a1f36; border: 2px solid rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; font-size: 0.7rem; color: var(--text-ghost); z-index: 3; position: relative; transition: all 0.3s ease; }
.step-node.active { background: #111422; border-color: var(--primary-neon); color: var(--primary-neon); box-shadow: 0 0 10px rgba(168, 85, 247, 0.3); }
.step-node.completed { background: var(--primary-neon); border-color: var(--primary-neon); color: #fff; }

.step-labels { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--text-ghost); font-weight: 500; margin-bottom: 24px; padding: 0 2px; }
.step-label-text.active { color: #fff; font-weight: 600; }

.progress-container { margin-bottom: 24px; }
.progress-info-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 0.85rem; font-weight: 600; }
.progress-percentage { color: #fff; font-size: 1.2rem; font-weight: 700; }
.progress-status-text { color: var(--text-ghost); }
.progress-bar-bg { width: 100%; height: 8px; background: rgba(255,255,255,0.06); border-radius: 10px; overflow: hidden; position: relative; }
.progress-bar-fill { width: 0%; height: 100%; background: linear-gradient(90deg, var(--primary-neon), #7c3aed); border-radius: 10px; transition: width 0.1s linear; }

.modal-action-buttons { display: flex; flex-direction: column; gap: 8px; }
.action-finalize-trigger { display: none; width: 100%; padding: 15px; border-radius: 12px; background: linear-gradient(135deg, var(--primary-neon), #7c3aed); color: #fff; font-weight: 700; font-size: 0.92rem; border: none; text-transform: uppercase; cursor: pointer; box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3); }
.action-finalize-trigger:active { transform: scale(0.98); }
.btn-modal-cancel { width: 100%; padding: 12px; border-radius: 12px; background: transparent; border: 1px solid rgba(255,255,255,0.08); color: var(--text-ghost); font-weight: 600; font-size: 0.85rem; cursor: pointer; transition: all 0.2s; }
.btn-modal-cancel:hover { background: rgba(255,255,255,0.02); color: #fff; }
.cdkey-preview-bottom {
    display: none;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 3px;
    padding: 10px 0 2px;
    user-select: none;
    pointer-events: none;
}

footer { text-align: center; color: var(--text-ghost); padding: 30px 0; font-size: 0.75rem; border-top: 1px solid rgba(255,255,255,0.02); margin-top: 40px; }
