/* =============================================================
   404 CRISIS — styles
   偽404ページ（白）→ 崩壊 → 虚空（暗）＋HUD
   UIはビットマップ系フォント（DotGothic16 / VT323 / Press Start 2P）
   ============================================================= */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #04060c;
    --ink: #eef1f7;
    --dim: rgba(238, 241, 247, 0.62);
    --mute: rgba(238, 241, 247, 0.36);
    --line: rgba(238, 241, 247, 0.16);
    --red: #ff2a3c;
    --green: #29ff8e;
    --mono: "VT323", ui-monospace, SFMono-Regular, Menlo, monospace;
    --jp: "DotGothic16", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
    --disp: "Press Start 2P", "DotGothic16", monospace;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background: #ffffff;
    font-family: var(--jp);
    touch-action: none;
    overscroll-behavior: none;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.8s ease;
}

body.breached {
    background: var(--bg);
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}

body:has(#hud:not(.hidden)) { cursor: none; }
body:has(#hud:not(.hidden)) .ui-stop { cursor: pointer; }

/* スマホでのみ有効な改行 */
.sp { display: none; }

.fatal-message {
    position: fixed;
    inset: auto 0 40px 0;
    text-align: center;
    color: #333;
    font-size: 14px;
    font-family: system-ui, sans-serif;
}

/* ============ WebGL キャンバス ============ */
#gl {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0;
    transition: opacity 1.1s ease;
}

body.breached #gl { opacity: 1; }

/* ============ 偽の404ページ ============ */
#fakepage {
    position: fixed;
    inset: 0;
    z-index: 10;
    background: #ffffff;
    transition: background 0.5s ease;
}

body.breached #fakepage { background: transparent; pointer-events: none; }

#fpCard, .fp-clone {
    position: absolute;
    top: 0;
    left: 0;
    width: min(860px, 92vw);
    padding: 28px 8px 0 24px;
    font-family: "Times New Roman", "Hiragino Mincho ProN", serif;
    color: #000;
}

#fpCard h1, .fp-clone h1 {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 0.65em;
}

#fpCard .fp-en, .fp-clone .fp-en { font-size: 16px; margin-bottom: 0.8em; }

#fpCard .fp-jp, .fp-clone .fp-jp {
    font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
    font-size: 13px;
    color: #444;
    margin-bottom: 1.2em;
}

#fpCard hr, .fp-clone hr { border: none; border-top: 1px solid #999; margin-bottom: 6px; }

#fpCard address, .fp-clone address { font-style: italic; font-size: 14px; color: #222; }

/* --- 段階1：微グリッチ --- */
body.glitch-1 #fpCard { animation: microjit 2.4s steps(1) infinite; }

