/* 全体スタイル */
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a1a 0%, #2c3e50 100%);
    font-family: 'Montserrat', sans-serif;
    touch-action: none;
    user-select: none;
    color: #ecf0f1;
}

#game-canvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    transition: filter 0.3s ease;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    /* UIレイヤーがクリックを邪魔しないように */
}

/* ★変更：ヘッダーのアクセシビリティ向上 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: calc(14px + env(safe-area-inset-top)) 28px 12px 28px;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 100%);
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.label {
    font-size: 10px;
    color: rgba(255,255,255,0.45);
    margin-bottom: 2px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 3px;
}

.value {
    font-size: 30px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

/* ★変更：コンボ表示を力強く */
#combo-display {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 56px;
    /* 少し大きく */
    font-weight: 700;
    /* 200から700へ変更 */
    color: #ffffff;
    opacity: 0;
    letter-spacing: 5px;
    transition: opacity 0.3s, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    /* 影を強烈にして視認性を強制的に上げる */
    text-shadow: 0 5px 20px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 255, 255, 0.3);
    white-space: nowrap;
}

#combo-display span {
    font-size: 24px;
    display: block;
    text-align: center;
    font-weight: 700;
    /* 太字に */
    margin-top: -5px;
    color: #f1c40f;
    /* 色をゴールドっぽくして目立たせる */
}

.score-box,
.timer-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}


#time.warning {
    color: #e74c3c;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* コンボ表示 */

/* スタート画面 */
#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    pointer-events: auto;
}

h1 {
    color: #fff;
    /* font-size: 64px; から可変サイズ（画面幅の15%だが最大64px）に変更 */
    font-size: min(12vw, 60px);
    margin-bottom: 0px;
    font-weight: 200;
    letter-spacing: min(0.8vw, 4px);
    text-transform: none;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
    white-space: nowrap;
}

.subtitle {
    color: #7f8c8d;
    margin-bottom: 60px;
    font-weight: 400;
    letter-spacing: 2px;
    font-size: 14px;
}

.btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 15px 60px;
    font-size: 16px;
    color: white;
    border-radius: 30px;
    /* 角丸を強く */
    cursor: pointer;
    letter-spacing: 3px;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.1);
}

/* --- フィーバーゲージ --- */
#fever-container {
    position: absolute;
    /* 下からの距離（40px）に、ホームバー分の安全領域を足す */
    bottom: calc(40px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 400px;
    text-align: center;
    pointer-events: none;
}


/* SHUFFLE ボタンは廃止 (ゲーム中UIから除外) */
#btn-shuffle {
    display: none !important;
}

/* 【style.css の .in-game-btn を上書き】 */
.in-game-btn {
    position: absolute;
    top: calc(75px + env(safe-area-inset-top));
    right: 28px;

    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255,255,255,0.7);

    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);

    padding: 8px 14px;
    font-size: 11px;
    border-radius: 20px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 2px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.2s;

    /* ★変更：ボタン全体の影も少し濃くして存在感を出す */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 10;
    pointer-events: auto;
}

