/* diceroll.css: ダイスロールアプリ固有のスタイル */

/* プリセットボタンのグリッドレイアウト */
.preset-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

/* プリセットボタン用のスタイル */
.btn--preset {
    padding: 12px 5px;
    font-size: 1rem;
    background-color: #fff;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    transition: all 0.2s;
}
.btn--preset:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* カスタムロール入力欄とボタンのレイアウト */
.custom-roll-container {
    display: flex;
    gap: 10px;
}
.custom-dice-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid var(--border-color-input);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
}
.custom-roll-container .btn {
    width: auto;
    margin-bottom: 0;
    flex-shrink: 0;
}

/* 結果表示エリア */
.result-area {
    margin-top: 30px;
    padding: 20px;
    background-color: var(--code-bg, #f6f8fa);
    border: 1px solid var(--border-color, #eee);
    border-radius: var(--border-radius-sm, 5px);
    min-height: 120px;
    text-align: center;
    overflow: hidden; 
}

.result-display .placeholder {
    color: var(--text-color-light);
}

.result-total {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    line-height: 1.2;
}

.result-details {
    margin-top: 8px;
    color: var(--text-color-subtle);
    word-break: break-all;
}

.result-error {
    color: var(--danger-color, #d9534f);
    font-weight: bold;
}

/* アニメーション中のスタイル */
.shuffling .result-total {
    color: var(--text-color-light);
}
.shuffling .result-details {
    font-style: italic;
}

/* クリティカル・ファンブルのスタイル */
.special-text {
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 5px;
}
.special-text.critical {
    color: #d9a400;
}
.special-text.fumble {
    color: var(--danger-color, #d9534f);
}

.result-total.critical {
    color: #d9a400;
    animation: glow 1.5s ease-in-out infinite alternate;
}
.result-total.fumble {
    color: var(--danger-color, #d9534f);
}

@keyframes glow {
  from {
    text-shadow: 0 0 4px #fff, 0 0 8px #fff, 0 0 12px #ffdd77, 0 0 16px #ffdd77;
  }
  to {
    text-shadow: 0 0 8px #fff, 0 0 12px #ffdd77, 0 0 16px #ffdd77, 0 0 20px #ffdd77;
  }
}

/* 履歴エリアのスタイル */
.history-area {
    margin-top: 40px;
}

.history-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.history-header-container h2 {
    margin: 0;
    border-bottom: none;
}

.btn--clear-history {
    background: none;
    border: 1px solid #ccc;
    color: var(--text-color-subtle);
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}
.btn--clear-history:hover {
    background-color: #f0f0f0;
    border-color: #aaa;
}
.btn--clear-history:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border-color, #eee);
    border-radius: var(--border-radius-sm);
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #fff;
    border-bottom: 1px solid var(--border-color, #eee);
}
.history-item:last-child {
    border-bottom: none;
}

.history-item-total {
    font-size: 1.2rem;
    font-weight: bold;
    min-width: 50px;
}

.history-item-details {
    font-size: 0.9rem;
    color: var(--text-color-light);
    text-align: right;
}

.no-history {
    padding: 20px;
    text-align: center;
    color: var(--text-color-light);
}

.history-item.critical .history-item-total {
    color: #d9a400;
}
.history-item.fumble .history-item-total {
    color: var(--danger-color, #d9534f);
}

/* ▼▼▼ 判定ルール説明エリアのスタイルを追加 ▼▼▼ */
.rule-guide {
    margin-top: 30px;
    padding: 15px 20px;
    background-color: var(--code-bg, #f6f8fa);
    border-top: 2px solid var(--border-color, #eee);
    border-radius: 0 0 var(--border-radius-md) var(--border-radius-md); /* コンテナ下部の角丸に合わせる */
    color: var(--text-color-subtle);
}

.rule-guide h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1rem;
    color: var(--text-color);
}

.rule-guide ul {
    padding-left: 20px;
    margin: 0;
    font-size: 0.9rem;
}

.rule-guide li {
    margin-bottom: 5px;
}

.rule-guide li:last-child {
    margin-bottom: 0;
}
/* ▲▲▲ ここまで追加 ▲▲▲ */