@font-face {
    font-family: 'Lalezar';
    src: url('/static/fonts/Lalezar-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-0: #08090b;
    --bg-1: #0e1013;
    --bg-2: #15181c;
    --card: #131519;
    --border: #24272c;
    --gold: #ffb703;
    --gold-dim: #b8860b;
    --text-hi: #f4f4f6;
    --text-mid: #b7bac0;
    --text-low: #74787f;
    --danger: #e25555;
    --radius: 14px;
    --shadow-gold: 0 0 40px rgba(255, 183, 3, 0.15);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg-0);
    color: var(--text-hi);
    font-family: -apple-system, "Segoe UI", "Vazirmatn", Tahoma, Roboto, Arial, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(ellipse 900px 600px at 15% -10%, rgba(255, 183, 3, 0.08), transparent 60%),
        radial-gradient(ellipse 700px 500px at 90% 10%, rgba(255, 183, 3, 0.05), transparent 55%),
        var(--bg-0);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        repeating-linear-gradient(115deg, rgba(255,255,255,0.015) 0px, rgba(255,255,255,0.015) 1px, transparent 1px, transparent 70px);
    animation: driftLines 40s linear infinite;
}

@keyframes driftLines {
    0% { background-position: 0 0; }
    100% { background-position: 400px 400px; }
}

a { color: inherit; text-decoration: none; }

.brand-font { font-family: 'Lalezar', -apple-system, sans-serif; letter-spacing: 1px; }

/* Use the brand display font across headings, buttons, tabs and nav —
   body copy (p, textarea, changelog text) stays on the system font for readability. */
h1, h2, h3, h4,
.nav-links a,
.btn,
.tab-btn,
.admin-tab,
.version-item .v-num,
.build-row .info .v,
.platform-card .version-tag,
.field label,
.hero-badge {
    font-family: 'Lalezar', -apple-system, "Segoe UI", Tahoma, sans-serif;
    letter-spacing: 0.3px;
}

/* ---------- Layout ---------- */

.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 6%;
    background: rgba(8, 9, 11, 0.72);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.nav .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 26px;
    color: var(--gold);
}

.nav .logo img {
    width: 34px;
    height: 34px;
    filter: drop-shadow(0 0 10px rgba(255, 183, 3, 0.5));
    animation: micPulse 3.2s ease-in-out infinite;
}

@keyframes micPulse {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(255, 183, 3, 0.35)); transform: scale(1); }
    50% { filter: drop-shadow(0 0 16px rgba(255, 183, 3, 0.65)); transform: scale(1.06); }
}

.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a { color: var(--text-mid); font-size: 14px; transition: color .2s ease; }
.nav-links a:hover { color: var(--gold); }

.container { max-width: 1180px; margin: 0 auto; padding: 0 6%; }

/* ---------- Hero ---------- */

.hero {
    position: relative;
    padding: 110px 6% 90px;
    text-align: center;
    overflow: hidden;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 13px;
    color: var(--text-mid);
    background: rgba(255,255,255,0.02);
    opacity: 0;
    animation: fadeUp .7s ease forwards;
}

.hero h1 {
    font-family: 'Lalezar', sans-serif;
    font-size: clamp(48px, 9vw, 92px);
    margin: 22px 0 10px;
    color: var(--text-hi);
    opacity: 0;
    animation: fadeUp .8s ease .1s forwards;
}

.hero h1 span { color: var(--gold); }

