/* === 三体 NDS像素舞台剧 - 样式表 === */

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

body {
    background: #1a1a2e;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: monospace;
    overflow: hidden;
    image-rendering: pixelated;
}

/* NDS主机外壳 */
#nds-console {
    background: linear-gradient(180deg, #c8c8d0 0%, #a8a8b0 100%);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 
        0 8px 32px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.3),
        inset 0 -2px 4px rgba(0,0,0,0.2);
    border: 2px solid #888;
    position: relative;
}

/* 屏幕容器 */
.nds-screen-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nds-screen {
    width: 512px;
    height: 384px;
    background: #000;
    border: 4px solid #2a2a2a;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        inset 0 0 20px rgba(0,0,0,0.8),
        0 0 0 2px #555;
}

.nds-screen canvas {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.screen-label {
    font-size: 9px;
    color: #666;
    letter-spacing: 3px;
    margin-top: 4px;
    text-transform: uppercase;
}

/* NDS铰链 */
.nds-hinge {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 16px;
    margin: 6px 0;
}

.hinge-left, .hinge-right {
    width: 60px;
    height: 8px;
    background: linear-gradient(180deg, #999 0%, #777 100%);
    border-radius: 4px;
}

.hinge-center {
    width: 40px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.power-led {
    width: 6px;
    height: 6px;
    background: #00ff44;
    border-radius: 50%;
    box-shadow: 0 0 6px #00ff44;
    animation: led-pulse 2s infinite;
}

@keyframes led-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 控制区 */
.nds-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    margin-top: 8px;
}

.dpad {
    display: grid;
    grid-template-columns: 20px 20px 20px;
    grid-template-rows: 20px 20px 20px;
    gap: 1px;
}

.dpad-up { grid-column: 2; grid-row: 1; }
.dpad-left { grid-column: 1; grid-row: 2; }
.dpad-center { grid-column: 2; grid-row: 2; }
.dpad-right { grid-column: 3; grid-row: 2; }
.dpad-down { grid-column: 2; grid-row: 3; }

.dpad > div {
    background: linear-gradient(180deg, #555 0%, #333 100%);
    border-radius: 2px;
}

.dpad-center {
    border-radius: 50%;
}

.control-buttons {
    display: flex;
    gap: 12px;
}

.btn-ab {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #555;
    background: linear-gradient(180deg, #666 0%, #444 100%);
    color: #ddd;
    font-family: monospace;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.btn-ab:active {
    transform: scale(0.9);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

#btn-a {
    background: linear-gradient(180deg, #cc4444 0%, #992222 100%);
    border-color: #aa3333;
}

#btn-b {
    background: linear-gradient(180deg, #4444cc 0%, #222299 100%);
    border-color: #3333aa;
}

.start-select {
    display: flex;
    gap: 8px;
}

.btn-ss {
    padding: 4px 12px;
    border-radius: 8px;
    border: 1px solid #555;
    background: linear-gradient(180deg, #555 0%, #333 100%);
    color: #aaa;
    font-family: monospace;
    font-size: 8px;
    cursor: pointer;
    letter-spacing: 1px;
}

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

/* 对话系统 */
.dialogue-box {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    background: rgba(0, 0, 40, 0.92);
    border: 2px solid #4488ff;
    border-radius: 4px;
    padding: 10px 12px;
    min-height: 80px;
}

.speaker-name {
    color: #ffcc00;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 6px;
    text-shadow: 1px 1px 0 #000;
    letter-spacing: 1px;
}

.dialogue-text {
    color: #ffffff;
    font-size: 11px;
    line-height: 1.6;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
    min-height: 36px;
}

.dialogue-indicator {
    position: absolute;
    bottom: 6px;
    right: 10px;
    color: #4488ff;
    font-size: 10px;
    animation: bounce 0.8s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

/* 旁白框 */
.narration-box {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid #666;
    border-radius: 4px;
    padding: 12px;
}

.narration-text {
    color: #cccccc;
    font-size: 11px;
    line-height: 1.6;
    font-style: italic;
    text-align: center;
}

/* 选择框 */
.choices-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 40, 0.95);
    border: 2px solid #ffcc00;
    border-radius: 4px;
    padding: 12px;
    min-width: 200px;
}

.choice-item {
    color: #fff;
    font-size: 11px;
    padding: 8px 12px;
    cursor: pointer;
    border: 1px solid transparent;
    margin: 4px 0;
    transition: all 0.15s;
}

.choice-item:hover, .choice-item.selected {
    background: rgba(68, 136, 255, 0.3);
    border-color: #4488ff;
    color: #ffcc00;
}

/* 幕标题 */
.act-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    text-shadow: 2px 2px 0 #000, 0 0 10px rgba(68,136,255,0.5);
    letter-spacing: 4px;
    z-index: 10;
    transition: opacity 0.5s;
}

.act-title .act-sub {
    font-size: 11px;
    color: #aaa;
    margin-top: 8px;
    letter-spacing: 2px;
}

/* 上屏字幕 */
.subtitle-top {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 10px;
    background: rgba(0,0,0,0.7);
    padding: 4px 10px;
    border-radius: 2px;
    white-space: nowrap;
}

/* 标题画面 */
.title-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000010;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 1s;
}

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

.title-content {
    text-align: center;
    position: relative;
}

.title-stars {
    position: absolute;
    top: -100px;
    left: -200px;
    right: -200px;
    bottom: -100px;
    pointer-events: none;
}

.game-title {
    font-size: 64px;
    color: #fff;
    text-shadow: 
        0 0 20px rgba(68,136,255,0.8),
        0 0 40px rgba(68,136,255,0.4),
        3px 3px 0 #112;
    letter-spacing: 20px;
    margin-bottom: 12px;
}

.game-subtitle {
    font-size: 14px;
    color: #4488ff;
    letter-spacing: 6px;
    margin-bottom: 20px;
}

.game-credit {
    font-size: 11px;
    color: #666;
    margin-bottom: 40px;
}

.press-start {
    font-size: 13px;
    color: #ffcc00;
    letter-spacing: 2px;
}

.blink {
    animation: blink-anim 1.2s infinite;
}

@keyframes blink-anim {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* 转场效果 */
.transition-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 100;
    pointer-events: none;
}

/* 响应式 */
@media (max-width: 600px) {
    #nds-console {
        padding: 10px;
        border-radius: 8px;
    }
    .nds-screen {
        width: 320px;
        height: 240px;
    }
    .game-title {
        font-size: 40px;
        letter-spacing: 12px;
    }
}
