/* General Styles & Variables */
:root {
    --primary-color: #00e676; /* Bright Green */
    --secondary-color: #00b0ff; /* Bright Blue */
    --accent-color: #ff4081; /* Pink/Magenta */
    --text-light: #e0e0e0;
    --text-dark: #333;
    --bg-dark: #1a1a2e; /* Dark Blue/Purple for background */
    --bg-light: #f5f5f5;
    --card-bg: rgba(255, 255, 255, 0.08); /* Semi-transparent for futuristic feel */
    --border-color: rgba(255, 255, 255, 0.15);
    --hover-glow: 0 0 15px var(--primary-color), 0 0 30px var(--primary-color);
    --transition-speed: 0.3s ease;

    /* Fonts */
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Oxanium', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-light);
    background-color: var(--bg-dark);
    overflow-x: hidden; /* Prevent horizontal scroll from animations */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--secondary-color);
}

h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    margin-bottom: 20px;
}

h1 { font-size: 3.5em; line-height: 1.1; }
h2 { font-size: 2.5em; text-align: center; margin-bottom: 40px; color: var(--secondary-color); }
h3 { font-size: 1.8em; color: var(--text-light); }

p {
    margin-bottom: 15px;
}

.text-center {
    text-align: center;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 50px;
    text-transform: uppercase;
    font-weight: 600;
    font-family: var(--font-heading);
    transition: all var(--transition-speed);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: var(--bg-dark);
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--hover-glow);
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--bg-dark);
    transform: translateY(-3px);
    box-shadow: var(--hover-glow);
}

.btn-tertiary {
    background-color: var(--accent-color);
    color: var(--bg-dark);
    border: 2px solid var(--accent-color);
}

.btn-tertiary:hover {
    background-color: transparent;
    color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 0 15px rgba(255, 64, 129, 0.6);
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1em;
}

.btn-xl {
    padding: 18px 36px;
    font-size: 1.3em;
}

/* Header */
.main-header {
    background-color: rgba(26, 26, 46, 0.8); /* Slightly transparent */
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-family: var(--font-heading);
    font-size: 1.8em;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 1px;
}

.main-nav ul {
    list-style: none;
    display: flex;
}

.main-nav ul li {
    margin-left: 30px;
}

.main-nav ul li a {
    color: var(--text-light);
    font-weight: 400;
    font-size: 1.05em;
    position: relative;
    padding-bottom: 5px;
}

.main-nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    left: 0;
    bottom: 0;
    transition: width var(--transition-speed);
}

.main-nav ul li a:hover::after,
.main-nav ul li a.active::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 2em;
    cursor: pointer;
    z-index: 1001;
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-light);
    overflow: hidden; /* Crucial for containing the 3D background */
}

#hero-3d-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-color: var(--bg-dark); /* Fallback */
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding-top: 80px; /* Account for fixed header */
}

.hero-title {
    font-size: 4.5em;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 0 15px rgba(0, 230, 118, 0.4);
    animation: fadeInScale 1.2s ease-out;
}

.hero-subtitle {
    font-size: 1.5em;
    font-weight: 300;
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeIn 1.5s ease-out 0.5s forwards;
}

.hero-ctas {
    display: flex;
    justify-content: center;
    gap: 20px;
    opacity: 0;
    animation: fadeIn 1.5s ease-out 1s forwards;
}

/* Sections General */
.section {
    padding: 80px 0;
    position: relative;
    z-index: 5; /* Ensure content is above any subtle background effects */
}

.section:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.1); /* Subtle dark stripe */
}

.section-title {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 60px;
    font-size: 2.8em;
    text-shadow: 0 0 10px rgba(0, 176, 255, 0.3);
}

.section-subtitle {
    text-align: center;
    font-size: 1.2em;
    margin-bottom: 40px;
    color: var(--text-light);
}

/* Problem/Solution Section */
.problem-solution-section {
    padding-bottom: 0; /* Connects better to next section */
}

.solution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.solution-item {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.solution-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 15px var(--primary-color);
}

.solution-item h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.5em;
}

.solution-item p {
    font-size: 1.1em;
    color: var(--text-light);
}


/* Community Section */
.community-section {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.9), rgba(10, 10, 20, 0.9));
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.community-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.feature-card {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 15px var(--secondary-color);
}

.feature-card img {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px var(--primary-color));
}

.feature-card h3 {
    color: var(--secondary-color);
    margin-bottom: 10px;
}

/* Free Resources Section */
.free-resources-section {
    text-align: center;
}

.youtube-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    margin-top: 40px;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
}

.youtube-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.free-resources-section .btn {
    margin-top: 20px;
}

