/* 游乐场各游戏共用的样式：只放所有游戏都一样的"外框"——返回、静音按钮
   和几条全局规则。HUD、遮罩、按键这些每个游戏单独调过的仍然写在各自
   页面的 <style> 里（在本文件之后，同名规则以页面里的为准）。
   颜色用各页面 :root 里定义的 --primary。 */

/* 从首页/游乐场跳进来时上一页选择进了浏览器原生跨页面转场
   （@view-transition），这边不选择进转场会被中止，控制台报错 */
@view-transition {
    navigation: auto;
}

* { box-sizing: border-box; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 按钮/链接关掉双击放大（防缩放脚本对它们不拦 touchend，见 game-kit.js） */
button, a { touch-action: manipulation; }

.back-home {
    position: fixed;
    z-index: 60;
    top: calc(10px + env(safe-area-inset-top));
    left: calc(10px + env(safe-area-inset-left));
    font-size: 12px;
    letter-spacing: 1px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* 高度跟静音按钮一样凑够 32px（全站最小点击尺寸），文字用 flex 居中 */
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border-radius: 2px;
}
.back-home:active { background: rgba(255, 255, 255, 0.1); }

/* 32×32：全站小按钮统一的最小点击尺寸 */
.mute-btn {
    position: fixed;
    z-index: 60;
    top: calc(10px + env(safe-area-inset-top));
    right: calc(10px + env(safe-area-inset-right));
    width: 32px;
    height: 32px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
}
.mute-btn:active { background: rgba(255, 255, 255, 0.1); }

.back-home:focus-visible,
.mute-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
