/* 旧・重複.bingo-modal定義を削除 */
/* BINGOポップアップモーダル */
.bingo-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.45);
    justify-content: center;
    align-items: center;
    animation: modal-fadein 0.4s cubic-bezier(.68,-0.55,.27,1.55);
}
.bingo-modal.show {
    display: flex !important;
    animation: modal-fadein 0.4s cubic-bezier(.68,-0.55,.27,1.55);
}
.bingo-modal-content {
    background: #fffbe6;
    border-radius: 28px;
    box-shadow: 0 8px 32px #ffb6e6cc, 0 2px 0 #fff;
    padding: 40px 32px 32px 32px;
    text-align: center;
    min-width: 240px;
    max-width: 90vw;
    margin: 0 auto;
    position: relative;
    animation: pop-bounce 0.5s cubic-bezier(.68,-0.55,.27,1.55);
    border: 4px solid #ffb6e6;
    transition: box-shadow 0.2s, border 0.2s;
}
.bingo-modal-message {
    font-size: 2.2em;
    font-weight: bold;
    color: #e53935;
    text-shadow: 0 2px 12px #ffb6e6, 0 1px 0 #fff, 0 0 8px #a3d8ff;
    margin-bottom: 12px;
    letter-spacing: 0.04em;
    font-family: 'Comic Sans MS', 'Segoe UI Rounded', 'Arial Rounded MT Bold', 'MS PGothic', sans-serif;
    animation: pop-bounce 0.7s cubic-bezier(.68,-0.55,.27,1.55);
}
.bingo-modal-message {
    font-size: 2.2em;
    font-weight: bold;
    color: #e53935;
    text-shadow: 0 2px 12px #ffb6e6, 0 1px 0 #fff, 0 0 8px #a3d8ff;
    margin-bottom: 12px;
    letter-spacing: 0.04em;
    font-family: 'Comic Sans MS', 'Segoe UI Rounded', 'Arial Rounded MT Bold', 'MS PGothic', sans-serif;
    animation: pop-bounce 0.7s cubic-bezier(.68,-0.55,.27,1.55);
}
@keyframes pop-bounce {
    0% { transform: scale(0.7); opacity: 0; }
    60% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
.bingo-modal-close {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 2em;
    color: #e53935;
    cursor: pointer;
    font-weight: bold;
    transition: color 0.2s;
}
.bingo-modal-close:hover {
    color: #ffb6e6;
}
@keyframes pop-bounce {
    0% { transform: scale(0.7); opacity: 0; }
    60% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
@media (max-width: 600px) {
    html, body {
        width: 100vw;
        min-width: 0;
        max-width: 100vw;
        overflow-x: hidden;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    .bingo-center-wrapper {
        text-align: center !important;
        width: 100vw;
        min-width: 0;
        max-width: 100vw;
        margin: 0 auto;
        padding: 0 0;
            display: flex !important;
            flex-direction: column !important;
            align-items: center !important;
            justify-content: center !important;
        box-sizing: border-box;
    }
    .bingo-flex-row {
        text-align: center !important;
        flex-direction: column !important;
        gap: 12px;
        align-items: center;
        width: 100vw;
        max-width: 100vw;
        margin: 0 auto;
        box-sizing: border-box;
            display: flex !important;
            justify-content: center !important;
        }
    #bingo-card {
        min-width: unset !important;
        padding: 8px 0 8px 0 !important;
        font-size: 15px !important;
        border-width: 2px !important;
        border-radius: 14px !important;
        box-shadow: 0 1px 8px #bfa76a33 !important;
    width: 99vw !important;
    max-width: 99vw !important;
        margin: 0 auto 12px auto !important;
        box-sizing: border-box !important;
        display: grid !important;
        grid-template-columns: repeat(5, 1fr) !important;
        justify-content: center !important;
        align-items: center !important;
        font-family: 'Segoe UI Rounded', 'Arial Rounded MT Bold', 'Comic Sans MS', 'MS PGothic', sans-serif !important;
    }
    #bingo-card::before {
        font-size: 0.95em !important;
        height: 18px !important;
        line-height: 18px !important;
        border-radius: 5px 5px 0 0 !important;
    }
    #bingo-card {
        padding-top: 24px !important;
    }
    .cell {
        font-family: 'Comic Sans MS', 'Segoe UI Rounded', 'Arial Rounded MT Bold', 'MS PGothic', sans-serif !important;
        width: 15vw;
        height: 15vw;
        min-width: 36px;
        min-height: 36px;
        max-width: 52px;
        max-height: 52px;
        font-size: 1.15em;
        margin: 1vw;
        border-width: 2.5px;
        border-radius: 50%;
        font-family: 'Segoe UI Rounded', 'Arial Rounded MT Bold', 'Comic Sans MS', 'MS PGothic', sans-serif;
        box-sizing: border-box;
        transition: background 0.2s, color 0.2s, box-shadow 0.2s, border 0.2s;
    }
    #roulette-display {
        width: 80px;
        height: 80px;
        border-width: 2px;
        border-radius: 7px;
        margin-bottom: 8px;
    }
    #current-number {
        font-size: 36px;
        line-height: 80px;
    }
    #current-number.big-result {
        font-size: 54px !important;
    }
    #draw-button {
        font-size: 15px;
        padding: 8px 6vw;
        border-radius: 10px;
        width: 92vw;
        max-width: 99vw;
        margin-bottom: 8px;
    }
    .bingo-modal-content {
        padding: 8vw 2vw 6vw 2vw !important;
        min-width: 0 !important;
        max-width: 96vw !important;
        width: 92vw !important;
        font-size: 1.2em !important;
        border-radius: 18px !important;
    }
    .bingo-modal-message {
        font-size: 2em !important;
        line-height: 1.3 !important;
        word-break: keep-all;
    }
    .bingo-side-panel {
        display: flex;
        flex-direction: column;
        align-items: center !important;
        justify-content: center !important;
        width: 100vw;
        max-width: 100vw;
        margin: 0 auto;
        box-sizing: border-box;
    }
    #draw-button, #roulette-display {
        margin-left: auto;
        margin-right: auto;
        display: block;
    }
    h1.word {
        font-size: 2.1em;
        margin: 18px 0 8px 0;
        padding: 0.1em 0.2em;
    }
}
/* ニキビンゴタイトル中央揃え */
h1.word {
        text-align: center;
        width: 100%;
        margin: 28px 0 12px 0;
        font-size: 3.6em;
        font-weight: 900;
        letter-spacing: 0.08em;
        color: #fff;
        font-family: 'Segoe UI Rounded', 'Arial Rounded MT Bold', 'Comic Sans MS', 'MS PGothic', sans-serif;
        text-shadow:
            0 4px 18px #a3d8ff,
            0 2px 8px #ffb6e6,
            0 1px 0 #fff,
            0 0 12px #fffbe6,
            0 0 2px #ffb6e6,
            0 0 2px #b6e0ff;
        background: none;
        -webkit-background-clip: border-box;
        -webkit-text-fill-color: #fff;
        background-clip: border-box;
        filter: drop-shadow(0 6px 20px #fff8);
        border-radius: 16px;
        padding: 0.18em 0.3em;
        box-shadow: 0 2px 16px #fffbe6cc;
}

body {
    background: linear-gradient(45deg, #D2B4DE, #B080C0); /* パステルピンクから薄紫 */
}
.bingo-side-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
/* 横並びレイアウト用ラッパー */
.bingo-flex-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 40px;
    margin: 32px auto;
    width: max-content;
}
#current-number.big-result {
    font-size: 160px !important;
    font-family: 'Pocket Calculator', 'pocket calculator', 'DS-Digital', 'ds-digital', 'Orbitron', 'Consolas', 'Courier New', monospace !important;
    transition: font-size 0.2s cubic-bezier(.68,-0.55,.27,1.55);
}
/* 数字決定時の回転アニメーション */
@keyframes spin-once {
    0% { transform: rotate(0deg); }
    80% { transform: rotate(340deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

#current-number.spin-once {
    animation: spin-once 0.5s cubic-bezier(.68,-0.55,.27,1.55);
}
#current-number.spin-once {
    animation: spin-once 0.5s cubic-bezier(.68,-0.55,.27,1.55);
}
/* 全体中央寄せ用ラッパー */
.bingo-center-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}


