/* Main game styles */
:root {
    --bg-color: #0a1f0a;
    --primary-color: #00ff66;
    --secondary-color: #22cc44;
    --accent-color: #66ff99;
    --dark-bg: #051505;
    --canvas-bg: #1a472a;
    --text-color: #ffffff;
    --btn-primary: #00cc44;
    --btn-hover: #00ff55;
}

body {
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: 'Roboto', sans-serif;
    background-image: linear-gradient(to bottom right, #051505, #0f2f1f);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.game-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

header h1 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(0, 255, 102, 0.5);
    font-size: 2.5rem;
    font-family: 'Press Start 2P', cursive;
    letter-spacing: 1px;
}

.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    flex-grow: 1;
    min-height: 75vh;
}

#game-canvas {
    width: 100%;
    height: 75vh;
    background-color: var(--canvas-bg);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--primary-color);
}

/* Full-width background for game canvas */
#game-canvas canvas {
    display: block;
    width: 100%;
    height: 100%;
    background-color: #1a472a; /* Dark green matching the canvas */
}

.game-ui {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stats {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-color);
    background-color: rgba(5, 21, 5, 0.7);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border-left: 3px solid var(--primary-color);
}

.controls, .difficulty {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.btn {
    background-color: var(--btn-primary);
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Roboto', sans-serif;
}

.btn:hover {
    background-color: var(--btn-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.difficulty-btn {
    background-color: #1a5f2a;
}

.difficulty-btn:hover {
    background-color: #22aa44;
}

.difficulty-btn.active {
    background-color: var(--primary-color);
    color: var(--dark-bg);
    position: relative;
}

.difficulty-btn.active:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 30%;
    height: 3px;
    background-color: #ffffff;
    border-radius: 3px;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 100;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--dark-bg);
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 255, 102, 0.3);
    border: 2px solid var(--primary-color);
    max-width: 90%;
    width: 400px;
    animation: modal-in 0.3s ease-out;
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.8rem;
    text-shadow: 0 0 5px rgba(0, 255, 102, 0.3);
    font-family: 'Press Start 2P', cursive;
    letter-spacing: 1px;
}

.modal-content p {
    margin-bottom: 25px;
    color: #ffffff;
    font-size: 1.2rem;
}

/* MEGA FOOTER STYLES */
.mega-footer {
    position: relative;
    background: var(--dark-bg);
    border-top: 4px solid var(--primary-color);
    padding: 3rem 1rem;
    overflow: hidden;
    margin-top: 4rem;
    z-index: 1;
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 102, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 102, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: -1;
    opacity: 0.2;
    transform-origin: center;
    transform: perspective(500px) rotateX(60deg);
}

.shooting-star {
    position: absolute;
    width: 2px;
    height: 80px;
    background: linear-gradient(to bottom, transparent, var(--primary-color), transparent);
    opacity: 0;
    z-index: -1;
    animation: shooting-star 5s infinite;
    transform: rotate(-45deg);
}

.star-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.star-2 {
    top: 15%;
    left: 50%;
    animation-delay: 2s;
}

.star-3 {
    top: 30%;
    left: 80%;
    animation-delay: 3.5s;
}

@keyframes shooting-star {
    0% {
        opacity: 0;
        transform: translateX(0) translateY(0) rotate(-45deg);
    }
    5% {
        opacity: 1;
    }
    20% {
        opacity: 0;
        transform: translateX(-100px) translateY(100px) rotate(-45deg);
    }
    100% {
        opacity: 0;
        transform: translateX(-100px) translateY(100px) rotate(-45deg);
    }
}

.pixel-art {
    position: absolute;
    opacity: 0.5;
    z-index: -1;
    animation: float 6s infinite ease-in-out;
    font-size: 2rem;
    filter: blur(0.5px);
}

.pixel-joystick {
    top: 20%;
    left: 15%;
    animation-delay: 0s;
}

.pixel-ghost {
    top: 40%;
    right: 20%;
    animation-delay: 1s;
}

.pixel-heart {
    top: 60%;
    left: 25%;
    animation-delay: 2s;
}