@keyframes microjit {
    0%, 92% { transform: none; text-shadow: none; filter: none; }
    93% { transform: translate(2px, -1px) skewX(0.6deg); text-shadow: -2px 0 #f0f, 2px 0 #0ff; }
    94% { transform: translate(-3px, 1px); text-shadow: 3px 0 #f00; }
    95% { transform: none; text-shadow: none; }
    97% { transform: translate(1px, 0) scaleY(1.02); filter: invert(1); }
    97.6% { transform: none; filter: none; }
}

/* --- 段階2：本格グリッチ --- */
body.glitch-2 #fpCard { animation: hardjit 0.9s steps(1) infinite; }

@keyframes hardjit {
    0% { transform: none; text-shadow: none; clip-path: none; }
    12% { transform: translate(-6px, 2px) skewX(-2deg); text-shadow: -4px 0 #f0f, 4px 0 #0ff; }
    18% { transform: translate(4px, -3px); clip-path: polygon(0 0, 100% 0, 100% 42%, 0 46%, 0 58%, 100% 55%, 100% 100%, 0 100%); }
    26% { transform: none; text-shadow: none; clip-path: none; }
    48% { transform: translate(8px, 0) scaleX(0.98); text-shadow: 6px 0 #f00; }
    54% { transform: none; text-shadow: none; }
    76% { transform: translate(-3px, 5px) skewY(1deg); filter: invert(1); }
    80% { transform: none; filter: none; }
}

body.glitch-2 #fakepage { animation: pageflash 0.9s steps(1) infinite; }

@keyframes pageflash {
    0%, 74% { background: #fff; }
    76% { background: #f4f4f4; }
    77% { background: #fff; }
    91% { background: #ffecec; }
    93% { background: #fff; }
}

/* --- 侵入ログ --- */
#breachLog {
    position: absolute;
    left: 24px;
    bottom: 26px;
    font-family: var(--mono);
    font-size: 17px;
    line-height: 1.7;
    color: #c40016;
    white-space: pre;
}

/* --- DOM破片 --- */
#shards { position: fixed; inset: 0; z-index: 11; pointer-events: none; }

.dom-shard {
    position: fixed;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.18);
    transition: transform 1.25s cubic-bezier(0.18, 0.6, 0.24, 1), opacity 1.15s ease;
    opacity: 1;
    will-change: transform, opacity;
}

.dom-shard .fp-clone { position: absolute; top: 0; left: 0; }

/* ============ スティンガー ============ */
#stinger {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(ellipse at 50% 42%, rgba(10, 16, 30, 0.3), rgba(4, 6, 12, 0.72) 75%);
    padding: 20px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
}

#stinger.show {
    opacity: 1;
    visibility: visible;
    animation: stingerin 0.4s steps(4) both;
}

/* transformやblurは使わない（大画面要素のアニメは重い）。opacityのみ */
@keyframes stingerin {
    from { opacity: 0.15; }
    to { opacity: 1; }
}

.stinger-inner { will-change: opacity; }

.stinger-eyebrow {
    font-family: var(--mono);
    font-size: 16px;
    letter-spacing: 0.28em;
    color: var(--red);
    margin-bottom: 20px;
    animation: blinktext 0.8s steps(2) infinite;
}

@keyframes blinktext { 50% { opacity: 0.35; } }

.logo { line-height: 1; user-select: none; }

.logo .l404 {
    position: relative;
    display: block;
    font-family: var(--disp);
    font-weight: 400;
    font-size: clamp(64px, 19vw, 150px);
    letter-spacing: 0.04em;
    color: var(--ink);
    text-shadow: 0 0 42px rgba(238, 241, 247, 0.35);
}

.logo .l404::before,
.logo .l404::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.logo .l404::before {
    color: #ff2a6a;
    transform: translate(-4px, 0);
    animation: sliceA 1.4s steps(1) infinite;
    opacity: 0.85;
}

.logo .l404::after {
    color: #21e6ff;
    transform: translate(4px, 0);
    animation: sliceB 1.1s steps(1) infinite;
    opacity: 0.85;
}

@keyframes sliceA {
    0%, 68% { clip-path: inset(100% 0 0 0); transform: translate(-4px, 0); }
    72% { clip-path: inset(12% 0 64% 0); transform: translate(-9px, 2px); }
    78% { clip-path: inset(58% 0 18% 0); transform: translate(-5px, -2px); }
    84% { clip-path: inset(100% 0 0 0); }
}

@keyframes sliceB {
    0%, 60% { clip-path: inset(100% 0 0 0); transform: translate(4px, 0); }
    64% { clip-path: inset(64% 0 8% 0); transform: translate(10px, -2px); }
    72% { clip-path: inset(6% 0 76% 0); transform: translate(6px, 3px); }
    78% { clip-path: inset(100% 0 0 0); }
}

.logo .lcrisis {
    display: block;
    font-family: var(--disp);
    font-size: clamp(17px, 4.6vw, 34px);
    letter-spacing: 0.6em;
    text-indent: 0.6em;
    color: transparent;
    -webkit-text-stroke: 1px var(--ink);
    margin-top: 22px;
}

.stinger-sub {
    font-family: var(--jp);
    font-size: 15px;
    letter-spacing: 0.14em;
    color: var(--dim);
    margin-top: 26px;
}

.stinger-sound {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
}

.btn-soundtoggle {
    font-family: var(--mono);
    font-size: 15px;
    letter-spacing: 0.2em;
    padding: 8px 22px;
}

.btn-soundtoggle.off { color: var(--red); border-color: var(--red); }

.stinger-diff {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 16px;
}

.stinger-diff .btn-main { min-width: 200px; }

.btn-main.btn-hard {
    background: transparent;
    color: var(--red);
    border: 1px solid var(--red);
    padding: 14px 43px;
}

.btn-main.btn-hard:hover { background: var(--red); color: #fff; }

.stinger-foot {
    pointer-events: auto;
    margin-top: 30px;
    font-family: var(--jp);
    font-size: 12px;
    letter-spacing: 0.1em;
    color: var(--mute);
}

.stinger-foot a {
    color: var(--mute);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.stinger-foot a:hover { color: var(--ink); border-color: var(--ink); }

.stinger-foot .sf-sep { margin: 0 0.8em; opacity: 0.5; }

/* OGP撮影時はボタン・フッターを隠し、ロゴを大きく */
body.ogp .stinger-sound,
body.ogp .stinger-diff,
body.ogp .stinger-foot { display: none; }

body.ogp .logo .l404 { font-size: 250px; }
body.ogp .logo .lcrisis { font-size: 56px; margin-top: 34px; }
body.ogp .stinger-sub { font-size: 26px; margin-top: 40px; }

/* ============ HUD ============ */
#hud {
    position: fixed;
    inset: 0;
    z-index: 30;
    pointer-events: none;
    transition: opacity 0.4s;
}

#hud.hidden { opacity: 0; visibility: hidden; }

.hud-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: calc(14px + env(safe-area-inset-top)) calc(18px + env(safe-area-inset-right)) 0 calc(18px + env(safe-area-inset-left));
}

#statusLine {
    font-family: var(--mono);
    font-size: 17px;
    letter-spacing: 0.1em;
    color: var(--mute);
    margin-bottom: 7px;
}

#statusLine b { color: var(--red); font-weight: 400; }
#statusLine b.ok { color: var(--green); }

.restore { display: flex; align-items: baseline; gap: 9px; }

.restore-label {
    font-family: var(--mono);
    font-size: 14px;
    letter-spacing: 0.26em;
    color: var(--dim);
}

#restoreNum {
    font-family: var(--disp);
    font-size: 27px;
    line-height: 1;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.restore-goal { font-family: var(--mono); font-size: 17px; color: var(--mute); }

.restore-track {
    width: 168px;
    height: 4px;
    background: rgba(238, 241, 247, 0.14);
    margin-top: 9px;
    overflow: hidden;
}

#restoreBar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--red), var(--green));
    transition: width 0.25s ease;
}

.hud-center { text-align: center; padding-top: 4px; }

#waveLabel {
    font-family: var(--mono);
    font-size: 16px;
    letter-spacing: 0.22em;
    color: var(--dim);
}

#waveLabel span { color: var(--red); margin-left: 0.8em; }

#timerBox {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
}

.timer-label {
    font-family: var(--mono);
    font-size: 14px;
    letter-spacing: 0.3em;
    color: var(--dim);
}

#timerVal {
    font-family: var(--disp);
    font-size: 21px;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    position: relative;
    top: 3px;   /* Press Start 2P は字面が上寄りなのでベースラインを揃える */
}