/* --- ビンゴカード本体 --- */
#bingo-card {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    justify-content: center;
    align-items: center;
    width: max-content;
    margin: 0 auto;
    background: #f7ecd0;
    color: #222;
    font-family: 'Segoe UI', 'MS PGothic', 'sans-serif';
    border: 6px solid #bfa76a;
    border-radius: 22px;
    box-shadow: 0 4px 24px #bfa76a55, 0 2px 0 #fff inset;
    padding: 80px 18px 18px 18px; /* ヘッダー分上部をさらに広く */
    font-size: 22px;
    line-height: normal;
    position: relative;
    min-width: 320px;
    overflow: hidden;
}

/* BINGOヘッダー */
#bingo-card::before {
    content: " B   I   N   G   O ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    line-height: 60px;
    text-align: center;
    font-family: 'Impact', 'Arial Black', 'Segoe UI', sans-serif;
    font-size: 2.8em;
    letter-spacing: 0;
    color: #fffbe6;
    text-shadow: 0 2px 0 #bfa76a, 0 4px 12px #bfa76a99, 0 1px 0 #fff;
    background: linear-gradient(90deg, #bfa76a 0%, #fffbe6 100%);
    border-bottom: 3px solid #bfa76a;
    border-radius: 8px 8px 0 0;
    padding: 0;
    box-sizing: border-box;
    z-index: 2;
    overflow: hidden;
    font-weight: bold;
}

