:root {
    --roe-red: #ff4d4d;
    --roe-orange: #ff944d;
    --roe-yellow: #ffdb4d;
    --roe-green: #4dff88;
    --roe-blue: #4d94ff;
    --roe-purple: #944dff;
    --water-bg: radial-gradient(circle at 50% -20%, #172554 0%, #0f172a 75%, #020617 100%); /* 深海の神秘的グラデーション */
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.25);
}

html {
    background: #020617 !important; /* html要素も完全に漆黒極深海ネイビーにして隙間漏れを完全シャットアウト */
    background-image: none !important;
}

body.game-body-roe {
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw !important;
    height: 100dvh !important; /* dvhを使用してスマホのツールバー見切れを完全に防ぐ */
    overflow: hidden !important;
    background: #020617 !important; /* 完全に不透明な極深海ネイビーで枠外の隙間漏れを完全シャットアウト */
    background-image: none !important; /* ポータル等から継承される背景画像を完全無効化 */
    font-family: 'Zen Maru Gothic', sans-serif;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 100dvh; /* dvhを使用して実際の可視領域に完全一致させる */
    max-height: 100dvh; /* 最大高さもツールバー内にぴったり収める */
    background: #020617 !important; /* アンチエイリアスによる境界線漏れを防ぐため、コンテナの背景自体を暗く設定 */
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(56, 189, 248, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-radius: 2.5rem;
    overflow: hidden;
    touch-action: none;
    -webkit-overflow-scrolling: none;

    /* スマホ（特に iOS Safari）での描画のチラつきを完全に防止するコンポジット固定 */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

/* 美しい海底背景専用レイヤー（コンテナ境界の隙間漏れを物理的に防ぐための独立配置） */
.game-bg-layer {
    position: absolute;
    inset: 0;
    background-image: url('underwater_seabed_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0; /* 物理エンジンやゲーム要素、UI、タイトル覆いの後方に配置 */
    pointer-events: none;
    
    /* スマホ（iOS Safari等）での背景チラつき防止対策 */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

#game-canvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    display: block;
    z-index: 4; /* 背景レイヤー(z-index: 1〜3)よりも前面、UIレイヤー(z-index: 10)より背面に配置 */
}

#ui-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}

#ui-layer > * {
    pointer-events: auto;
}

.header-info {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.score-box, .timer-box {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 0.75rem 0.5rem;
    border-radius: 1.5rem;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    width: 95px; /* ガタツキ防止用の完全固定幅 */
    min-width: 95px;
    box-sizing: border-box;
}

.next-box {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 0.75rem 0.5rem;
    border-radius: 1.5rem;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    width: 80px; /* NEXTプレビュー用固定幅 */
    min-width: 80px;
    box-sizing: border-box;
}

.label {
    display: block;
    font-size: 0.7rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
    font-family: 'Outfit', sans-serif;
}

#score {
    font-size: 1.5rem;
    font-weight: 900;
    font-family: 'Outfit', monospace;
    font-variant-numeric: tabular-nums; /* 数字の等幅表示 */
    background: linear-gradient(to bottom, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#timer-val {
    font-size: 1.5rem;
    font-weight: 900;
    font-family: 'Outfit', monospace;
    font-variant-numeric: tabular-nums; /* 数字の等幅表示 */
    background: linear-gradient(to bottom, #fef08a, #eab308); /* 明るいイエロー */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 8px rgba(234, 179, 8, 0.4);
}

/* タイマーが少なくなった際の警告点滅 */
.timer-box.timer-danger {
    border-color: rgba(239, 68, 68, 0.8) !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.6), 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    animation: timerPulse 0.5s ease-in-out infinite alternate;
}

.timer-box.timer-danger #timer-val {
    background: linear-gradient(to bottom, #fca5a5, #ef4444) !important;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 12px rgba(239, 68, 68, 0.8);
}

@keyframes timerPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

#next-preview {
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#msg-overlay {
    position: absolute;
    inset: -4px; /* サブピクセル隙間の完全隠蔽 */
    background: radial-gradient(circle at 50% 30%, #0b1329 0%, #050814 100%);
    backdrop-filter: blur(16px);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
    z-index: 250;
    overflow: hidden;
}

#gameover-overlay {
    position: absolute;
    inset: -4px; /* サブピクセル隙間の完全隠蔽 */
    background: radial-gradient(circle at 50% 30%, #0a1124 0%, #03050c 100%);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
    z-index: 20;
}

.msg-content {
    text-align: center;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

h2 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-premium {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 999px;
    color: white;
    font-weight: 900;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
}

.btn-premium:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.4);
}

.hidden {
    opacity: 0;
    pointer-events: none !important;
}

.final-score {
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 2rem;
    color: #f59e0b;
}

/* Bubbles Animation */
.bubbles {
    position: absolute;
    bottom: -20px;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.bubble {
    position: absolute;
    bottom: -20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: rise 10s infinite ease-in;
}

@keyframes rise {
    0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
    10% { opacity: 0.4; }
    30% { transform: translateY(-250px) translateX(15px) rotate(90deg); opacity: 0.6; }
    60% { transform: translateY(-500px) translateX(-15px) rotate(210deg); opacity: 0.6; }
    85% { opacity: 0.4; }
    100% { transform: translateY(-820px) translateX(10px) rotate(360deg); opacity: 0; }
}
/* Fry (Baby Fish) Particle */
.fry-particle {
    position: absolute;
    width: 6px;
    height: 4px;
    border-radius: 50% 100% 100% 50%;
    pointer-events: none;
    z-index: 5;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    animation: swimAway 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.fry-particle::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 5px solid currentColor;
    border-top: 3px solid transparent;
    border-bottom: 3px solid transparent;
    opacity: 0.7;
}

@keyframes swimAway {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    20% {
        transform: scale(1.5) rotate(15deg);
    }
    100% {
        transform: translate(var(--tx), var(--ty)) rotate(45deg) scale(0.5);
        opacity: 0;
    }
}

/* 水中光（God rays）演出 */
#game-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(45deg, rgba(56, 189, 248, 0.04) 0%, transparent 60%),
        linear-gradient(-45deg, rgba(129, 140, 248, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 2;
    animation: godRays 12s ease-in-out infinite alternate;
}

@keyframes godRays {
    0% { transform: scale(1) rotate(0deg); opacity: 0.6; }
    50% { transform: scale(1.15) rotate(3deg); opacity: 0.9; }
    100% { transform: scale(1) rotate(-3deg); opacity: 0.6; }
}

/* 音量ボタン */
.volume-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 1.1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

.volume-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.volume-btn.muted {
    opacity: 0.5;
    background: rgba(0, 0, 0, 0.3);
}

/* 警告パルス（デッドライン） */
.warning-flash-overlay {
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 40px rgba(239, 68, 68, 0);
    pointer-events: none;
    z-index: 15;
    transition: box-shadow 0.5s ease;
    border-radius: 2.5rem;
}

.warning-flash-overlay.active {
    animation: warningPulse 1s ease-in-out infinite alternate;
}

@keyframes warningPulse {
    0% { box-shadow: inset 0 0 15px rgba(239, 68, 68, 0.4); }
    100% { box-shadow: inset 0 0 50px rgba(239, 68, 68, 0.95); }
}

/* スマホ用タッチコントローラー */
.touch-controls {
    display: none !important; /* スワイプ・タップジェスチャーによる快適な直接操作が実装されているため、操作パネルUIを完全撤去！ */
}

.touch-controls .control-row {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    width: 100%;
    pointer-events: none;
}

.ctrl-btn {
    pointer-events: auto;
    width: 48px; /* 60px から 48px へコンパクト化し、被り面積を劇的縮小！ */
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08); /* 極薄の白系透明背景 */
    backdrop-filter: blur(4px); /* 薄いすりガラスにして後ろを透かす */
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.25rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ctrl-btn:active {
    transform: scale(0.9);
    background: rgba(56, 189, 248, 0.4); /* 美しいシアン（水色）発光 */
    border-color: rgba(56, 189, 248, 0.7);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.6);
    color: #e0f2fe;
}

.drop-btn {
    width: 140px; /* 180px から 140px にスリム化 */
    height: 40px; /* 48px から 40px にスリム化 */
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.1em;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.3) 0%, rgba(34, 211, 238, 0.3) 100%); /* 美しい半透明シアン */
    border: 1.5px solid rgba(34, 211, 238, 0.35);
}

.drop-btn:active {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.7) 0%, rgba(34, 211, 238, 0.7) 100%);
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.6);
}

