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

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
    color: #2c3e50;
    background: #f8f9fa;
    overflow-x: hidden;
}

/* Container */
.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
.article-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
    color: #2c3e50;
    text-align: center;
    animation: fadeInUp 0.8s ease;
}

.article-meta {
    text-align: center;
    margin-bottom: 3rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.reading-time, .article-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 600;
    margin: 3rem 0 1.5rem 0;
    color: #34495e;
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
}

.article-paragraph {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: #34495e;
    text-align: justify;
    animation: fadeIn 0.6s ease;
}

.article-paragraph.emphasis {
    font-style: italic;
    font-size: 1.4rem;
    color: #2c3e50;
    text-align: center;
    margin: 2rem 0;
    padding: 1rem;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
}

.article-paragraph.large-quote {
    font-size: 1.8rem;
    font-weight: 600;
    text-align: center;
    color: #667eea;
    margin: 2rem 0;
    line-height: 1.4;
}

/* Article Sections */
.hero-article {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 4rem 0;
    color: white;
}

.hero-article .article-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.article-section {
    margin-bottom: 4rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.article-section:nth-child(even) {
    animation-delay: 0.2s;
}

.article-section:nth-child(odd) {
    animation-delay: 0.1s;
}

/* Quote Boxes */
.quote-box {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-left: 5px solid #667eea;
    padding: 2rem;
    margin: 2rem 0;
    border-radius: 10px;
    position: relative;
}

.quote-box::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 4rem;
    color: #667eea;
    opacity: 0.3;
}

.quote-box.large {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    transform: scale(1.05);
}

