/* ============================================================
 * Jerry的成长日志 — 背景环境音效开关（右下角圆形喇叭按钮）
 * 独立功能模块，与动态背景图（bg-blur.css）解耦。
 * 安全回退：移除音效只需删 index.html 的 audio/button/script、
 *           删本文件、删 assets/rain.mp3 即可，不影响其他逻辑。
 * ============================================================ */

/* 固定右下角的圆形喇叭按钮 */
.ambient-toggle {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(15, 20, 35, 0.62);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #e2e8f0;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 60;                          /* 高于常规内容，低于弹窗遮罩 */
    display: grid;
    place-items: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.42);
    transition: transform 0.15s ease, background 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.ambient-toggle:hover {
    transform: scale(1.08);
    background: rgba(15, 20, 35, 0.82);
}
.ambient-toggle:active {
    transform: scale(0.96);
}

/* 加载失败时优雅降级：图标变暗、不可点，但不影响页面其他功能 */
.ambient-toggle.broken {
    opacity: 0.45;
    cursor: not-allowed;
}
.ambient-toggle.broken:hover {
    transform: none;
    background: rgba(15, 20, 35, 0.62);
}

/* 小屏适配 */
@media (max-width: 600px) {
    .ambient-toggle {
        right: 14px;
        bottom: 14px;
        width: 44px;
        height: 44px;
        font-size: 19px;
    }
}
