/* ===== 游戏主场景 - 视觉小说风格 ===== */
#game-screen {
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* 背景图 */
.game-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    filter: brightness(0.7) saturate(0.8);
}

/* 女孩立绘 */
.character-layer {
    position: absolute;
    bottom: 30%;
    left: 5%;
    z-index: 2;
    height: 50%;
    max-height: 400px;
}

.character-sprite {
    height: 100%;
    width: auto;
    max-width: 300px;
    object-fit: contain;
    filter: brightness(0.9) contrast(1.1);
    transition: opacity 0.5s ease;
}

/* ===== HUD ===== */
.game-hud {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(5, 5, 8, 0.6) 0%, transparent 100%);
}

.hud-left, .hud-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hud-center {
    display: flex;
    align-items: center;
}

/* 回合显示 - 红色进度条 */
.round-display {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.round-label {
    font-size: 11px;
    color: var(--color-text-dim);
    letter-spacing: 1px;
}

.round-bar {
    width: 120px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.round-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--color-danger), #f87171);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.round-count {
    font-size: 12px;
    color: var(--color-text-dim);
    font-variant-numeric: tabular-nums;
}

/* 寻找线索按钮 */
.hint-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(182, 108, 255, 0.1);
    border: 1px solid rgba(182, 108, 255, 0.25);
    border-radius: 20px;
    color: var(--color-text);
    font-family: var(--font-main);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.hint-btn:hover {
    background: rgba(182, 108, 255, 0.2);
    border-color: rgba(182, 108, 255, 0.4);
}

.hint-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.hint-icon {
    font-size: 14px;
}

.hint-count {
    color: var(--color-accent-light);
    font-size: 11px;
}

/* HUD 按钮 */
.hud-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--color-text-dim);
    font-family: var(--font-main);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.hud-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text);
}

.hud-btn svg {
    opacity: 0.7;
}

/* ===== 对话面板（视觉小说风格） ===== */
.dialogue-panel {
    position: absolute;
    bottom: 70px;
    left: 16px;
    right: 16px;
    z-index: 8;
    background: var(--color-overlay);
    border: 1px solid rgba(182, 108, 255, 0.1);
    border-radius: 12px;
    padding: 20px 24px;
    backdrop-filter: blur(10px);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dialogue-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-accent-light);
    letter-spacing: 2px;
}

.dialogue-content {
    flex: 1;
    overflow-y: auto;
}

.dialogue-text {
    font-size: 15px;
    line-height: 1.9;
    color: var(--color-text);
    letter-spacing: 0.3px;
}

/* 打字机光标 */
.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--color-accent);
    margin-left: 2px;
    animation: blink 0.8s ease-in-out infinite;
    vertical-align: text-bottom;
}

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

/* ===== 等待演出 ===== */
.waiting-overlay {
    position: absolute;
    bottom: 70px;
    left: 16px;
    right: 16px;
    z-index: 9;
    background: var(--color-overlay);
    border: 1px solid rgba(182, 108, 255, 0.1);
    border-radius: 12px;
    padding: 20px 24px;
    backdrop-filter: blur(10px);
    min-height: 120px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.waiting-overlay.active {
    display: flex;
}

.waiting-text {
    font-size: 14px;
    color: var(--color-text-dim);
    letter-spacing: 2px;
    animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

.waiting-dots {
    display: flex;
    gap: 6px;
}

.waiting-dots span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--color-accent);
    animation: dotPulse 1.4s ease-in-out infinite;
}

.waiting-dots span:nth-child(2) { animation-delay: 0.2s; }
.waiting-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ===== 输入区域 ===== */
.input-area {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    z-index: 10;
    display: flex;
    gap: 10px;
}

.game-input {
    flex: 1;
    padding: 12px 18px;
    background: rgba(10, 10, 20, 0.9);
    border: 1px solid rgba(182, 108, 255, 0.25);
    border-radius: 10px;
    color: var(--color-text);
    font-family: var(--font-main);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition-normal);
}

.game-input::placeholder {
    color: var(--color-text-dim);
    opacity: 0.6;
}

.game-input:focus {
    border-color: rgba(182, 108, 255, 0.5);
    box-shadow: 0 0 15px rgba(182, 108, 255, 0.1);
}

.game-input:disabled {
    opacity: 0.4;
}

.send-btn {
    padding: 12px 24px;
    background: var(--color-accent-dark);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.send-btn:hover {
    background: var(--color-accent);
    box-shadow: 0 0 20px rgba(182, 108, 255, 0.3);
}

.send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    box-shadow: none;
}

/* ===== 游戏内菜单 ===== */
.game-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20;
    backdrop-filter: blur(4px);
}

.game-menu-overlay.active {
    display: flex;
}

.game-menu-panel {
    background: rgba(10, 10, 20, 0.95);
    border: 1px solid rgba(182, 108, 255, 0.2);
    border-radius: 12px;
    padding: 8px;
    min-width: 200px;
}

.game-menu-btn {
    display: block;
    width: 100%;
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: var(--color-text);
    font-family: var(--font-main);
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    border-radius: 8px;
    transition: all var(--transition-normal);
}

.game-menu-btn:hover {
    background: rgba(182, 108, 255, 0.1);
    color: var(--color-accent-light);
}

.game-menu-btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}

/* 额外回合提示 */
.bonus-round-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(182, 108, 255, 0.15);
    border: 1px solid rgba(182, 108, 255, 0.3);
    color: var(--color-accent-light);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    letter-spacing: 2px;
    z-index: 15;
    animation: toastIn 0.5s ease, toastOut 0.5s ease 2s forwards;
    pointer-events: none;
}

@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
    .character-layer {
        left: 0;
        bottom: 32%;
        height: 40%;
    }
    
    .dialogue-panel {
        bottom: 64px;
        left: 10px;
        right: 10px;
        padding: 16px 18px;
        min-height: 100px;
    }
    
    .waiting-overlay {
        bottom: 64px;
        left: 10px;
        right: 10px;
    }
    
    .input-area {
        bottom: 10px;
        left: 10px;
        right: 10px;
    }
    
    .round-bar {
        width: 80px;
    }
    
    .hint-btn span:not(.hint-icon):not(.hint-count) {
        display: none;
    }
}
