* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Microsoft YaHei", sans-serif;
}

body {
    background-color: #111;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

#game-container {
    width: 1280px;
    height: 720px;
    background-color: #2c3e50; /* 默认背景色，后续可以换成背景图 */
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    overflow: hidden;
}

/* 视觉区 (背景和立绘) */
#visual-area {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    display: none;
}

#sprite-img {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 65%; /* 从 85% 缩小到 65%，使人物比例更真实，融入环境 */
    max-width: 90%;
    object-fit: contain; /* 保证图片无论什么尺寸都不会被拉伸变形 */
    z-index: 5; /* 保证立绘在对话框下面，背景图上面 */
    pointer-events: none; /* 穿透点击，防止点不到对话框 */
    display: none; /* 有图时自动显示 */
    animation: spriteFadeIn 0.6s cubic-bezier(0.25, 0.8, 0.25, 1); /* 添加人物出场动画，更有二次元感 */
}

@keyframes spriteFadeIn {
    0% {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* 状态条 */
#status-bar {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 350px;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 15px;
    border-radius: 8px;
    color: white;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px solid rgba(255,255,255,0.2);
}

.status-label {
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
}

.progress-bar-bg {
    flex: 1;
    height: 12px;
    background: #555;
    border-radius: 6px;
    overflow: hidden;
}

#penguin-progress {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    transition: width 0.5s ease-in-out;
}

#penguin-text {
    font-size: 14px;
    font-weight: bold;
}

/* 对话框 */
#dialogue-box {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    min-height: 180px; /* 从固定 height 改为 min-height，让选项能把框撑开 */
    background: rgba(20, 30, 40, 0.85);
    border: 2px solid #5fa6d6;
    border-radius: 12px;
    padding: 20px 30px;
    color: white;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

#speaker-name {
    font-size: 22px;
    font-weight: bold;
    color: #81ecec;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px #000;
}

#dialogue-text {
    font-size: 18px;
    line-height: 1.6;
    letter-spacing: 1px;
}

#next-indicator {
    position: absolute;
    bottom: 15px;
    right: 20px;
    font-size: 20px;
    color: #5fa6d6;
    animation: bounce 1s infinite;
    display: none; /* 默认隐藏，只有文字打完且语音播完才显示 */
}

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

/* 起名界面 */
#name-input-screen {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.name-box {
    background: rgba(30, 40, 50, 0.9);
    padding: 40px;
    border-radius: 12px;
    border: 2px solid #5fa6d6;
    text-align: center;
    color: white;
}

.name-box h2 {
    margin-bottom: 20px;
    color: #81ecec;
}

#player-name-input {
    width: 100%;
    padding: 10px;
    font-size: 18px;
    margin-bottom: 20px;
    border-radius: 6px;
    border: none;
    outline: none;
    text-align: center;
}

#btn-start-game {
    padding: 12px 30px;
    font-size: 18px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

#btn-start-game:hover {
    background: #2980b9;
}

/* 选项 (内嵌在对话框中) */
#inline-options-container {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-btn {
    background: rgba(0, 0, 0, 0.4); /* 透明度降低，与对话框更融合 */
    color: #ecf0f1;
    border: 1px solid rgba(95, 166, 214, 0.5); /* 边框变淡 */
    border-left: 4px solid #3498db; /* 左侧加个小竖条，更有设计感 */
    padding: 10px 15px; 
    font-size: 16px; 
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left; /* 文字左对齐，因为要显示名字 */
}

.option-btn:hover {
    background: rgba(52, 152, 219, 0.4); 
    border-color: #5fa6d6;
    padding-left: 20px; /* hover 时稍微向右推一点，互动感更强 */
}

.option-player-name {
    font-weight: bold;
    color: #f1c40f; /* 玩家名字用显眼的颜色 */
    margin-right: 8px;
}

/* 模态框 (报告) */
#report-modal {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #2c0e0e;
    border: 2px solid #e74c3c;
    width: 800px;
    padding: 40px;
    border-radius: 12px;
    color: #ecf0f1;
    box-shadow: 0 0 40px rgba(231, 76, 60, 0.6);
}

.modal-title {
    color: #e74c3c;
    font-size: 28px;
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 10px;
    margin-bottom: 25px;
    text-align: center;
    text-shadow: 0 0 10px rgba(231,76,60,0.5);
}

.report-section {
    margin-bottom: 20px;
}

.report-section h3 {
    margin-bottom: 8px;
    font-size: 20px;
}

.report-section:nth-of-type(1) h3 { color: #e74c3c; }
.report-section:nth-of-type(2) h3 { color: #e67e22; }
.report-section:nth-of-type(3) h3 { color: #2ecc71; }

.report-section p {
    font-size: 16px;
    line-height: 1.6;
    color: #bdc3c7;
    background: rgba(0,0,0,0.4);
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid transparent;
}

.report-section:nth-of-type(1) p { border-left-color: #e74c3c; }
.report-section:nth-of-type(2) p { border-left-color: #e67e22; }
.report-section:nth-of-type(3) p { border-left-color: #2ecc71; }

#btn-restart {
    display: block;
    margin: 30px auto 0;
    padding: 12px 40px;
    font-size: 18px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: bold;
}

#btn-restart:hover {
    background: #c0392b;
}

/* 结局视频 */
#cg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* 从 cover 改为 contain，保证视频按原比例完整显示，不被裁剪 */
    z-index: 200; /* 盖住所有东西 */
    background: black; /* 视频上下或左右的黑边 */
}

.hidden {
    display: none !important;
}