/* ===== Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: #0b0b0b;
    background-image: radial-gradient(circle at center, #1a1a1a 0%, #050505 100%);
    background-attachment: fixed;
    color: #cccccc;
    font-family: Verdana, Tahoma, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Scanline overlay */
.scanlines {
    position: fixed;
    inset: 0;
    background:
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
    z-index: 999;
}

/* ===== Layout ===== */
#wrapper {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
    position: relative;
    z-index: 10;
}

/* ===== Header / Hero ===== */
header {
    text-align: center;
    padding: 48px 0 28px;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

#main-logo {
    width: 100%;
    max-width: 800px;
    height: auto;
    display: block;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.1));
    transition: filter 0.3s ease;
}

#main-logo:hover {
    filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.3));
}

.brand-title {
    margin: 0;
    font-size: clamp(1.35rem, 4vw, 2rem);
    font-weight: bold;
    letter-spacing: 0.18em;
    text-transform: none;
    color: #ffffff;
    text-shadow:
        0 0 12px rgba(255, 255, 255, 0.15),
        2px 2px 0 #222;
    line-height: 1.2;
}

.brand-tag {
    color: #ff0000;
    letter-spacing: 0.12em;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.45);
}

/* ===== Content shell ===== */
.content-box {
    background: #111111;
    border: 1px solid #333333;
    padding: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

.inner-border {
    border: 1px solid #222222;
    background: #0d0d0d;
}

.header-bar {
    background: #222222;
    color: #ffffff;
    padding: 8px 16px;
    font-size: 10px;
    letter-spacing: 2px;
    font-weight: bold;
    border-bottom: 1px solid #333333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    background: #00ff00;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 5px #00ff00;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

/* ===== Intro ===== */
.main-content {
    padding: 36px 24px 28px;
    text-align: center;
}

.est-line {
    font-size: clamp(12px, 2.2vw, 16px);
    color: #ffffff;
    letter-spacing: 0.28em;
    margin: 0 0 16px;
    text-shadow: 2px 2px 0 #333333;
    font-weight: bold;
    line-height: 1.5;
}

.glitch-text {
    color: #ff0000;
    font-weight: bold;
    font-size: clamp(12px, 2vw, 14px);
    letter-spacing: 1px;
    margin: 0 0 16px;
    line-height: 1.5;
}

.intro-text {
    line-height: 1.8;
    color: #999999;
    font-size: 12px;
    margin: 0;
    max-width: 36rem;
    margin-inline: auto;
}

/* ===== Downloads ===== */
.download-section {
    padding: 0 24px 32px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.download-button {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #111;
    border: 1px solid #ff0000;
    color: #ff0000;
    padding: 12px 28px;
    font-size: 12px;
    font-weight: bold;
    text-decoration: none;
    letter-spacing: 2px;
    transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
    min-width: min(100%, 220px);
    text-align: center;
}

.download-button:hover,
.download-button:focus-visible {
    background: #ff0000;
    color: #fff;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.4);
    outline: none;
}

.download-button span {
    font-size: 9px;
    display: block;
    color: #888;
    margin-top: 4px;
    letter-spacing: 1px;
}

.download-button:hover span,
.download-button:focus-visible span {
    color: #eee;
}

/* ===== Shared section divider ===== */
.node-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #555;
    font-size: 9px;
    letter-spacing: 3px;
    margin-bottom: 20px;
}

.node-divider::before,
.node-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #222;
    min-width: 12px;
}

.node-divider span {
    padding: 0 14px;
    white-space: nowrap;
}

/* ===== Server monitor ===== */
.server-monitor-section {
    padding: 0 24px 36px;
}

.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 16px;
    justify-items: stretch;
}

