/* =====================================================================
   AdisArcade runtime — 共通ステージ / HUD / トグル
   2モード: background(トップ背景フル画面) / page(アーカイブ個別の枠内)
   ===================================================================== */

/* ---- ステージ: background = 背景フル画面 ---- */
.arcade-stage[data-mode="background"] {
    position: fixed;
    inset: 0;
    z-index: -1;            /* 背景FX(-2)の手前・本文(0)の奥 */
    pointer-events: none;
    overflow: hidden;
}
.arcade-stage[data-mode="background"] .arcade-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* ---- ステージ: page = アーカイブ個別の 16:9 枠 ---- */
.arcade-stage[data-mode="page"] {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: rgba(10, 9, 8, 0.4);
    border: 1px solid rgba(242, 238, 227, 0.14);
    overflow: hidden;
}
.arcade-stage[data-mode="page"] .arcade-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

/* ---- HUD (共通) ---- */
.arcade-hud {
    z-index: 30;
    pointer-events: none;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    color: #FFD500;
    user-select: none;
    text-align: right;
}
.arcade-stage[data-mode="background"] .arcade-hud {
    position: fixed;
    top: 50%;
    right: clamp(10px, 2.2vw, 30px);
    transform: translateY(-50%);
}
.arcade-stage[data-mode="page"] .arcade-hud {
    position: absolute;
    top: 14px;
    right: 14px;
}
.arcade-hud-label {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(242, 238, 227, 0.55);
}
.arcade-hud-score {
    font-weight: 700;
    line-height: 0.95;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 18px rgba(255, 213, 0, 0.55);
    transition: transform 0.08s ease;
}
.arcade-stage[data-mode="background"] .arcade-hud-score { font-size: clamp(34px, 5vw, 60px); }
.arcade-stage[data-mode="page"]       .arcade-hud-score { font-size: clamp(26px, 4vw, 40px); }
.arcade-hud-score.bump { transform: scale(1.16); }
.arcade-hud-hi {
    font-size: 11px;
    letter-spacing: 0.12em;
    color: rgba(242, 238, 227, 0.7);
    margin-top: 6px;
}
.arcade-hud-lives {
    margin-top: 12px;
    font-size: 15px;
    letter-spacing: 4px;
    min-height: 18px;
    text-shadow: 0 0 10px rgba(255, 213, 0, 0.5);
}
.arcade-hud-lives .lost { color: rgba(242, 238, 227, 0.18); text-shadow: none; }
.arcade-hud-meters {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-end;
}
.arcade-meter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 9px;
    letter-spacing: 0.14em;
    line-height: 1;
    text-transform: uppercase;
    color: #0A0908;
    background: #FFD500;
    padding: 3px 6px;
}
.arcade-meter i { font-style: normal; font-weight: 700; }
.arcade-meter .bar { position: relative; width: 34px; height: 3px; background: rgba(10, 9, 8, 0.3); overflow: hidden; }
.arcade-meter .bar > span { position: absolute; left: 0; top: 0; bottom: 0; background: #0A0908; }

/* ---- トグル (background のみ・右下・これだけクリック可) ---- */
.arcade-toggle {
    position: fixed;
    right: clamp(10px, 2.2vw, 22px);
    bottom: clamp(10px, 2.2vw, 22px);
    z-index: 30;
    pointer-events: auto;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    background: rgba(10, 9, 8, 0.55);
    border: 1px solid rgba(242, 238, 227, 0.2);
    color: rgba(242, 238, 227, 0.8);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    transition: border-color 0.2s, color 0.2s;
}
.arcade-toggle:hover { border-color: #FFD500; color: #FFD500; }
.arcade-toggle-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #FFD500;
    box-shadow: 0 0 8px rgba(255, 213, 0, 0.8);
}
.arcade-toggle.is-off .arcade-toggle-dot { background: rgba(242, 238, 227, 0.3); box-shadow: none; }
.arcade-toggle.is-off .arcade-toggle-label::after { content: ' OFF'; }

/* ---- モバイル/タッチ・モーション抑制では background を一切出さない (JSも起動しない) ---- */
@media (max-width: 1023px) {
    .arcade-stage[data-mode="background"] { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
    .arcade-stage[data-mode="background"] { display: none !important; }
}
