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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    background: linear-gradient(135deg,#2d1b2e,#1a1a2e,#1f1f3a);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#game-container {
    width: 1200px;
    height: 675px;
    background: #1a1a2e;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
}

.hidden {
    display: none !important;
}

#start-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    text-align: center;
}

#start-screen h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 20px rgba(255, 255, 255, 0.3); }
    to { text-shadow: 0 0 30px rgba(255, 255, 255, 0.6), 0 0 40px rgba(102, 126, 234, 0.5); }
}

#start-screen p {
    font-size: 1.2em;
    color: #aaa;
    margin-bottom: 40px;
}

#name-input-container {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#name-input-container label {
    font-size: 1em;
    color: #fff;
}

#player-name {
    padding: 12px 20px;
    font-size: 1.1em;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.5);
    border-radius: 10px;
    color: #fff;
    text-align: center;
    width: 250px;
    outline: none;
    transition: all 0.3s ease;
}

#player-name:focus {
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
}

#player-name::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#start-btn, #restart-btn {
    padding: 15px 50px;
    font-size: 1.2em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

#start-btn:hover, #restart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

#game-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #1a1a2e;
    position: relative;
}

#chapter-title {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    z-index: 10;
    backdrop-filter: blur(5px);
}

#status-bar {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 20px;
    border-radius: 10px;
    z-index: 10;
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 150px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.status-label {
    color: #fff;
    font-size: 13px;
    white-space: nowrap;
    flex: 1;
}

.status-bar-container {
    flex: 2;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.status-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ecdc4, #45b7d1);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.status-bar-fill.confidence-value {
    background: linear-gradient(90deg, #ff6b6b, #ff8e53);
    width: 50%;
}

.status-value {
    color: #fff;
    font-size: 13px;
    min-width: 25px;
    text-align: right;
    white-space: nowrap;
}

#scene-image {
    width: 100%;
    height: 100%;
    background: #0f0f1a;
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: 0;
}

#current-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease;
}

#dialogue-box {
    position: absolute;
    bottom: 60px;
    left: 30px;
    right: 30px;
    background: rgba(0, 0, 0, 0.9);
    padding: 20px 25px;
    color: #fff;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    z-index: 5;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

#speaker-name {
    font-size:0px;
    font-weight: bold;
    color: #4ecdc4;
    /* margin-bottom: 8px; */
}

#dialogue-text {
    font-size: 18px;
    line-height: 1.5;
    color: #e0e0e0;
    flex: 1;
}

#choices-container {
    position: absolute;
    bottom: 10px;
    right: 30px;
    left: auto;
    padding: 0;
    display: flex;
    justify-content: flex-end;
    z-index: 5;
}

.choice-btn {
    padding: 10px 20px;
    background: rgba(36, 36, 36, 0.5);
    border: 2px solid #9e9e9eff;
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    text-align: center;
    min-width: 120px;
    margin-left: 10px; 
}

.choice-btn:hover {
    border: 2px solid #ff8b8bff;
    /* background: rgba(78, 205, 196, 0.4); */
    transform: translateY(-2px);
    /* box-shadow: 0 4px 12px rgba(78, 205, 196, 0.3); */
}

#game-info {
    display: none;
    position: absolute;
    bottom: 10px;
    left: 30px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    z-index: 5;
    background: rgba(0, 0, 0, 0.6);
    padding: 5px 12px;
    border-radius: 12px;
}

#ending-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    text-align: center;
    padding: 40px;
}

#ending-image {
    width: 80%;
    max-width: 600px;
    margin-bottom: 30px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#ending-img {
    width: 100%;
    height: auto;
    display: block;
}

#ending-title {
    font-size: 2.5em;
    margin-bottom: 20px;
    animation: glow 2s ease-in-out infinite alternate;
}

#ending-description {
    font-size: 1.2em;
    color: #ccc;
    margin-bottom: 40px;
    line-height: 1.6;
}

@media (max-width: 1250px) {
    #game-container {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
        border-radius: 0;
    }
    
    #start-screen h1, #ending-title {
        font-size: 1.8em;
    }
    
    #dialogue-text {
        font-size: 1em;
    }
    
    .choice-btn {
        font-size: 0.9em;
        padding: 10px 15px;
    }
}

@media (orientation: portrait) {
    body {
        justify-content: flex-start;
        align-items: flex-start;
        overflow: auto;
    }
    
    #game-container {
        width: 100%;
        height: 100vh;
        max-width: none;
        border-radius: 0;
    }
    
    #chapter-title {
        top: 10px;
        left: 10px;
        font-size: 12px;
        padding: 6px 12px;
    }
    
    #status-bar {
        top: 10px;
        right: 10px;
        padding: 10px 15px;
        min-width: 120px;
    }
    
    .status-label {
        font-size: 11px;
    }
    
    .status-bar-container {
        height: 6px;
    }
    
    .status-value {
        font-size: 11px;
        min-width: 20px;
    }
    
    #scene-image {
        width: 100%;
        height: 33.33vh;
        background:transparent;
        top: 20%;
        left: 0;
    }
    
    #current-image {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    #dialogue-box {
        bottom: 300px;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 400px;
        padding: 15px 20px;
        border-radius: 8px;
    }
    
    #speaker-name {
        display: none;
    }
    
    #dialogue-text {
        font-size: 18px;
        line-height: 1.4;
    }
    
    #choices-container {
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 400px;
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
    
    .choice-btn {
        padding: 12px 20px;
        font-size: 14px;
        min-width: auto;
        width: 100%;
        text-align: center;
    }
    
    #game-info {
        bottom: 8px;
        left: 15px;
        font-size: 11px;
        padding: 4px 10px;
    }
    
    #start-screen h1 {
        font-size: 1.8em;
        margin-bottom: 15px;
    }
    
    #start-screen p {
        font-size: 1em;
        margin-bottom: 25px;
    }
    
    #player-name {
        width: 200px;
        font-size: 1em;
        padding: 10px 15px;
    }
    
    #start-btn, #restart-btn {
        padding: 12px 40px;
        font-size: 1em;
    }
    
    #ending-screen {
        padding: 20px;
    }
    
    #ending-image {
        width: 90%;
        margin-bottom: 20px;
    }
    
    #ending-title {
        font-size: 1.8em;
        margin-bottom: 15px;
    }
    
    #ending-description {
        font-size: 1em;
        margin-bottom: 30px;
    }
}