.quote-box p {
    font-size: 1.3rem;
    font-style: italic;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.quote-attribution {
    font-weight: 600;
    text-align: right;
    color: #34495e;
}

.quote-box.large .quote-attribution {
    color: rgba(255, 255, 255, 0.9);
}

/* Challenge Showcase */
.challenge-showcase {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
}

.challenge-showcase::before {
    content: '🎮';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    opacity: 0.3;
}

.challenge-showcase h3 {
    color: #495057;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.challenge-showcase p {
    margin-bottom: 1rem;
    color: #6c757d;
}

/* Special Boxes */
.achievement-box {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ffc107;
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    position: relative;
}

.achievement-box::before {
    content: '🏆';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 1.5rem;
}

.achievement-box h3 {
    color: #856404;
    margin-bottom: 1rem;
    text-align: center;
}

.certificate-box {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
}

.certificate-box::before {
    content: '🪪';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 1.5rem;
}

.certificate-display {
    background: white;
    border: 2px dashed #28a745;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1rem 0;
    text-align: center;
    font-weight: 600;
    color: #155724;
}

.conclusion-box {
    background: linear-gradient(135deg, #e8f4f8 0%, #d1ecf1 100%);
    border: 2px solid #17a2b8;
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
}

.final-question {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 2px solid #dc3545;
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
}

.final-cta {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
}

/* Play Game Section */
.play-game-section {
    background: #2c3e50;
    padding: 4rem 0;
    text-align: center;
    margin: 4rem 0;
    position: relative;
    overflow: hidden;
}

.play-game-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" font-size="50">🎮</text></svg>') repeat;
    opacity: 0.05;
}

.game-cta {
    position: relative;
    z-index: 1;
}

.game-cta h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.game-cta p {
    color: #ecf0f1;
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.btn-large {
    padding: 1rem 3rem;
    font-size: 1.3rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.btn-large:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

/* Game Section */
.game-section {
    background: white;
    padding: 4rem 0;
}

.continue-article {
    background: #f8f9fa;
    padding: 4rem 0;
}

/* Share Section */
.share-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 3rem;
    border-radius: 15px;
    margin: 3rem 0;
}

.share-section h3 {
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.share-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* Game Area Styles */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #667eea;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.8;
    color: #6c757d;
}

.game-area {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.stats-bar {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 5px;
    font-weight: 500;
}

.stat-value {
    display: block;
    font-size: 1.3rem;
    font-weight: bold;
    color: #667eea;
}

.challenge-container {
    min-height: 300px;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
}

.start-screen {
    text-align: center;
    width: 100%;
}

.start-screen h2 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.feature-list {
    text-align: left;
    max-width: 300px;
    margin: 20px auto;
    list-style: none;
}

.feature-list li {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #495057;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 30px 30px 20px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h2 {
    color: #495057;
    margin-bottom: 0;
}

.modal-body {
    padding: 20px 30px;
}

.final-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.certificate-preview {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: 10px;
    margin: 20px 0;
    color: #155724;
    font-weight: 600;
}

.modal-actions {
    padding: 20px 30px 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

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

/* Challenge-specific styles (keeping existing ones) */
.image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.image-grid img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-grid img:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

.image-grid img.selected {
    border-color: #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.math-problem {
    font-size: 1.5rem;
    margin: 20px 0;
    color: #495057;
    text-align: center;
}

.math-input {
    font-size: 1.2rem;
    padding: 10px 20px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    text-align: center;
    width: 200px;
    margin: 0 10px;
}

.text-input {
    font-size: 1.1rem;
    padding: 12px 20px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    margin: 20px 0;
}

.pattern-grid {
    display: grid;
    grid-template-columns: repeat(3, 80px);
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.pattern-cell {
    width: 80px;
    height: 80px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
}

.pattern-cell.active {
    background: #667eea;
    border-color: #667eea;
}

.pattern-cell.clickable {
    cursor: pointer;
}

.pattern-cell.clickable:hover {
    background: #f8f9fa;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(4, 80px);
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.color-cell {
    width: 80px;
    height: 80px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-cell:hover {
    transform: scale(1.05);
}

.color-cell.selected {
    border-color: #333;
    border-width: 4px;
}

.tic-tac-toe-board {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    gap: 5px;
    margin: 20px auto;
    width: 310px;
}

.ttt-cell {
    width: 100px;
    height: 100px;
    border: 2px solid #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    background: white;
    transition: all 0.3s ease;
}

.ttt-cell:hover {
    background: #f8f9fa;
}

.ttt-cell.player-x {
    color: #4CAF50;
}

.ttt-cell.player-o {
    color: #f44336;
}

.ttt-status {
    text-align: center;
    font-weight: bold;
    margin-top: 10px;
}

.driving-area {
    text-align: center;
}

.parking-lot {
    position: relative;
    width: 500px;
    height: 400px;
    background: #f0f0f0;
    border: 3px solid #333;
    margin: 20px auto;
    border-radius: 10px;
}

.car {
    position: absolute;
    width: 50px;
    height: 30px;
    background: #4CAF50;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.parking-space {
    position: absolute;
    width: 60px;
    height: 40px;
    border: 2px dashed #666;
    left: 250px;
    top: 200px;
    background: rgba(76, 175, 80, 0.1);
}

.driving-instructions {
    margin-top: 10px;
    color: #666;
}

.reaction-area {
    text-align: center;
}

.btn-reaction {
    font-size: 1.5rem;
    padding: 20px 40px;
    background: #f44336;
    min-width: 250px;
}

.captcha-area {
    text-align: center;
}

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

.sequence-buttons {
    text-align: center;
}

.sequence-item {
    animation: fadeIn 0.5s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .article-title {
        font-size: 2.5rem;
    }

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

    .article-paragraph {
        font-size: 1.1rem;
    }

    .article-paragraph.emphasis {
        font-size: 1.2rem;
    }

    .article-paragraph.large-quote {
        font-size: 1.4rem;
    }

    .hero-article {
        padding: 2rem 0;
    }

    .hero-article .article-content {
        padding: 2rem 1.5rem;
    }

    .container {
        padding: 0 15px;
    }

    .game-cta h2 {
        font-size: 2rem;
    }

    .btn-large {
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }

    .color-grid {
        grid-template-columns: repeat(3, 70px);
    }

    .color-cell {
        width: 70px;
        height: 70px;
    }

    .tic-tac-toe-board {
        grid-template-columns: repeat(3, 80px);
        width: 250px;
    }

    .ttt-cell {
        width: 80px;
        height: 80px;
        font-size: 1.5rem;
    }

    .parking-lot {
        width: 300px;
        height: 250px;
    }

    .parking-space {
        left: 150px;
        top: 120px;
    }

    .car {
        width: 40px;
        height: 25px;
    }
}

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

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

    .article-meta {
        flex-direction: column;
        gap: 1rem;
    }

    .share-buttons {
        flex-direction: column;
        align-items: center;
    }

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

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

    .stats-bar {
        flex-direction: column;
        gap: 10px;
    }
}