/* レスポンシブ非表示設定 */
@media (min-width: 769px) {
    .hidden-pc {
        display: none !important;
    }
    #game-container {
        max-width: 600px !important; /* PC時は最大幅を600pxに拡張してダイナミックに！ */
        max-height: 960px !important; /* 最大高さを960pxに拡張して大迫力に！ */
        height: 96dvh !important; /* PC時もdvhで美しくアスペクト比維持 */
        margin: 2dvh auto !important; /* 画面中央に美しくそびえ立たせる */
    }
}

@media (max-width: 768px) {
    /* スマホ時はコントローラーがあるため、ゲームオーバーや開始画面に少しだけ調整 */
    .msg-content {
        margin-bottom: 5rem;
    }

    /* --- スマホ用ヘッダー見切れ防止超スリムレイアウト --- */
    .header-info {
        padding: 0.5rem 0.5rem 0 0.5rem !important;
        gap: 0.25rem !important;
    }
    .score-box, .timer-box {
        width: 75px !important;
        min-width: 75px !important;
        padding: 0.4rem 0.2rem !important;
        border-radius: 1rem !important;
    }
    .next-box {
        width: 62px !important;
        min-width: 62px !important;
        padding: 0.4rem 0.2rem !important;
        border-radius: 1rem !important;
    }
    #next-preview {
        width: 42px !important;
        height: 42px !important;
    }
    .fever-box {
        margin: 0 0.15rem !important;
        padding: 0.4rem 0.35rem !important;
        border-radius: 1rem !important;
    }
    .fever-bar-outer {
        height: 8px !important;
    }
    .volume-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.9rem !important;
    }
    #score, #timer-val {
        font-size: 1.15rem !important;
    }
    .label {
        font-size: 0.55rem !important;
        margin-bottom: 0.1rem !important;
    }
}

