body {
    background: var(--bg-how-to) no-repeat center center fixed;
    background-size: cover;
    font-family: 'Arial', sans-serif;
    color: #fff;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0; /* Ensure no default margins */
    overflow-x: hidden; /* Prevent horizontal overflow */
}

/* Header styling */
header {
    border-bottom: 2px solid #3498db; /* Consistent with step borders */
    padding: 1rem;
    text-align: center;
    z-index: 10; /* Ensure header stays above content */
    box-shadow: 0 2px 10px rgba(0, 0, 50, 0.5);
}

/* Main content */
main {
    flex: 1; /* Grow to push footer down */
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    position: relative;
    z-index: 2; /* Above potential body::before overlay */
}

/* Container for how-to-play content */
.container.how-to-play {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(0, 0, 30, 0.9) 0%, rgba(10, 10, 40, 0.95) 100%);
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 50, 0.5);
    overflow: hidden;
}



/* Page title */
.how-to-play h1 {
    font-family: 'UnifrakturCook', cursive;
    font-size: 2.8rem;
    color: #ffd700;
    text-align: center;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
    margin-bottom: 2rem;
    animation: fadeIn 1s ease-in-out;
}

/* Steps container */
.steps {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Individual step */
.step {
    background: rgba(20, 20, 50, 0.85);
    border: 2px solid #3498db;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    animation: slideIn 0.5s ease-in-out;
    transition: transform 0.3s ease;
    overflow: hidden;
}

.step:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(52, 152, 219, 0.5);
}

/* Step content (flexbox for text and image) */
.step-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* Step text */
.step-text {
    flex: 1;
    min-width: 250px;
    color: #ecf0f1;
}

.step-text h2 {
    font-family: 'UnifrakturCook', cursive;
    font-size: 2rem;
    color: #e67e22;
    margin-bottom: 1rem;
    text-shadow: 0 0 5px rgba(230, 126, 34, 0.5);
}

.step-text p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    color: #d1d1d1;
}

.step-text p small {
    font-size: 0.9rem;
    color: #b0b0b0;
}

/* Code block styling */
.step-text pre {
    background: #1a1a1a;
    color: #00ff00;
    padding: 1rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    margin: 1rem 0;
    border: 1px solid #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
    white-space: pre-wrap;
    overflow-x: auto;
}

/* Images */
.step-content img,
.step-content img#down_img_realm {
    max-width: 300px; /* Reduced max-width for better scaling */
    width: 100%;
    height: auto;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.step-content img:hover,
.step-content img#down_img_realm:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.5);
}

/* Button styling */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    border-radius: 6px;
    border: 2px solid #ecf0f1;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%); /* Green gradient for Create Account */
    transition: all 0.3s ease;
    cursor: var(--hover-wow-gif) 16 16, auto;
    box-sizing: border-box;
}

.btn:hover {
    background: linear-gradient(135deg, #27ae60 0%, #219653 100%); /* Darker green on hover */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.5);
}

/* Primary button */
.btn-primary {
    background: linear-gradient(135deg, #1b9bf0 0%, #2980b9 100%);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f618d 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.5);
}

/* Secondary button */
.btn-secondary {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #d35400 0%, #c0392b 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(211, 84, 0, 0.5);
}

/* Download options */
.download-options {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    header {
        padding: 0.8rem;
    }

    .container.how-to-play {
        padding: 1rem;
        margin: 1rem;
    }

    .how-to-play h1 {
        font-size: 2rem;
    }

    .step {
        padding: 1rem;
    }

    .step-content {
        flex-direction: column;
        gap: 1rem;
        padding: 0.5rem;
    }

    .step-text {
        min-width: 100%;
    }

    .step-text h2 {
        font-size: 1.6rem;
    }

    .step-text p {
        font-size: 1rem;
    }

    .step-text pre {
        font-size: 0.9rem;
        padding: 0.8rem;
    }

    .step-content img,
    .step-content img#down_img_realm {
        max-width: 100%; /* Override max-width for smaller screens */
    }

    .download-options {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn {
        font-size: 1rem;
        padding: 0.6rem 1rem;
        width: 100%;
        text-align: center;
    }

    footer {
        padding: 0.8rem;
    }
}

@media (max-width: 576px) {
    .how-to-play h1 {
        font-size: 1.8rem;
    }

    .step-text h2 {
        font-size: 1.4rem;
    }

    .step-text p {
        font-size: 0.9rem;
    }

    .step-text p small {
        font-size: 0.8rem;
    }

    .step-text pre {
        font-size: 0.8rem;
    }

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