/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: 'Cyberpunk';
    src: url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&display=swap');
    font-display: swap;
}

body {
    font-family: 'Courier New', Courier, monospace;
    background-color: #121212;
    color: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* 世界观介绍容器 */
.worldview-container {
    max-width: 800px;
    width: 100%;
    height: 600px;
    background-color: #050505;
    border: 4px solid #00ffff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    opacity: 1;
    transition: opacity 1.5s ease-in-out;
}

/* 渐隐效果类 */
.fade-out {
    opacity: 0;
}

/* 渐显效果类 */
.fade-in {
    opacity: 1;
    transition: opacity 1.5s ease-in-out;
}

.worldview-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00ffff, transparent);
    animation: scanline 3s linear infinite;
}

.worldview-text {
    font-family: 'Cyberpunk', 'Courier New', monospace;
    font-size: 18px;
    line-height: 1.8;
    color: #e0e0e0;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
    max-width: 700px;
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    background-color: rgba(0, 0, 0, 0.7);
}

/* 主界面 */
.main-menu {
    max-width: 800px;
    width: 100%;
    height: 600px;
    background-color: #050505;
    border: 4px solid #ff00ff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.3);
    position: relative;
}

.main-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 0, 255, 0.1), transparent 70%);
}

/* 标题容器 */
.title-container {
    text-align: center;
    margin-bottom: 50px;
}

/* 中文游戏标题 */
.game-title {
    padding: 15px;
    background-color: #0a0a0a;
    border-bottom: 4px solid #333;
    font-size: 56px; /* 放大两倍 */
    text-transform: uppercase;
    letter-spacing: 4px;
    font-family: 'Cyberpunk', 'Press Start 2P', cursive;
    color: #ff00ff;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.7), 0 0 20px rgba(255, 0, 255, 0.5);
    margin-bottom: 10px;
}

/* 英文标题 */
.english-title {
    font-family: 'Cyberpunk', sans-serif;
    font-size: 24px;
    color: #00ffff;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.7);
    letter-spacing: 2px;
    margin: 0;
}

/* 进入游戏按钮 */
.start-button {
    padding: 15px 40px;
    background-color: #111;
    color: #00ffff;
    border: 2px solid #00ffff;
    border-radius: 4px;
    font-family: 'Cyberpunk', 'Courier New', monospace;
    font-size: 20px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.start-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.2), transparent);
    transition: all 0.6s ease;
}

.start-button:hover {
    background-color: #001111;
    transform: translateY(-3px);
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.7);
}

.start-button:hover::before {
    left: 100%;
}

.start-button:active {
    transform: translateY(1px);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* 游戏容器 */
.game-container {
    max-width: 100%;
    width: 100%;
    height: 100vh;
    background-color: #1e1e1e;
    border: 4px solid #333;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

/* 游戏标题区域 */
.game-header {
    padding: 10px;
    background-color: #0a0a0a;
    border-bottom: 4px solid #333;
    text-align: center;
}

.game-header .game-title {
    font-size: 24px;
    margin: 0;
}



/* 游戏屏幕 */
.game-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    background-color: #0a0a0a;
    padding: 10px;
}

#gameCanvas {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    border: 2px solid #333;
    background-color: #000;
    width: 100%;
    max-width: 800px;
    height: auto;
    max-height: calc(100vh - 300px);
}

#gameCanvas {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    border: 2px solid #333;
    background-color: #000;
}

/* 对话框区域 */
.dialog-area {
    border-top: 4px solid #ff00ff;
    background-color: #0a0a0a;
    max-height: 250px;
    display: flex;
    flex-direction: column;
}

/* 对话框 */
.dialog-box {
    padding: 15px;
    overflow-y: auto;
    box-shadow: inset 0 0 10px rgba(255, 0, 255, 0.2);
    flex: 1;
}

/* 对话框点击提示 */
.click-prompt {
    text-align: center;
    color: #aaa;
    font-style: italic;
    padding: 5px 0;
    font-size: 12px;
}

.location {
    color: #00ffff;
    font-size: 16px;
    margin-bottom: 10px;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.7);
}

.description {
    color: #e0e0e0;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.4;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.3);
}

/* 角色对话框 */
.character-dialog {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 6px;
    border: 2px solid;
    background-color: rgba(10, 10, 10, 0.8);
    position: relative;
    animation: fadeIn 0.4s ease-in-out;
}

.speaker-name {
    font-weight: bold;
    margin-right: 8px;
    text-shadow: 0 0 3px;
}

.dialog-text {
    margin: 8px 0 0 0;
    line-height: 1.6;
    font-size: 15px;
    color: #e0e0e0;
}

/* 选项按钮 */
.choices {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.choice-button {
    padding: 12px 20px;
    background-color: #333;
    color: #e0e0e0;
    border: 2px solid #555;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
    transform: translateY(15px);
    animation: slideUp 0.4s ease-out forwards;
}

.choice-button:hover {
    background-color: #555;
    border-color: #777;
    transform: translateY(-2px);
}

.choice-button:active {
    background-color: #222;
    border-color: #444;
}

/* 扫描线动画 */
@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(100%); }
}

/* 噪点动画 */
@keyframes noise {
    0%, 100% { background-position: 0 0; }
    10% { background-position: -5% -10%; }
    30% { background-position: 3% 15%; }
    50% { background-position: 12% 5%; }
    70% { background-position: -9% 8%; }
    90% { background-position: 5% -12%; }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

button:hover {
    background-color: #555;
    border-color: #777;
}

button:active {
    background-color: #222;
    border-color: #444;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .game-title {
        font-size: 20px;
    }

    #dialogText {
        font-size: 14px;
    }

    button {
        font-size: 14px;
        padding: 10px 15px;
    }
}

/* 噪点叠加层样式 */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.05;
    mix-blend-mode: overlay;
    pointer-events: none;
    animation: noise 0.5s infinite linear;
    z-index: 1000;
}

/* 像素风格滚动条 */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border: 2px solid #1e1e1e;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}