#timerBox.low .timer-label { color: var(--red); }

#timerBox.low #timerVal {
    color: var(--red);
    text-shadow: 0 0 14px rgba(255, 42, 60, 0.6);
    animation: blinktext 0.5s steps(2) infinite;
}

.hud-conn { text-align: right; }

.conn-label {
    display: block;
    font-family: var(--mono);
    font-size: 14px;
    letter-spacing: 0.26em;
    color: var(--dim);
    margin-bottom: 7px;
}

#hpPips { display: flex; gap: 5px; justify-content: flex-end; }

#hpPips i {
    width: 26px;
    height: 9px;
    background: var(--green);
    box-shadow: 0 0 8px rgba(41, 255, 142, 0.55);
    transition: background 0.25s, box-shadow 0.25s;
}

#hpPips i.off { background: rgba(238, 241, 247, 0.12); box-shadow: none; }

/* --- 下段 --- */
.hud-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0 calc(16px + env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
}

.zone {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 118px;
    height: 92px;
    background: rgba(8, 12, 22, 0.42);
    border: 1px solid var(--line);
    color: var(--dim);
    font-family: var(--mono);
    font-size: 18px;
    letter-spacing: 0.24em;
    text-indent: 0.24em;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.zone span { font-size: 16px; line-height: 1; }

.zone:active {
    background: rgba(238, 241, 247, 0.88);
    color: #050608;
    border-color: var(--ink);
}

.ammo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
}