/* --- Trivia Game Section --- */
.trivia-game-section {
    background-color: var(--bg-dark); /* Ensure consistent dark background */
    padding-top: 100px;
    padding-bottom: 100px;
}

.trivia-container {
    background-color: var(--card-bg); /* Use semi-transparent card background */
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 40px;
    max-width: 800px;
    margin: 40px auto 0 auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    text-align: center;
}

.trivia-question {
    font-size: 1.8em;
    font-family: var(--font-heading);
    color: var(--secondary-color);
    margin-bottom: 30px;
    line-height: 1.4;
}

.trivia-options {
    display: grid;
    grid-template-columns: 1fr; /* Stack options initially */
    gap: 15px;
    margin-bottom: 30px;
}

.trivia-option {
    background-color: rgba(255, 255, 255, 0.05); /* Lighter card-like background */
    color: var(--text-light);
    border: 1px solid var(--border-color);
    padding: 15px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color var(--transition-speed), border-color var(--transition-speed), transform 0.1s ease-out;
    text-align: left; /* Align text within option */
}

.trivia-option:hover:not(.selected):not(.correct):not(.incorrect) {
    background-color: rgba(0, 230, 118, 0.1); /* Subtle primary color hover */
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.trivia-option.selected {
    border-color: var(--primary-color); /* Highlight selected */
    background-color: rgba(0, 230, 118, 0.2);
}

.trivia-option.correct {
    background-color: rgba(0, 230, 118, 0.3); /* Green for correct */
    border-color: var(--primary-color);
    pointer-events: none; /* Disable after selection */
}

.trivia-option.incorrect {
    background-color: rgba(255, 64, 129, 0.3); /* Red for incorrect */
    border-color: var(--accent-color);
    pointer-events: none; /* Disable after selection */
}

/* Ensure other options are muted when one is selected/graded */
.trivia-options.graded .trivia-option:not(.correct):not(.incorrect) {
    opacity: 0.5;
    pointer-events: none;
}

.trivia-feedback {
    font-size: 1.2em;
    color: var(--accent-color); /* Red for incorrect, green for correct - handled by JS */
    margin-top: -15px; /* Pull it up a bit */
    margin-bottom: 20px;
    min-height: 25px; /* Prevent layout shift */
    font-weight: 600;
}

#trivia-next-btn {
    margin-top: 20px;
    padding: 12px 25px;
    font-size: 1em;
    display: none; /* Hidden until needed */
}

.trivia-results {
    display: none; /* Hidden until quiz ends */
    margin-top: 40px;
}

.trivia-results h3 {
    font-size: 2em;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.trivia-results p {
    font-size: 1.5em;
    color: var(--text-light);
    margin-bottom: 30px;
}

#trivia-restart-btn {
    padding: 12px 25px;
    font-size: 1em;
}

/* --- Bitcoin Muncher Game Section --- */
.game-section {
    background: linear-gradient(135deg, rgba(10, 10, 20, 0.9), rgba(26, 26, 46, 0.9));
    padding-top: 80px;
    padding-bottom: 80px;
    border-top: 1px solid var(--border-color);
}

.game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    position: relative; /* For absolute positioning of messages */
}

#gameCanvas {
    background-color: #000; /* Black background for the maze */
    display: block;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 230, 118, 0.5), 0 0 15px rgba(0, 176, 255, 0.3);
    border: 2px solid var(--primary-color);
    /* NEW: Fixed larger size for base, still responsive */
    width: 1500px;  /* *** INCREASED from 750px (25 cells * 60px/cell = 1500px) *** */
    height: 1500px; /* *** INCREASED from 750px *** */
    max-width: 100%; /* Ensures it shrinks on smaller screens */
    height: auto; /* Maintains aspect ratio when max-width applies */
}

.game-info {
    display: flex;
    gap: 30px;
    font-family: var(--font-heading);
    font-size: 1.3em;
    color: var(--text-light);
    margin-top: 20px;
}

.game-info span {
    color: var(--primary-color);
    font-weight: 700;
}

.game-messages {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10; /* Above the canvas */
    text-align: center;
    width: 90%;
    max-width: 400px;
}

.message-box {
    background-color: rgba(26, 26, 46, 0.95);
    border: 2px solid var(--secondary-color);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 0 25px rgba(0, 176, 255, 0.4);
}

