/* src/public/css/bingo.css */

.bingo-container {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* 左側：抽選機エリア */
.draw-side {
    flex: 1;
    min-width: 300px;
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ガラガラから出た球の表示 */
.bingo-ball-display {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle at 30% 30%, #ffffff, #e74c3c 70%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset -10px -10px 20px rgba(0,0,0,0.2), 0 10px 20px rgba(0,0,0,0.2);
    margin-bottom: 30px;
    position: relative;
    transition: transform 0.1s;
}

/* 球の中の白い円と数字 */
.bingo-ball-inner {
    width: 120px;
    height: 120px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: bold;
    color: #333;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

.rolling {
    animation: shake 0.3s linear infinite;
}

@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.btn-draw {
    padding: 15px 40px;
    background-color: #f39c12;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: background-color 0.2s;
    width: 100%;
}

.btn-draw:hover { background-color: #d68910; }
.btn-draw:disabled { background-color: #ccc; cursor: not-allowed; }

.btn-reset {
    margin-top: 15px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    text-decoration: underline;
}

/* 右側：ナンバーボード（履歴）エリア */
.board-side {
    flex: 2;
    min-width: 350px;
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.board-side h3 {
    margin-top: 0;
    color: #2a5298;
    margin-bottom: 20px;
    text-align: center;
}

.bingo-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
    gap: 8px;
}

.board-number {
    background: #f1f3f5;
    color: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s;
}

/* 出た数字のスタイル */
.board-number.drawn {
    background: #2a5298;
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transform: scale(1.05);
}

/* 💡 追加：編集モードで手動で入れた番号（ガラガラで出した番号と区別するため緑色にする） */
.board-number.manual {
    background: #27ae60;
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transform: scale(1.05);
}

/* 💡 追加：編集モード中だけクリックできることを分かりやすくする */
.board-number.editable {
    cursor: pointer;
    outline: 2px dashed #f39c12;
    outline-offset: -2px;
}

.board-number.editable:hover {
    opacity: 0.8;
}

/* 💡 追加：編集モードの番号はキーボードでも操作できるため、
   今どこを選んでいるかが分かるようにフォーカス枠を出します */
.board-number.editable:focus-visible {
    outline: 3px solid #f39c12;
    outline-offset: 2px;
}

/* 💡 追加：編集・全画面表示の操作ボタン */
.bingo-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.opt-bingo-btn {
    padding: 8px 16px;
    background: #ffffff;
    color: #2a5298;
    border: 1px solid #2a5298;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.opt-bingo-btn:hover {
    background: #eef2f9;
}

/* 編集モードがオンの時のボタン表示 */
.opt-bingo-btn.active {
    background: #2a5298;
    color: #ffffff;
}

/* 💡 追加：編集モード中に表示する操作説明 */
.edit-hint {
    margin-top: 12px;
    padding: 12px 15px;
    background: #fff8e1;
    border-left: 4px solid #f39c12;
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #6b5300;
}

.edit-hint .hint-manual { color: #27ae60; font-weight: bold; }
.edit-hint .hint-drawn  { color: #2a5298; font-weight: bold; }

/* 💡 追加：出た番号・残り番号の件数表示 */
.bingo-remain {
    margin: -10px 0 15px 0;
    text-align: center;
    font-size: 0.85rem;
    color: #666;
}

/* 💡 追加：全画面表示（ネイティブ全画面と、iPhone/iPad用の擬似全画面の両方に対応） */
#bingo-fullscreen-target:fullscreen,
#bingo-fullscreen-target.pseudo-fullscreen {
    background: #f5f6f8;
    padding: 20px;
    overflow-y: auto;
    align-content: flex-start;
}

/* 💡 追加：スマホ・タブレット対応（画面が狭い時は縦並びにして文字を小さくする） */
@media (max-width: 768px) {
    .bingo-container {
        gap: 20px;
        margin-top: 15px;
    }

    .draw-side,
    .board-side {
        min-width: 100%;
        padding: 20px;
    }

    .bingo-ball-display {
        width: 150px;
        height: 150px;
        margin-bottom: 20px;
    }

    .bingo-ball-inner {
        width: 90px;
        height: 90px;
        font-size: 3rem;
    }

    .btn-draw {
        padding: 12px 20px;
        font-size: 1.2rem;
    }

    .bingo-board {
        grid-template-columns: repeat(auto-fit, minmax(34px, 1fr));
        gap: 6px;
    }

    .board-number {
        height: 34px;
        font-size: 0.95rem;
    }
}
/* 💡 追加：共通アコーディオン（.tool-options）の中に入れた時の余白調整 */
.tool-options-inner .bingo-options { margin-top: 0; }