#ammoPips { display: flex; gap: 6px; align-items: flex-end; }

#ammoPips i {
    width: 9px;
    height: 26px;
    background: var(--ink);
    box-shadow: 0 0 6px rgba(238, 241, 247, 0.4);
    transition: background 0.12s, box-shadow 0.12s;
}

#ammoPips i.off { background: rgba(238, 241, 247, 0.14); box-shadow: none; }

#ammoPips.reloading i { animation: pipblink 0.3s steps(2) infinite; }

@keyframes pipblink { 50% { background: rgba(238, 241, 247, 0.35); } }

#btnReload {
    font-family: var(--mono);
    font-size: 17px;
    letter-spacing: 0.22em;
    text-indent: 0.22em;
    color: var(--dim);
    background: rgba(8, 12, 22, 0.42);
    border: 1px solid var(--line);
    padding: 7px 26px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

#btnReload:active { background: var(--ink); color: #050608; }

#reloadHint {
    font-family: var(--mono);
    font-size: 14px;
    letter-spacing: 0.18em;
    color: var(--mute);
}

#reloadHint.urgent {
    color: var(--red);
    animation: blinktext 0.5s steps(2) infinite;
}

.hud-mute {
    position: absolute;
    top: calc(78px + env(safe-area-inset-top));
    right: calc(18px + env(safe-area-inset-right));
    pointer-events: auto;
    width: 32px;
    height: 32px;
}

.hud-title {
    position: absolute;
    top: calc(120px + env(safe-area-inset-top));
    right: calc(18px + env(safe-area-inset-right));
    pointer-events: auto;
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.16em;
    color: var(--dim);
    background: rgba(8, 12, 22, 0.42);
    border: 1px solid var(--line);
    padding: 6px 10px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.hud-title:hover { color: var(--ink); border-color: var(--ink); }

.btn-mute {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 12, 22, 0.42);
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--dim);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.btn-mute:hover { color: var(--ink); border-color: var(--ink); }
.btn-mute svg { width: 16px; height: 16px; }
.btn-mute .sx { display: none; }
.btn-mute.muted .sw { display: none; }
.btn-mute.muted .sx { display: block; }
.btn-mute.muted { color: var(--red); border-color: var(--red); }

/* ============ クロスヘア ============ */
#crosshair {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 40;
    pointer-events: none;
    display: none;
    mix-blend-mode: difference;
}

#hud:not(.hidden) + #crosshair { display: block; }

#crosshair i {
    position: absolute;
    left: -17px;
    top: -17px;
    width: 34px;
    height: 34px;
    border: 2px solid #fff;
    transition: opacity 0.2s;
}

#crosshair i::before,
#crosshair i::after {
    content: '';
    position: absolute;
    background: #fff;
}

