/**
 * 罰ゲームルーレット - 専用スタイル
 */

/* ===== 強度選択 ===== */
.level-selector {
    display: flex;
    gap: 12px;
}

.level-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px 12px;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.level-btn:hover {
    background: var(--color-white);
}

.level-btn.active {
    background: var(--color-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* カラーバー（上部アクセント） */
.level-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 2px 2px 0 0;
    opacity: 0.4;
    transition: opacity 0.2s ease, height 0.2s ease;
}

.level-btn.active .level-bar {
    opacity: 1;
    height: 4px;
}

/* ソフト: グリーン */
.level-soft .level-bar {
    background: #4caf50;
}

.level-soft:hover,
.level-soft.active {
    border-color: #4caf50;
}

.level-soft.active .level-name {
    color: #388e3c;
}

/* ミディアム: オレンジ */
.level-medium .level-bar {
    background: #ff9800;
}

.level-medium:hover,
.level-medium.active {
    border-color: #ff9800;
}

.level-medium.active .level-name {
    color: #e65100;
}

/* ハード: レッド */
.level-hard .level-bar {
    background: #e53935;
}

.level-hard:hover,
.level-hard.active {
    border-color: #e53935;
}

.level-hard.active .level-name {
    color: #c62828;
}

.level-name {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    transition: color 0.2s ease;
}

.level-desc {
    font-size: 11px;
    color: var(--color-text-muted);
}

/* ===== ルーレット表示 ===== */
.roulette-section {
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}

.roulette-display {
    width: 100%;
    max-width: 400px;
}

.roulette-frame {
    position: relative;
    width: 100%;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-white);
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.roulette-text {
    padding: 24px 20px;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--color-primary-dark);
    text-align: center;
    line-height: 1.5;
    user-select: none;
}

.roulette-text.spinning {
    animation: slotShuffle 0.06s steps(1) infinite;
}

.roulette-text.result {
    animation: resultBounce 0.4s ease-out;
}

.roulette-frame.spinning {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(61, 90, 128, 0.1);
}

.roulette-frame.result {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(224, 120, 80, 0.15);
}

.roulette-indicator {
    font-size: 13px;
    color: var(--color-text-muted);
    min-height: 20px;
}

@keyframes slotShuffle {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

@keyframes resultBounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

/* ===== 結果セクション ===== */
.result-section {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--color-border);
}

.result-badge {
    flex-shrink: 0;
    padding: 4px 12px;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    color: var(--color-white);
    background: var(--color-primary);
    border-radius: 20px;
}

.result-badge.soft {
    background: #4caf50;
}

.result-badge.medium {
    background: #ff9800;
}

.result-badge.hard {
    background: #e53935;
}

.result-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text);
    line-height: 1.5;
}

/* ===== 履歴セクション ===== */
.history-section {
    padding: 14px 20px;
    border-bottom: 1px solid var(--color-border);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.history-item + .history-item {
    border-top: 1px solid var(--color-border);
}

.history-badge {
    flex-shrink: 0;
    padding: 2px 8px;
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    color: var(--color-white);
    border-radius: 12px;
}

.history-badge.soft {
    background: #4caf50;
}

.history-badge.medium {
    background: #ff9800;
}

.history-badge.hard {
    background: #e53935;
}

.history-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-num {
    flex-shrink: 0;
    font-family: var(--font-display);
    font-size: 12px;
    color: var(--color-text-muted);
}

/* ===== カスタム追加フォーム ===== */
.custom-add-form {
    margin-bottom: 12px;
}

.custom-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.custom-select {
    flex-shrink: 0;
    width: 120px;
    padding: 9px 12px;
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
}

.custom-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.custom-input {
    flex: 1;
    padding: 9px 12px;
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.custom-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.custom-input::placeholder {
    color: var(--color-text-muted);
}

.custom-list-wrapper {
    margin-top: 16px;
}

.custom-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.custom-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.custom-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    color: var(--color-text-secondary);
}

.custom-item + .custom-item {
    border-top: 1px solid var(--color-border);
}

.custom-item-text {
    flex: 1;
}

.custom-item-delete {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 16px;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
}

.custom-item-delete:hover {
    color: #e53935;
}

/* ===== スピンボタン状態 ===== */
#spinBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== レスポンシブ対応 ===== */
@media (max-width: 600px) {
    .level-selector {
        gap: 8px;
    }

    .level-btn {
        padding: 12px 6px 10px;
    }

    .level-name {
        font-size: 12px;
    }

    .level-desc {
        font-size: 10px;
    }

    .roulette-section {
        padding: 24px 16px;
    }

    .roulette-text {
        font-size: 18px;
        padding: 20px 16px;
    }

    .result-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .custom-add-row {
        flex-wrap: wrap;
    }

    .custom-select {
        width: 100%;
    }

    .custom-input {
        width: 100%;
    }

    .custom-add-row .btn-primary {
        width: 100%;
    }
}
