/* ==========================
   ミニゲーム
========================== */

.game-loading{
    position:fixed;
    inset:0;
    z-index:2000;
    display:none;
    align-items:center;
    justify-content:center;
    flex-direction:column;
    gap:12px;
    background:rgba(255,255,255,.82);
}

.game-loading.visible{display:flex}

.game-loading-spinner{
    width:34px;
    height:34px;
    border:4px solid #ffe1ed;
    border-top-color:#ff709f;
    border-radius:50%;
    animation:game-loading-spin .8s linear infinite;
}

.game-loading-text{
    color:#777;
    font-size:13px;
    font-weight:bold;
}

@keyframes game-loading-spin{
    to{transform:rotate(360deg)}
}

/* ==========================
   TOP
========================== */

.game-top-intro,
.game-select-intro{
    margin-bottom:14px;
}

.game-top-title,
.game-select-title{
    color:#333;
    font-size:17px;
    font-weight:bold;
}

.game-top-description,
.game-select-description{
    margin-top:4px;
    color:#888;
    font-size:12px;
}

.game-type-list,
.difficulty-select-list{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.game-extra-list{
    margin-top:12px;
}

.game-demo-section{
    margin-top:22px;
    padding-top:18px;
    border-top:1px solid rgba(255,112,159,.28);
}

.game-demo-heading{
    margin-bottom:12px;
    padding:12px 14px;
    border:1px solid rgba(255,112,159,.24);
    border-radius:14px;
    background:rgba(255,255,255,.78);
}

.game-demo-heading h2{
    margin:0;
    color:#b64f78;
    font-size:15px;
    font-weight:700;
}

.game-demo-heading p{
    margin:4px 0 0;
    color:#888;
    font-size:12px;
}

.game-type-card,
.difficulty-select-card{
    display:flex;
    align-items:center;
    width:100%;
    min-height:82px;
    box-sizing:border-box;
    padding:12px 14px;
    border-radius:16px;
    background:#fff;
    color:#333;
    text-decoration:none;
    box-shadow:0 3px 8px rgba(0,0,0,.1);
}

.game-type-icon{
    display:flex;
    align-items:center;
    justify-content:center;
    width:48px;
    height:48px;
    flex:0 0 48px;
    border-radius:14px;
    background:#fff0f6;
    font-size:24px;
}

.game-type-icon img{
    width:100%;
    height:100%;
    object-fit:contain;
    border-radius:14px;
    display:block;
}

.game-type-content{
    min-width:0;
    flex:1;
    margin-left:12px;
}

.game-type-title{
    font-size:14px;
    font-weight:bold;
}

.game-type-description{
    margin-top:4px;
    color:#888;
    font-size:11px;
    line-height:1.5;
}

.game-type-arrow,
.difficulty-select-arrow{
    margin-left:10px;
    color:#bbb;
    font-size:25px;
    line-height:1;
}

/* ==========================
   ランキング
========================== */

.game-ranking-setting{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:14px;
    padding:12px 14px;
    border-radius:14px;
    background:#fff;
    box-shadow:0 2px 6px rgba(0,0,0,.08);
}

.game-ranking-setting-title{
    color:#555;
    font-size:12px;
    font-weight:bold;
}

.game-ranking-setting-status{
    margin-top:3px;
    color:#999;
    font-size:11px;
}

.game-ranking-setting-button{
    min-width:64px;
    padding:8px 12px;
    border:0;
    border-radius:10px;
    background:#fff0f6;
    color:#ff5f96;
    font:inherit;
    font-size:11px;
    font-weight:bold;
    cursor:pointer;
}

.game-ranking-modal{
    position:fixed;
    inset:0;
    z-index:2200;
    display:none;
    align-items:center;
    justify-content:center;
    padding:20px;
    box-sizing:border-box;
    background:rgba(0,0,0,.32);
}

.game-ranking-modal.visible{
    display:flex;
}

.game-ranking-dialog{
    width:100%;
    max-width:430px;
    padding:20px;
    box-sizing:border-box;
    border-radius:18px;
    background:#fff;
    box-shadow:0 8px 30px rgba(0,0,0,.18);
}

.game-ranking-title{
    color:#333;
    font-size:17px;
    font-weight:bold;
}

.game-ranking-description{
    margin-top:8px;
    color:#888;
    font-size:12px;
    line-height:1.7;
}

.game-ranking-actions{
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-top:16px;
}

.game-ranking-button{
    min-height:46px;
    border:0;
    border-radius:12px;
    font:inherit;
    font-size:13px;
    font-weight:bold;
    cursor:pointer;
}

.game-ranking-button.primary{
    background:#fff0f6;
    color:#ff5f96;
}

.game-ranking-button.secondary{
    background:#f5f5f5;
    color:#666;
}

.game-ranking-button:disabled{
    cursor:default;
    opacity:.55;
}

.game-transition-modal.visible{
    display:flex;
}

.game-transition-button.primary{
    background:#fff0f6;
    color:#ff5f96;
}

.game-transition-button.secondary{
    background:#f7f7f7;
    color:#555;
}

.anagram-control.secondary{
    background:#f4f4f4;
    color:#666;
}

.anagram-control.primary{
    background:#fff0f6;
    color:#ff5f96;
}

.game-explanation.visible{
    display:block;
}

.next-button.visible{display:flex}

@media (min-width:768px){
.page-scroll .container{
        width:100%;
        max-width:none;
        margin:0;
        padding:20px 30px 40px;
    }
.game-top-intro,
    .game-type-list,
    .game-select-intro,
    .difficulty-select-list,
    .game-streak,
    .game-card{
        width:100%;
        max-width:none;
    }
}

@media(max-width:767px){
.game-type-card,
    .difficulty-select-card{
        min-height:78px;
    }
}

.anagram-hint-modal.visible,
.anagram-reveal-modal.visible{
    display:flex;
}

.anagram-miss-modal.visible{
    display: flex;
}

/* 新しい問題への遷移中は現在の問題を描画したままにしない */
body.game-navigating .background{
    visibility: hidden;
}

/* ==========================
   デザイン刷新（Issue #286・ミニゲーム選択ページ）
   ※このファイルは難易度選択・プレイ画面と共用のため、
     刷新スタイルは .game-top-container 配下に限定し、
     ランキングモーダルとローディングのみ全体に適用する
========================== */

.game-top-container{
    width:100%;
    max-width:1348px;
    margin:0;
    padding:18px 14px 10px;
    box-sizing:border-box;
}

.game-top-heading h2{
    display:flex;
    align-items:center;
    gap:9px;
    margin:0;
    color:var(--theme-heading, #8f0f31);
    font-size:18px;
    font-weight:bold;
    line-height:1.4;
}

.game-top-heading h2::before{
    content:"";
    flex:0 0 auto;
    width:5px;
    height:21px;
    border-radius:99px;
    background:linear-gradient(180deg, var(--theme-btn-from, #fb4d6d), var(--theme-primary, #e11d48));
}

.game-top-lead{
    margin:6px 0 0;
    color:var(--theme-text-muted, #7a5c63);
    font-size:12px;
    line-height:1.5;
}

.game-top-container .game-top-intro{margin-bottom:16px;}

/* ランキング参加カード */
.game-top-container .game-ranking-setting{
    padding:14px 16px;
    border:1px solid var(--theme-border-soft, #f6e3e6);
    border-radius:16px;
    background:#fff;
    box-shadow:0 2px 10px rgba(190, 18, 60, .05);
    margin-bottom:24px;
}

.game-ranking-setting-main{
    display:flex;
    align-items:center;
    gap:10px;
    min-width:0;
}

.game-ranking-icon{
    display:flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    width:38px;
    height:38px;
    border-radius:50%;
    background:var(--theme-blush, #fff1f2);
    color:var(--theme-primary, #e11d48);
}

.game-ranking-icon svg{width:20px;height:20px;}

.game-top-container .game-ranking-setting-title{
    color:var(--theme-text, #3d2c2e);
    font-size:14px;
    font-weight:bold;
}

.game-top-container .game-ranking-setting-status{
    flex:0 0 auto;
    margin-top:0;
    padding:3px 10px;
    border-radius:999px;
    background:var(--theme-blush, #fff1f2);
    color:var(--theme-brand, #be123c);
    font-size:11px;
    font-weight:bold;
}

.game-top-container .game-ranking-setting-button{
    flex:0 0 auto;
    min-width:0;
    padding:8px 16px;
    border:1px solid var(--theme-border, #f3c2cd);
    border-radius:999px;
    background:#fff;
    color:var(--theme-brand, #be123c);
    font-size:12px;
}

.game-top-container .game-ranking-setting-button:active{transform:scale(.97);}

/* ゲームカード */
.game-top-container .game-type-list{
    display:grid;
    grid-template-columns:1fr;
    gap:10px;
}

.game-top-container .game-type-card{
    min-height:0;
    padding:14px 16px;
    border:1px solid var(--theme-border-soft, #f6e3e6);
    border-radius:16px;
    background:#fff;
    color:var(--theme-text, #3d2c2e);
    box-shadow:0 2px 10px rgba(190, 18, 60, .05);
    transition:transform .12s ease;
    -webkit-tap-highlight-color:transparent;
}

.game-top-container .game-type-card:active{transform:scale(.98);}

.game-top-container .game-type-icon{
    width:44px;
    height:44px;
    flex:0 0 44px;
    border-radius:50%;
    background:var(--theme-blush, #fff1f2);
    color:var(--theme-primary, #e11d48);
    font-size:inherit;
}

.game-top-container .game-type-icon svg{width:22px;height:22px;}

.game-top-container .game-type-icon img{
    width:100%;
    height:100%;
    object-fit:cover;
    border-radius:50%;
}

.game-top-container .game-type-content{margin-left:12px;}

.game-top-container .game-type-title{
    color:var(--theme-text, #3d2c2e);
    font-size:15px;
}

.game-top-container .game-type-description{
    margin-top:3px;
    color:var(--theme-text-muted, #7a5c63);
    font-size:12px;
    line-height:1.55;
}

.game-top-container .game-type-arrow{
    color:var(--theme-border, #f3c2cd);
    font-size:22px;
}

/* 記録・楽曲クイズ */
.game-top-container .game-demo-section{
    margin-top:26px;
    padding-top:0;
    border-top:0;
}

.game-top-container .game-extra-list{margin-top:12px;}

/* ランキングモーダル（body直下へ移して使う） */
.game-ranking-dialog{border-radius:20px;padding:24px;}
.game-ranking-title{color:var(--theme-heading, #8f0f31);}
.game-ranking-description{color:var(--theme-text-muted, #7a5c63);}
.game-ranking-button.primary{
    background:linear-gradient(135deg, var(--theme-btn-from, #fb4d6d), var(--theme-primary, #e11d48));
    color:#fff;
}
.game-ranking-button.secondary{
    border:1px solid var(--theme-border, #f3c2cd);
    background:#fff;
    color:var(--theme-text-sub, #57444a);
}

/* ローディング（テーマ色に統一） */
.game-loading-spinner{
    border-color:var(--theme-tint, #fdeef1);
    border-top-color:var(--theme-primary, #e11d48);
}
.game-loading-text{color:var(--theme-text-muted, #7a5c63);}

@media(min-width:768px){
    .game-top-container{padding:22px 22px 12px;}
    .game-top-container .game-type-list{grid-template-columns:repeat(2, minmax(0, 1fr));gap:12px;}
    .game-top-container .game-type-card{padding:16px 18px;}
}