#crosshair i::before { left: 50%; top: -9px; width: 2px; height: 48px; transform: translateX(-50%); }
#crosshair i::after { top: 50%; left: -9px; height: 2px; width: 48px; transform: translateY(-50%); }

#crosshair.pop i { animation: chpop 0.16s steps(3); }

@keyframes chpop { 40% { transform: scale(0.72); } }

#crosshair.dim { opacity: 0.25; }

/* ============ ヒント ============ */
#hint {
    position: fixed;
    left: 50%;
    bottom: calc(132px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 36;
    pointer-events: none;
    font-family: var(--jp);
    font-size: 15px;
    letter-spacing: 0.1em;
    color: var(--ink);
    background: rgba(4, 6, 12, 0.68);
    border: 1px solid var(--line);
    padding: 10px 22px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
}

#hint b { color: var(--red); margin-right: 0.6em; font-weight: 400; }

#hint.show { opacity: 1; }

/* ============ バナー ============ */
#banner {
    position: fixed;
    left: 0;
    right: 0;
    top: 34%;
    z-index: 35;
    text-align: center;
    pointer-events: none;
    font-family: var(--mono);
    font-size: clamp(28px, 5vw, 44px);
    letter-spacing: 0.38em;
    text-indent: 0.38em;
    color: var(--ink);
    opacity: 0;
    transform: scale(1.12);
    transition: opacity 0.18s, transform 0.18s;
    text-shadow: 0 0 24px rgba(238, 241, 247, 0.35);
}

#banner.show { opacity: 1; transform: none; }

#banner span { color: var(--red); }

#banner em {
    display: block;
    font-style: normal;
    font-family: var(--disp);
    font-size: clamp(26px, 5.6vw, 52px);
    letter-spacing: 0.14em;
    text-indent: 0.14em;
    margin-bottom: 10px;
}

#banner.warn { color: var(--red); text-shadow: 0 0 30px rgba(255, 42, 60, 0.6); }
#banner.warn em { animation: blinktext 0.4s steps(2) infinite; }
#banner.good { color: var(--green); text-shadow: 0 0 30px rgba(41, 255, 142, 0.5); }

/* ============ ダメージ演出 ============ */
#dmgFx {
    position: fixed;
    inset: 0;
    z-index: 33;
    pointer-events: none;
    opacity: 0;
    background:
        radial-gradient(ellipse at 50% 50%, transparent 42%, rgba(255, 20, 40, 0.55) 100%);
}

#dmgFx.on { animation: dmgflash 0.55s ease-out both; }

/* 弾が迫っている時の「危な！」ビネット（JSがopacityを毎フレーム駆動） */
#dangerFx {
    position: fixed;
    inset: 0;
    z-index: 32;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(ellipse at 50% 50%, transparent 52%, rgba(255, 26, 48, 0.55) 100%);
}

@keyframes dmgflash {
    0% { opacity: 1; transform: scale(1.06); }
    100% { opacity: 0; transform: none; }
}

