/* Reset default margins and ensure box-sizing */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #0d0d0d; /* Darker background like X.com */
    color: #e0e0e0; /* Light gray text for readability */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; /* Modern sans-serif */
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    line-height: 1.6;
}

header, main, footer {
    max-width: 900px; /* Slightly wider for modern look */
    width: 100%;
    padding: 30px;
    text-align: center;
}

header {
    background: linear-gradient(135deg, #6b00b3, #00b7eb); /* Gradient for header */
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

h1 {
    font-size: 2.5rem; /* 40px */
    font-weight: 700;
    margin: 10px 0;
    color: #ffffff;
}

h2 {
    font-size: 1.75rem; /* 28px */
    font-weight: 600;
    margin: 20px 0 15px;
    color: #d4b8ff; /* Light purple accent, overridden in light panels */
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 15px 0;
    color: #d4b8ff;
}

p {
    font-size: 1.1rem; /* 17.6px */
    margin: 10px 0;
}

a {
    color: #b388ff; /* Purple link color */
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #ffffff;
}

/* Unified button style */
.button {
    display: inline-block;
    background-color: #6b00b3; /* Purple */
    color: #ffffff;
    padding: 10px 20px;
    margin: 10px 5px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.3s;
}

.button:hover {
    background-color: #ff6f00; /* Orange on hover */
    text-decoration: none;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0;
}

nav {
    margin: 20px 0;
}

.tagline {
    color: #fff;
    font-size: 1.3em;
    margin: 10px 0 20px;
}

.description {
    text-align: center;
    font-size: 1.2rem;
    margin: 20px 0;
    color: #e0e0e0;
}

.game-image {
    max-width: 320px;
    height: auto;
    border: 3px solid #6b00b3; /* Updated to match button purple */
    border-radius: 12px;
    margin: 15px 0;
    transition: transform 0.3s;
}

.game-image:hover {
    transform: scale(1.05);
}

.magic-image {
    width: 60px; /* Matches index.html and games.html */
    height: auto;
    margin: 15px auto;
    border: 3px solid #6b00b3; /* Updated to match button purple */
    border-radius: 12px;
    display: block; /* Center image */
}

.x-logo {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-left: 5px;
    transition: transform 0.3s;
}

.x-logo:hover {
    transform: scale(1.1);
}

.hero, .featured, .contact-section {
    background-color: #f0f0f0; /* Consistent light gray background */
    padding: 20px;
    margin: 20px 0;
    border-radius: 10px;
    text-align: center;
    color: #333; /* Dark text for contrast */
}

.hero h2, .featured h2, .contact-section h2, .hero h3, .featured h3, .contact-section h3 {
    color: #333; /* Dark headings for readability */
}

.hero p {
    color: #333;
    text-align: center; /* Center text in hero */
}

.hero ul {
    text-align: left;
    margin: 15px auto;
    padding-left: 25px;
    max-width: 600px;
}

.hero ul.validator-links {
    text-align: center;
    list-style: none;
    padding: 0;
    margin: 15px auto;
}

.hero ul.validator-links li {
    margin: 10px 0;
}

.game-list {
    display: flex;
    justify-content: center; /* Center the game cards */
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px auto; /* Center the container */
    max-width: 100%; /* Ensure it fits within hero */
}

.feature-card {
    background-color: #f0f0f0; /* Match parent background */
    width: 200px; /* Fixed width for consistent sizing */
    min-width: 200px;
    padding: 15px;
    margin: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
    color: #333; /* Dark text for contrast */
    display: flex;
    flex-direction: column;
    align-items: center; /* Center content within card */
}

.feature-card h3 {
    font-size: 1.25rem;
    margin: 10px 0;
    color: #333;
}

.feature-card p {
    font-size: 1rem;
    margin: 10px 0;
}

.feature-card .game-image {
    max-width: 100%; /* Fit image within card */
    width: auto;
    height: auto;
    margin: 10px auto; /* Center image */
    display: block;
}

.feature-card .button {
    margin: 10px auto; /* Center button */
}

.featured {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}

.feature-card {
    background-color: #f0f0f0; /* Match parent background */
    width: 200px; /* Fixed width for consistent sizing */
    min-width: 200px;
    padding: 15px;
    margin: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
    color: #333; /* Dark text for contrast */
}

.two-column {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    margin: 20px 0;
}

.left-column, .right-column {
    flex: 1;
    min-width: 300px;
    text-align: left;
    padding: 20px;
    background-color: #1a1a1a; /* Slightly lighter dark background */
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); /* Subtle shadow like X.com */
}

.left-column p, .right-column p {
    text-align: center; /* Center text for buttons */
}

ul {
    font-size: 1.1rem;
    margin: 15px 0;
    padding-left: 25px;
}

footer {
    margin-top: auto;
    background-color: #333;
    color: #fff;
    font-size: 0.9rem;
    padding: 20px;
}

footer a {
    color: #00b7eb;
    text-decoration: none;
    margin: 0 10px;
}

footer a:hover {
    text-decoration: underline;
}

/* Video container for validator page */
.video-container {
    position: relative;
    max-width: 560px; /* Maximum width */
    width: 100%; /* Full width up to max */
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    margin: 20px auto; /* Center with auto margins */
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* Validator node links */
.link {
    color: #00ff00; /* Green for other pages */
    text-decoration: none;
    font-weight: 500;
}

.link:hover {
    text-decoration: underline;
    color: #ffffff;
}

.purple-link {
    color: #b388ff; /* Purple for what-is-magic.html and games.html links */
    text-decoration: none;
    font-weight: 500;
}

.purple-link:hover {
    text-decoration: underline;
    color: #ffffff;
}

/* Ordered list for instructions */
ol {
    text-align: left;
    margin: 20px auto;
    max-width: 600px;
    padding-left: 25px;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    p {
        font-size: 1rem;
    }

    .game-image {
        max-width: 250px;
    }

    .magic-image {
        width: 50px; /* Slightly smaller for mobile */
    }

    .button {
        font-size: 0.9rem;
        padding: 8px 16px;
    }

    .two-column {
        flex-direction: column;
        gap: 20px;
    }

    .left-column, .right-column {
        text-align: center;
        padding: 15px;
    }

    .x-logo {
        width: 20px;
        height: 20px;
    }

    .video-container {
        max-width: 100%; /* Ensure video fits screen */
    }

    .feature-card {
        width: 180px; /* Slightly smaller for mobile */
        min-width: 180px;
    }

    .hero {
        margin: 10px 0;
        padding: 15px;
    }

    .description {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    header, main, footer {
        padding: 20px;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .game-image {
        max-width: 200px;
    }

    .magic-image {
        width: 40px;
    }

    .feature-card {
        width: 160px; /* Further reduced for small screens */
        min-width: 160px;
    }

    .description {
        font-size: 1rem;
    }
}