:root {
    --blue-1: #0785ee;
    --blue-2: #0052b7;
    --stone: #2f3029;
    --stone-dark: #161711;
    --cream: #f5d083;
    --cream-dark: #ae7827;
    --green: #7ed321;
    --green-dark: #2b6814;
    --text: #ffffff;
    --ink: #151515;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
}

.public-page {
    background-image: url("bg-index.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    overflow-x: hidden;
}


.download-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 22px;
    align-items: center;
    padding: 38px 0;
    position: relative;
    z-index: 1;
}

.hero-card,
.version-panel,
.admin-shell,
.login-card,
.upload-card,
.admin-table-card {
    border: 4px solid #0f1719;
    box-shadow:
        inset 0 0 0 3px rgba(255,255,255,.12),
        0 8px 0 rgba(0,0,0,.32),
        0 18px 36px rgba(0,0,0,.28);
}

.hero-card {
    width: fit-content;
    max-width: 100%;
    min-height: unset;
    background: linear-gradient(
        180deg,
        rgba(58, 72, 76, .72),
        rgba(36, 48, 51, .78)
    );
    border-radius: 24px;
    padding: 14px;
    position: relative;
    display: grid;
    place-items: center;
    justify-self: center;
    align-self: center;
    backdrop-filter: blur(4px);

    transform: translateY(150px);
}

.top-chip {
    position: absolute;
    top: 18px;
    left: 22px;
    z-index: 2;
    background: linear-gradient(180deg, #148eff, #0063c2);
    border: 3px solid #0a1d30;
    border-radius: 14px;
    padding: 8px 16px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
    text-shadow: 0 2px 0 #001629;
}

.hero-art {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 18px;
    border: 4px solid #101612;
    background: #51bdf6;
}

.title-block {
    text-align: center;
    margin: 22px 0 18px;
}

h1,
h2,
p {
    margin-top: 0;
}

.title-block h1 {
    margin-bottom: 6px;
    font-size: clamp(2.4rem, 6vw, 5.4rem);
    line-height: .95;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #ffffff;
    text-shadow:
        0 4px 0 #000,
        4px 0 0 #000,
        -4px 0 0 #000,
        0 -4px 0 #000,
        0 8px 0 rgba(0,0,0,.35);
}

.title-block p {
    margin-bottom: 0;
    font-size: clamp(1.05rem, 2.4vw, 1.45rem);
    font-weight: 800;
    text-shadow: 0 3px 0 #000;
}

.download-card {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    background: linear-gradient(180deg, #f9dda1, #e0ad57);
    color: var(--ink);
    border: 4px solid #1b1408;
    border-radius: 18px;
    padding: 16px;
    box-shadow: inset 0 0 0 3px rgba(255,255,255,.33);
}

.download-icon-wrap {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(180deg, #0d8fff, #0058bf);
    border: 4px solid #111;
}

.download-icon-wrap img {
    width: 44px;
}

.download-copy {
    min-width: 0;
}

.small-label,
.date-line {
    display: block;
    font-weight: 800;
    opacity: .72;
}

.download-copy strong {
    display: block;
    margin: 2px 0;
    font-size: clamp(1.1rem, 2.4vw, 1.6rem);
    overflow-wrap: anywhere;
}

.download-button,
.login-card button,
.upload-card button,
.small-button {
    appearance: none;
    border: 4px solid #0b1824;
    border-radius: 16px;
    background: linear-gradient(180deg, #1597ff, #0063c6);
    color: #fff;
    font-weight: 950;
    font-size: 1.05rem;
    text-decoration: none;
    padding: 14px 22px;
    box-shadow: inset 0 0 0 3px rgba(255,255,255,.14), 0 5px 0 rgba(0,0,0,.32);
    cursor: pointer;
    text-shadow: 0 2px 0 #001528;
}

.download-button.disabled {
    opacity: .55;
    cursor: not-allowed;
}

.version-panel {
    align-self: stretch;
    background: linear-gradient(
        180deg,
        rgba(58, 72, 76, .72),
        rgba(36, 48, 51, .78)
    );
    border-radius: 24px;
    padding: 24px;
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
}

.developer-credit {
    position: absolute;
    top: 22px;
    right: 24px;
    color: #ffffff;
    font-size: .95rem;
    font-weight: 900;
    text-shadow: 0 2px 0 rgba(0,0,0,.75);
    white-space: nowrap;
}

.version-content {
    width: 100%;
    margin-top: 58px;
}

.version-content h2 {
    margin-bottom: 18px;
}

.version-table {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0,0,0,.12);
}

.version-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px;
    column-gap: 14px;
    padding: 14px 12px;
    border-bottom: 2px solid rgba(255,255,255,.12);
}

.version-row:last-child {
    border-bottom: none;
}

.version-head {
    background: rgba(0,0,0,.25);
    color: #f9d990;
    font-size: .86rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.version-file {
    min-width: 0;
    color: #ffffff;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.version-file span {
    display: block;
    margin-top: 4px;
    opacity: .72;
    font-size: .88rem;
}

.version-date {
    color: #ffffff;
    font-weight: 850;
    line-height: 1.25;
    word-break: normal;
}

.big-download-box {
    width: min(430px, calc(100vw - 80px));
    min-height: 230px;
    border: 3px solid rgba(255,255,255,.35);
    border-radius: 18px;
    background: linear-gradient(
        180deg,
        rgba(31, 39, 41, .82),
        rgba(18, 25, 27, .86)
    );
    box-shadow:
        inset 0 0 0 2px rgba(255,255,255,.08),
        0 7px 0 rgba(0,0,0,.22);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    text-decoration: none;
    cursor: pointer;
    color: var(--cream);
    padding: 26px;
}

.big-download-box:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.big-download-box.disabled {
    opacity: .65;
    cursor: not-allowed;
}

.download-file-name {
    font-size: clamp(1.1rem, 2.4vw, 1.6rem);
    font-weight: 950;
    color: var(--cream);
    text-align: center;
    overflow-wrap: anywhere;
    text-shadow: 0 3px 0 rgba(0,0,0,.65);
}

.big-download-box img {
    width: 110px;
    height: 110px;
    object-fit: contain;
}

.version-panel h2,
.admin-table-card h2 {
    color: var(--cream);
    text-shadow: 0 3px 0 #000;
    letter-spacing: .08em;
    text-transform: uppercase;
}

table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 12px;
}

th,
td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 2px solid rgba(255,255,255,.12);
    vertical-align: top;
}

th {
    color: #f9d990;
    background: rgba(0,0,0,.25);
    font-size: .86rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

td {
    color: #fff;
    font-weight: 750;
}

td span {
    display: inline-block;
    margin-top: 4px;
    opacity: .68;
    font-size: .88rem;
}

.admin-page {
    background: #161819;
    color: #f8f8f8;
}

.admin-shell {
    width: min(1000px, calc(100% - 32px));
    margin: 36px auto;
    background: #242624;
    border-radius: 22px;
    padding: 24px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 24px;
}

.admin-header h1 {
    margin-bottom: 4px;
    font-size: clamp(2rem, 4vw, 3rem);
}

.admin-header p {
    margin-bottom: 0;
    color: rgba(255,255,255,.72);
    font-weight: 700;
}

.login-card {
    max-width: 420px;
    background: #30322f;
    border-radius: 18px;
    padding: 22px;
}

.login-card label {
    display: block;
    margin-bottom: 8px;
    font-weight: 800;
}

.login-card input {
    width: 100%;
    padding: 14px;
    margin-bottom: 14px;
    border-radius: 12px;
    border: 3px solid #111;
    font-size: 1rem;
}

.admin-grid {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 22px;
}

.upload-card,
.admin-table-card {
    background: #30322f;
    border-radius: 18px;
    padding: 18px;
}

.upload-drop {
    min-height: 260px;
    border: 4px dashed rgba(255,255,255,.35);
    border-radius: 20px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    text-align: center;
    cursor: pointer;
    background: rgba(0,0,0,.18);
    margin-bottom: 16px;
}

.upload-drop input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.plus {
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: linear-gradient(180deg, #f9dda1, #d69b42);
    border: 4px solid #121212;
    color: #111;
    font-size: 4rem;
    font-weight: 900;
    line-height: 1;
}

.upload-drop strong {
    font-size: 1.4rem;
}

.upload-drop em {
    max-width: 240px;
    color: rgba(255,255,255,.7);
    font-style: normal;
    overflow-wrap: anywhere;
}

.upload-card button,
.login-card button {
    width: 100%;
}

.small-button {
    padding: 10px 16px;
    font-size: .95rem;
}

.success-box,
.error-box {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 18px;
    font-weight: 800;
}


.upload-progress-wrap {
    margin: 0 0 16px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(0,0,0,.22);
    border: 2px solid rgba(255,255,255,.12);
}

.upload-progress-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 900;
}

.upload-progress-bar {
    width: 100%;
    height: 18px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(0,0,0,.45);
    border: 2px solid rgba(255,255,255,.18);
}

#upload-progress-fill {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(180deg, #8be83e, #3c9d18);
    transition: width .15s linear;
}

#upload-status {
    display: block;
    margin-top: 8px;
    color: rgba(255,255,255,.72);
    font-weight: 700;
}