/* ポップでアーティスティックなコンボテキスト */
.combo-popup {
    position: absolute;
    pointer-events: none;
    z-index: 150;
    font-family: 'Outfit', 'Zen Maru Gothic', sans-serif;
    font-weight: 900;
    font-size: 2.2rem;
    text-align: center;
    transform-origin: center center;
    /* フリッカーバグを引き起こす background-clip と transparent を完全廃止し、
       単色と強力なネオンテキストシャドウで美しいプレミアムデザインを再現！ */
    color: #ff007f;
    text-shadow: 
        2px 2px 0px #000000,
        0 0 10px #ff007f,
        0 0 20px #ffaa00;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
    animation: comboPop 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;

    /* スマホでのチラつき防止対策 (GPUコンポジットレイヤーの強制昇格) */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform, opacity;
}

.combo-popup .sub-score {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
    color: #ffeb3b;
    -webkit-text-fill-color: initial;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.9), 0 0 10px rgba(255, 235, 59, 0.8);
    margin-top: -0.25rem;
}

@keyframes comboPop {
    0% {
        transform: scale(0.2) rotate(-15deg);
        opacity: 0;
    }
    15% {
        transform: scale(1.3) rotate(10deg);
        opacity: 1;
    }
    30% {
        transform: scale(1.0) rotate(-5deg);
        opacity: 1;
    }
    75% {
        transform: scale(1.0) translateY(-20px) rotate(-5deg);
        opacity: 1;
    }
    100% {
        transform: scale(0.6) translateY(-60px) rotate(15deg);
        opacity: 0;
    }
}

/* レベルアップポップアップ */
.level-up-popup {
    position: absolute;
    pointer-events: none;
    z-index: 155;
    font-family: 'Outfit', 'Zen Maru Gothic', sans-serif;
    font-weight: 900;
    font-size: 2.6rem;
    text-align: center;
    transform-origin: center center;
    /* フリッカーバグを引き起こす background-clip と transparent を完全廃止し、
       単色と強力なネオンテキストシャドウで美しいプレミアムデザインを再現！ */
    color: #00ff66;
    text-shadow: 
        2px 2px 0px #000000,
        0 0 10px #00ff66,
        0 0 25px #ffff00;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.6));
    animation: levelUpPop 2.0s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;

    /* スマホでのチラつき防止対策 (GPUコンポジットレイヤーの強制昇格) */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform, opacity;
}

.level-up-popup .sub-desc {
    display: block;
    font-size: 1.0rem;
    font-weight: 800;
    color: #ffffff;
    -webkit-text-fill-color: initial;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.9);
    margin-top: 0.25rem;
    letter-spacing: 0.1em;
}

@keyframes levelUpPop {
    0% {
        transform: scale(0.1) rotate(20deg);
        opacity: 0;
    }
    12% {
        transform: scale(1.3) rotate(-10deg);
        opacity: 1;
    }
    20% {
        transform: scale(1.0) rotate(0deg);
        opacity: 1;
    }
    85% {
        transform: scale(1.0) translateY(-10px);
        opacity: 1;
    }
    100% {
        transform: scale(0.5) translateY(-50px);
        opacity: 0;
    }
}

/* --- Ranking Modal UI Styles --- */
.btn-secondary-roe {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.85);
    padding: 0.75rem 2rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.05em;
    backdrop-filter: blur(5px);
}

.btn-secondary-roe:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.1);
}

.ranking-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 500; /* タイトル画面(z-index:250)の前面に表示するための調整 */
    transition: opacity 0.3s ease;
}

.ranking-modal-content {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 2rem;
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    width: 90%;
    max-width: 420px;
    max-height: 85%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(56, 189, 248, 0.05);
    position: relative;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.ranking-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.ranking-close:hover {
    color: #ef4444;
}

.ranking-modal-title {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 900;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, #38bdf8 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.05em;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.ranking-tabs {
    display: flex;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    padding: 0.25rem;
    margin-bottom: 1.25rem;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 0.5rem 0;
    font-weight: 900;
    font-size: 0.85rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.05em;
}

.tab-btn.active {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.ranking-list-container {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 1.25rem;
    padding-right: 0.25rem;
}

/* スクロールバーのカスタマイズ */
.ranking-list-container::-webkit-scrollbar {
    width: 6px;
}
.ranking-list-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}
.ranking-list-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
.ranking-list-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
}

.ranking-table th {
    font-size: 0.75rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding-bottom: 0.75rem;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.1);
}

.ranking-table td {
    padding: 0.75rem 0.25rem;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.ranking-table tr.my-row {
    background: rgba(99, 102, 241, 0.15);
}

.ranking-table tr.my-row td {
    border-color: rgba(99, 102, 241, 0.3);
}

.ranking-user-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1.5px solid rgba(99, 102, 241, 0.3);
    border-radius: 1.25rem;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-login-roe {
    display: inline-block;
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 999px;
    color: white;
    font-weight: 900;
    font-size: 0.85rem;
    text-decoration: none;
    margin-top: 0.5rem;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
}

.btn-login-roe:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(6, 182, 212, 0.4);
}

/* --- Fever Mode (たまらんモード) UI Styles --- */
ruby {
    ruby-position: over;
    text-shadow: 0 0 15px rgba(129, 140, 248, 0.6);
}

rt {
    font-size: 0.4em;
    font-weight: 900;
    letter-spacing: 0.1em;
    padding-bottom: 0.1em;
    color: #ff007f;
    text-shadow: 0 0 5px rgba(255, 0, 127, 0.8);
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
}

