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

:root {
    --primary-color: #6a1b9a; /* 深紫色 */
    --secondary-color: #ff9800;
    --accent-color: #ab47bc; /* 紫色强调色 */
    --dark-color: #4a148c; /* 更深紫色 */
    --light-color: #f5f5f7;
    --text-color: #333;
    --text-light: #666;
    --card-bg: #ffffff;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f8f9fa;
}

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

/* Navigation */
.navbar {
    background: linear-gradient(135deg, #6a1b9a, #4a148c); /* 紫色渐变 */
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.logo {
    display: flex;
    align-items: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
}

.logo img {
    height: 50px;
    margin-right: 10px;
}

.logo i {
    margin-right: 10px;
    color: var(--secondary-color);
}

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

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 8px 0;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: white;
}

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

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.btn-login,
.btn-signup {
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: 'Poppins', sans-serif;
}

.btn-login {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-signup {
    background-color: var(--secondary-color);
    color: white;
}

.btn-login:hover {
    border-color: white;
}

.btn-signup:hover {
    background-color: #e68900;
    transform: translateY(-2px);
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    cursor: pointer;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    padding: 4rem 0;
    background-image: url('img/pattern.jpeg');
    background-position: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('img/header.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    z-index: 2;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    position: relative;
    z-index: 2; /* 确保内容在背景之上 */
}

.hero h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.highlight {
    color: var(--secondary-color);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 600px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn-primary,
.btn-secondary {
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: none;
    font-family: 'Poppins', sans-serif;
}

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

.btn-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
    background-color: #e68900;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.3);
}

.btn-secondary:hover {
    border-color: white;
    transform: translateY(-2px);
}

.hero-stats {
    display: flex;
    gap: 3rem;
    margin-top: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

.number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary-color);
    min-width: 120px;
    text-align: left;
    display: inline-block;
}

.label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.hero-visual {
    display: flex;
    justify-content: center;
}

.game-preview {
    width: 100%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.card-table {
    background: #ab47bc;
    border-radius: 12px;
    padding: 2rem;
    min-height: 300px;
    position: relative;
    overflow: hidden;
}

.card-deck {
    position: absolute;
    width: 100px;
    height: 100px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.player-hand {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

/* 发牌动画区域 */
.dealing-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.card {
    width: 60px;
    height: 80px;
    background: white;
    border-radius: 8px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    cursor: pointer;
    border: 1px solid #ddd;
}

/* 数字 - 左上角 */
.card .card-value {
    position: absolute;
    top: 4px;
    left: 6px;
    font-weight: bold;
    font-size: 0.85rem;
    line-height: 1;
}

/* 花色 - 中间放大 */
.card .card-suit {
    font-size: 2rem;
    line-height: 1;
}

/* 红色花色 - 红心和方块 */
.card.red-suit .card-value,
.card.red-suit .card-suit {
    color: #e74c3c;
}

/* 黑色花色 - 黑桃和梅花 */
.card.black-suit .card-value,
.card.black-suit .card-suit {
    color: #2c3e50;
}

/* 悬停效果 */
.card:hover {
    transform: translateY(-10px);
}

/* 发牌动画中的卡牌 */
.dealing-card {
    position: absolute;
    width: 60px;
    height: 80px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    z-index: 10;
    border: 1px solid #ddd;
}

.dealing-card .card-value {
    position: absolute;
    top: 4px;
    left: 6px;
    font-weight: bold;
    font-size: 0.85rem;
    line-height: 1;
}

.dealing-card .card-suit {
    font-size: 2rem;
    line-height: 1;
}

.dealing-card.red-suit .card-value,
.dealing-card.red-suit .card-suit {
    color: #e74c3c;
}

.dealing-card.black-suit .card-value,
.dealing-card.black-suit .card-suit {
    color: #2c3e50;
}

.dealing-card.flying {
    animation: flyToHand 0.8s ease-out forwards;
}

@keyframes flyToHand {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5) rotate(-180deg);
    }
    30% {
        opacity: 1;
        transform: translate(-50%, calc(-50% - 60px)) scale(1.1) rotate(-90deg);
    }
    70% {
        opacity: 1;
        transform: translate(-50%, calc(-50% - 30px)) scale(1) rotate(-20deg);
    }
    100% {
        opacity: 1;
        transform: translate(calc(-50% + var(--end-x)), calc(-50% + var(--end-y))) scale(1) rotate(var(--end-rotate));
    }
}

.dealing-card.settled {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    opacity: 1;
    animation: cardSettle 0.3s ease-out;
}

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

/* 手牌悬停效果 */
.player-hand .card {
    transition: transform 0.3s ease;
    cursor: pointer;
}

.player-hand .card:hover {
    transform: translateY(-10px);
}

/* Features Section */
.features {
    padding: 5rem 0;
    background-color: white;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary-color); /* 改为紫色 */
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color)); /* 紫色渐变 */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.8rem;
    color: white;
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-color); /* 改为紫色 */
}

