/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Courier New', monospace; /* Retro font for PS1 style */
}

:root {
    /* PS1-era color palette */
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --background-color: #1a1a2e;
    --text-color: #f0f0f0;
    --accent-color: #ffbe0b;
    --link-color: #00f5d4;
    --border-color: #ff9f1c;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    /* Low-bit depth pattern for PS1 look */
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%232e2e44' fill-opacity='0.15' fill-rule='evenodd'/%3E%3C/svg%3E");
}

/* Text Glitch Effect - PS1 Style */
@keyframes glitch {
    0% {
        text-shadow: 1px 0 0 #ff0000, -1px 0 0 #00ff00;
    }
    20% {
        text-shadow: 1px 0 0 #ff0000, -1px 0 0 #00ff00;
    }
    40% {
        text-shadow: 1px 0 0 #ff0000, -1px 0 0 #00ff00;
    }
    60% {
        text-shadow: -1px 0 0 #ff0000, 1px 0 0 #00ff00;
    }
    80% {
        text-shadow: -1px 0 0 #ff0000, 1px 0 0 #00ff00;
    }
    100% {
        text-shadow: -1px 0 0 #ff0000, 1px 0 0 #00ff00;
    }
}

/* Header Styles */
header {
    text-align: center;
    padding: 2rem 1rem;
    background-color: rgba(26, 26, 46, 0.9);
    border-bottom: 4px solid var(--accent-color);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--primary-color) 0%, transparent 70%);
    opacity: 0.1;
    z-index: -1;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: glitch 5s infinite alternate;
    font-weight: bold;
    color: var(--accent-color);
    text-shadow: 3px 3px 0px var(--primary-color);
}

.tagline {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.logo-container {
    margin: 0 auto 1rem;
    max-width: 150px;
}

#logo {
    width: 100%;
    height: auto;
    image-rendering: pixelated; /* PS1 pixelated style */
}

/* Navigation Styles */
nav {
    background-color: rgba(26, 26, 46, 0.8);
    padding: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    flex-wrap: wrap;
}

nav ul li {
    margin: 0.5rem 1rem;
}

nav ul li a {
    color: var(--link-color);
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

nav ul li a:hover {
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
    text-shadow: 0 0 5px var(--accent-color);
}

/* Main Content Styles */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

section {
    margin-bottom: 3rem;
    padding: 2rem;
    background-color: rgba(26, 26, 46, 0.7);
    border: 2px solid var(--border-color);
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px dashed var(--border-color);
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
    color: var(--secondary-color);
}

p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.7;
}

/* Game Section Styles */
.game-section {
    text-align: center;
}

.game-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    background-color: #000;
    padding: 10px;
    border: 3px solid var(--primary-color);
    position: relative;
}

.game-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

#game-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.retro-btn {
    background-color: var(--primary-color);
    color: var(--text-color);
    border: none;
    padding: 0.8rem 1.5rem;
    margin-top: 1rem;
    font-size: 1.1rem;
    text-transform: uppercase;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
    box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.3);
}

.retro-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.retro-btn:active {
    transform: translateY(1px);
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.3);
}

/* How to Play Section */
.how-to-section .instructions {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    border-radius: 5px;
}

.how-to-section ul {
    list-style-type: none;
    padding-left: 1rem;
}

.how-to-section li {
    margin-bottom: 1rem;
    position: relative;
    padding-left: 1.5rem;
}

.how-to-section li::before {
    content: '▶';
    color: var(--accent-color);
    position: absolute;
    left: 0;
    top: 0;
}

/* Footer Styles */
footer {
    background-color: rgba(26, 26, 46, 0.9);
    padding: 2rem 1rem;
    text-align: center;
    border-top: 4px solid var(--accent-color);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    color: var(--link-color);
    text-decoration: none;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.2rem;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
    }

    nav ul li {
        margin: 0.3rem 0;
    }

    h2 {
        font-size: 1.7rem;
    }

    h3 {
        font-size: 1.3rem;
    }

    p {
        font-size: 1rem;
    }

    section {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }

    .tagline {
        font-size: 1rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .retro-btn {
        padding: 0.6rem 1.2rem;
        font-size: 1rem;
    }
}