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

.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)}
}

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

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

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

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

/* ==========================
   問題画面
========================== */

.game-streak{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
    margin-bottom:14px;
}

.streak-item{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    min-height:80px;
    padding:10px;
    box-sizing:border-box;
    border-radius:16px;
    background:#fff;
    box-shadow:0 2px 6px rgba(0,0,0,.08);
}

.streak-label{
    color:#777;
    font-size:11px;
    font-weight:bold;
    text-align:center;
}

.streak-item strong{
    margin-top:3px;
    color:#ff5f96;
    font-size:25px;
    line-height:1.2;
}

.game-card{
    width:100%;
    box-sizing:border-box;
    padding:20px 16px;
    border-radius:18px;
    background:#fff;
    box-shadow:0 3px 8px rgba(0,0,0,.12);
}

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

.game-question{
    margin:18px 0;
    color:#333;
    font-size:17px;
    font-weight:bold;
    line-height:1.7;
}

.choice-list,
.tf-list{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.choice-button,
.char-button{
    min-height:46px;
    padding:10px 12px;
    border:1px solid #eee;
    border-radius:12px;
    background:#fafafa;
    color:#333;
    font:inherit;
    cursor:pointer;
}

.choice-button:hover,
.char-button:hover{
    background:#fff5f8;
}

.choice-button:disabled,
.char-button:disabled{
    cursor:default;
    opacity:.55;
}

.anagram-chars{
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    gap:8px;
    margin-bottom:14px;
}

.char-button{
    min-width:44px;
    font-size:16px;
    font-weight:bold;
}

.anagram-answer{
    min-height:48px;
    padding:12px;
    box-sizing:border-box;
    border-radius:12px;
    background:#f8f8f8;
    color:#555;
    text-align:center;
    line-height:24px;
}

.anagram-controls{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
    margin-top:10px;
}

.anagram-control{
    min-height:46px;
    padding:10px 12px;
    border:0;
    border-radius:12px;
    font:inherit;
    font-size:13px;
    font-weight:bold;
    cursor:pointer;
}

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

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

.anagram-control:disabled{
    cursor:default;
    opacity:.55;
}

.game-result{
    min-height:30px;
    margin-top:16px;
    font-size:18px;
    font-weight:bold;
    text-align:center;
}

.game-result.correct{color:#2b9a62}

.game-result.incorrect{color:#d45d6f}

.game-explanation{
    display:none;
    margin-top:10px;
    padding:12px;
    border-radius:12px;
    background:#fff8fb;
    color:#555;
    font-size:13px;
    line-height:1.7;
}

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

.game-explanation-link{
    display:inline-flex;
    align-items:center;
    margin-top:8px;
    padding:8px 12px;
    border-radius:10px;
    background:#fff0f6;
    color:#ff5f96;
    font-weight:bold;
    text-decoration:none;
}

.game-explanation-link:hover{
    text-decoration:underline;
}

.next-button{
    display:none;
    align-items:center;
    justify-content:center;
    min-height:46px;
    margin-top:10px;
    border-radius:12px;
    background:#fff0f6;
    color:#ff5f96;
    font-weight:bold;
    text-decoration:none;
}

.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-streak{
        gap:8px;
    }
.streak-item{
        min-height:76px;
        padding:8px 6px;
    }
.streak-label{
        font-size:10px;
    }
.streak-item strong{
        font-size:23px;
    }
}

.anagram-multi-pool .anagram-chars{
    margin-top:10px;
}

.anagram-multi-pool .char-button.char-used{
    background:#f3f3f3;
    border-color:#e1e1e1;
    color:#c8c8c8;
    cursor:default;
    opacity:1;
    text-decoration:none;
}

.anagram-multi-pool .char-button.char-used:hover{
    background:#f3f3f3;
}

.anagram-multi-answer-item.completed .anagram-answer-select strong{
    color:#2b9a62;
}

.anagram-answer-select{
    width:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:9px 10px;
    border:0;
    background:transparent;
    color:#555;
    font:inherit;
    text-align:left;
    cursor:pointer;
}

.anagram-answer-select span{
    flex:none;
    color:#7659b8;
    font-size:12px;
    font-weight:bold;
}

.anagram-answer-select strong{
    flex:1;
    color:#555;
    font-size:13px;
    font-weight:bold;
    text-align:right;
    word-break:break-all;
}

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