/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #f59e0b;
    --accent-color: #10b981;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --background: #fafafa;
    --surface: #ffffff;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

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

/* Background Effects */
.background-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -2;
}

.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.1) 0%, transparent 50%);
    z-index: -1;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    z-index: 1000;
    padding: 1rem 0;
}

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

.nav-brand .logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.logo-icon {
    font-size: 1.75rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.025em;
}

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

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s ease;
}

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

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    padding-top: 100px;
}

/* Hero Section */
.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    min-height: 80vh;
    padding: 4rem 0;
}

.hero-content {
    max-width: 600px;
}

.hero-badge {
    display: inline-block;
    background: rgba(245, 158, 11, 0.1);
    color: var(--secondary-color);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.gradient-text {
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gradient-secondary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
    margin-right: 1rem;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.secondary-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-cta-button:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Hero Visual */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 400px;
}

.floating-card {
    position: absolute;
    background: var(--surface);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    animation: float 6s ease-in-out infinite;
}

.floating-card.delay-1 {
    animation-delay: -2s;
    top: 20%;
    right: 10%;
}

.floating-card.delay-2 {
    animation-delay: -4s;
    bottom: 20%;
    left: 10%;
}

.card-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.operation-preview {
    color: var(--primary-color);
}

.equals {
    color: var(--text-secondary);
}

.result-preview {
    color: var(--secondary-color);
}

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

/* Game Section */
.game-section {
    min-height: 100vh;
    padding: 2rem 0;
}

.game-container {
    max-width: 1000px;
    margin: 0 auto;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.game-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.back-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

/* Game Instructions */
.game-instructions {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.instruction-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    max-width: 600px;
    text-align: center;
}

.instruction-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.instruction-card ol {
    text-align: left;
    margin-bottom: 2rem;
    padding-left: 1rem;
}

.instruction-card li {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.difficulty-info {
    margin: 1.5rem 0;
    text-align: center;
}

.difficulty-badge {
    display: inline-block;
    background: rgba(245, 158, 11, 0.1);
    color: var(--secondary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.start-round-btn {
    background: var(--gradient-secondary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* Game Play Area */
.game-play-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.operation-display {
    width: 100%;
    max-width: 500px;
}

.operation-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    font-size: 2.5rem;
    font-weight: 700;
}

.operation-text {
    color: var(--primary-color);
    min-width: 120px;
    text-align: center;
}

.equals-sign {
    color: var(--text-secondary);
    font-size: 2rem;
}

.answer-section {
    position: relative;
}

#answerInput {
    width: 80px;
    height: 80px;
    border: 3px solid var(--border);
    border-radius: 16px;
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    background: var(--surface);
    outline: none;
    transition: all 0.3s ease;
}

#answerInput:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.game-controls {
    display: flex;
    gap: 1rem;
}

.submit-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gradient-secondary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.skip-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.skip-button:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.feedback {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 12px;
    padding: 1rem 2rem;
    transition: all 0.3s ease;
}

.feedback.correct {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.feedback.incorrect {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Results Section */
.results-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.results-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    text-align: center;
    max-width: 500px;
    animation: scaleIn 0.6s ease-out;
}

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

.results-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.results-card h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.result-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.primary-button,
.secondary-button {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.primary-button {
    background: var(--gradient-secondary);
    color: white;
}

.secondary-button {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.primary-button:hover,
.secondary-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.secondary-button:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
        padding-top: 80px;
    }
    
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .hero-section {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-visual {
        height: 300px;
    }
    
    .floating-card {
        position: relative;
        margin: 1rem;
    }
    
    .floating-card.delay-1,
    .floating-card.delay-2 {
        position: relative;
        top: auto;
        right: auto;
        bottom: auto;
        left: auto;
    }
    
    .game-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .game-stats {
        gap: 1rem;
    }
    
    .operation-card {
        padding: 2rem;
        font-size: 2rem;
        gap: 1rem;
    }
    
    #answerInput {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .game-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .results-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .results-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .instruction-card,
    .results-card {
        padding: 1.5rem;
    }
    
    .operation-card {
        padding: 1.5rem;
        font-size: 1.5rem;
    }
    
    #answerInput {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
}
