/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Header and Navigation */
.header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.search-box {
    display: flex;
    gap: 0.5rem;
}

.search-box input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 250px;
}

.search-box button {
    padding: 0.5rem 1rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

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

/* Category Tabs */
.category-header {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.category-tab {
    padding: 0.5rem 1rem;
    background-color: #f0f0f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.category-tab:hover {
    background-color: #e0e0e0;
}

.category-tab.active {
    background-color: #007bff;
    color: white;
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* Game Card */
.game-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    position: relative;
}

.game-card:hover {
    transform: translateY(-5px);
}

.game-thumbnail {
    position: relative;
    height: 150px;
    overflow: hidden;
    cursor: pointer;
}

.game-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Missing image placeholder styles */
.missing-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f0f0f0 25%, #e0e0e0 25%, #e0e0e0 50%, #f0f0f0 50%, #f0f0f0 75%, #e0e0e0 75%);
    background-size: 20px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

.missing-image-placeholder i {
    font-size: 32px;
    margin-bottom: 8px;
}

.missing-image-placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px;
}

/* New Start Game Button Style (based on image) */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-card:hover .game-overlay {
    opacity: 1;
}

.rating {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: #ffcc00;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.play-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    padding: 0;
    margin: 0;
}

.play-button:hover {
    background-color: #0069d9;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.4);
}

.play-button:active {
    transform: scale(0.98);
}

.play-button .power-icon {
    font-size: 24px;
    margin-bottom: 8px;
    color: #ffffff;
}

.play-button .power-icon i {
    font-size: 28px;
}

.play-button .button-text {
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.game-info {
    padding: 1rem;
}

.game-info h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.game-info p {
    font-size: 0.9rem;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Error message styles */
.error-message {
    padding: 15px;
    margin: 20px 0;
    background-color: #ffebee;
    color: #c62828;
    border-left: 4px solid #c62828;
    border-radius: 4px;
    text-align: center;
    width: 100%;
    font-weight: bold;
}

/* Pagination styles */
.pagination-container {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    flex-wrap: wrap;
}

.pagination-info {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.pagination-buttons {
    display: flex;
    gap: 0.5rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #0069d9;
}

.pagination-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.no-games-message {
    grid-column: 1 / -1;
    padding: 2rem;
    text-align: center;
    color: #666;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Search results styling */
.search-stats {
    grid-column: 1 / -1;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: #f0f7ff;
    border-left: 3px solid #007bff;
    color: #333;
    font-size: 0.9rem;
}

.highlight {
    background-color: #ffee00;
    font-weight: bold;
    padding: 0 2px;
    border-radius: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-box {
        width: 100%;
    }
    
    .search-box input {
        flex: 1;
    }
    
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .pagination-info,
    .pagination-buttons {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .game-grid {
        grid-template-columns: 1fr;
    }
    
    .category-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .category-tab {
        width: 100%;
    }
}

/* Game iframe loading and error states */
#gameFrame {
    transition: opacity 0.3s ease;
    background-color: #000;
}

.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.iframe-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 8px;
    max-width: 80%;
}

.iframe-error h4 {    margin-bottom: 10px;    color: #ff5555;}

/* Footer Styles */
.site-footer {
    background-color: #fff;
    padding: 1.5rem 0;
    border-top: 1px solid #eee;
    margin-top: 2rem;
}

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

.footer-links {
    margin-bottom: 1rem;
}

.footer-links a {
    color: #007bff;
    text-decoration: none;
    margin: 0 0.5rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-copyright {
    color: #666;
    font-size: 0.9rem;
}

.footer-highlight {
    color: #007bff;
    font-weight: bold;
}

/* Game Modal Styles */
.game-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    overflow: auto;
}

.game-modal-content {
    background-color: #222;
    width: 90%;
    max-width: 1200px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.game-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #333;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom: 1px solid #444;
}

.game-modal-header h2 {
    color: white;
    margin: 0;
    font-size: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.game-modal-body {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.game-frame-container {
    position: relative;
    width: 100%;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

#gameFrame {
    width: 100%;
    height: 600px;
    background-color: #000;
    border: none;
}

.game-modal-footer {
    padding: 1rem;
    border-top: 1px solid #444;
    background-color: #333;
}

.ad-container {
    width: 100%;
    min-height: 100px;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
}

.ad-placeholder {
    color: #aaa;
    padding: 1rem;
    text-align: center;
    width: 100%;
}

/* Responsive Game Modal */
@media (max-width: 992px) {
    .game-modal-content {
        width: 95%;
    }
    
    #gameFrame {
        height: 500px;
    }
}

@media (max-width: 768px) {
    .game-modal-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .game-modal-header {
        border-radius: 0;
    }
    
    #gameFrame {
        height: 400px;
    }
}

@media (max-width: 480px) {
    #gameFrame {
        height: 300px;
    }
    
    .game-modal-header h2 {
        font-size: 1.2rem;
    }
}

/* 广告样式 */
.ad-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.ad-header {
    background-color: rgba(0, 123, 255, 0.1);
    color: #99ccff;
    padding: 0.5rem;
    font-size: 0.8rem;
    text-align: center;
    border-bottom: 1px solid rgba(0, 123, 255, 0.2);
}

.ad-content {
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90px;
}

.ad-placeholder {
    color: #aaa;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.4;
}  