/**
 * 簡単ルーレット - 専用スタイル
 */

/* ルーレットセクション */
.roulette-section {
    padding: 32px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-white) 100%);
    border-bottom: 1px solid var(--color-border);
}

.roulette-container {
    position: relative;
    width: 280px;
    height: 280px;
}

/* ルーレットの針（上部） */
.roulette-pointer {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 24px solid var(--color-accent);
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* ルーレットホイール */
.roulette-wheel {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        var(--color-primary) 0deg 60deg,
        var(--color-accent) 60deg 120deg,
        var(--color-primary) 120deg 180deg,
        var(--color-accent) 180deg 240deg,
        var(--color-primary) 240deg 300deg,
        var(--color-accent) 300deg 360deg
    );
    box-shadow: 
        0 0 0 6px var(--color-white),
        0 0 0 10px var(--color-primary-dark),
        0 8px 24px rgba(0, 0, 0, 0.15);
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.roulette-wheel.spinning {
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.roulette-wheel.no-transition {
    transition: none;
}

/* ルーレット中央 */
.roulette-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--color-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.roulette-center-text {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    color: var(--color-primary-dark);
    letter-spacing: 0.5px;
}

/* セグメントラベル */
.segment-label {
    position: absolute;
    top: 50%;
    left: 50%;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    color: var(--color-white);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    transform-origin: 0 0;
    pointer-events: none;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 結果セクション */
.result-section {
    padding: 28px 20px;
    text-align: center;
    background: linear-gradient(180deg, #fff9f5 0%, var(--color-white) 100%);
    border-bottom: 1px solid var(--color-border);
    animation: resultFadeIn 0.5s ease-out;
}

@keyframes resultFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-label {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.result-value {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    color: var(--color-accent);
    word-break: break-word;
    animation: resultPop 0.3s ease-out 0.2s both;
}

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

/* 抽選履歴 */
.history-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
    color: var(--color-text-secondary);
    animation: historySlideIn 0.3s ease-out;
}

@keyframes historySlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.history-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.history-item:first-child {
    padding-top: 0;
}

.history-number {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    color: var(--color-white);
    background: var(--color-primary);
    border-radius: 50%;
}

.history-item:first-child .history-number {
    background: var(--color-accent);
}

.history-text {
    flex: 1;
    word-break: break-word;
}

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

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

#spinBtn:disabled:hover {
    background: var(--color-accent);
}

/* 回転中のエフェクト */
.roulette-wheel.spinning ~ .roulette-center .roulette-center-text {
    animation: pulse 0.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* レスポンシブ対応 */
@media (max-width: 600px) {
    .roulette-section {
        padding: 24px 16px;
    }

    .roulette-container {
        width: 240px;
        height: 240px;
    }

    .roulette-center {
        width: 60px;
        height: 60px;
    }

    .roulette-center-text {
        font-size: 10px;
    }

    .segment-label {
        font-size: 9px;
        max-width: 55px;
    }

    .roulette-pointer {
        border-left: 12px solid transparent;
        border-right: 12px solid transparent;
        border-top: 20px solid var(--color-accent);
    }

    .result-section {
        padding: 20px 16px;
    }

    .result-value {
        font-size: 26px;
    }

    .history-item {
        gap: 10px;
        padding: 8px 0;
        font-size: 13px;
    }

    .history-number {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }

    .history-time {
        font-size: 11px;
    }
}

/* テキストエリアの高さ調整 */
#choicesInput {
    min-height: 120px;
}

/* 選択肢が少ない時の警告メッセージ */
.warning-message {
    padding: 12px 20px;
    background: #fff8e1;
    border-bottom: 1px solid #ffe082;
    font-size: 13px;
    color: #f57c00;
    text-align: center;
}