.message-box h3 {
    font-size: 2.2em;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.message-box p {
    font-size: 1.2em;
    color: var(--text-light);
    margin-bottom: 25px;
}

.message-box .btn {
    padding: 12px 25px;
    font-size: 1.1em;
}

.hidden {
    display: none;
}

/* Mobile Controls */
.mobile-controls {
    display: none; /* Hidden by default, shown on small screens */
    margin-top: 20px;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.control-btn {
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
    color: var(--bg-dark);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.8em;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s ease-out, box-shadow 0.2s ease-out;
}

.control-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.horizontal-controls {
    display: flex;
    gap: 10px;
}


/* About Section */
.about-section p {
    max-width: 800px;
    margin: 0 auto 20px auto;
    text-align: center;
    font-size: 1.1em;
}

.about-section .btn {
    margin-top: 30px;
}

/* Final CTA Section */
.cta-final-section {
    background: linear-gradient(45deg, var(--bg-dark), rgba(0, 0, 0, 0.3));
    text-align: center;
    padding: 100px 0;
    border-top: 1px solid var(--border-color);
}

.cta-final-section .section-title {
    color: var(--primary-color);
    text-shadow: 0 0 20px rgba(0, 230, 118, 0.6);
    margin-bottom: 30px;
}

.cta-final-section .section-subtitle {
    font-size: 1.4em;
    margin-bottom: 50px;
}


/* Footer */
.main-footer {
    background-color: #0c0c1b;
    color: var(--text-light);
    padding: 40px 0;
    font-size: 0.9em;
    border-top: 1px solid var(--border-color);
}

.main-footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
}

.footer-brand {
    flex: 1;
    min-width: 200px;
}

.footer-brand h3 {
    color: var(--primary-color);
    font-family: var(--font-heading);
    margin-bottom: 10px;
}

.footer-nav ul {
    list-style: none;
    padding: 0;
}

.footer-nav ul li {
    margin-bottom: 8px;
}

.footer-nav ul li a {
    color: var(--text-light);
    transition: color var(--transition-speed);
}

.footer-nav ul li a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.social-links img {
    width: 30px;
    height: 30px;
    filter: brightness(0) invert(1) opacity(0.8); /* Make icons white/light gray */
    transition: filter var(--transition-speed);
}

.social-links a:hover img {
    filter: brightness(1) invert(0) opacity(1) drop-shadow(0 0 10px var(--primary-color));
}


/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Responsive Design */
@media (max-width: 992px) {
    h1 { font-size: 3.8em; }
    h2 { font-size: 2.2em; }
    .hero-subtitle { font-size: 1.3em; }

    .main-nav {
        display: none; /* Hide desktop nav by default on smaller screens */
        flex-direction: column;
        width: 100%;
        background-color: rgba(26, 26, 46, 0.95);
        position: absolute;
        top: 100%;
        left: 0;
        padding: 20px 0;
        box-shadow: 0 5px 15px rgba(0,0,0,0.4);
        border-top: 1px solid var(--border-color);
    }

    .main-nav.active {
        display: flex;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
    }

    .main-nav ul li {
        margin: 15px 0;
    }

    .nav-toggle {
        display: block;
    }

    .hero-ctas {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 3em; }
    h2 { font-size: 2em; }
    .hero-subtitle { font-size: 1.1em; }
    .section { padding: 60px 0; }
    .section-title { margin-bottom: 40px; font-size: 2.2em; }

    /* Trivia responsive */
    .trivia-options {
        grid-template-columns: 1fr; /* Stack options on smaller screens */
    }

    /* Mobile Controls */
    .mobile-controls {
        display: flex; /* Show controls on mobile */
    }
    .game-info {
        font-size: 1.1em;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-nav ul {
        margin-top: 20px;
    }

    .social-links {
        margin-top: 20px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 2.5em; }
    .hero-subtitle { font-size: 1em; }
    .btn { padding: 12px 24px; font-size: 0.9em; }
    .btn-large { padding: 14px 28px; font-size: 1em; }
    .btn-xl { padding: 16px 32px; font-size: 1.1em; }
    .solution-item, .feature-card { padding: 20px; }
    .solution-item h3, .feature-card h3 { font-size: 1.3em; }

    /* Trivia responsive */
    .trivia-question {
        font-size: 1.5em;
    }
    .trivia-option {
        font-size: 1em;
        padding: 12px 15px;
    }
    .trivia-container {
        padding: 25px;
    }
    .trivia-results h3 {
        font-size: 1.8em;
    }
    .trivia-results p {
        font-size: 1.2em;
    }

    /* Mobile Controls */
    .control-btn {
        width: 50px;
        height: 50px;
        font-size: 1.5em;
    }
    .message-box {
        padding: 20px;
    }
    .message-box h3 {
        font-size: 1.8em;
    }
    .message-box p {
        font-size: 1em;
    }
}