/* ============ ダッシュ演出 ============ */
body.dashing::after {
    content: '';
    position: fixed;
    inset: -22%;
    z-index: 32;
    pointer-events: none;
    background: repeating-conic-gradient(from 0deg,
        rgba(255, 255, 255, 0.09) 0deg 1deg,
        transparent 1deg 11deg);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 32%, #000 72%);
    mask-image: radial-gradient(circle at 50% 50%, transparent 32%, #000 72%);
    animation: streak 0.4s linear infinite;
}

@keyframes streak { to { transform: rotate(11deg) scale(1.06); } }

/* ============ フローター ============ */
#floatLayer { position: fixed; inset: 0; z-index: 45; pointer-events: none; }

.floater {
    position: absolute;
    font-family: var(--mono);
    font-size: 21px;
    color: var(--green);
    text-shadow: 0 0 10px rgba(41, 255, 142, 0.7);
    transform: translate(-50%, -50%);
    animation: floatup 0.85s steps(12) both;
}

@keyframes floatup {
    0% { opacity: 0; margin-top: 6px; }
    18% { opacity: 1; }
    100% { opacity: 0; margin-top: -44px; }
}

/* ============ オーバーレイ共通 ============ */
.ov {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(3, 5, 10, 0.8);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s, visibility 0.45s;
    padding: 20px;
}

.ov.show { opacity: 1; visibility: visible; }

.panel { max-width: 600px; width: 100%; }

.ov-eyebrow {
    font-family: var(--mono);
    font-size: 17px;
    letter-spacing: 0.3em;
    color: var(--mute);
    margin-bottom: 12px;
}

.ov-code {
    font-family: var(--disp);
    font-weight: 400;
    font-size: clamp(56px, 15vw, 104px);
    line-height: 1;
    letter-spacing: 0.02em;
    margin-bottom: 22px;
}

.ov-code span {
    font-size: 0.38em;
    margin-left: 0.24em;
    letter-spacing: 0.1em;
    vertical-align: 0.16em;
}

.ov-code.ok { color: var(--green); text-shadow: 0 0 46px rgba(41, 255, 142, 0.45); }
.ov-code.gone { color: var(--red); text-shadow: 0 0 46px rgba(255, 42, 60, 0.45); }

.ov-msg { font-size: 15px; line-height: 1.9; color: var(--ink); margin-bottom: 26px; }

.result {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 14px;
    margin-bottom: 30px;
}

.stats { display: flex; gap: 14px; }

.stats > div {
    border: 1px solid var(--line);
    padding: 12px 18px;
    min-width: 112px;
    background: rgba(8, 12, 22, 0.5);
}

.stats dt {
    font-family: var(--mono);
    font-size: 14px;
    letter-spacing: 0.22em;
    color: var(--mute);
    margin-bottom: 4px;
}

.stats dd {
    font-family: var(--mono);
    font-size: 26px;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.rank {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--line);
    padding: 8px 22px;
    background: rgba(8, 12, 22, 0.5);
}

.rank-label {
    font-family: var(--mono);
    font-size: 14px;
    letter-spacing: 0.22em;
    color: var(--mute);
}

#rankVal {
    font-family: var(--disp);
    font-size: 30px;
    line-height: 1.1;
    color: var(--ink);
}

#rankVal[data-rank="S"] { color: #ffd23c; text-shadow: 0 0 22px rgba(255, 210, 60, 0.6); }
#rankVal[data-rank="A"] { color: var(--green); }
#rankVal[data-rank="B"] { color: #4db8ff; }

.btn-main {
    display: inline-block;
    font-family: var(--jp);
    font-weight: 400;
    font-size: 17px;
    letter-spacing: 0.2em;
    text-indent: 0.2em;
    color: #050608;
    background: var(--ink);
    border: none;
    padding: 15px 44px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    text-decoration: none;
}