.fever-box {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 0.6rem 1rem;
    border-radius: 1.25rem;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    flex: 1;
    margin: 0 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.fever-bar-outer {
    width: 100%;
    height: 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
    position: relative;
}

.fever-bar-inner {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff007f 0%, #ff7700 50%, #ffaa00 100%);
    box-shadow: 0 0 10px #ff007f, 0 0 20px #ffaa00;
    transition: width 0.1s ease-out;
    border-radius: 6px;
}

/* ゲージが80%以上になったときのドキドキ脈動エフェクト */
.fever-bar-inner.danger-pulse {
    animation: barPulse 0.4s infinite alternate;
}

@keyframes barPulse {
    0% { filter: brightness(1); box-shadow: 0 0 8px #ff007f; }
    100% { filter: brightness(1.5); box-shadow: 0 0 20px #ff7700, 0 0 30px #ff007f; }
}

/* フィーバー突入時の巨大通知オーバーレイ */
.fever-flash-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 300;
    pointer-events: none;
    animation: feverFlashBg 1.5s ease-out forwards;
}

.fever-flash-text {
    font-family: 'Outfit', 'Zen Maru Gothic', sans-serif;
    font-weight: 900;
    font-size: 3.5rem;
    text-align: center;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, #ff007f 0%, #ffaa00 25%, #00f2ff 50%, #a855f7 75%, #ff007f 100%);
    background-size: 400% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 5px 5px 0px rgba(0,0,0,0.9), 0 0 30px rgba(255, 0, 127, 0.8);
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.8));
    animation: 
        feverTextSplash 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
        rainbowShift 2s linear infinite;
    transform: scale(0.2);
}

@keyframes feverFlashBg {
    0% { background: rgba(255, 255, 255, 0.95); }
    15% { background: rgba(255, 0, 127, 0.7); }
    30% { background: rgba(0, 242, 255, 0.8); }
    45% { background: rgba(15, 23, 42, 0.9); }
    100% { background: rgba(15, 23, 42, 0); opacity: 0; }
}

@keyframes feverTextSplash {
    0% { transform: scale(0.1) rotate(-20deg); opacity: 0; }
    30% { transform: scale(1.4) rotate(10deg); opacity: 1; }
    50% { transform: scale(1.0) rotate(-5deg); opacity: 1; }
    85% { transform: scale(1.0) translateY(-10px) rotate(-5deg); opacity: 1; }
    100% { transform: scale(1.8) translateY(-100px) rotate(15deg); opacity: 0; }
}

@keyframes rainbowShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* フィーバー中（たまらんモード）の激しいレインボー水槽演出 */
#game-container.fever-active {
    animation: feverNeonBorder 0.6s infinite linear;
    box-shadow: 0 0 100px rgba(255, 0, 127, 0.6), inset 0 0 45px rgba(255, 0, 127, 0.4) !important;
}

@keyframes feverNeonBorder {
    0% { border-color: #ff007f; }
    20% { border-color: #ffaa00; }
    40% { border-color: #00ff66; }
    60% { border-color: #00f2ff; }
    80% { border-color: #a855f7; }
    100% { border-color: #ff007f; }
}

/* フィーバー中の水中光（God rays）の超高速サイケデリックレインボー化 */
#game-container.fever-active::before {
    background: 
        linear-gradient(45deg, rgba(255, 0, 127, 0.12) 0%, transparent 60%),
        linear-gradient(-45deg, rgba(0, 242, 255, 0.12) 0%, transparent 60%),
        linear-gradient(180deg, rgba(255, 170, 0, 0.05) 0%, transparent 80%) !important;
    animation: godRays 2.5s ease-in-out infinite alternate, feverRainbowBg 4.0s linear infinite !important;
    opacity: 0.9 !important;
}

@keyframes feverRainbowBg {
    0% { filter: hue-rotate(0deg) saturate(2); }
    100% { filter: hue-rotate(360deg) saturate(2); }
}

/* フィーバー中のみ表示されるパーティクル演出用クラス */
.fever-particle {
    position: absolute;
    pointer-events: none;
    z-index: 120;
    border-radius: 50%;
    animation: feverParticleRise 1.5s ease-out forwards;
}

@keyframes feverParticleRise {
    0% { transform: translateY(0) scale(1) rotate(0deg); opacity: 0.9; }
    100% { transform: translateY(-300px) scale(0.2) rotate(360deg); opacity: 0; }
}

/* --- Deep Sea Caustics & Seabed Styles --- */

/* 海底のさざ波・水中光の不規則な揺らぎ（Caustics）の再現 */
.water-caustics {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 35% 20%, rgba(56, 189, 248, 0.18) 0%, transparent 60%),
        radial-gradient(circle at 75% 65%, rgba(14, 165, 233, 0.14) 0%, transparent 70%);
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 2; /* 泡や魚卵、UIの後方（背景）に配置 */
    animation: waterWiggle 14s ease-in-out infinite alternate;
    border-radius: 2.5rem; /* 水槽の角丸にフィット */
}

/* 二重の波の干渉を表現するafter疑似要素 */
.water-caustics::after {
    content: '';
    position: absolute;
    inset: -100px;
    background-image: 
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.025) 0px, rgba(255, 255, 255, 0.025) 3px, transparent 3px, transparent 36px),
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.018) 0px, rgba(255, 255, 255, 0.018) 3px, transparent 3px, transparent 32px);
    filter: blur(8px);
    mix-blend-mode: overlay;
    animation: causticsWave 22s linear infinite;
    pointer-events: none;
}

