/* ===========================
   CSS Variables & Reset
   =========================== */
:root {
    --green: #39ff14;
    --yellow: #ffe600;
    --blue: #00b4ff;
    --red: #ff3e3e;

    --bg-deep: #06060f;
    --bg-card: rgba(12, 12, 30, 0.7);
    --text-primary: #e8e8f0;
    --text-muted: #8888aa;

    --glow-green: 0 0 20px rgba(57, 255, 20, 0.4);
    --glow-yellow: 0 0 20px rgba(255, 230, 0, 0.4);
    --glow-blue: 0 0 20px rgba(0, 180, 255, 0.4);
    --glow-red: 0 0 20px rgba(255, 62, 62, 0.4);

    --font-title: 'Audiowide', cursive;
    --font-body: 'Space Grotesk', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ===========================
   Starfield Canvas
   =========================== */
#starfield {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ===========================
   Floating Pixels (decorative)
   =========================== */
.floating-pixels {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.pixel-block {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    opacity: 0;
    animation: floatUp 8s ease-in infinite;
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) scale(0.5);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-10vh) scale(1);
        opacity: 0;
    }
}

/* ===========================
   Main Layout
   =========================== */
main {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 3rem 1.5rem 2rem;
}

.hero {
    max-width: 680px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

/* ===========================
   Team Color Bar
   =========================== */
.team-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.team-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

.team-green {
    background: var(--green);
    box-shadow: var(--glow-green);
    animation-delay: 0s;
}

.team-yellow {
    background: var(--yellow);
    box-shadow: var(--glow-yellow);
    animation-delay: 0.5s;
}

.team-blue {
    background: var(--blue);
    box-shadow: var(--glow-blue);
    animation-delay: 1s;
}

.team-red {
    background: var(--red);
    box-shadow: var(--glow-red);
    animation-delay: 1.5s;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.4);
        opacity: 0.7;
    }
}

/* ===========================
   Game Title
   =========================== */
.game-title {
    font-family: var(--font-title);
    font-size: clamp(3rem, 10vw, 5.5rem);
    line-height: 1;
    letter-spacing: 0.04em;
    position: relative;
}

.title-pixel {
    background: linear-gradient(135deg, var(--blue), var(--green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-war {
    background: linear-gradient(135deg, var(--yellow), var(--red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-left: 0.15em;
}

.game-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, var(--green), var(--blue), var(--yellow), var(--red));
    border-radius: 2px;
    opacity: 0.6;
}

/* ===========================
   Tagline & Description
   =========================== */
.tagline {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    margin-top: 0.5rem;
}

.description {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 520px;
}

/* ===========================
   Ships Row
   =========================== */
.ships-row {
    display: flex;
    gap: 2rem;
    margin: 0.5rem 0;
}

.ship {
    font-size: 1.5rem;
    animation: hover-ship 2.5s ease-in-out infinite;
    filter: drop-shadow(0 0 8px currentColor);
}

.ship-green { color: var(--green); animation-delay: 0s; }
.ship-yellow { color: var(--yellow); animation-delay: 0.6s; }
.ship-blue { color: var(--blue); animation-delay: 1.2s; }
.ship-red { color: var(--red); animation-delay: 1.8s; }

@keyframes hover-ship {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ===========================
   Download Section
   =========================== */
.download-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #1a73e8, #00b4ff);
    border: none;
    border-radius: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 20px rgba(0, 180, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.btn-download::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-download:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow:
        0 8px 30px rgba(0, 180, 255, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-download:hover::before {
    opacity: 1;
}

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

.android-icon {
    flex-shrink: 0;
}

.btn-github {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.btn-github:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.github-icon {
    flex-shrink: 0;
}

/* ===========================
   How to Play
   =========================== */
.how-to-play {
    width: 100%;
    margin-top: 1.5rem;
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    backdrop-filter: blur(16px);
}

.how-to-play h2 {
    font-family: var(--font-body);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
}

.step-number {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(0, 180, 255, 0.15), rgba(57, 255, 20, 0.1));
    border: 1px solid rgba(0, 180, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--blue);
}

.step p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ===========================
   Footer
   =========================== */
footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

footer a {
    color: var(--blue);
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: var(--green);
}

/* ===========================
   Reveal Animation
   =========================== */
.hero > * {
    opacity: 0;
    transform: translateY(20px);
    animation: revealUp 0.7s ease-out forwards;
}

.hero > *:nth-child(1) { animation-delay: 0.1s; }
.hero > *:nth-child(2) { animation-delay: 0.2s; }
.hero > *:nth-child(3) { animation-delay: 0.35s; }
.hero > *:nth-child(4) { animation-delay: 0.5s; }
.hero > *:nth-child(5) { animation-delay: 0.65s; }
.hero > *:nth-child(6) { animation-delay: 0.8s; }
.hero > *:nth-child(7) { animation-delay: 0.95s; }

@keyframes revealUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 480px) {
    main {
        padding: 2rem 1rem 1.5rem;
    }

    .hero {
        gap: 1.25rem;
    }

    .tagline {
        font-size: 1.05rem;
    }

    .description {
        font-size: 0.88rem;
    }

    .btn-download {
        padding: 0.9rem 2rem;
        font-size: 1rem;
    }

    .how-to-play {
        padding: 1.5rem;
    }

    .ships-row {
        gap: 1.25rem;
    }
}
