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

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Header and Navigation */
header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.logo h1 {
    font-size: 1.8rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: #3498db;
}

/* Main Content */
.game-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.game-info {
    text-align: center;
    margin-bottom: 2rem;
}

.game-info h2 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.game-info p {
    font-size: 1.2rem;
    color: #7f8c8d;
}

.game-wrapper {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    margin-bottom: 2rem;
}

#breakoutCanvas {
    border: 2px solid #34495e;
    border-radius: 4px;
    background-color: #ecf0f1;
    margin-bottom: 1.5rem;
}

.game-controls {
    margin-bottom: 1.5rem;
}

.btn-primary, .btn-secondary {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 0.5rem;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 1.5rem;
}

.stat-item {
    background-color: #f8f9fa;
    padding: 1rem 2rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-label {
    font-weight: bold;
    color: #7f8c8d;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #3498db;
}

.game-instructions {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.game-instructions h3 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    text-align: center;
}

.game-instructions ul {
    list-style-position: inside;
    max-width: 800px;
    margin: 0 auto;
}

.game-instructions li {
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    color: #555;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #3498db;
}

/* About, Contact, Privacy, Terms Pages */
.page-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.page-container h2 {
    font-size: 2.2rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3498db;
}

.page-container h3 {
    font-size: 1.6rem;
    color: #34495e;
    margin: 1.5rem 0 1rem 0;
}

.page-container p {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: #555;
}

.page-container ul {
    list-style-position: inside;
    margin-bottom: 1.5rem;
}

.page-container li {
    margin-bottom: 0.5rem;
    color: #555;
}

/* Blog Hero Section */
.blog-hero {
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    padding: 80px 0;
    margin-bottom: 50px;
    text-align: center;
}

.blog-hero h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.blog-hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

/* Blog Container Styles */
.blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

.blog-container .container {
    width: 100%;
}

/* Blog Header */
.blog-header {
    text-align: center;
    margin-bottom: 60px;
    padding-top: 20px;
}

.blog-header h2 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 700;
}

.blog-header p {
    font-size: 1.2rem;
    color: #7f8c8d;
    max-width: 700px;
    margin: 0 auto;
}

/* Blog Posts Grid */
.blog-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
}

