/* World-Class CSS for Stack Fire Ball Game */

/* ===== ROOT VARIABLES & RESET ===== */
:root {
    --primary-blue: #1a365d;
    --secondary-orange: #ff6b35;
    --accent-yellow: #ffd93d;
    --accent-purple: #9b59b6;
    --text-white: #ffffff;
    --text-light: #e2e8f0;
    --text-gray: #64748b;
    --bg-dark: #0f172a;
    --bg-medium: #1e293b;
    --bg-light: #334155;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #ff6b35 0%, #ffd93d 100%);
    --gradient-game: linear-gradient(135deg, #1a365d 0%, #2d3748 50%, #4a5568 100%);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);
    --shadow-2xl: 0 25px 50px rgba(0,0,0,0.25);
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-white);
    background: var(--bg-dark);
    overflow-x: hidden;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--accent-yellow);
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gradient-secondary);
    border-radius: 2px;
}

h3 {
    font-size: 1.5rem;
    color: var(--secondary-orange);
    margin-bottom: 1rem;
}

p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* ===== LAYOUT ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 4rem 0;
    position: relative;
}

/* ===== NAVIGATION ===== */
.nav-header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    transition: var(--transition);
}

.navbar {
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-yellow);
}

.logo-icon {
    font-size: 2rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--accent-yellow);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-yellow);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-white);
    border-radius: 2px;
    transition: var(--transition);
}

/* ===== HERO SECTION ===== */
.hero-section {
    background: var(--gradient-game);
    padding: 8rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 107, 53, 0.1) 0%, transparent 50%);
    animation: float 6s ease-in-out infinite;
}

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

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-description {
    max-width: 800px;
    margin: 0 auto 3rem;
    font-size: 1.2rem;
    color: var(--text-light);
}


/* ===== GAME SECTION ===== */
.game-section {
    background: var(--bg-medium);
    padding: 4rem 0;
    position: relative;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.game-frame {
    width: 100%;
    max-width: 900px;
    aspect-ratio: 16/9;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-2xl);
    border: 3px solid var(--accent-yellow);
    position: relative;
    background: var(--bg-dark);
}

.game-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.game-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.control-btn {
    background: var(--gradient-primary);
    color: var(--text-white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ===== TAGS SECTION ===== */
.tags-section {
    background: var(--bg-dark);
    position: relative;
}

.tags-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.tags-group {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.tags-group:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent-yellow);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    background: var(--gradient-primary);
    color: var(--text-white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tag:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* ===== GUIDE SECTION ===== */
.guide-section {
    background: var(--bg-medium);
}

.guide-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.guide-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.guide-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--secondary-orange);
}

.guide-item ul {
    list-style: none;
    padding-left: 0;
}

.guide-item li {
    padding: 0.5rem 0;
    position: relative;
    padding-left: 1.5rem;
}

.guide-item li::before {
    content: '▶️';
    position: absolute;
    left: 0;
    top: 0.5rem;
    font-size: 0.8rem;
}

/* ===== FEATURES SECTION ===== */
.features-section {
    background: var(--bg-dark);
    position: relative;
}

.features-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 107, 53, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(102, 126, 234, 0.1) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    padding: 2.5rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-secondary);
    transform: scaleX(0);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-2xl);
    border-color: var(--accent-yellow);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

/* ===== ABOUT SECTION ===== */
.about-section {
    background: var(--bg-medium);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content p {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-links a,
.footer-link {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover,
.footer-link:hover {
    color: var(--accent-yellow);
}

/* ===== UTILITY CLASSES ===== */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--bg-dark);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-lg);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav-toggle.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .container {
        padding: 0 1rem;
    }

    section {
        padding: 3rem 0;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .hero-section {
        padding: 6rem 0 3rem;
    }

    .game-frame {
        aspect-ratio: 9/16;
    }

    .game-controls {
        gap: 0.5rem;
    }

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

    .features-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}

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

    h2 {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .feature-card,
    .guide-item,
    .tags-group {
        padding: 1.5rem;
    }

    .game-controls {
        flex-direction: column;
        align-items: center;
    }

    .control-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* ===== LOADING ANIMATION ===== */
.game-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        var(--bg-dark) 0%,
        var(--bg-light) 50%,
        var(--bg-dark) 100%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    z-index: 1;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.game-frame.loaded::before {
    display: none;
}

/* ===== SCROLL BEHAVIOR ===== */
html {
    scroll-behavior: smooth;
}

/* ===== SELECTION STYLING ===== */
::selection {
    background: var(--secondary-orange);
    color: var(--text-white);
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-orange);
}