.pixel-star {
    top: 30%;
    right: 10%;
    animation-delay: 3s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.footer-content {
    position: relative;
    z-index: 2;
    margin-bottom: 2rem;
}

.footer-title {
    color: var(--primary-color);
    font-family: 'Press Start 2P', cursive;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
    text-shadow: 0 0 10px rgba(0, 255, 102, 0.5);
}

.footer-heading {
    color: var(--primary-color);
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    margin-bottom: 1rem;
    position: relative;
    padding-left: 1rem;
}

.footer-heading::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 49% { opacity: 0; }
    50%, 100% { opacity: 1; }
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    font-family: 'Roboto', sans-serif;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

.play-now-btn {
    background: linear-gradient(45deg, #00cc44 0%, #00ff66 100%);
    color: white;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    display: inline-block;
    margin-top: 1rem;
    text-decoration: none;
    box-shadow: 0 0 20px rgba(0, 255, 102, 0.4);
    transition: all 0.3s;
}

.play-now-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 30px rgba(0, 255, 102, 0.6);
}

.new-badge {
    background: linear-gradient(45deg, #ff5e00, #ffb700);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.7rem;
    color: white;
    font-weight: bold;
    animation: pulse-new 1.5s infinite;
    margin-left: 5px;
}

@keyframes pulse-new {
    0%, 100% { opacity: 0.9; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

.footer-bottom {
    text-align: center;
    margin-top: 3rem;
    position: relative;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 204, 255, 0.3);
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.social-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s;
}

.social-icon:hover {
    transform: translateY(-5px);
    color: var(--accent-color);
}

.copyright {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
}

.legal-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.legal-links a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.3s;
    position: relative;
}

.legal-links a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: var(--primary-color);
    transition: all 0.3s;
}

.legal-links a:hover {
    color: var(--primary-color);
}

.hidden {
    display: none;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .game-area {
        flex-direction: row;
        align-items: flex-start;
    }
    
    #game-canvas {
        width: 70%;
        height: 80vh; /* Increased height for better visibility */
        min-height: 600px; /* Ensure minimum height */
    }
    
    .game-ui {
        width: 25%;
        margin-left: 5%;
    }
    
    .controls, .difficulty {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 767px) {
    #game-canvas {
        height: 60vh; /* Increased for mobile too */
        min-height: 450px; /* Minimum height for mobile */
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .footer-title {
        font-size: 1.2rem;
    }
    
    .footer-heading {
        font-size: 0.7rem;
    }
    
    .footer-links {
        font-size: 0.9rem;
    }
    
    .legal-links {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Content Section Styling */
.content-section {
    background-color: rgba(5, 21, 5, 0.7);
    border-radius: 10px;
    padding: 2rem;
    margin: 3rem auto;
    max-width: 900px;
    color: #ffffff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 102, 0.3);
    position: relative;
    overflow: hidden;
    line-height: 1.6;
    z-index: 2;
}

.content-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color), var(--primary-color));
    background-size: 300% 100%;
    animation: gradient-shift 8s linear infinite;
    z-index: 1;
}

.section-title {
    color: var(--primary-color);
    font-family: 'Press Start 2P', cursive;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
    text-shadow: 0 0 10px rgba(0, 255, 102, 0.5);
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(0, 255, 102, 0.7);
}

.content-container {
    padding: 1rem;
}

.author-intro {
    font-style: italic;
    color: #bbffcc;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 3px solid var(--primary-color);
}

.subsection-title {
    color: var(--accent-color);
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 255, 102, 0.3);
}

.rule-list, .strategy-list {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.rule-list li, .strategy-list li {
    margin-bottom: 0.75rem;
}

.strategy-list {
    counter-reset: strategy-counter;
    list-style-type: none;
    padding-left: 0;
}

.strategy-list li {
    counter-increment: strategy-counter;
    position: relative;
    padding-left: 2.5rem;
    margin-bottom: 1.5rem;
}

.strategy-list li::before {
    content: counter(strategy-counter);
    background: var(--primary-color);
    color: var(--dark-bg);
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
    box-shadow: 0 0 8px rgba(0, 255, 102, 0.7);
}

.strategy-list li strong {
    color: #ffffff;
    display: block;
    margin-bottom: 0.3rem;
    font-size: 1.1rem;
}

.challenges {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.challenge-item {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1.2rem;
    border: 1px solid rgba(0, 255, 102, 0.15);
    transition: all 0.3s ease;
}

.challenge-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
    border-color: rgba(0, 255, 102, 0.3);
}

.challenge-item h4 {
    color: var(--accent-color);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    font-weight: bold;
}

.call-to-action {
    background-color: rgba(0, 255, 102, 0.1);
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin-top: 2rem;
    font-weight: bold;
    text-align: center;
    border-radius: 4px;
}

/* Responsive adjustments for content section */
@media (max-width: 768px) {
    .content-section {
        padding: 1.5rem;
        margin: 2rem auto;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .subsection-title {
        font-size: 1rem;
    }
    
    .challenges {
        grid-template-columns: 1fr;
    }
}