:root {
    /* 复古游戏配色方案 - 紫色系 */
    --primary-color: #9b6dff;
    --primary-hover: #8a5ef0;
    --primary-light: #b18fff;
    
    /* 背景色：深紫色系 */
    --secondary-color: #2a1b3d;
    --secondary-dark: #1a1028;
    --secondary-light: #3d2b5c;
    
    /* 强调色：霓虹蓝 */
    --accent-color: #00e5ff;
    --accent-hover: #00d1e6;
    --accent-light: rgba(0, 229, 255, 0.2);
    
    /* 文字颜色 */
    --text-color: #ffffff;
    --text-light: #b8b8b8;
    
    /* 其他通用颜色 */
    --card-bg: rgba(42, 27, 61, 0.8);
    --border-color: rgba(155, 109, 255, 0.2);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
    --background-color: #1a1028;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Press Start 2P', system-ui, -apple-system, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(45deg, var(--secondary-color) 25%, transparent 25%),
        linear-gradient(-45deg, var(--secondary-color) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--secondary-color) 75%),
        linear-gradient(-45deg, transparent 75%, var(--secondary-color) 75%);
    background-size: 40px 40px;
    background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
    opacity: 0.15;
    z-index: -1;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            0deg,
            rgba(155, 109, 255, 0.1) 0px,
            rgba(155, 109, 255, 0.1) 2px,
            transparent 2px,
            transparent 4px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(0, 229, 255, 0.1) 0px,
            rgba(0, 229, 255, 0.1) 2px,
            transparent 2px,
            transparent 4px
        );
    background-size: 40px 40px;
    opacity: 0.2;
    z-index: -1;
    pointer-events: none;
}

.page-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    width: 100%;
    padding: 2rem 0;
}

.language-switcher {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.language-switcher select {
    padding: 0.5rem 2rem 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.875rem;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.language-switcher select:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.language-switcher select:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

/* 统一标题栏样式 */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    padding: 2rem 0;
    text-align: center;
    position: relative;
    border-bottom: 4px solid var(--accent-color);
    box-shadow: 0 4px 0 var(--primary-color);
    width: 100%;
    box-sizing: border-box;
    max-width: 1200px;
    margin: 0 auto;
    height: 120px; /* 固定高度 */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            45deg,
            rgba(255, 255, 255, 0.1) 0px,
            rgba(255, 255, 255, 0.1) 1px,
            transparent 1px,
            transparent 2px
        );
    opacity: 0.3;
    pointer-events: none;
}

.header h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 
        2px 2px 0 var(--secondary-dark),
        -2px -2px 0 var(--secondary-dark),
        2px -2px 0 var(--secondary-dark),
        -2px 2px 0 var(--secondary-dark);
    letter-spacing: -2px;
    line-height: 1.2;
}

.header p {
    margin: 0.5rem 0 0;
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 0 var(--secondary-dark);
    line-height: 1.4;
}

.back-button {
    position: absolute;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
    height: 40px; /* 固定按钮高度 */
}

.back-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.back-button:focus {
    outline: none;
}

.back-button svg {
    width: 20px;
    height: 20px;
}

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

.game-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    box-sizing: border-box;
    aspect-ratio: 16/9;
    background: var(--secondary-color);
    border-radius: 8px;
    overflow: hidden;
}

#game-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#game-frame.loaded {
    opacity: 1;
}

.fullscreen-icon {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0;
    margin: 0;
    outline: none;
}

.fullscreen-icon:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.fullscreen-icon svg {
    width: 24px;
    height: 24px;
    color: white;
    transition: transform 0.3s ease;
}

.fullscreen-icon:hover svg {
    transform: scale(1.1);
}

/* 全屏模式下的样式 */
.game-container:fullscreen {
    background: #000;
    padding: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-container:fullscreen #game-frame {
    width: 100%;
    height: 100%;
}

/* Safari 全屏模式 */
.game-container:-webkit-full-screen {
    background: #000;
    padding: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-container:-webkit-full-screen #game-frame {
    width: 100%;
    height: 100%;
}

/* IE11 全屏模式 */
.game-container:-ms-fullscreen {
    background: #000;
    padding: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-container:-ms-fullscreen #game-frame {
    width: 100%;
    height: 100%;
}

.game-info {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    text-align: center;
}

.game-info h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.features {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.feature-item {
    flex: 1;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.feature-item h3 {
    color: var(--primary-color);
    margin-top: 0;
}

.feature-item ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
}

.feature-item li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.feature-item li:last-child {
    border-bottom: none;
}

.footer {
    background: var(--card-bg);
    color: var(--text-light);
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
    width: 100%;
    box-sizing: border-box;
    border-top: 1px solid var(--border-color);
}

.footer p {
    margin: 0;
    font-size: 0.875rem;
}

.footer span {
    color: var(--primary-color);
}

.game-card {
    background: var(--card-bg);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    display: block;
    position: relative;
    border: 2px solid var(--border-color);
    backdrop-filter: blur(4px);
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 48%, rgba(155, 109, 255, 0.1) 50%, transparent 52%),
        linear-gradient(-45deg, transparent 48%, rgba(0, 229, 255, 0.1) 50%, transparent 52%);
    background-size: 20px 20px;
    opacity: 0.3;
    pointer-events: none;
}

.game-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-color);
}

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

.game-title {
    margin: 0;
    padding: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-color);
    font-weight: 500;
    text-align: center;
    background: var(--card-bg);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
    height: 2.4em;
    text-shadow: 1px 1px 0 var(--secondary-dark);
}

@media (max-width: 768px) {
    .features {
        flex-direction: column;
    }
    
    .game-container {
        aspect-ratio: 4/3;
    }

    .header {
        padding: 1.5rem 0;
    }

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

    .header p {
        font-size: 1rem;
    }

    .container {
        padding: 1rem;
    }

    .game-info {
        padding: 1rem;
    }

    .language-switcher {
        top: 0.75rem;
        right: 0.75rem;
    }

    .language-switcher select {
        padding: 0.375rem 1.75rem 0.375rem 0.75rem;
        font-size: 0.75rem;
    }

    .main-content {
        padding: 1rem 0;
    }

    .back-button {
        left: 1rem;
        padding: 0.375rem;
    }
    
    .back-button svg {
        width: 16px;
        height: 16px;
    }
}

/* 加载动画样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 16, 40, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.loading-box {
    width: 60px;
    height: 60px;
    position: relative;
    transform: rotate(45deg);
}

.loading-box::before,
.loading-box::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--accent-color);
    opacity: 0.6;
    animation: pulse 2s ease-in-out infinite;
}

.loading-box::after {
    animation-delay: -1s;
}

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

/* 游戏列表样式 */
.game-grid {
    opacity: 0;
    transition: opacity 0.3s ease;
    position: relative;
    min-height: 400px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.game-grid.loaded {
    opacity: 1;
}

/* 游戏详情页加载状态 */
.game-container.loading {
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-container.loading::before,
.game-container.loading::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-color);
    opacity: 0.6;
    animation: pulse 2s ease-in-out infinite;
}

.game-container.loading::after {
    animation-delay: -1s;
} 