.hero p.lead {
    max-width: 620px;
    margin: 0 auto;
    color: var(--text-mid);
    font-size: 17px;
    opacity: 0;
    animation: fadeUp .8s ease .22s forwards;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-cta {
    margin-top: 38px;
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeUp .8s ease .34s forwards;
}

.hero-waves {
    position: absolute;
    left: 50%;
    top: 10px;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    align-items: flex-end;
    height: 46px;
    opacity: .55;
}

.hero-waves span {
    width: 4px;
    border-radius: 3px;
    background: linear-gradient(to top, var(--gold-dim), var(--gold));
    animation: waveBar 1.4s ease-in-out infinite;
}

@keyframes waveBar {
    0%, 100% { height: 8px; }
    50% { height: 42px; }
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 26px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

.btn img { width: 18px; height: 18px; }

.btn-primary {
    background: var(--gold);
    color: #17140a;
    box-shadow: 0 6px 24px rgba(255, 183, 3, 0.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(255, 183, 3, 0.4); }

.btn-ghost {
    background: rgba(255,255,255,0.03);
    color: var(--text-hi);
    border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-2px); }

.btn-danger { background: rgba(226, 85, 85, 0.12); color: var(--danger); border-color: rgba(226,85,85,.35); }
.btn-danger:hover { background: rgba(226, 85, 85, 0.2); }

.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ---------- Sections ---------- */

.section { padding: 80px 0; }
.section-title {
    font-family: 'Lalezar', sans-serif;
    font-size: clamp(28px, 4vw, 40px);
    margin-bottom: 8px;
    color: var(--text-hi);
}
.section-sub { color: var(--text-mid); margin-bottom: 42px; max-width: 560px; }

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .7s ease, transform .7s ease;
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- Platform cards ---------- */

.platforms {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
}
@media (max-width: 760px) { .platforms { grid-template-columns: 1fr; } }

.platform-card {
    background: linear-gradient(180deg, var(--card), var(--bg-1));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    position: relative;
    overflow: hidden;
    transition: border-color .25s ease, transform .25s ease;
}
.platform-card:hover { border-color: rgba(255,183,3,0.35); transform: translateY(-4px); }

.platform-card .icon-wrap {
    width: 54px; height: 54px;
    border-radius: 14px;
    background: rgba(255,183,3,0.08);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 18px;
}
.platform-card .icon-wrap img { width: 28px; height: 28px; }

.platform-card h3 { font-size: 22px; margin: 0 0 6px; }
.platform-card .version-tag { color: var(--gold); font-size: 13px; font-weight: 600; }
.platform-card p { color: var(--text-mid); font-size: 14px; margin: 14px 0 22px; }

.no-build {
    color: var(--text-low);
    font-size: 14px;
    border: 1px dashed var(--border);
    padding: 16px;
    border-radius: 10px;
    text-align: center;
}

/* ---------- Changelog / version list ---------- */

.version-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.version-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    background: rgba(255,255,255,0.015);
}
.version-item .v-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.version-item .v-num { color: var(--gold); font-weight: 700; }
.version-item .v-meta { color: var(--text-low); font-size: 12px; }
.version-item .v-log {
    color: var(--text-mid);
    font-size: 13.5px;
    margin-top: 8px;
    white-space: pre-wrap;
}

/* ---------- Gallery ---------- */

.tabs { display: flex; gap: 10px; margin-bottom: 26px; }
.tab-btn {
    padding: 9px 18px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-mid);
    cursor: pointer;
    font-size: 14px;
    transition: all .2s ease;
}
.tab-btn.active { background: var(--gold); color: #17140a; border-color: var(--gold); font-weight: 600; }

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}
.gallery img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform .3s ease, box-shadow .3s ease;
}