.server-card {
    background: #151515;
    border: 1px solid #333;
    padding: 16px;
    text-align: left;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.server-card.online {
    border-left: 4px solid #00ff00;
}

.server-card.offline {
    border-left: 4px solid #ff0000;
    opacity: 0.75;
}

.server-card-error {
    width: 100%;
    text-align: center;
    border-left: none;
    grid-column: 1 / -1;
}

.server-alias {
    font-size: 10px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    padding-right: 64px;
}

.server-name {
    font-size: 13px;
    color: #fff;
    font-weight: bold;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.server-info {
    font-size: 11px;
    color: #888;
    margin: 4px 0;
    word-break: break-word;
}

.server-info span {
    color: #ccc;
}

.status-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 9px;
    font-weight: bold;
}

.status-online { color: #00ff00; }
.status-offline { color: #ff0000; }

/* ===== How to play ===== */
.how-to-play-section {
    padding: 0 24px 36px;
    text-align: left;
}

.guide-container {
    background: #0a0a0a;
    border: 1px solid #222;
    padding: 20px;
}

.guide-step {
    margin-bottom: 20px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.guide-step:last-child {
    margin-bottom: 0;
}

.step-number {
    color: #ff0000;
    font-weight: bold;
    font-size: 16px;
    min-width: 28px;
    flex-shrink: 0;
    line-height: 1.3;
}

.step-text {
    font-size: 11px;
    line-height: 1.65;
    color: #ccc;
    min-width: 0;
}

.step-text strong {
    color: #fff;
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    letter-spacing: 0.04em;
}

.step-text a {
    color: #ff0000;
    text-decoration: none;
    font-weight: bold;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease, text-shadow 0.2s ease;
    word-break: break-word;
}

.step-text a:hover,
.step-text a:focus-visible {
    color: #fff;
    border-bottom-color: #ff0000;
    text-shadow: 0 0 8px rgba(255, 0, 0, 0.8);
    outline: none;
}

.note-box {
    border-left: 2px solid #555;
    padding-left: 10px;
    margin-top: 8px;
    color: #888;
    font-style: italic;
    font-size: 10px;
    line-height: 1.5;
}

/* ===== Footer ===== */
footer {
    margin-top: 36px;
    text-align: center;
    padding-bottom: 48px;
}

.affiliate-section {
    margin-bottom: 18px;
}

.affiliate-banner {
    display: inline-block;
    max-width: 100%;
    padding: 5px;
    background: #111111;
    border: 1px solid #333333;
    transition: border-color 0.2s ease;
}

.affiliate-banner:hover,
.affiliate-banner:focus-visible {
    border-color: #ff0000;
    outline: none;
}

.affiliate-banner img {
    display: block;
    width: 100%;
    max-width: 468px;
    height: auto;
}

.copyright {
    font-size: 10px;
    color: #444444;
    letter-spacing: 2px;
    line-height: 1.6;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #050505;
}

::-webkit-scrollbar-thumb {
    background: #222222;
    border: 1px solid #333333;
}

::-webkit-scrollbar-thumb:hover {
    background: #333333;
}

/* ===== Mobile / tablet ===== */
@media (max-width: 720px) {
    header {
        padding: 32px 0 20px;
    }

    .logo-container {
        gap: 10px;
    }

    .brand-title {
        letter-spacing: 0.12em;
    }

    .main-content {
        padding: 28px 16px 22px;
    }

    .est-line {
        letter-spacing: 0.14em;
    }

    .download-section,
    .server-monitor-section,
    .how-to-play-section {
        padding-left: 16px;
        padding-right: 16px;
    }

    .download-section {
        flex-direction: column;
        align-items: stretch;
        padding-bottom: 28px;
    }

    .download-button {
        width: 100%;
        min-width: 0;
        padding: 14px 20px;
    }

    .node-divider {
        letter-spacing: 2px;
        margin-bottom: 16px;
    }

    .node-divider span {
        padding: 0 10px;
    }

    .guide-container {
        padding: 16px;
    }

    .guide-step {
        gap: 10px;
        margin-bottom: 18px;
    }

    .step-number {
        font-size: 14px;
        min-width: 24px;
    }

    footer {
        margin-top: 28px;
        padding-bottom: 36px;
    }

    .copyright {
        letter-spacing: 1.5px;
        padding: 0 8px;
    }
}

@media (max-width: 400px) {
    #wrapper {
        padding: 0 12px;
    }

    .header-bar {
        font-size: 9px;
        letter-spacing: 1px;
        padding: 8px 12px;
    }

    .brand-title {
        letter-spacing: 0.08em;
    }

    .est-line {
        letter-spacing: 0.08em;
    }
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .status-dot {
        animation: none;
    }

    #main-logo,
    .download-button,
    .step-text a,
    .affiliate-banner {
        transition: none;
    }
}
