/* ===== 最后的守塔人 - 像素舞台剧样式 ===== */

@font-face {
    font-family: 'PixelFont';
    src: local('Courier New');
}

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

body {
    background: #0a0a12;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Courier New', monospace;
    overflow: hidden;
}

/* 舞台容器 */
#stage-container {
    position: relative;
    width: 640px;
    height: 360px;
    border: 4px solid #2a2a3a;
    box-shadow: 
        0 0 0 4px #1a1a2a,
        0 0 40px rgba(255, 200, 100, 0.1),
        inset 0 0 60px rgba(0, 0, 0, 0.5);
    image-rendering: pixelated;
    background: #000;
}

/* 画布 */
#stage-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* ===== 标题画面 ===== */
#title-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, #0a0a1a 0%, #1a1a3a 50%, #0a1a2a 100%);
    z-index: 100;
    transition: opacity 1s;
}

#title-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.pixel-title {
    font-size: 36px;
    color: #ffd700;
    text-shadow: 
        3px 3px 0 #8b6914,
        -1px -1px 0 #fff8dc;
    letter-spacing: 8px;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { text-shadow: 3px 3px 0 #8b6914, 0 0 10px rgba(255, 215, 0, 0.3); }
    to { text-shadow: 3px 3px 0 #8b6914, 0 0 25px rgba(255, 215, 0, 0.6); }
}

.pixel-subtitle {
    font-size: 11px;
    color: #7799aa;
    letter-spacing: 4px;
    margin-top: 8px;
}

.title-menu {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pixel-btn {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    padding: 10px 32px;
    background: #1a2a3a;
    color: #aaddff;
    border: 2px solid #4488aa;
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.15s;
    image-rendering: pixelated;
}

.pixel-btn:hover {
    background: #2a4a5a;
    color: #ffffff;
    border-color: #66ccee;
    box-shadow: 0 0 12px rgba(100, 200, 255, 0.3);
    transform: scale(1.02);
}

.pixel-btn:active {
    transform: scale(0.98);
}

.title-hint {
    position: absolute;
    bottom: 20px;
    font-size: 10px;
    color: #445566;
    letter-spacing: 2px;
}

/* ===== 对话框 ===== */
#dialogue-box {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    background: rgba(5, 10, 20, 0.92);
    border: 2px solid #3a5a7a;
    padding: 12px 16px;
    z-index: 50;
    min-height: 72px;
    box-shadow: 0 0 20px rgba(0, 50, 100, 0.3);
}

#dialogue-box::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border: 1px solid rgba(100, 180, 255, 0.1);
    pointer-events: none;
}

#speaker-name {
    font-size: 12px;
    color: #ffd700;
    margin-bottom: 6px;
    letter-spacing: 2px;
    text-shadow: 1px 1px 0 rgba(139, 105, 20, 0.5);
}

#dialogue-text {
    font-size: 13px;
    color: #ddeeff;
    line-height: 1.7;
    letter-spacing: 1px;
    min-height: 36px;
}

#dialogue-indicator {
    position: absolute;
    bottom: 6px;
    right: 10px;
    color: #6699aa;
    font-size: 10px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* ===== 幕间标题 ===== */
#act-title {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.95);
    z-index: 80;
    opacity: 0;
    transition: opacity 0.8s;
}

#act-title.show {
    opacity: 1;
}

.act-number {
    font-size: 11px;
    color: #667788;
    letter-spacing: 6px;
    margin-bottom: 12px;
}

.act-name {
    font-size: 22px;
    color: #eeddcc;
    letter-spacing: 6px;
    text-shadow: 2px 2px 0 rgba(100, 80, 60, 0.5);
}

/* ===== 控制栏 ===== */
#controls {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    z-index: 60;
}

.ctrl-btn {
    font-family: 'Courier New', monospace;
    width: 28px;
    height: 28px;
    background: rgba(10, 20, 30, 0.8);
    color: #88aacc;
    border: 1px solid #3a5a7a;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
}

.ctrl-btn:hover {
    background: rgba(30, 60, 90, 0.9);
    color: #ffffff;
}

.ctrl-btn.active {
    background: rgba(40, 80, 120, 0.9);
    border-color: #66ccee;
    color: #66ccee;
}

/* ===== 进度条 ===== */
#progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(20, 30, 40, 0.8);
    z-index: 60;
}

#progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4488aa, #66ccee);
    transition: width 0.3s;
}

/* ===== 工具类 ===== */
.hidden {
    display: none !important;
}

/* ===== 响应式 ===== */
@media (max-width: 680px) {
    #stage-container {
        width: 100vw;
        height: 56.25vw;
        border-width: 2px;
    }
    
    .pixel-title {
        font-size: 24px;
        letter-spacing: 4px;
    }
    
    #dialogue-text {
        font-size: 11px;
    }
}