@keyframes waterWiggle {
    0% { transform: scale(1.0) rotate(0deg) translate(0, 0); }
    100% { transform: scale(1.15) rotate(4deg) translate(10px, 15px); }
}

@keyframes causticsWave {
    0% { transform: rotate(0deg) scale(1.0) translate(0, 0); }
    50% { transform: rotate(180deg) scale(1.15) translate(20px, -20px); }
    100% { transform: rotate(360deg) scale(1.0) translate(0, 0); }
}

/* 水槽内のすり鉢（受け皿）の外側のデッドスペースを黒く覆うマスクレイヤー */
.bowl-bg-mask {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    /* 高さと背景グラデーションはgame.js内のcreateBowl()で物理エンジンと完璧にシンクロして動的設定されます */
    border-radius: 0 0 2.5rem 2.5rem;
    pointer-events: none;
    z-index: 1; /* 背景画像の上、Causticsや泡、魚卵の下に配置 */
}

/* 海底の砂地・岩壁の美しいシルエット層 */
.seabed-silhouette {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.3) 50%, rgba(2, 6, 23, 0.75) 100%);
    pointer-events: none;
    z-index: 3; /* 物理水槽底面と完璧に重ねて交差させる */
    border-radius: 0 0 2.5rem 2.5rem;
}

/* フィーバー中（たまらんモード）の海底揺らぎの激しいサイケデリックレインボー融合 */
#game-container.fever-active .water-caustics {
    background: 
        radial-gradient(circle at 35% 20%, rgba(255, 0, 127, 0.22) 0%, transparent 60%),
        radial-gradient(circle at 75% 65%, rgba(0, 242, 255, 0.2) 0%, transparent 70%) !important;
    animation: waterWiggle 3.5s ease-in-out infinite alternate, feverRainbowBg 5s linear infinite !important;
    mix-blend-mode: screen !important;
    opacity: 0.95;
}

#game-container.fever-active .water-caustics::after {
    background-image: 
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.05) 0px, rgba(255, 255, 255, 0.05) 4px, transparent 4px, transparent 30px),
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.04) 0px, rgba(255, 255, 255, 0.04) 4px, transparent 4px, transparent 25px) !important;
    animation: causticsWave 7s linear infinite !important;
    filter: blur(6px) !important;
}

/* --- Title Premium UI Enhancements --- */

/* 深海の神秘的ネオングロー円 */
.title-bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;

    /* スマホでのチラつき防止対策 (GPUコンポジットレイヤーの強制昇格) */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform;
}

.title-bg-glow.glow-1 {
    width: 250px;
    height: 250px;
    background: #ff007f;
    top: 10%;
    left: -10%;
    animation: floatingGlow 8s ease-in-out infinite alternate;
}

.title-bg-glow.glow-2 {
    width: 300px;
    height: 300px;
    background: #00f2ff;
    bottom: 10%;
    right: -10%;
    animation: floatingGlow 10s ease-in-out infinite alternate-reverse;
}

@keyframes floatingGlow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, -20px) scale(1.15); }
}

/* プレミアムカードベース */
.premium-card {
    width: 88%;
    max-width: 420px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.7) 0%, rgba(8, 12, 24, 0.8) 100%) !important;
    border: 1.5px solid rgba(56, 189, 248, 0.35) !important; /* 美しいシアンのネオン境界線 */
    border-radius: 2.25rem !important;
    padding: 2.25rem 1.5rem !important;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.8),
        inset 0 0 30px rgba(56, 189, 248, 0.15) !important; /* 美しいシアンの内側グロー */
    z-index: 10;
    text-align: center;
    box-sizing: border-box;
}

.title-logo-container {
    margin-bottom: 2.25rem;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.title-logo-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.25rem;
}

.logo-sub-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 900;
    color: #38bdf8;
    letter-spacing: 0.45em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
    animation: pulseSubTitle 2s infinite alternate;
}

@keyframes pulseSubTitle {
    0% { opacity: 0.7; }
    100% { opacity: 1; text-shadow: 0 0 15px rgba(56, 189, 248, 0.9); }
}

/* 立体3Dポップ ＆ 0.3秒おき一文字ずつ変色するアーティスティックタイトル文字 */
.neon-title-art {
    font-size: 3.2rem !important;
    font-weight: 900 !important;
    font-family: 'Zen Maru Gothic', sans-serif !important;
    margin: 0 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.15rem;
    letter-spacing: 0.02em !important;
    line-height: 1.3 !important;
}

.neon-title-art .char {
    display: inline-block;
    color: #ffffff !important; /* 文字盤を真っ白にし、黒ずみを完全解消！ */
    animation: colorPulseArt 2.4s infinite linear;
    animation-delay: calc(var(--char-idx) * 0.3s); /* 0.3秒おきに変色ウェーブ */
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.8)); /* ぼかしフィルターは静的に固定しチラつきバグを撲滅！ */
    
    /* 水色テーマに調和する、スカイブルー〜ネイビーの多層3D押し出し立体影 */
    text-shadow: 
        0 1px 0 #0284c7,
        0 2px 0 #0369a1,
        0 3px 0 #075985,
        0 4px 0 #0c4a6e,
        0 5px 0 rgba(0, 0, 0, 0.9),
        0 8px 15px rgba(14, 165, 233, 0.5) !important;

    /* スマホでのチラつき防止対策 (GPUコンポジットレイヤーの強制昇格) */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform, color;
}

