/* Global Styles */
:root {
    --primary-color: #1E88E5;
    --primary-dark: #1565C0;
    --primary-light: #42A5F5;
    --secondary-color: #FFC107;
    --accent-color: #FF5722;
    --dark-bg: #0A192F;
    --darker-bg: #071120;
    --light-bg: #172A45;
    --text-color: #FFFFFF;
    --light-text: #CCD6F6;
    --gray: #8892B0;
    --dark-gray: #495670;
    --success: #4CAF50;
    --warning: #FF9800;
    --danger: #F44336;
}

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

body {
    /* Other styles remain unchanged */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background-color: var(--dark-bg);
    line-height: 1.6;

    /* Background image styles */
    background-image: url('../images/football-bg.jpg');
    background-repeat: no-repeat;
    background-position: center top;
    background-attachment: fixed;
    background-size: 100% auto;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: var(--primary-light);
    transition: all 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

/* 主体内容 */
main {
    padding: 50px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

button {
    cursor: pointer;
    transition: all 0.3s ease;
}


.section-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

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

/* Header Styles */
.header {
    background-color: var(--darker-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid var(--primary-dark);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    width: 40px;
    height: 40px;
}

.header h1 {
    color: var(--text-color);
    font-size: 1.5rem;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav li {
    position: relative;
}

.nav a {
    color: var(--light-text);
    font-weight: 500;
    padding: 5px 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav a.active {
    color: var(--secondary-color);
}

.nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--secondary-color);
}

.search-container {
    position: relative;
    margin-left: 20px;
}

.search-container input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 15px 8px 40px;
    color: var(--text-color);
    width: 200px;
    transition: all 0.3s ease;
}

.search-container input:focus {
    outline: none;
    box-shadow: 0 0 10px var(--primary-color);
    width: 250px;
}

.search-container i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
}


.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
}

/* Featured Games Section */
.featured-games {
    padding: 40px 0;
    background: linear-gradient(rgba(10, 25, 47, 0.9), rgba(10, 25, 47, 0.9)), url('../images/football-bg.jpg');
    background-size: cover;
    background-position: center;
}

.featured-slider {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.slider-container {
    display: flex;
    transition: transform 0.5s ease;
    height: 400px;
}

.featured-card {
    min-width: 100%;
    position: relative;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    overflow: hidden;
}

.featured-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
}

.play-button {
    background-color: var(--secondary-color);
    color: var(--dark-bg);
    border: none;
    padding: 12px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.play-button:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.featured-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: var(--text-color);
}

.featured-title {
    font-size: 2rem;
    margin-bottom: 5px;
    color: var(--secondary-color);
}