/* Game Screenshots Gallery */
.gallery-section {
    padding: 5rem 0;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.gallery-container {
    position: relative;
    max-width: 900px;
    margin: 3rem auto 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.gallery-wrapper {
    flex: 1;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.gallery-track {
    display: flex;
    transition: transform 0.5s ease;
}

.gallery-slide {
    min-width: 100%;
    opacity: 1;
}

.gallery-slide img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
}

.gallery-slide.active {
    opacity: 1;
}

.gallery-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(106, 27, 154, 0.3);
    flex-shrink: 0;
}

.gallery-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(106, 27, 154, 0.4);
}

.gallery-btn:active {
    transform: scale(0.95);
}

.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 2rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ccc;
    cursor: pointer;
    transition: var(--transition);
}

.dot:hover {
    background-color: var(--accent-color);
}

.dot.active {
    background-color: var(--primary-color);
    transform: scale(1.2);
}

/* Game Modes */
.game-modes {
    padding: 5rem 0;
    background-color: #f8f9fa;
}

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

.mode-tab {
    padding: 12px 24px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.mode-tab.active,
.mode-tab:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.mode-content {
    display: none;
    grid-template-columns: 1fr 0.2fr;
    gap: 3rem;
    align-items: center;
    animation: fadeIn 0.5s ease;
}

.mode-content.active {
    display: grid;
}

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

.mode-info h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.mode-info p {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.mode-info ul {
    list-style: none;
    margin-bottom: 2rem;
}

.mode-info ul li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--text-color);
}

.mode-info ul li i {
    color: var(--accent-color);
    font-size: 1.1rem;
}

.btn-play-mode {
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Poppins', sans-serif;
}

.btn-play-mode:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(106, 27, 154, 0.3);
}

.mode-visual {
    display: flex;
    justify-content: center;
}

.mode-visual .card-table {
    width: 100%;
    max-width: 400px;
    min-height: 250px;
}

/* Tournaments */

/* Tournaments */
.tournaments {
    padding: 5rem 0;
    background-color: white;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.view-all {
    color: var(--primary-color); /* 改为紫色 */
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tournaments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.tournament-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
}

.tournament-card.featured {
    border: 2px solid var(--secondary-color);
}

.tournament-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background-color: var(--secondary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.tournament-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-color); /* 改为紫色 */
}

.tournament-prize {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.tournament-prize span {
    color: var(--accent-color); /* 改为紫色 */
    font-weight: 700;
    font-size: 1.2rem;
}

.tournament-info {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
}

.btn-enter {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color); /* 改为紫色 */
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-enter:hover {
    background-color: var(--dark-color); /* 更深的紫色 */
}

/* Download Section */
.download-section {
    padding: 5rem 0;
    background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
    color: white;
    position: relative;
    overflow: hidden;
}

.download-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('img/pattern.jpeg');
    /* background-size: cover; */
    background-position: center;
    opacity: 0.3;
    z-index: 1;
}

.download-section .container {
    position: relative;
    z-index: 2;
}

.download-section .section-title {
    color: white;
}

.download-section .section-subtitle {
    color: rgba(255, 255, 255, 0.8);
}

.download-content {
    display: grid;
    grid-template-columns: 1.2fr 0.2fr;
    gap: 4rem;
    align-items: center;
    margin-top: 3rem;
}

.download-info h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.download-info p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    max-width: 800px;
}

.download-features {
    list-style: none;
}

.download-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
}

.download-features li i {
    color: var(--secondary-color);
    font-size: 1.2rem;
}

.download-buttons-large {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.btn-download-platform {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    backdrop-filter: blur(10px);
}

.btn-download-platform i {
    font-size: 2rem;
}

.btn-text {
    display: flex;
    flex-direction: column;
}

.btn-text span {
    font-size: 0.85rem;
    opacity: 0.8;
}

.btn-text strong {
    font-size: 1.3rem;
    font-weight: 700;
}

.btn-download-platform:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Footer */
.footer {
    background-color: #2d1b3d; /* 深紫色 */
    color: white;
    padding: 4rem 0 2rem;
}

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

.footer-section h3,
.footer-section h4 {
    color: white;
    margin-bottom: 1.5rem;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
}

.footer-section a {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    margin-bottom: 10px;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--secondary-color);
    padding-left: 5px;
}

.download-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-app {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.btn-app i {
    font-size: 1.5rem;
}

.btn-app:hover {
    background: rgba(255, 255, 255, 0.2);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: white;
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--secondary-color);
    transform: translateY(-3px);
}

/* 自定义弹框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 3rem 2.5rem;
    max-width: 450px;
    width: 90%;
    text-align: center;
    position: relative;
    transform: scale(0.8) translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background-color: #f5f5f5;
    color: var(--primary-color);
    transform: rotate(90deg);
}

.modal-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    color: white;
    animation: pulse 2s infinite;
}

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

.modal-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 700;
}

.modal-message {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.modal-btn {
    padding: 12px 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Poppins', sans-serif;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(106, 27, 154, 0.3);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .nav-links {
        display: none;
    }
    
    .menu-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}