/* 1文字単位で滑らかに移り変わる、極上の水色・シアン系ネオン変色カラー (高負荷な filter アニメーションを完全排除) */
@keyframes colorPulseArt {
    0% { color: #ffffff; }
    25% { color: #e0f2fe; }
    50% { color: #bae6fd; }
    75% { color: #7dd3fc; }
    100% { color: #38bdf8; }
}

.title-badge {
    display: inline-block;
    background: linear-gradient(90deg, rgba(6,182,212,0.2) 0%, rgba(56,189,248,0.2) 100%);
    border: 1px solid rgba(56, 189, 248, 0.45);
    color: #e0f2fe;
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.25em;
    padding: 0.25rem 0.85rem;
    border-radius: 999px;
    margin-top: 0.5rem;
    font-family: 'Outfit', sans-serif;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* プレミアムな遊び方説明ボタン */
.btn-premium-howtoplay {
    background: rgba(15, 23, 42, 0.6);
    border: 1.5px solid rgba(168, 85, 247, 0.3);
    padding: 0.75rem 2.0rem;
    border-radius: 999px;
    color: #c084fc;
    font-weight: 900;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.05em;
    backdrop-filter: blur(10px);
}

.btn-premium-howtoplay:hover {
    background: rgba(168, 85, 247, 0.12);
    border-color: #a855f7;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(168, 85, 247, 0.2);
}

/* --- Premium How To Play Modal UI Styles --- */
.howtoplay-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 500; /* タイトル画面(z-index:250)の前面に表示するための調整 */
    transition: opacity 0.3s ease;
}

.howtoplay-modal-content {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 2rem;
    padding: 2.25rem 1.5rem 1.5rem 1.5rem;
    width: 90%;
    max-width: 420px;
    max-height: 85%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(56, 189, 248, 0.05);
    position: relative;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.howtoplay-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.howtoplay-close:hover {
    color: #ef4444;
}

.howtoplay-modal-title {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 900;
    margin-top: 0;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, #a855f7 0%, #ff007f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.05em;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.howtoplay-list-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.25rem;
}

/* スクロールバーのカスタマイズ */
.howtoplay-list-container::-webkit-scrollbar {
    width: 6px;
}
.howtoplay-list-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}
.howtoplay-list-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
.howtoplay-list-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.htp-premium-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.htp-premium-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1.25rem;
    padding: 0.85rem 1rem;
}

.htp-premium-icon {
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.06);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.htp-premium-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.htp-premium-text strong {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.15rem;
}

.htp-premium-text span {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}f 0%, #ff5500 45%, #ffbb00 70%, #00f2ff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    animation: rainbowShift 4s linear infinite;
    line-height: 1.25 !important;
    
    /* ぷにぷにポップな超立体3D影エフェクト */
    text-shadow: 
        0 1px 0 rgba(0, 0, 0, 0.8),
        0 2px 0 rgba(0, 0, 0, 0.8),
        0 3px 0 rgba(0, 0, 0, 0.8),
        0 4px 0 rgba(0, 0, 0, 0.8),
        0 5px 0 rgba(0, 0, 0, 0.8),
        0 8px 15px rgba(0, 0, 0, 0.6),
        0 0 25px rgba(255, 0, 127, 0.75) !important;
}

.neon-title ruby {
    text-shadow: none !important;
}

.neon-title rt {
    font-size: 0.32em !important;
    letter-spacing: 0.25em !important;
    color: #ff007f !important;
    text-shadow: 0 0 10px rgba(255, 0, 127, 0.9) !important;
    display: block !important;
    margin-bottom: -0.3rem !important;
    transform: translateY(-2px);
}

.title-sub {
    font-size: 2.3rem !important;
    color: #ffffff !important;
    -webkit-text-fill-color: initial !important;
    text-shadow: 
        0 1px 0 rgba(0, 0, 0, 0.8),
        0 2px 0 rgba(0, 0, 0, 0.8),
        0 3px 0 rgba(0, 0, 0, 0.8),
        0 0 15px rgba(255, 255, 255, 0.4) !important;
}

.title-badge {
    display: inline-block;
    background: linear-gradient(90deg, rgba(255,0,127,0.2) 0%, rgba(0,242,255,0.2) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.25em;
    padding: 0.25rem 0.85rem;
    border-radius: 999px;
    margin-top: 0.5rem;
    font-family: 'Outfit', sans-serif;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* HOW TO PLAY の美麗カードグリッド */
.how-to-play-container {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.5rem;
    padding: 1.25rem 1.0rem;
    margin-bottom: 1.75rem;
    text-align: left;
}

.htp-title {
    font-size: 0.8rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.15em;
    text-align: center;
    margin-top: 0;
    margin-bottom: 1.0rem;
    font-family: 'Outfit', sans-serif;
}

.htp-grid {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.htp-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.htp-icon {
    font-size: 1.35rem;
    background: rgba(255, 255, 255, 0.08);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.htp-text {
    display: flex;
    flex-direction: column;
}

.htp-text strong {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.1rem;
}

.htp-text span {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.3;
}

/* プレミアムなスタートボタン */
.button-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.btn-premium-start {
    background: linear-gradient(135deg, #0ea5e9 0%, #22d3ee 100%); /* 美しいアクアシアンネオン */
    border: none;
    padding: 0.9rem 2.0rem;
    border-radius: 999px;
    color: white;
    font-weight: 900;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.45);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
}

.btn-premium-start::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 20%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    transform: skewX(-25deg);
    animation: shineLight 3s infinite linear;
}

@keyframes shineLight {
    0% { left: -50%; }
    100% { left: 150%; }
}

.btn-premium-start:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 30px rgba(14, 165, 233, 0.65);
}

.btn-premium-ranking {
    background: rgba(15, 23, 42, 0.6);
    border: 1.5px solid rgba(0, 242, 255, 0.3);
    padding: 0.75rem 2.0rem;
    border-radius: 999px;
    color: #00f2ff;
    font-weight: 900;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.05em;
    backdrop-filter: blur(10px);
}

.btn-premium-ranking:hover {
    background: rgba(0, 242, 255, 0.12);
    border-color: #00f2ff;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 242, 255, 0.2);
}

/* --- Item Slots Premium UI --- */
.item-slots {
    position: absolute;
    bottom: 2.8rem; /* すり鉢（ボウル）下部の左右デッドスペースへ移設 */
    left: 1.5rem;
    right: 1.5rem;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 120; /* タッチコントローラーと同等以上に手前に配置 */
    width: calc(100% - 3.0rem);
}

.item-btn {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    user-select: none;
    -webkit-user-select: none;
    padding: 0;
    box-sizing: border-box;
}

/* 各ボタンの固有ネオングロー */
#item-stone {
    box-shadow: 0 0 12px rgba(249, 115, 22, 0.2), 0 8px 24px rgba(0, 0, 0, 0.4);
    border-color: rgba(249, 115, 22, 0.35);
}
#item-stone:not(.used):hover {
    background: rgba(249, 115, 22, 0.15) !important;
    border-color: #f97316 !important;
    box-shadow: 0 0 25px rgba(249, 115, 22, 0.5), 0 8px 24px rgba(0, 0, 0, 0.4) !important;
    transform: translateY(-3px) scale(1.05);
}

#item-dna {
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.2), 0 8px 24px rgba(0, 0, 0, 0.4);
    border-color: rgba(168, 85, 247, 0.35);
}
#item-dna:not(.used):hover {
    background: rgba(168, 85, 247, 0.15) !important;
    border-color: #a855f7 !important;
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.5), 0 8px 24px rgba(0, 0, 0, 0.4) !important;
    transform: translateY(-3px) scale(1.05);
}