/* Blog Post Card */
.blog-post {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-post:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Post Thumbnail */
.post-thumbnail {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 3px solid #3498db;
    background-color: #f8f9fa;
}

.post-thumbnail-img {
    width: 100%;
    height: auto;
    min-height: 150px;
    max-height: 200px;
    object-fit: contain;
    transition: transform 0.5s ease;
    display: block;
}

.blog-post:hover .post-thumbnail-img {
    transform: scale(1.05);
}

/* Post Content */
.post-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.post-title {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
    line-height: 1.3;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.9rem;
    color: #95a5a6;
    margin-bottom: 15px;
}

.post-excerpt {
    color: #7f8c8d;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.read-more {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s ease, transform 0.2s ease;
    align-self: flex-start;
}

.read-more:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* Newsletter Section */
.newsletter-section {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 50px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.newsletter-content h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.newsletter-content p {
    margin-bottom: 30px;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.newsletter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-form input[type="email"] {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    width: 100%;
    max-width: 350px;
    outline: none;
}

.subscribe-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    white-space: nowrap;
}

.subscribe-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* Responsive Blog Styles */
@media (max-width: 768px) {
    .blog-hero {
        padding: 60px 20px;
    }
    
    .blog-hero h1 {
        font-size: 2.2rem;
    }
    
    .blog-posts {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .newsletter-section {
        padding: 40px 20px;
    }
    
    .newsletter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .newsletter-form input[type="email"] {
        max-width: none;
    }
    
    .subscribe-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .blog-hero h1 {
        font-size: 1.8rem;
    }
    
    .blog-hero p {
        font-size: 1rem;
    }
    
    .blog-header h2 {
        font-size: 2rem;
    }
}
}

/* Article Detail Page Styles */
.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.article {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.article-header {
    padding: 40px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.article-header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 0.9rem;
    color: #95a5a6;
}

.article-meta span {
    display: flex;
    align-items: center;
}

.article-meta span::before {
    content: "•";
    margin-right: 10px;
    opacity: 0;
}

.article-meta span:first-child::before {
    display: none;
}

.article-featured-image {
    padding: 0 40px;
    margin-top: -20px;
    margin-bottom: 30px;
    display: block;
}

.featured-image {
    width: 100%;
    height: auto !important;
    min-height: 200px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    display: block;
    object-fit: contain;
}

.article-content {
    padding: 40px;
}

.article-content p {
    color: #333;
    line-height: 1.8;
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.article-content h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.article-content ul {
    margin: 20px 0;
    padding-left: 25px;
}

.article-content ul li {
    margin-bottom: 10px;
    line-height: 1.6;
    color: #333;
}

.article-content a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-content a:hover {
    color: #2980b9;
    text-decoration: underline;
}

.article-footer {
    padding: 40px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.share-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.share-buttons span {
    font-weight: bold;
    color: #333;
}

.share-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.share-btn:hover {
    background: #2980b9;
}

.back-to-blog {
    display: inline-block;
    background: #2c3e50;
    color: white;
    padding: 12px 24px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s ease;
    align-self: flex-start;
}

.back-to-blog:hover {
    background: #34495e;
    color: white;
    text-decoration: none;
}

/* Responsive Article Styles */
@media (max-width: 768px) {
    .article-header {
        padding: 30px 20px;
    }
    
    .article-header h1 {
        font-size: 2rem;
    }
    
    .article-featured-image {
        padding: 0 20px;
    }
    
    .article-content,
    .article-footer {
        padding: 30px 20px;
    }
    
    .share-buttons {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .back-to-blog {
        width: 100%;
        text-align: center;
    }
}

/* Mobile-First Enhancements */
.gameCanvas {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Game Grid Responsive Design */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 6px;
    margin: 12px auto;
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
    padding: 0 8px;
}

.game-card {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 100px;
    justify-content: space-between;
    box-sizing: border-box;
    max-width: 100%;
    transform: scale(0.95); /* Slightly scale down the card */
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Header adjustments */
    .navbar {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }

    .logo h1 {
        font-size: 1.5rem;
        text-align: center;
    }

    .nav-links {
        margin-top: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links li {
        margin: 0 0.5rem;
    }

    .nav-links a {
        font-size: 1rem;
    }

    /* Main content adjustments */
    main {
        padding: 10px;
        height: auto;
        min-height: calc(100vh - 120px);
    }

    /* Game grid adjustments */
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
        margin-top: 8px;
        width: 100%;
        padding: 0 10px;
    }

    .game-card {
        padding: 4px;
        min-height: 80px;
        max-width: 100%;
        transform: scale(0.9); /* Scale down for mobile */
    }

    .game-card h3 {
        font-size: 10px;
        margin: 2px 0;
        line-height: 1.2;
    }
    
    .game-card p {
        font-size: 8px;
        margin: 2px 0;
        line-height: 1.2;
    }
    
    .game-card svg {
        width: 30px;
        height: 30px;
        transform: scale(0.8); /* Scale down icons proportionally */
    }

    .game-container {
        padding: 0 1rem;
        margin: 1rem auto;
    }

    .game-wrapper {
        padding: 1rem;
        border-radius: 6px;
    }

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

    .game-info p {
        font-size: 1rem;
    }

    /* Game controls for mobile */
    .game-controls {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .btn-primary, .btn-secondary {
        padding: 0.8rem 1.2rem;
        font-size: 1rem;
        min-width: 120px;
        margin: 0.5rem;
    }

    /* Stats display */
    .game-stats {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .stat-item {
        width: 100%;
        max-width: 300px;
        justify-content: space-between;
    }

    /* Touch controls container */
    .touch-controls {
        display: none;
        position: fixed;
        bottom: 20px;
        left: 0;
        right: 0;
        z-index: 1000;
        padding: 10px;
    }

    /* Mobile menu adjustments */
    .mobile-menu-btn {
        display: block;
    }

    /* Footer adjustments */
    .footer-content {
        padding: 0 1rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }

    /* Blog adjustments */
    .blog-posts {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .blog-post {
        margin: 0 auto;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    /* Further adjustments for smaller screens */
    .game-info h2 {
        font-size: 1.8rem;
    }

    /* Game grid adjustments for very small screens */
    .game-grid {
        grid-template-columns: 1fr;
        margin: 8px auto;
        padding: 0 15px;
    }

    .game-card {
        min-height: 80px;
        padding: 6px;
        max-width: 100%;
        transform: scale(0.85); /* Scale down for very small screens */
    }

    .game-card h3 {
        font-size: 12px;
        margin: 3px 0;
        line-height: 1.2;
    }
    
    .game-card p {
        font-size: 9px;
        margin: 3px 0;
        line-height: 1.2;
    }
    
    .game-card svg {
        width: 30px;
        height: 30px;
        transform: scale(0.7); /* Scale down icons proportionally */
    }

    .page-container {
        padding: 1.2rem;
        margin: 1rem;
    }

    .page-container h2 {
        font-size: 1.6rem;
    }

    .page-container h3 {
        font-size: 1.4rem;
    }

    /* Button sizing for better touch targets */
    .btn-primary, .btn-secondary {
        padding: 0.9rem 1.4rem;
        font-size: 1.1rem;
        min-width: 140px;
        border-radius: 8px;
    }

    /* Game canvas container */
    #gameContainer {
        min-height: 500px;
        padding: 10px;
    }

    /* Article adjustments */
    .article-header h1 {
        font-size: 1.8rem;
    }

    .article-content p {
        font-size: 1rem;
    }
}

/* Touch control styles for mobile */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .touch-controls {
        display: block;
    }

    /* Make buttons and interactive elements larger for touch */
    button, a.btn-primary, a.btn-secondary, .read-more, .back-to-blog {
        min-height: 48px;
        min-width: 48px;
        font-size: 1.1rem;
    }

    /* Prevent accidental scroll when touching game area */
    #gameContainer {
        touch-action: manipulation;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
}