/* --- 基础页面重置与居中 --- */
body {
    margin: 0; 
    padding: 0; 
    
    /* 在图片上叠加一层 60% 透明度的黑色，让背景暗下来 */
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), 
        url('./assets/bg.webp'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

    display: flex; 
    justify-content: center; 
    align-items: center;
    height: 100vh; 
    overflow: hidden; 
    font-family: sans-serif;
}

/* --- 画布容器 --- */
#canvas-container {
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

/* --- 主画布 --- */
canvas {
    display: block;
    max-width: 100vw;
    max-height: 100vh;
}

/* --- 启动遮罩层 --- */
#audio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    color: #a8d8c8;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    cursor: pointer;
    transition: opacity 0.5s ease;
}

#audio-overlay h1 {
    letter-spacing: 5px;
    font-weight: 300;
}

#audio-overlay p {
    font-size: 14px;
    opacity: 0.7;
}

/* --- 右下角悬浮摄像头窗口 --- */
#webcam {
    display: block;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 240px;      /* 窗口宽度，可自行调整 */
    height: auto;
    border: 2px solid rgba(168, 216, 200, 0.6);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    transform: scaleX(-1); /* 水平镜像翻转，像照镜子一样 */
    z-index: 1000;         /* 确保在最上层显示 */
    object-fit: cover;
    opacity: 0.85;
    transition: opacity 0.3s ease;
    pointer-events: none;  /* 防止遮挡鼠标点击事件 */
}

/* 鼠标悬停时恢复清晰度 */
#webcam:hover {
    opacity: 1;
}
/* 左上角计数模块样式 */
#score-board {
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 12px 24px;
    background: rgba(10, 20, 20, 0.8); /* 半透明深色底 */
    backdrop-filter: blur(8px); /* 背景模糊 */
    color: #a8d8c8; /* 主题青绿色 */
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 2px;
    border: 2px solid rgba(168, 216, 200, 0.4);
    border-radius: 8px;
    z-index: 1000; /* 确保在最上层 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    pointer-events: none; /* 防止点击到它 */
    transition: all 0.3s ease;
}

/* 数字部分高亮 */
#score-count {
    color: #fff;
    font-size: 24px;
    text-shadow: 0 0 10px rgba(200, 255, 240, 0.8);
}

#total-count {
    font-size: 16px;
    opacity: 0.7;
}