.fever-label {
    font-size: 14px;
    color: #bdc3c7;
    margin-bottom: 8px;
    letter-spacing: 4px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.fever-bar-bg {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#fever-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #f1c40f, #e67e22);
    border-radius: 5px;
    transition: width 0.3s ease-out;
    box-shadow: 0 0 10px #f1c40f;
}

/* --- フィーバー発動中のスタイル --- */

/* ★変更：背景をカラフルな虹色グラデーションにし、アニメーションで動かす */
body.fever-mode {
    background: linear-gradient(45deg, #ff007f, #7f00ff, #00d4ff, #ffdf00) !important;
    background-size: 300% 300% !important;
    animation: rainbowBg 2.5s ease infinite !important;
}

/* ★追加：背景をヌルヌル動かすためのアニメーション定義 */
@keyframes rainbowBg {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body.fever-mode #fever-bar {
    background: linear-gradient(90deg, #ffffff, #ffeaa7);
    box-shadow: 0 0 20px #ffffff;
    animation: flashBar 0.5s infinite alternate;
}

body.fever-mode .fever-label {
    color: #ffffff;
    text-shadow: 0 0 10px #ffffff;
}

body.fever-mode #fever-bar {
    background: linear-gradient(90deg, #ff00cc, #3333ff);
    box-shadow: 0 0 20px #ff00cc;
    animation: flashBar 0.5s infinite alternate;
}

body.fever-mode .fever-label {
    color: #ff9ff3;
    text-shadow: 0 0 10px #ff9ff3;
}

@keyframes flashBar {
    from {
        filter: brightness(1);
    }

    to {
        filter: brightness(1.5);
    }
}

/* 既存のCSSの末尾に追加してください */

#user-display {
    /* ゲーム中UIからは非表示 (機能はMyPageに集約) */
    display: none !important;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.privacy-notice {
    margin-top: 18px;
    padding: 8px 20px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
    line-height: 1.6;
    letter-spacing: 0.5px;
    max-width: 300px;
}

.btn.secondary {
    font-size: 14px;
    padding: 10px 40px;
    border-color: rgba(255, 255, 255, 0.5);
    color: #bdc3c7;
}

.btn.small {
    padding: 10px 20px;
    font-size: 14px;
    margin: 5px;
}

.input-field {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px;
    color: white;
    width: 80%;
    margin-bottom: 10px;
    border-radius: 4px;
    font-family: inherit;
}

/* --- モーダル --- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 20;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

/* MyPage からサブモーダル(ranking/shop/rule/rename)を開いた時、
   MyPageの上に重ねて表示するため z-index を上げる */
#ranking-modal, #shop-modal, #rule-modal, #rename-modal {
    z-index: 25;
}

.modal-content {
    background: linear-gradient(135deg, #2c3e50, #1a1a1a);
    padding: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

@media (max-width: 600px) {
    .modal-content {
        padding: 24px 20px;
        max-height: 85vh;
    }
}

.modal h2 {
    margin-top: 0;
    color: #fff;
    font-weight: 200;
    letter-spacing: 5px;
    margin-bottom: 20px;
}

.btn-close {
    margin-top: 20px;
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    font-size: 12px;
    letter-spacing: 2px;
    text-decoration: underline;
}

#ranking-list {
    list-style: none;
    padding: 0;
    margin: 16px 0;
    text-align: left;
    max-height: 300px;
    overflow-y: auto;
}

#ranking-list li {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    font-size: 14px;
    gap: 12px;
}

.rank-num {
    font-weight: 700;
    min-width: 32px;
    color: rgba(255,255,255,0.5);
    font-size: 13px;
}

#ranking-list li:nth-child(1) .rank-num { color: #f1c40f; }
#ranking-list li:nth-child(2) .rank-num { color: #bdc3c7; }
#ranking-list li:nth-child(3) .rank-num { color: #cd7f32; }

#ranking-list li.is-me {
    background: rgba(241, 196, 15, 0.14);
    border-radius: 4px;
    border-bottom-color: rgba(241, 196, 15, 0.3);
    padding-left: 6px;
    padding-right: 6px;
}
#ranking-list li.is-me .rank-name { color: #f1c40f; font-weight: 700; }
#ranking-list li.rank-sep {
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 4px;
    font-size: 16px;
    padding: 4px 0;
    border-bottom: none;
    justify-content: center;
}

.rank-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-score {
    color: #f1c40f;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 1px;
}

#my-best-score {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    letter-spacing: 2px;
    margin: 8px 0;
    text-align: center;
}

#auth-msg {
    font-size: 12px;
    color: #e74c3c;
    margin-top: 10px;
    min-height: 1.2em;
}


.in-game-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.3);
}

/* UIレイヤー全体はクリックを貫通させるが、ボタンだけは反応するように調整 */
#ui-layer {
    pointer-events: none;
}
/* ★追加：ログアウトボタンのスタイル */
.btn-logout {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #bdc3c7;
    padding: 2px 8px;
    font-size: 10px;
    border-radius: 12px;
    margin-left: 10px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.2s;
    pointer-events: auto; /* クリック可能にする */
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: #fff;
}