/* 使用前の穏やかな脈動 */
.item-btn:not(.used) {
    animation: itemPulse 2s infinite alternate;
}

@keyframes itemPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.03); }
}

.item-icon {
    font-size: 1.45rem;
    line-height: 1;
    margin-bottom: 0.05rem;
}

.item-label {
    font-size: 0.55rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.55);
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.05em;
}

/* 使用済み状態 (暗化) */
.item-btn.used {
    opacity: 0.25 !important;
    cursor: not-allowed !important;
    background: rgba(0, 0, 0, 0.6) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
    box-shadow: none !important;
    animation: none !important;
    transform: none !important;
}

.item-btn.used .item-label {
    color: #ef4444 !important;
}

/* 豪快な画面揺らし（画面シェイク） */
.screen-shake {
    animation: shake 0.45s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-3px, 0, 0); }
    20%, 80% { transform: translate3d(5px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-7px, 0, 0); }
    40%, 60% { transform: translate3d(7px, 0, 0); }
}

/* 神秘的なDNAスキャニングレーザービーム */
.scan-beam {
    position: absolute;
    left: 0;
    width: 100%;
    height: 10px;
    background: linear-gradient(180deg, rgba(168, 85, 247, 0) 0%, #a855f7 50%, rgba(168, 85, 247, 0) 100%);
    box-shadow: 0 0 15px #a855f7, 0 0 35px #a855f7;
    z-index: 100;
    pointer-events: none;
    animation: scanning 1.2s ease-in-out forwards;
}

@keyframes scanning {
    0% { top: 0%; opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* ==========================================================================
   Welcome Tap Autoplay Policy Overlay (Artistic Deep Sea Neo-Glow Edition)
   ========================================================================== */
.welcome-overlay {
    position: absolute;
    inset: 0;
    z-index: 1000; /* 全てのUI、タイトル画面、オーバーレイの最前面 */
    background: radial-gradient(circle at 50% 30%, #030712 0%, #020617 65%, #000105 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    overflow: hidden;
    cursor: pointer;
    transition: opacity 1.0s cubic-bezier(0.25, 1, 0.5, 1), transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

/* フェードアウト時のシームレスな吸い込み演出 */
.welcome-overlay.welcome-fade-out {
    opacity: 0;
    transform: scale(1.15); /* 奥に吸い込まれるように拡大しながら消える */
    pointer-events: none;
}

/* 深海の神秘的な発光揺らぎ */
.welcome-bg-glow {
    position: absolute;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.12) 0%, rgba(236, 72, 153, 0.04) 50%, rgba(0,0,0,0) 70%);
    filter: blur(20px);
    animation: slowGlowMove 8s ease-in-out infinite alternate;
    pointer-events: none;

    /* スマホでのチラつき防止対策 (GPUコンポジットレイヤーの強制昇格) */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform;
}

@keyframes slowGlowMove {
    0% { transform: scale(1.0) translate(-10px, -10px); }
    100% { transform: scale(1.2) translate(10px, 10px); }
}

.welcome-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 10;
    pointer-events: none;
}

/* 呼吸するように脈動するゴールドピンクの卵オーブ */
.pulsing-roe-orb {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 3.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.orb-inner {
    position: absolute;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffedd5 0%, #f97316 65%, #db2777 100%);
    box-shadow: 0 0 35px rgba(249, 115, 22, 0.6), inset -5px -5px 15px rgba(0, 0, 0, 0.4), inset 5px 5px 10px rgba(255, 255, 255, 0.6);
    animation: orbPulse 3.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;

    /* スマホでのチラつき防止対策 (GPUコンポジットレイヤーの強制昇格) */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform;
}

.orb-shine {
    position: absolute;
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 50%);
    transform: rotate(-15deg);
    animation: orbPulse 3.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;

    /* スマホでのチラつき防止対策 (GPUコンポジットレイヤーの強制昇格) */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform;
}

/* box-shadowアニメーションを完全廃止し、滑らかなスケール変化のみでフリッカーを撲滅！ */
@keyframes orbPulse {
    0% {
        transform: scale(1.0);
    }
    50% {
        transform: scale(1.06);
    }
    100% {
        transform: scale(1.0);
    }
}

/* オシャレでアーティスティックな明滅テキスト */
.welcome-prompt {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.prompt-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.45em;
    text-indent: 0.45em; /* センタリングのズレ補正 */
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
    animation: slowBlink 2.4s ease-in-out infinite;
}

.prompt-sub {
    font-family: 'Outfit', sans-serif;
    font-size: 0.65rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.25em;
    text-indent: 0.25em;
    animation: slowBlink 2.4s ease-in-out infinite;
    animation-delay: 0.3s;
}

@keyframes slowBlink {
    0% { opacity: 0.35; filter: blur(0px); }
    50% { opacity: 0.95; filter: blur(0.3px); }
    100% { opacity: 0.35; filter: blur(0px); }
}

/* --- Premium Credit Button & Modal UI Styles --- */
.btn-premium-credit {
    background: rgba(15, 23, 42, 0.6);
    border: 1.5px solid rgba(16, 185, 129, 0.3);
    padding: 0.75rem 2.0rem;
    border-radius: 999px;
    color: #34d399;
    font-weight: 900;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: 'Outfit', sans-serif;
    margin-top: 0.25rem;
}

.btn-premium-credit:hover {
    background: rgba(16, 185, 129, 0.12);
    border-color: #10b981;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.2);
}

.credit-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 500;
    transition: opacity 0.3s ease;
}

.credit-modal-content {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 2rem;
    padding: 2.25rem 1.5rem 1.5rem 1.5rem;
    width: 90%;
    max-width: 420px;
    max-height: 85%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(16, 185, 129, 0.05);
    position: relative;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.credit-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.credit-close:hover {
    color: #ef4444;
}

.credit-modal-title {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 900;
    margin-top: 0;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.05em;
}

.credit-list-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.credit-premium-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.credit-premium-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1.25rem;
    padding: 0.85rem 1.15rem;
    transition: all 0.3s ease;
}

.credit-premium-item:hover {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.2);
    transform: translateX(4px);
}

