:root {
    --primary-pink: #3b82f6;
    /* Electric Blue */
    --primary-pink-glow: rgba(59, 130, 246, 0.6);
    --secondary-magenta: #1e40af;
    --cyan-accent: #60a5fa;
    --bg-dark: #0f172a;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255, 45, 117, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(0, 242, 255, 0.1) 0%, transparent 40%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    padding-top: 80px;
    /* Space for fixed nav */
    padding-bottom: 50px;
}

/* Background Grid */
.background-grid {
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(circle at center, black, transparent 80%);
    pointer-events: none;
    z-index: -1;
}

.floating-orbit {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: float 20s infinite alternate ease-in-out;
    z-index: -1;
}

.blur-pink {
    width: 500px;
    height: 500px;
    background: var(--primary-pink);
    top: -200px;
    left: -100px;
}

.blur-magenta {
    width: 400px;
    height: 400px;
    background: var(--secondary-magenta);
    bottom: -100px;
    right: -100px;
    animation-delay: -7s;
}

.blur-cyan {
    width: 300px;
    height: 300px;
    background: var(--cyan-accent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.1;
}

@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }

    100% {
        transform: translate(50px, 80px) rotate(10deg) scale(1.1);
    }
}

#game-container {
    width: 90%;
    max-width: 600px;
    /* Slightly wider for reading */
    padding: 3rem 2rem;
    background: var(--glass);
    backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    /* Only hide internal overflow if needed, but we want content to flow */
    text-align: center;
    margin-bottom: 2rem;
}

.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(255, 45, 117, 0.15);
    border: 1px solid rgba(255, 45, 117, 0.3);
    color: var(--primary-pink);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 2px;
    border-radius: 2rem;
    margin-bottom: 1.5rem;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1;
    margin-bottom: 0.5rem;
}

h1 span {
    color: var(--primary-pink);
    text-shadow: 0 0 20px var(--primary-pink-glow);
}

.subtitle {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 3rem;
}

/* 3D Scene */
#scene-3d {
    perspective: 1000px;
    margin-bottom: 3rem;
}

#character-card {
    width: 100%;
    height: 320px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    border-radius: 2.5rem;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.reflection {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    border-radius: 2.5rem;
}

#character-preview {
    width: 250px;
    height: 250px;
    position: relative;
    transform: translateZ(50px);
    /* Lift the character */
}

#robot-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.5));
    animation: robot-float 4s infinite ease-in-out;
    transform-origin: bottom bottom;
}

#robot-img.buddy {
    height: 100%;
    margin-top: 5%;
}

.character-shadow {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 20px;
    background: rgba(0, 0, 0, 0.4);
    filter: blur(10px);
    border-radius: 50%;
    animation: shadow-pulse 4s infinite ease-in-out;
}

@keyframes robot-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

@keyframes shadow-pulse {

    0%,
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.4;
    }

    50% {
        transform: translateX(-50%) scale(0.8);
        opacity: 0.2;
    }
}

/* Stats */
.stats-container {
    margin-bottom: 3rem;
    display: grid;
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    text-align: left;
}

.label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #94a3b8;
    width: 60px;
}

.bar-bg {
    flex-grow: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-pink), var(--cyan-accent));
    border-radius: 10px;
    box-shadow: 0 0 10px var(--primary-pink-glow);
}

/* Loading Area */
#loading-area {
    margin-bottom: 2rem;
    transition: all 0.5s ease;
}

#loading-area.hidden {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

.loading-bar-container {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#loading-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-pink), var(--cyan-accent), var(--primary-pink));
    background-size: 200% 100%;
    animation: gradient-flow 2s linear infinite;
    box-shadow: 0 0 15px var(--primary-pink-glow);
    transition: width 0.1s ease;
}

@keyframes gradient-flow {
    0% {
        background-position: 100% 0%;
    }

    100% {
        background-position: -100% 0%;
    }
}

#loading-status {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--primary-pink);
    letter-spacing: 2px;
}

#percent {
    font-family: monospace;
    font-size: 0.9rem;
}

/* Button */
#start-btn {
    width: 100%;
    padding: 1.4rem;
    background: var(--primary-pink);
    border: none;
    border-radius: 1.5rem;
    color: white;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 10px 30px rgba(255, 45, 117, 0.4);
}

#start-btn.fade-out {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, transparent 60%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s ease;
    pointer-events: none;
}

#start-btn:hover {
    transform: translateY(-5px);
    background: #4a90ff;
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.5);
}

#start-btn:hover .btn-glow {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
}

#start-btn:active {
    transform: translateY(2px);
}

/* Footer */
footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 2rem;
    padding-top: 2rem;
}

/* Navigation */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1000;
}

.nav-logo {
    font-weight: 800;
    font-size: 1.2rem;
    color: white;
}

.nav-logo span {
    color: var(--primary-pink);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--cyan-accent);
}

/* Content Sections */
.content-section {
    padding: 3rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
}

.content-section h2 {
    font-size: 1.8rem;
    color: white;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.content-section h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--primary-pink);
    border-radius: 2px;
}

.content-wrapper p,
.content-section p {
    color: #cbd5e1;
    line-height: 1.7;
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.feature-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.feature-card h3 {
    font-size: 1.1rem;
    color: var(--cyan-accent);
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 0;
}

/* Steps */
.steps-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem;
    border-radius: 1rem;
}

.step-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.1);
    line-height: 1;
}

/* Footer Content */
.footer-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

.footer-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-family: monospace;
    font-size: 0.65rem;
    color: #475569;
}

/* Responsive Nav */
@media (max-width: 600px) {
    .nav-links {
        display: none;
        /* Simple hide for small screens for now, or use hamburger */
    }

    .main-nav {
        justify-content: center;
    }
}