/* ★追加：ルール説明ボックスのスタイル */
/* ★追加：ルールモーダル用のスタイル */
.rule-section {
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.rule-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.rule-section h3 {
    margin: 0 0 10px 0;
    font-size: 15px;
    color: #f1c40f;
    letter-spacing: 1.5px;
    line-height: 1.4;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.rule-section p {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #ecf0f1;
    line-height: 1.7;
    word-break: break-word;
    overflow-wrap: break-word;
}

.rule-section .en-text {
    font-size: 11px;
    color: #7f8c8d;
    line-height: 1.5;
}

.rule-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rule-list li {
    font-size: 13px;
    color: #ecf0f1;
    margin-bottom: 10px;
    line-height: 1.7;
    display: block;
    word-break: break-word;
    overflow-wrap: break-word;
}
.rule-list li strong { color: #fff; }

.secret-text {
    color: #f1c40f !important;
    font-weight: 700;
}

/* --- How to Play: Visual Step Indicator --- */
.rule-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 12px 0 4px;
    padding: 10px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
}
.rv-step {
    background: rgba(241,196,15,0.15);
    color: #f1c40f;
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
}
.rv-arrow {
    color: rgba(255,255,255,0.3);
    font-size: 14px;
}

/* --- How to Play: Hyper Bomb Grid --- */
.rule-hyper-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}
.rule-hyper-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    font-size: 11px;
    color: #bdc3c7;
}
.rule-hyper-item strong { color: #fff; margin-right: 4px; font-size: 12px; }
.rule-hyper-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* --- How to Play: Score Table --- */
.rule-score-table {
    margin-top: 8px;
}
.rule-score-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    font-size: 12px;
    color: #bdc3c7;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.rule-score-row.highlight {
    background: rgba(255,255,255,0.03);
}
.rule-score-label {
    flex-shrink: 0;
    width: 90px;
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- How to Play: Rebellion Bomb Grid --- */
.rule-rebellion-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 10px;
}
.rule-reb-item {
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #ecf0f1;
    line-height: 1.4;
}
.rule-reb-item small {
    font-weight: 400;
    font-size: 10px;
    color: rgba(255,255,255,0.5);
}
.rule-reb-item.green { background: rgba(46,204,113,0.12); border-left: 3px solid #2ecc71; }
.rule-reb-item.yellow { background: rgba(241,196,15,0.12); border-left: 3px solid #f1c40f; }
.rule-reb-item.red { background: rgba(231,76,60,0.12); border-left: 3px solid #e74c3c; }

/* スマホ向けに rule-modal を読みやすく */
@media (max-width: 600px) {
    #rule-modal .modal-content {
        padding: 20px 18px;
        max-width: 100%;
    }
    .rule-section {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }
    .rule-section h3 {
        font-size: 14px;
        letter-spacing: 1px;
    }
    .rule-section p,
    .rule-list li {
        font-size: 13px;
        line-height: 1.7;
    }
    .rule-section .en-text {
        font-size: 10px;
    }
}

/* ========== PAUSEボタン ========== */
.pause-btn {
    /* SHUFFLEボタンの左隣に配置 */
    right: auto;
    left: 40px;
    top: calc(90px + env(safe-area-inset-top));
    font-size: 18px;
    padding: 10px 16px;
    letter-spacing: 0;
}

/* ========== 重力インジケーター ========== */
#gravity-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 5;
    text-align: center;
    animation: gravityPulse 1s ease-in-out infinite alternate;
}

#gravity-arrow {
    font-size: 72px;
    line-height: 1;
    filter: drop-shadow(0 0 12px currentColor);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#gravity-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 4px;
    color: rgba(255,255,255,0.7);
    margin-top: 4px;
}

@keyframes gravityPulse {
    from { opacity: 0.7; transform: translate(-50%, -50%) scale(0.95); }
    to   { opacity: 1;   transform: translate(-50%, -50%) scale(1.05); }
}

/* ========== リザルト：レビューボタン（aタグ対応）========== */
a.btn.secondary {
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

#result-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
    z-index: 15;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: resultFadeIn 0.5s ease;
}

@keyframes resultFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.result-content {
    text-align: center;
    padding: 40px 30px;
    width: 90%;
    max-width: 420px;
}

.result-title {
    font-size: 14px;
    letter-spacing: 8px;
    color: #7f8c8d;
    font-weight: 700;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.result-score-label {
    font-size: 12px;
    letter-spacing: 5px;
    color: #7f8c8d;
    font-weight: 700;
    text-transform: uppercase;
}

.result-score {
    font-size: 72px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin: 8px 0 30px;
    text-shadow: 0 0 40px rgba(255,255,255,0.3);
    animation: scoreCountUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scoreCountUp {
    from { transform: scale(0.6); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
}

.result-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.result-stat-label {
    font-size: 10px;
    letter-spacing: 2px;
    color: #7f8c8d;
    font-weight: 700;
    text-transform: uppercase;
}

.result-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #f1c40f;
}

.highscore-badge {
    font-size: 14px;
    font-weight: 700;
    color: #f1c40f;
    letter-spacing: 2px;
    margin-bottom: 20px;
    animation: badgePulse 1s ease infinite alternate;
}

@keyframes badgePulse {
    from { opacity: 0.7; transform: scale(0.97); }
    to   { opacity: 1;   transform: scale(1.03); }
}

.result-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    margin-top: 24px;
}

/* ========== コンボ倍率UI（ヘッダー中央内） ========== */
#multiplier-display {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.4);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s, color 0.3s;
    text-shadow: 0 1px 6px rgba(0,0,0,0.8);
    white-space: nowrap;
}

