/* =========================
   全体
========================= */

body{
    margin:0;
    padding:20px;
    font-family:sans-serif;
    background:linear-gradient(135deg,#4facfe,#00f2fe);
    min-height:100vh;
    display:flex;
    justify-content:center;
    align-items:center;
}

/* =========================
   カード
========================= */

.quiz-card{
    background:white;
    width:90%;
    max-width:700px;
    padding:30px;
    border-radius:20px;
    box-shadow:0 8px 25px rgba(0,0,0,0.2);
    text-align:center;
}

/* =========================
   タイトル
========================= */

h1{
    color:#1e3a8a;
    margin-bottom:20px;
}

/* =========================
   問題
========================= */

#question{
    margin:20px 0;
    font-size:24px;
    line-height:1.5;
}

/* 第○問 */

#progress{
    font-size:18px;
    color:#666;
}

/* =========================
   選択肢
========================= */

#choices{
    display:flex;
    flex-direction:column;
    gap:12px;
    margin-top:20px;
}

/* =========================
   ボタン
========================= */

button{
    padding:15px;
    font-size:18px;
    border:none;
    border-radius:12px;
    background:#2563eb;
    color:white;
    cursor:pointer;

    transition:transform 0.2s, background 0.2s;
}

button:hover{
    transform:scale(1.05);
    background:#1d4ed8;
}

button:active{
    transform:scale(0.95);
}

/* =========================
   結果エリア（強化）
========================= */

#resultArea{
    margin-top:20px;
    text-align:left;
    padding:10px;
}

/* 結果タイトル */
#resultArea h2{
    color:#1e3a8a;
    text-align:center;
}



#resultMeta{
    background:#f8fafc;
    border-radius:12px;
    padding:15px;
    margin-bottom:15px;
    box-shadow:0 2px 8px rgba(0,0,0,0.1);
}

#resultMeta input,
#resultMeta select{
    width:100%;
    padding:8px;
    margin-top:5px;
    border-radius:8px;
    border:1px solid #ccc;
    font-size:14px;
}

#datetime{
    margin-top:10px;
    font-size:14px;
    color:#555;
}

/* =========================
   ○×エフェクト
========================= */

#effect{
    position:fixed;
    top:50%;
    left:50%;
    transform:translate(-50%,-50%);
    font-size:150px;
    font-weight:bold;
    opacity:0;
    pointer-events:none;
    z-index:9999;
}

/* =========================
   正解・不正解フラッシュ
========================= */

.correct{
    animation:correctFlash 0.5s;
}

@keyframes correctFlash{
    0%{background:white;}
    50%{background:#b7ffb7;}
    100%{background:white;}
}

.wrong{
    animation:wrongFlash 0.5s;
}

@keyframes wrongFlash{
    0%{background:white;}
    50%{background:#ffb7b7;}
    100%{background:white;}
}

/* =========================
   スマホ対応
========================= */

@media(max-width:600px){

    h1{ font-size:28px; }

    #question{ font-size:20px; }

    button{ font-size:16px; }

    #effect{ font-size:100px; }
}

/* =========================
   ページめくり
========================= */

.page-turn{
    animation:pageTurn .7s ease;
}

@keyframes pageTurn{

    0%{
        opacity:0;
        transform:
        perspective(1000px)
        rotateY(-90deg);
    }

    100%{
        opacity:1;
        transform:
        perspective(1000px)
        rotateY(0deg);
    }
}

/* =========================
   閃光
========================= */

#flash{
    position:fixed;
    inset:0;
    background:white;
    opacity:0;
    pointer-events:none;
    z-index:10000;
}

.flash{
    animation:flash .5s;
}

@keyframes flash{

    0%{
        opacity:0;
    }

    40%{
        opacity:1;
    }

    100%{
        opacity:0;
    }
}

/* =========================
   ランク演出
========================= */

#rankDisplay{
    font-size:5rem;
    text-align:center;
    margin:10px 0;
    color:#f59e0b;
}

#titleDisplay{
    text-align:center;
    margin-bottom:20px;
}

.rank-pop{
    animation:rankPop .8s ease;
}

@keyframes rankPop{

    0%{
        transform:scale(.2);
        opacity:0;
    }

    50%{
        transform:scale(1.4);
    }

    100%{
        transform:scale(1);
        opacity:1;
    }
}
