:root {
    --bg-deep: #1a1c2e;
    --bg-surface: #252839;
    --bg-elevated: #2e3246;
    --text-primary: #f0f0f0;
    --text-secondary: #9499b3;
    --grass: #5dba4d;
    --amber: #e6a23c;
    --diamond: #4de4e0;
    --coral: #e07a5f;
    --water: #4a9eff;
}

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

html {
    font-size: 20px;
}

body {
    font-family: "Nunito", sans-serif;
    background-color: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 1rem;
    animation: fadeIn 0.5s ease;
}

/* ── Header ── */

header {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInUp 0.5s ease;
}

header h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.title-red {
    color: #e3350d;
}

.title-white {
    color: #ffffff;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0.15rem;
}

/* ── Status Bar ── */

.status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--bg-elevated);
    border-radius: 10px;
    padding: 0.75rem 1.15rem;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.5s ease 0.1s both;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.online {
    background: var(--grass);
    box-shadow: 0 0 6px var(--grass);
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.offline {
    background: var(--coral);
    box-shadow: 0 0 6px var(--coral);
}

.status-label {
    font-weight: 700;
    font-size: 0.95rem;
}

.status-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

/* ── Server Address ── */

.server-address {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding-top: 0.5rem;
    margin-top: 0.35rem;
    border-top: 1px solid var(--bg-elevated);
    font-size: 0.85rem;
}

.address-label {
    color: var(--text-secondary);
    font-weight: 600;
}

.address-value {
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 0.15rem 0.55rem;
    border-radius: 5px;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: "SFMono-Regular", "Cascadia Code", "Consolas", monospace;
    letter-spacing: 0.02em;
    user-select: all;
    cursor: text;
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--bg-elevated);
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.btn-copy:hover {
    color: var(--text-primary);
    background: var(--bg-deep);
    border-color: var(--bg-elevated);
}

.btn-copy.copied {
    color: var(--grass);
    box-shadow: 0 0 6px rgba(93, 186, 77, 0.3);
}

/* ── Cards ── */

.card {
    background: var(--bg-surface);
    border: 1px solid var(--bg-elevated);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h2 {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.card-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ── Modpack Card ── */

.modpack-card {
    animation: fadeInUp 0.5s ease 0.2s both;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.card-header h2 {
    margin-bottom: 0;
}

.version-badge {
    display: none;
    background: var(--bg-elevated);
    color: var(--diamond);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.15rem 0.6rem;
    border-radius: 6px;
}

.version-badge.visible {
    display: inline-block;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.65rem 1.4rem;
    background: var(--diamond);
    color: var(--bg-deep);
    font-family: "Nunito", sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: filter 0.2s, transform 0.15s;
}

.btn-download:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.btn-download:active {
    transform: translateY(0);
}

/* ── Discord Bar ── */

.discord-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    background: #5865f2;
    color: #ffffff;
    font-family: "Nunito", sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.5s ease 0.25s both;
    transition: filter 0.2s, transform 0.15s;
}

.discord-bar:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.discord-bar:active {
    transform: translateY(0);
}

/* ── Guide Section ── */

.guide-section {
    border-top: 1px solid var(--bg-elevated);
    padding: 3rem 1.25rem 4rem;
    animation: fadeInUp 0.5s ease 0.3s both;
}

.guide-container {
    max-width: 1100px;
    margin: 0 auto;
}

.guide-section h2 {
    font-size: 1.4rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.5rem;
}

.guide-section h2::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    background: var(--grass);
    border-radius: 2px;
    margin: 0.5rem auto 0;
}

.guide-section .warning-notice {
    max-width: 720px;
    margin: 1.5rem auto 1.75rem;
}

.guide-section .tutorial-tabs {
    max-width: 400px;
    margin: 0 auto 2rem;
}

/* ── Steps ── */

.step {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 0 0 2.5rem 0;
    position: relative;
}

.step.has-image {
    grid-template-columns: 1fr 1fr;
    align-items: start;
}

.step-text {
    position: relative;
}

.step-text-inner {
    display: flex;
    gap: 1rem;
}

/* Vertical connector line: runs from bottom of badge to top of next step's badge */
.step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 36px;
    left: 17px;
    width: 2px;
    bottom: 0;
    background: var(--bg-elevated);
}

.step-number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    color: var(--grass);
    font-weight: 800;
    font-size: 0.9rem;
    border-radius: 10px;
}

.step-content h3 {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 36px;
    margin-bottom: 0.5rem;
}

.step-content p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 0.4rem;
}

.step-content a {
    color: var(--water);
    text-decoration: none;
    font-weight: 600;
}

.step-content a:hover {
    text-decoration: underline;
}

.step-content ul {
    color: var(--text-secondary);
    font-size: 0.88rem;
    padding-left: 1.2rem;
    margin-bottom: 0.4rem;
}

.step-content code {
    background: var(--bg-elevated);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.82rem;
}

.step:not(.has-image) .step-content {
    max-width: 100%;
}

.step-image-wrapper {
    display: flex;
    align-items: flex-start;
}

.warning {
    background: rgba(230, 162, 60, 0.1);
    border-left: 3px solid var(--amber);
    padding: 0.5rem 0.75rem;
    border-radius: 0 6px 6px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.4rem 0;
}

.warning strong {
    color: var(--amber);
}

/* ── Warning Notice ── */

.warning-notice {
    margin-bottom: 1.25rem;
}

.warning-notice a {
    color: var(--water);
    font-weight: 600;
    text-decoration: none;
}

.warning-notice a:hover {
    text-decoration: underline;
}

/* ── Tutorial Tabs ── */

.tutorial-tabs {
    display: flex;
    border-bottom: 2px solid var(--bg-elevated);
    margin-bottom: 0.25rem;
}

.tab-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: var(--text-secondary);
    font-family: "Nunito", sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--grass);
    border-bottom-color: var(--grass);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ── Step Images ── */

.step-image {
    display: block;
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid var(--bg-elevated);
    cursor: pointer;
    transition: opacity 0.15s;
}

.step-image:hover {
    opacity: 0.85;
}

/* ── Lightbox ── */

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.lightbox.open {
    display: flex;
}

.lightbox img {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: 10px;
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.5);
}

.img-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--coral);
    color: var(--text-primary);
    font-size: 0.7rem;
    font-weight: 800;
    border-radius: 50%;
    margin-left: 0.25rem;
    vertical-align: middle;
}

/* ── Animations ── */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ── Responsive ── */

@media (max-width: 768px) {
    .step.has-image {
        grid-template-columns: 1fr;
    }

    .guide-section {
        padding: 2rem 1.25rem 3rem;
    }

    .guide-section .tutorial-tabs {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1.5rem 1rem 3rem;
    }

    header h1 {
        font-size: 1.6rem;
    }

    .status-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .status-details {
        padding-left: 1.55rem;
    }

    .server-address {
        padding-left: 1.55rem;
    }

    .tab-btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.5rem;
    }

    .step-image {
        border-radius: 6px;
    }

    .guide-section {
        padding: 1.5rem 1rem 2rem;
    }

    .guide-section h2 {
        font-size: 1.2rem;
    }

    .step {
        padding-bottom: 1.75rem;
    }

    .step:not(:last-child)::after {
        display: none;
    }
}