#multiplier-display.active {
    opacity: 1;
}

/* ========== 難易度表示（ヘッダー中央内） ========== */
#difficulty-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
    text-shadow: 0 1px 6px rgba(0,0,0,0.8);
    white-space: nowrap;
}

#difficulty-label.show {
    opacity: 1;
}

/* ========== ワンタップ・リスタート ========== */
.result-buttons .btn#btn-replay {
    padding: 20px 80px;
    font-size: 20px;
    letter-spacing: 5px;
    border-color: rgba(255, 255, 255, 0.6);
    animation: replayPulse 2s ease infinite;
}

@keyframes replayPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.2); }
    50% { box-shadow: 0 0 20px 4px rgba(255,255,255,0.15); }
}

#result-screen .result-content {
    animation: resultSlideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes resultSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ========== ニュースTip (トースト形式) ========== */
/* 画面下端中央に短時間だけ表示される小さな通知。
   スクロールしないのでプレイの妨げにならない。 */
#news-ticker {
    position: absolute;
    left: 50%;
    bottom: calc(18px + env(safe-area-inset-bottom));
    transform: translateX(-50%) translateY(10px);
    max-width: min(90vw, 380px);
    padding: 8px 18px;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(241, 196, 15, 0.45);
    border-radius: 20px;
    z-index: 4;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#news-ticker.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
#news-ticker-inner {
    display: block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #f1c40f;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== コンボタイマーゲージ ========== */
#combo-timer-bar {
    position: absolute;
    top: calc(80px + env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
    z-index: 3;
    pointer-events: none;
}

#combo-timer-fill {
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.5);
    border-radius: 2px;
    transition: width 0.1s linear, background 0.3s;
}

#combo-timer-fill.danger {
    background: #e74c3c;
    animation: comboBarBlink 0.3s infinite alternate;
}

@keyframes comboBarBlink {
    from { opacity: 0.5; }
    to   { opacity: 1; }
}

/* ========== ニアミス表示 ========== */
#near-miss-display {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 16;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 3px;
    color: #e74c3c;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    text-align: center;
    pointer-events: none;
    animation: nearMissPulse 0.8s ease infinite alternate;
}

@keyframes nearMissPulse {
    from { opacity: 0.6; transform: translate(-50%, -50%) scale(0.97); }
    to   { opacity: 1;   transform: translate(-50%, -50%) scale(1.03); }
}

/* ========== ビネット効果 ========== */
#vignette-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 1s ease;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.7) 100%);
}

#vignette-overlay.active {
    opacity: 1;
}

#vignette-overlay.critical {
    background: radial-gradient(ellipse at center, transparent 35%, rgba(80,0,0,0.8) 100%);
}

/* ========== ライバル通知 ========== */
#rival-notice {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.6);
    margin: 8px 0 4px;
    text-align: center;
}

/* ========== スコアリング説明リスト ========== */
.scoring-list li {
    font-size: 13px;
    line-height: 1.8;
}

/* ========== チェイン振動 ========== */
@keyframes chainVibrate {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-1px, 1px); }
    50% { transform: translate(1px, -1px); }
    75% { transform: translate(-1px, -1px); }
}

.chain-vibrate {
    animation: chainVibrate 0.05s linear infinite;
}

/* ========== ヒント明滅 ========== */
@keyframes hintBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ========== ハッピーアワー ========== */
#happy-hour-indicator {
    position: absolute;
    top: calc(65px + env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    pointer-events: none;
    animation: happyHourPulse 2s ease infinite;
}
#happy-hour-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 3px;
    color: #ffd700;
    text-shadow: 0 1px 8px rgba(255,215,0,0.3);
}
@keyframes happyHourPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}
.happy-hour-info {
    font-size: 11px;
    color: #7f8c8d;
    letter-spacing: 1px;
    margin-top: 16px;
}

/* ========== ランキングタブ ========== */
.ranking-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.ranking-tab {
    background: none;
    border: none;
    color: rgba(255,255,255,0.35);
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}
.ranking-tab.active {
    color: #fff;
    border-bottom-color: #f1c40f;
}

