/* ============================================================================
 * ホシフル — ゲーム専用スタイル
 * .play-stage の中に収まる前提。色はサイト共通のCSS変数を流用。
 * 構成は windrunner.css を踏襲（wr- → hf-）。テーマ色はバイオレット。
 * ========================================================================== */

.hf-root {
    position: relative;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.hf-canvas {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0c0a22;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .4);
}

/* ---------------- 上部HUD ---------------- */
.hf-hud {
    position: absolute;
    inset: 0 0 auto 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 16px;
    pointer-events: none;
}
.hf-hud-left { display: flex; flex-direction: column; gap: 2px; }
.hf-score-box { display: flex; align-items: baseline; gap: 8px; }
.hf-score-label {
    font-family: var(--font-pixel, monospace);
    font-size: .62rem; letter-spacing: .12em;
    color: var(--violet, #9a7bff);
    text-shadow: 0 0 8px rgba(154, 123, 255, .55);
}
.hf-score {
    font-family: var(--font-pixel, monospace);
    font-size: 1.9rem; line-height: 1;
    color: #fff;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .5), 0 0 14px rgba(255, 255, 255, .25);
}
.hf-sub {
    font-family: var(--font-pixel, monospace);
    font-size: .78rem;
    color: rgba(255, 255, 255, .8);
    text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}
.hf-graze-ico { color: var(--mint, #3ee0c8); }

#hfGraze {
    display: inline-block;
    color: var(--mint, #3ee0c8);
}
#hfGraze.hf-pop { animation: hf-pop .28s ease; }
@keyframes hf-pop {
    from { transform: scale(1.7); text-shadow: 0 0 12px rgba(62, 224, 200, .9); }
    to   { transform: scale(1); }
}

.hf-hud-right { display: flex; align-items: center; gap: 10px; pointer-events: auto; }

.hf-pause-btn {
    pointer-events: auto;
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .25);
    background: rgba(20, 16, 43, .55);
    color: #fff;
    font-size: .8rem;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background .15s, transform .1s;
}
.hf-pause-btn:hover { background: rgba(40, 32, 80, .75); }
.hf-pause-btn:active { transform: scale(.92); }

/* ---------------- オーバーレイ共通 ---------------- */
.hf-overlay {
    position: absolute; inset: 0;
    display: none;
    align-items: center; justify-content: center;
    background: radial-gradient(ellipse at center, rgba(12, 10, 34, .55), rgba(12, 10, 34, .8));
    backdrop-filter: blur(3px);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    z-index: 5;
}
.hf-overlay.is-active { display: flex; animation: hf-fade .25s ease; }
@keyframes hf-fade { from { opacity: 0; } to { opacity: 1; } }

.hf-overlay-card {
    display: flex; flex-direction: column; align-items: center;
    gap: 14px;
    max-width: 460px; width: 100%;
}
.hf-start .hf-overlay-card { max-width: 540px; }

/* タイトル */
.hf-logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 2rem;
}
.hf-logo span {
    font-family: var(--font-display, sans-serif);
    font-size: 1.7rem; letter-spacing: .02em;
    color: var(--violet, #9a7bff);
    text-shadow: 0 0 18px rgba(154, 123, 255, .55);
}
.hf-logo b { color: #fff; }
.hf-tagline { color: rgba(255, 255, 255, .8); font-size: .95rem; margin-top: -6px; }

.hf-rules {
    display: flex; flex-direction: column; gap: 6px;
    font-size: .85rem; color: rgba(255, 255, 255, .78);
}
.hf-rule-danger {
    display: inline-block;
    align-self: center;
    padding: 3px 14px;
    border-radius: 999px;
    font-weight: 700;
    color: var(--primary, #ff5e7d);
    background: rgba(255, 94, 125, .12);
    border: 1px solid rgba(255, 94, 125, .4);
}

.hf-hint {
    display: flex; flex-direction: column; gap: 6px;
    font-size: .8rem; color: rgba(255, 255, 255, .7);
    margin-top: 4px;
}
.hf-hint kbd {
    font-family: var(--font-pixel, monospace);
    font-size: .72rem;
    padding: 2px 7px; margin: 0 2px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .25);
    border-bottom-width: 2px;
    color: #fff;
}

/* 大ボタン */
.hf-big-btn {
    font-family: var(--font-display, sans-serif);
    font-size: 1.1rem;
    padding: 13px 42px;
    border: none; border-radius: 999px;
    background: linear-gradient(135deg, var(--violet, #9a7bff), #6d4fe0);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(109, 79, 224, .45);
    transition: transform .12s, box-shadow .12s, filter .12s;
}
.hf-big-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(109, 79, 224, .55); filter: brightness(1.06); }
.hf-big-btn:active { transform: translateY(0) scale(.97); }

.hf-text-btn {
    background: none; border: none;
    color: rgba(255, 255, 255, .65);
    font-size: .88rem; cursor: pointer;
    text-decoration: underline; text-underline-offset: 3px;
    padding: 4px;
}
.hf-text-btn:hover { color: #fff; }

/* ポーズ */
.hf-paused-title {
    font-family: var(--font-pixel, monospace);
    font-size: 2rem; letter-spacing: .2em;
    color: var(--sky, #5ec8ff);
    text-shadow: 0 0 16px rgba(94, 200, 255, .5);
}

/* ゲームオーバー */
.hf-over-title {
    font-family: var(--font-display, sans-serif);
    font-size: 1.6rem;
    color: var(--primary, #ff5e7d);
    text-shadow: 0 0 16px rgba(255, 94, 125, .4);
}
.hf-result { display: flex; flex-direction: column; align-items: center; gap: 0; }
.hf-result-score {
    font-family: var(--font-pixel, monospace);
    font-size: 3.4rem; line-height: 1;
    color: var(--gold, #ffcf45);
    text-shadow: 0 0 22px rgba(255, 207, 69, .5);
}
.hf-result-label {
    font-family: var(--font-pixel, monospace);
    font-size: .68rem; letter-spacing: .2em;
    color: rgba(255, 255, 255, .6);
}
.hf-result-detail {
    display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center;
    font-size: .88rem; color: rgba(255, 255, 255, .75);
}
.hf-result-detail b { color: #fff; font-family: var(--font-pixel, monospace); }

.hf-save-status {
    font-size: .85rem;
    padding: 8px 16px;
    border-radius: 10px;
    min-height: 1em;
}
.hf-save-status.muted { color: var(--ink-muted, #a59fd6); background: rgba(255, 255, 255, .06); }
.hf-save-status.ok { color: var(--mint, #3ee0c8); background: rgba(62, 224, 200, .12); }
.hf-save-status.best {
    color: var(--gold, #ffcf45); background: rgba(255, 207, 69, .14);
    font-weight: 700;
    animation: hf-best 1s ease infinite alternate;
}
@keyframes hf-best { from { box-shadow: 0 0 0 rgba(255, 207, 69, 0); } to { box-shadow: 0 0 18px rgba(255, 207, 69, .4); } }
.hf-save-status.err { color: var(--primary, #ff5e7d); background: rgba(255, 94, 125, .12); }

/* ---------------- レスポンシブ ---------------- */
@media (max-width: 560px) {
    .hf-score { font-size: 1.5rem; }
    .hf-logo span { font-size: 1.35rem; }
    .hf-result-score { font-size: 2.6rem; }
    .hf-big-btn { padding: 11px 34px; font-size: 1rem; }
    .hf-rules { font-size: .78rem; }
}

@media (prefers-reduced-motion: reduce) {
    .hf-overlay.is-active, .hf-save-status.best, #hfGraze.hf-pop { animation: none; }
}