/* --- ビンゴカードのマス --- */
.cell {
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2.5px solid #bfa76a;
    background: #f9f6ee;
    color: #222;
    font-size: 1.5em;
    font-family: 'Segoe UI', 'MS PGothic', 'sans-serif';
    border-radius: 50%;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 2px 8px #bfa76a33 inset, 0 1px 0 #fff;
    margin: 2px;
    position: relative;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.cell:hover {
    background: #fffbe6;
    box-shadow: 0 4px 16px #bfa76a55, 0 2px 0 #fff inset;
    color: #bfa76a;
}

/* --- 抽選されたマス --- */
    .marked {
        background: radial-gradient(circle at 60% 40%, #ffe066 70%, #ffd700 100%);
        color: #222;
        font-weight: bold;
        border: 2.5px solid #ff9800;
        box-shadow: 0 0 0 6px #fffbe6, 0 2px 8px #ffd70088 inset;
        text-shadow: 0 2px 6px #fff, 0 1px 0 #ffd700;
        z-index: 1;
        position: relative;
        transition: background 0.2s, color 0.2s, border 0.2s;
    }

/* --- FREEマス --- */
    .free {
        background: radial-gradient(circle at 60% 40%, #fffbe6 60%, #bfa76a 100%);
        color: #bfa76a;
        font-weight: bold;
        border: 2.5px solid #bfa76a;
        box-shadow: 0 0 0 4px #fffbe6, 0 2px 8px #bfa76a55 inset;
        font-style: italic;
    }

/* --- ルーレット演出用CSS --- */


#roulette-display {
    width: 200px;
    height: 200px;
    border: 5px solid #2c3e50;
    border-radius: 10px;
    margin: 0 auto 16px auto;
    overflow: hidden;
    position: relative;
    background-color: #111;
}

#draw-button {
    white-space: nowrap;
    width: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    font-size: 24px;
    padding: 16px 40px;
    border-radius: 18px;
    border: 4px solid #fff0fa;
    background: linear-gradient(100deg, #ffe0f7 0%, #b6e0ff 100%);
    color: #ff5fa2;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(255,182,230,0.22), 0 2px 0 #fff inset;
    letter-spacing: 2px;
    text-shadow: 0 2px 0 #fff, 0 3px 8px #ffb6e6;
    transition: filter 0.2s, box-shadow 0.2s, transform 0.1s;
    outline: none;
    font-family: 'Comic Sans MS', 'Segoe UI Rounded', 'Arial Rounded MT Bold', 'MS PGothic', sans-serif;
    position: relative;
    overflow: hidden;
}

#draw-button:hover:not(:disabled) {
    filter: brightness(1.15) drop-shadow(0 0 12px #ffb6e6);
    transform: translateY(-2px) scale(1.04);
}

#draw-button:active {
    filter: brightness(0.98);
    transform: translateY(2px) scale(0.98);
}

#current-number {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 160px;
    font-weight: bold;
    color: #e53935;
    line-height: 200px; /* 親要素の高さに合わせる */
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    font-family: 'Pocket Calculator', 'pocket calculator', 'DS-Digital', 'ds-digital', 'Orbitron', 'Consolas', 'Courier New', monospace;
    letter-spacing: 0.04em;
    padding-bottom: 0;
}

/* 🌀 回転アニメーションの定義 */
@keyframes spin {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* アニメーション適用時のクラス */
.spinning {
    animation: spin 0.3s linear infinite;
}