/* ========== ショップ ========== */
/* ========== Rebellion Bomb Shop ========== */
.shop-coins-display {
    font-size: 14px;
    font-weight: 700;
    color: #ffd700;
    letter-spacing: 3px;
    margin-bottom: 16px;
    text-align: center;
}
.shop-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 420px;
    overflow-y: auto;
}
.shop-target-card {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
    overflow: hidden;
}
.shop-target-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.shop-target-name {
    flex: 1;
    font-size: 13px;
    font-weight: 700;
    color: #ecf0f1;
    letter-spacing: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.shop-target-score {
    font-size: 12px;
    font-weight: 700;
    color: #f1c40f;
}
.shop-rank-diff {
    font-size: 10px;
    color: #e74c3c;
    background: rgba(231,76,60,0.15);
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 1px;
    white-space: nowrap;
}
.shop-bomb-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    gap: 10px;
    border-top: 1px solid rgba(255,255,255,0.04);
}
.shop-bomb-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.shop-bomb-emoji { font-size: 20px; flex-shrink: 0; }
.shop-bomb-info strong {
    font-size: 12px;
    color: #ecf0f1;
    letter-spacing: 1px;
}
.shop-bomb-desc {
    font-size: 10px;
    color: rgba(255,255,255,0.45);
    line-height: 1.5;
}
.shop-buy-btn {
    background: none;
    border: 1px solid rgba(241, 196, 15, 0.5);
    color: #f1c40f;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 6px 12px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.shop-buy-btn:hover { background: rgba(241,196,15,0.15); }
.shop-buy-btn.disabled {
    color: #555;
    border-color: #333;
    cursor: not-allowed;
}

/* --- Shop: Step Header --- */
.shop-step-header {
    font-size: 12px;
    font-weight: 700;
    color: #f1c40f;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 4px 0 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 10px;
}
.shop-msg {
    color: #7f8c8d;
    text-align: center;
    padding: 20px;
    font-size: 12px;
    line-height: 1.6;
}

/* --- Shop: Bomb Card (Step 1) --- */
.shop-bomb-card {
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 14px;
    background: rgba(255,255,255,0.02);
    transition: all 0.15s;
}
.shop-bomb-card:hover { background: rgba(241,196,15,0.06); border-color: rgba(241,196,15,0.3); }
.shop-bomb-card.unaffordable {
    opacity: 0.4;
    pointer-events: none;
}
.shop-bomb-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.shop-bomb-emoji-lg { font-size: 28px; flex-shrink: 0; }
.shop-bomb-card-info { flex: 1; min-width: 0; }
.shop-bomb-card-name {
    font-size: 14px;
    font-weight: 700;
    color: #ecf0f1;
    letter-spacing: 1px;
}
.shop-bomb-card-tier {
    font-size: 10px;
    color: #7f8c8d;
    margin-top: 2px;
}
.shop-bomb-card-price {
    font-size: 14px;
    font-weight: 700;
    color: #f1c40f;
    text-align: right;
    line-height: 1.2;
    flex-shrink: 0;
}
.shop-bomb-card-price span { font-size: 9px; color: #bdc3c7; letter-spacing: 1px; }
.shop-bomb-card-desc {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    line-height: 1.5;
}

/* --- Shop: Confirm (Step 2 & 4) --- */
.shop-confirm-wrap {
    padding: 10px 0;
}
.shop-confirm-bomb {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    margin-bottom: 14px;
}
.shop-confirm-target {
    font-size: 13px;
    color: #ecf0f1;
    padding: 10px 12px;
    background: rgba(52,152,219,0.1);
    border-left: 3px solid #3498db;
    border-radius: 4px;
    margin-bottom: 12px;
}
.shop-confirm-price {
    font-size: 13px;
    color: #f1c40f;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.shop-confirm-question {
    font-size: 12px;
    color: #bdc3c7;
    margin-bottom: 16px;
}
.shop-confirm-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.shop-btn-yes {
    background: #e74c3c !important;
    color: #fff !important;
    padding: 10px 24px !important;
}
.shop-btn-yes:hover { background: #c0392b !important; }
.shop-btn-no { padding: 10px 24px !important; }

/* --- Shop: Target Row (Step 3) --- */
.shop-target-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s;
}
.shop-target-row:hover { background: rgba(255,255,255,0.04); }

/* ========== Debuff: Dewdrop Blur overlay ========== */
#debuff-blur-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 3;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80px 60px at 20% 30%, rgba(100,180,255,0.25), transparent 70%),
        radial-gradient(ellipse 60px 80px at 70% 50%, rgba(100,180,255,0.2), transparent 70%),
        radial-gradient(ellipse 90px 50px at 50% 80%, rgba(100,180,255,0.22), transparent 70%),
        radial-gradient(ellipse 50px 70px at 85% 20%, rgba(100,180,255,0.18), transparent 70%);
    backdrop-filter: blur(1.5px);
}

/* ========== マイページ ========== */
.mypage-content {
    text-align: left;
}
.mypage-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    gap: 12px;
    min-width: 0;
}
.mypage-label {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
    letter-spacing: 2px;
    flex-shrink: 0;
}
.mypage-value {
    font-size: 15px;
    font-weight: 700;
    color: #ecf0f1;
    letter-spacing: 1px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
}
.mypage-skins {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mypage-skin-preview {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}
.mypage-missions {
    padding-top: 12px;
}

/* ========== ミッション ========== */
.mission-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mission-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.mission-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mission-text {
    font-size: 12px;
    color: #bdc3c7;
    letter-spacing: 1px;
}
.mission-progress-text {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    font-weight: 700;
}
.mission-bar-bg {
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}
.mission-bar-fill {
    height: 100%;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    transition: width 0.3s;
}
.mission-item.complete .mission-text { color: #2ecc71; }
.mission-item.complete .mission-bar-fill { background: #2ecc71; }
.mission-item.complete .mission-progress-text { color: #2ecc71; }

/* ========== MyPage: コメント枠 ========== */
#mypage-comment {
    margin: 0 0 18px;
    padding: 10px 14px;
    background: rgba(52, 152, 219, 0.12);
    border-left: 3px solid #3498db;
    border-radius: 4px;
    font-size: 12px;
    color: #ecf0f1;
    line-height: 1.6;
    text-align: left;
}
#mypage-comment div + div { margin-top: 4px; }

/* ========== MyPage: セクション見出し ========== */
.mypage-section-title {
    display: block;
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 700;
    color: #f1c40f;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(241, 196, 15, 0.3);
}

/* ========== MyPage: スコアチャート ========== */
.mypage-chart-section {
    margin: 16px 0;
    padding: 14px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
#mypage-chart-wrap {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 4px;
    min-height: 136px;
}
#mypage-chart-empty {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 2px;
    text-align: center;
    pointer-events: none;
    white-space: nowrap;
}
#mypage-chart-wrap.is-empty #mypage-chart-empty { display: block; }
#mypage-chart-tabs {
    display: flex;
    gap: 6px;
    margin: 10px 0 16px;
    justify-content: center;
}
.chart-tab {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #bdc3c7;
    padding: 5px 14px;
    font-size: 10px;
    letter-spacing: 2px;
    border-radius: 14px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}
.chart-tab:hover { color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.chart-tab.active {
    background: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
    border-color: #f1c40f;
}

#mypage-chart {
    display: flex;
    align-items: flex-end;
    height: 120px;
    padding: 16px 4px 0;
}
.chart-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}
.chart-bar {
    width: 100%;
    max-width: 36px;
    background: linear-gradient(to top, #f39c12, #f1c40f);
    border-radius: 3px 3px 0 0;
    position: relative;
    min-height: 2px;
    transition: height 0.4s ease;
}
.chart-bar.empty {
    background: rgba(255, 255, 255, 0.08);
}
.chart-val {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: #f1c40f;
    white-space: nowrap;
    letter-spacing: 0;
}
#mypage-chart-labels.chart-labels {
    display: flex;
    justify-content: space-around;
    margin-top: 6px;
    padding: 0 4px;
}
#mypage-chart-labels.chart-labels span {
    flex: 1;
    text-align: center;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}

/* ========== MyPage: アクションボタン群 ========== */
.mypage-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.mypage-actions .btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    letter-spacing: 3px;
    margin: 0;
}
.mypage-actions .btn.secondary {
    font-size: 12px;
    padding: 10px;
}
.mypage-actions .btn.logout {
    color: #e74c3c;
    border-color: rgba(231, 76, 60, 0.4);
}
.mypage-actions .btn.logout:hover {
    background: rgba(231, 76, 60, 0.1);
    color: #ff6b5b;
    border-color: #e74c3c;
}

/* ========== リザルト追加要素 ========== */
.result-coins {
    font-size: 16px;
    font-weight: 700;
    color: #ffd700;
    letter-spacing: 3px;
    margin: 8px 0;
    text-align: center;
}
.result-missions {
    font-size: 12px;
    color: #e74c3c;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 8px;
    text-align: center;
}