.featured-tags {
    font-size: 1rem;
    opacity: 0.8;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.featured-tags span {
    background-color: rgba(30, 136, 229, 0.2);
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 0.8rem;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    z-index: 10;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-btn:hover {
    background-color: var(--primary-color);
}

.prev-btn {
    left: 15px;
}

.next-btn {
    right: 15px;
}

/* All Games Section */
.all-games {
    padding: 40px 0;
    background-color: var(--dark-bg);
}


/* Footer */
.footer {
    background-color: var(--darker-bg);
    padding: 40px 0 20px;
    border-top: 2px solid var(--primary-dark);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-logo {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-logo img {
    width: 50px;
    height: 50px;
}

.footer-logo h2 {
    color: var(--text-color);
    font-size: 1.5rem;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.footer-logo p {
    color: var(--gray);
    font-size: 0.9rem;
}

.footer-links h3 {
    color: var(--text-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: var(--gray);
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--secondary-color);
}

.footer-social h3 {
    color: var(--text-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    color: var(--gray);
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.social-icons a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--dark-gray);
    color: var(--gray);
    font-size: 0.9rem;
}

.card-loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 50px;
    background-color: #1a1a2e; /* 深色背景，突出内容 */
    color: #f0f2f5;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    font-family: 'Arial', sans-serif;
    text-align: center;
}
.card-loading img {
    /* 将巨大的 GIF 尺寸限制在合理范围内 */
    width: 120px;
    height: 120px;

    /* 额外的酷炫效果：添加旋转动画 */
    animation: loading-spin 2s linear infinite;

    /* 增加一个发光效果，使其更具游戏感 */
    filter: drop-shadow(0 0 8px rgba(0, 224, 255, 0.8));
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.game-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    text-align: center;
    padding: 20px;
    position: relative;
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    animation: fade-in-up 0.8s forwards;
    opacity: 0;
}

.game-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--accent-color), var(--primary-color));
    background-size: 400% 400%;
    z-index: -1;
    border-radius: 16px;
    animation: gradient-border 3s ease infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

@keyframes gradient-border {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.game-card:nth-child(1) { animation-delay: 1.5s; }
.game-card:nth-child(2) { animation-delay: 1.7s; }
.game-card:nth-child(3) { animation-delay: 1.9s; }
.game-card:nth-child(4) { animation-delay: 2.1s; }
.game-card:nth-child(5) { animation-delay: 2.3s; }
.game-card:nth-child(6) { animation-delay: 2.5s; }
.game-card:nth-child(7) { animation-delay: 2.7s; }
.game-card:nth-child(8) { animation-delay: 2.9s; }
.game-card:nth-child(9) { animation-delay: 3.1s; }
.game-card:nth-child(10) { animation-delay: 3.3s; }
.game-card:nth-child(11) { animation-delay: 3.5s; }
.game-card:nth-child(12) { animation-delay: 3.7s; }

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(50px) rotateX(10deg); }
    to { opacity: 1; transform: translateY(0) rotateX(0); }
}

.game-card:hover {
    transform: translateY(-10px) scale(1.03) rotateY(5deg);
    box-shadow: 0 10px 30px rgba(0, 224, 255, 0.3);
}

.game-card img {
    width: 100%;
    /*height: 40%;*/
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: transform 0.5s ease;
}

.game-card:hover img {
    transform: scale(1.05);
}

.game-card h3 {
    margin-top: 15px;
    font-size: 1.5rem;
    color: var(--primary-color);
    text-shadow: 0 0 5px var(--primary-color);
}

.game-card p {
    font-size: 0.9rem;
    margin: 10px 0 20px;
    color: #ccc;
}

.game-card .play-button {
    display: block;
    width: 100%;
    padding: 12px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: var(--bg-color);
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px;
    box-shadow: 0 0 10px var(--primary-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.game-card .play-button:hover {
    box-shadow: 0 0 15px var(--secondary-color);
    transform: translateY(-3px);
}

.game-card .play-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.game-card .play-button:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .game-header {
        flex-direction: column;
    }

    .game-icon-container {
        flex-direction: row;
        justify-content: center;
    }

    .game-info {
        text-align: center;
    }

    .game-meta {
        justify-content: center;
    }

    .game-tags {
        justify-content: center;
    }

    .search-container input {
        width: 150px;
    }

    .search-container input:focus {
        width: 180px;
    }
}

@media (max-width: 768px) {
    .nav {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: var(--darker-bg);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
        transform: translateY(-150%);
        transition: transform 0.3s ease;
        z-index: 90;
    }

    .nav.active {
        transform: translateY(0);
    }

    .nav ul {
        flex-direction: column;
        gap: 15px;
    }

    .mobile-menu-btn {
        display: block;
    }

    .featured-card {
        height: 350px;
    }

    .slider-container {
        height: 350px;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .menu {
        display: flex;
        justify-content: space-between;
    }

    .search-container {
        margin: 10px 0 0;
        width: 100%;
    }

    .search-container input {
        width: 100%;
    }

    .search-container input:focus {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .featured-card {
        height: 300px;
    }

    .slider-container {
        height: 300px;
    }

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

    .play-button {
        padding: 10px 20px;
        font-size: 1rem;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .recommended-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .menu {
        display: flex;
        justify-content: space-between;
    }
}
