*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-solid: #000000;
    --text: #ffffff;
    --text-muted: #a1a1aa;
    --card-bg: rgba(10, 10, 10, 0.55);
    --card-border: rgba(255, 255, 255, 0.1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
}

html, body {
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background-color: var(--bg-solid);
    color: var(--text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text);
}

#bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 0;
}

.container {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.card {
    position: relative;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 48px 60px;
    min-width: 340px;
    max-width: 640px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
}

.card-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text);
}

.tabs {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 4px;
    border-radius: 14px;
    width: 100%;
    justify-content: center;
}

.tab {
    flex: 1;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.tab.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.tab:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
}

.tab-panels {
    width: 100%;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: panel-fade 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes panel-fade {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.download-grid {
    margin-top: 4px;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.download-btn {
    --tilt-rx: 0deg;
    --tilt-ry: 0deg;
    --tilt-tx: 0px;
    --tilt-ty: 0px;
    --tilt-scale: 1;
    transform:
        perspective(700px)
        rotateX(var(--tilt-rx))
        rotateY(var(--tilt-ry))
        translate3d(var(--tilt-tx), var(--tilt-ty), 0)
        scale(var(--tilt-scale));
    transform-style: preserve-3d;
    transform-origin: center;
    will-change: transform;
    transition:
        border-color 0.25s var(--ease-out-expo),
        box-shadow 0.25s var(--ease-out-expo),
        color 0.25s var(--ease-out-expo),
        transform 0.25s var(--ease-out-quint);

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #ffffff;
    text-decoration: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.download-btn:hover,
.download-btn:focus-visible {
    --tilt-rx: -10deg;
    --tilt-ry: 10deg;
    --tilt-tx: 1px;
    --tilt-ty: -4px;
    --tilt-scale: 1.06;
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35), 0 18px 45px rgba(255, 255, 255, 0.12);
}

.download-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    transform: translateZ(12px);
    transition: transform 0.25s var(--ease-out-quint);
}

.download-btn:hover svg {
    transform: translateZ(18px) scale(1.08);
}

.download-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 4px;
}

.checksum-list {
    margin-top: 16px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checksum-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
}

.checksum-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.checksum-hash {
    flex: 1;
    font-family: 'SF Mono', Monaco, Menlo, Consolas, monospace;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 6px 10px;
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: all;
}

.copy-btn {
    white-space: nowrap;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 6px 10px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.copy-btn:hover,
.copy-btn:focus-visible {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
    outline: none;
}

.copy-btn.copied {
    color: #000000;
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.95);
    animation: copy-pop 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes copy-pop {
    0% { transform: scale(1); }
    40% { transform: scale(0.92); }
    100% { transform: scale(1); }
}

@media (max-width: 620px) {
    .checksum-row {
        flex-wrap: wrap;
        gap: 8px;
        align-items: flex-start;
    }
    .checksum-hash {
        order: 3;
        flex-basis: 100%;
        text-align: center;
        font-size: 10px;
        letter-spacing: 0.02em;
    }
    .copy-btn {
        order: 2;
        margin-left: auto;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 36px 22px;
        min-width: unset;
    }
    .download-grid {
        grid-template-columns: 1fr;
    }
}

.download-toast {
    position: fixed;
    top: 24px;
    left: 24px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 18px;
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #ffffff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.2px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    z-index: 10001;
    pointer-events: none;
    line-height: 1.4;
}

.download-toast.visible {
    display: flex;
    animation: toast-drop 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards,
               toast-float 4s ease-in-out 0.4s infinite;
}

@keyframes toast-drop {
    from {
        opacity: 0;
        transform: translateY(-14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.toast-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    font-size: 10px;
    color: #ffffff;
    flex-shrink: 0;
}