#publish-button:disabled {
    opacity: .6;
    cursor: wait;
}

.success-box {
    background: rgba(78, 178, 42, .2);
    border: 2px solid #7ed321;
}

.error-box,
.error-text {
    background: rgba(255, 69, 69, .16);
    border: 2px solid #ff5959;
    color: #ffd1d1;
}

.error-text {
    padding: 10px;
    border-radius: 10px;
}

.history-title {
    margin-top: 26px;
}

@media (max-width: 860px) {
    .public-page {
        background-image: url("background_phone.png");
        background-size: cover;
        background-position: top center;
        background-repeat: no-repeat;
        background-attachment: scroll;
    }

    .download-shell {
        width: min(470px, calc(100% - 28px));
        min-height: 100svh;
        grid-template-columns: 1fr;
        gap: 72px;
        align-items: start;
        padding: 300px 0 34px;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .hero-card {
        width: fit-content;
        padding: 12px;
        justify-self: center;
        align-self: start;
        transform: none;
    }

    .big-download-box {
        width: min(390px, calc(100vw - 64px));
        min-height: 190px;
        padding: 22px;
        gap: 18px;
    }

    .download-file-name {
        font-size: clamp(1rem, 5vw, 1.35rem);
    }

    .big-download-box img {
        width: 88px;
        height: 88px;
    }

    .version-panel {
        align-self: auto;
        min-height: 410px;
        padding: 22px;
        margin-top: 0;
    }

    .developer-credit {
        top: 20px;
        right: 24px;
        font-size: .9rem;
    }

    .version-content {
        margin-top: 58px;
    }

    .version-row {
        grid-template-columns: minmax(0, 1fr) 118px;
        column-gap: 10px;
        padding: 14px 12px;
    }

    .admin-header {
        align-items: flex-start;
        flex-direction: column;
    }
}