.btn-main:hover { background: var(--red); color: #fff; transform: translateY(-2px); }
.btn-main:active { transform: translateY(1px); }

.btn-go { display: block; margin: 0 auto 14px; max-width: 480px; font-size: 15px; letter-spacing: 0.1em; text-indent: 0.1em; }

.ov-row { display: flex; justify-content: center; gap: 12px; margin-top: 16px; }

.btn-sub {
    font-family: var(--jp);
    font-size: 14px;
    letter-spacing: 0.12em;
    color: var(--dim);
    background: transparent;
    border: 1px solid var(--line);
    padding: 11px 22px;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.btn-sub:hover { color: #050608; background: var(--ink); border-color: var(--ink); }

.over-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 26px;
    font-family: var(--mono);
    font-size: 18px;
    letter-spacing: 0.08em;
    color: var(--dim);
    margin-bottom: 26px;
}

.over-stats span { white-space: nowrap; }

.ov-foot {
    margin-top: 30px;
    font-family: var(--jp);
    font-size: 12px;
    letter-spacing: 0.1em;
    color: var(--mute);
}

.ov-foot a {
    color: var(--mute);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.ov-foot a:hover { color: var(--ink); border-color: var(--ink); }

.ov-foot .sf-sep { margin: 0 0.8em; opacity: 0.5; }

.paused-msg {
    font-family: var(--disp);
    font-size: 30px;
    letter-spacing: 0.3em;
    text-indent: 0.3em;
    color: var(--ink);
    margin-bottom: 30px;
}

/* ============ レスポンシブ ============ */
@media (max-width: 700px) {
    #restoreNum { font-size: 21px; }
    .restore-track { width: 120px; }
    #hpPips i { width: 20px; }
    #waveLabel { display: none; }
    /* スマホは装飾テキストを消して機能要素だけに */
    #statusLine { display: none; }
    .conn-label { display: none; }
    .restore-goal { font-size: 13px; }
    .restore-label { font-size: 12px; letter-spacing: 0.18em; }
    /* TIMEは左グループ（RESTORE）の下へ */
    .hud-center {
        position: absolute;
        left: calc(18px + env(safe-area-inset-left));
        top: calc(64px + env(safe-area-inset-top));
        padding-top: 0;
    }
    #timerBox { justify-content: flex-start; margin-top: 0; }
    .timer-label { letter-spacing: 0.16em; }
    .hud-mute { top: calc(54px + env(safe-area-inset-top)); }
    .hud-title {
        top: calc(54px + env(safe-area-inset-top));
        right: calc(60px + env(safe-area-inset-right));
        height: 32px;
        padding: 0 10px;
    }
    .zone { width: 96px; height: 104px; }
    .stats { flex-wrap: wrap; justify-content: center; gap: 8px; }
    .stats > div { min-width: 96px; padding: 10px 12px; }
    .result { flex-wrap: wrap; gap: 8px; }
    #banner { letter-spacing: 0.2em; text-indent: 0.2em; }
    #hint { font-size: 13px; white-space: normal; text-align: center; width: min(92vw, 420px); }
    .stinger-sub { font-size: 13px; }
    .stinger-diff { flex-direction: column; gap: 10px; }
    .sp { display: inline; }
}

@media (hover: hover) and (pointer: fine) {
    .zone { opacity: 0.55; }
    .zone:hover { opacity: 1; }
}

/* ============ クローラー向け静的紹介 ============ */
/* display:flex が hidden属性のUAスタイルを上書きしてしまうため、hidden中は明示的に消す */
#seoIntro[hidden] { display: none !important; }

#seoIntro {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 24px;
}

#seoIntro .seo-inner { max-width: 640px; }

.seo-eyebrow {
    font-family: var(--mono);
    font-size: 15px;
    letter-spacing: 0.3em;
    color: var(--red);
    margin-bottom: 12px;
}

#seoIntro h2 {
    font-size: 22px;
    color: var(--ink);
    margin-bottom: 18px;
    line-height: 1.5;
}

#seoIntro p { font-size: 14px; line-height: 2; color: var(--dim); margin-bottom: 14px; }
#seoIntro a { color: var(--ink); text-underline-offset: 4px; }
.seo-foot { font-size: 12px; color: var(--mute); }

/* ============ OGP撮影モード ============ */
body.ogp .stinger-eyebrow { display: none; }
body.ogp #stinger { background: radial-gradient(ellipse at 50% 42%, rgba(10, 16, 30, 0.16), rgba(4, 6, 12, 0.5) 78%); }

/* ============ 動きを減らす設定 ============ */
@media (prefers-reduced-motion: reduce) {
    body.glitch-1 #fpCard,
    body.glitch-2 #fpCard,
    body.glitch-2 #fakepage,
    .logo .l404::before,
    .logo .l404::after { animation: none; }
    body.dashing::after { display: none; }
}