/* Android screenshots are portrait (phone) shaped, Windows stay landscape */
.gallery.gallery-android {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.gallery.gallery-android img {
    aspect-ratio: 9/16;
}
.gallery img:hover { transform: scale(1.03); box-shadow: var(--shadow-gold); }

.empty-gallery { color: var(--text-low); font-size: 14px; }

/* Lightbox */
.lightbox {
    position: fixed; inset: 0; background: rgba(5,5,6,0.92);
    display: none; align-items: center; justify-content: center; z-index: 200;
    backdrop-filter: blur(6px);
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 85vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox .close-btn {
    position: absolute; top: 26px; right: 6%;
    width: 42px; height: 42px; border-radius: 50%;
    background: rgba(255,255,255,0.06); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.lightbox .close-btn img { width: 18px; height: 18px; max-width: none; max-height: none; }

/* ---------- Footer ---------- */

.footer {
    border-top: 1px solid var(--border);
    padding: 34px 6%;
    text-align: center;
    color: var(--text-low);
    font-size: 13px;
}
.footer a { color: var(--text-mid); }
.footer a:hover { color: var(--gold); }

/* ---------- Admin ---------- */

.admin-shell { min-height: 100vh; display: flex; flex-direction: column; }

.login-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.login-card {
    width: 100%; max-width: 380px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
    animation: fadeUp .5s ease;
}
.login-card .icon-wrap {
    width: 56px; height: 56px; border-radius: 16px;
    background: rgba(255,183,3,0.08);
    display: flex; align-items: center; justify-content: center; margin: 0 auto 18px;
}
.login-card .icon-wrap img { width: 28px; height: 28px; }
.login-card h2 { text-align: center; font-family: 'Lalezar', sans-serif; font-size: 26px; margin: 0 0 26px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-mid); margin-bottom: 7px; }
.field input, .field textarea, .field select {
    width: 100%;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 14px;
    color: var(--text-hi);
    font-size: 14px;
    font-family: inherit;
    transition: border-color .2s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
    outline: none; border-color: var(--gold);
}
.field textarea { resize: vertical; min-height: 90px; }

.error-msg { color: var(--danger); font-size: 13px; margin-bottom: 14px; text-align: center; }

.admin-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 4%;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: rgba(8,9,11,0.85); backdrop-filter: blur(10px); z-index: 40;
}
.admin-body { padding: 34px 4% 70px; max-width: 1180px; margin: 0 auto; width: 100%; }

.admin-tabs { display: flex; gap: 10px; margin-bottom: 30px; border-bottom: 1px solid var(--border); }
.admin-tab {
    padding: 12px 20px; cursor: pointer; color: var(--text-mid); font-size: 14px;
    border-bottom: 2px solid transparent; transition: all .2s ease;
}
.admin-tab.active { color: var(--gold); border-color: var(--gold); }

.panel { display: none; }
.panel.active { display: block; animation: fadeUp .4s ease; }

.card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 26px; margin-bottom: 22px;
}
.card h3 { margin-top: 0; font-size: 17px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

.build-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px;
    flex-wrap: wrap;
}
.build-row .info { flex: 1; min-width: 200px; }
.build-row .info .v { color: var(--gold); font-weight: 700; margin-right: 8px; }
.build-row .info .log { color: var(--text-mid); font-size: 12.5px; margin-top: 4px; white-space: pre-wrap; }
.build-row .actions { display: flex; gap: 8px; }
.icon-btn {
    width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
    background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}
.icon-btn img { width: 16px; height: 16px; }
.icon-btn:hover { border-color: var(--gold); background: rgba(255,183,3,0.08); }
.icon-btn.danger:hover { border-color: var(--danger); background: rgba(226,85,85,0.1); }

.progress-wrap { margin-top: 14px; }
.progress-bar-bg {
    height: 8px; border-radius: 100px; background: var(--bg-1); overflow: hidden; border: 1px solid var(--border);
}
.progress-bar-fill {
    height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold-dim), var(--gold));
    transition: width .2s ease;
}
.progress-label { font-size: 12.5px; color: var(--text-mid); margin-top: 6px; }

.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.shot-item { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.shot-item img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; }
.shot-grid.shot-grid-android { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.shot-grid.shot-grid-android .shot-item img { aspect-ratio: 9/16; }
.shot-item .del-shot {
    position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%;
    background: rgba(10,10,12,0.75); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.shot-item .del-shot img { width: 13px; height: 13px; }

.dropzone {
    border: 2px dashed var(--border); border-radius: 12px; padding: 30px; text-align: center;
    color: var(--text-mid); cursor: pointer; transition: border-color .2s ease, background .2s ease;
}
.dropzone:hover, .dropzone.drag { border-color: var(--gold); background: rgba(255,183,3,0.04); }
.dropzone img { width: 30px; height: 30px; margin-bottom: 10px; opacity: .8; }

.toast {
    position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: var(--card); border: 1px solid var(--border); padding: 13px 22px; border-radius: 10px;
    font-size: 14px; opacity: 0; transition: all .3s ease; z-index: 300; display: flex; align-items: center; gap: 10px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast img { width: 16px; height: 16px; }
.toast.error { border-color: rgba(226,85,85,.4); }

.empty-state { color: var(--text-low); font-size: 14px; text-align: center; padding: 20px 0; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }
