/* src/public/css/dice.css */

.dice-container {
    background: #ffffff;
    padding: 50px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    text-align: center;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    align-items: center;
}

.controls label {
    font-weight: bold;
    color: #1e3c72;
}

.controls select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    min-width: 100px;
}

/* サイコロ表示エリア */
.dice-display {
    font-size: 6rem; /* サイコロの大きさ */
    color: #2a5298;
    margin-bottom: 30px;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    min-height: 120px;
}

/* 🎲 回転アニメーションの設定 */
.dice-icon {
    transition: transform 0.1s;
}

.rolling {
    animation: roll-animation 0.4s linear infinite;
}

@keyframes roll-animation {
    0%   { transform: rotate(0deg) scale(1); }
    25%  { transform: rotate(90deg) scale(1.1); }
    50%  { transform: rotate(180deg) scale(1); }
    75%  { transform: rotate(270deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

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

.btn-roll:hover {
    background-color: #d68910;
}

.btn-roll:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.result-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    min-height: 36px;
}

/* =========================================
   💡 追加：スマートフォン・タブレット対応（〜768px）
   以前は指定が無く、サイコロ6rem × 複数個が横に並ぶと
   小さい画面ではみ出して横スクロールが発生していました。
   ========================================= */
@media (max-width: 768px) {
    .dice-container {
        padding: 30px 16px;
    }
    /* 「個数」ラベルと選択欄は縦に並べて幅を取らせる */
    .controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 24px;
        width: 100%;
    }
    .controls select {
        width: 100%;
    }
    .dice-display {
        font-size: 3.5rem;
        gap: 12px;
        min-height: 80px;
    }
    .btn-roll {
        width: 100%;
        padding: 14px;
        font-size: 1.1rem;
    }
    .result-text {
        font-size: 1.1rem;
        word-break: break-all;
    }
}