.credit-premium-icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 8px rgba(16, 185, 129, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
}

.credit-premium-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.credit-premium-text strong {
    color: #f1f5f9;
    font-size: 0.95rem;
    font-weight: 700;
}

.credit-premium-text span {
    color: #94a3b8;
    font-size: 0.85rem;
    line-height: 1.3;
}

/* --- Premium Stats Button & Modal UI Styles --- */
.btn-premium-stats {
    background: rgba(15, 23, 42, 0.6);
    border: 1.5px solid rgba(56, 189, 248, 0.3);
    padding: 0.75rem 2.0rem;
    border-radius: 999px;
    color: #38bdf8;
    font-weight: 900;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: 'Outfit', sans-serif;
    margin-top: 0.25rem;
}

.btn-premium-stats:hover {
    background: rgba(56, 189, 248, 0.12);
    border-color: #38bdf8;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(56, 189, 248, 0.2);
}

.stats-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 500;
    transition: opacity 0.3s ease;
}

.stats-modal-content {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 2rem;
    padding: 2.25rem 1.5rem 1.5rem 1.5rem;
    width: 90%;
    max-width: 420px;
    max-height: 85%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(56, 189, 248, 0.05);
    position: relative;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stats-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.stats-close:hover {
    color: #ef4444;
}

.stats-modal-title {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 900;
    margin-top: 0;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.05em;
}

.stats-list-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.stats-premium-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stats-premium-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1.25rem;
    padding: 0.85rem 1.15rem;
    transition: all 0.3s ease;
}

.stats-premium-item:hover {
    background: rgba(56, 189, 248, 0.05);
    border-color: rgba(56, 189, 248, 0.2);
    transform: translateX(4px);
}

.stats-premium-icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 8px rgba(56, 189, 248, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-premium-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.stats-premium-text strong {
    color: #f1f5f9;
    font-size: 0.95rem;
    font-weight: 700;
}
