/* 로또 번호 생성기 */

:root {
    --lotto-green: #1a7f37;
    --lotto-green-light: #2ecc71;
    --lotto-gradient: linear-gradient(135deg, #1a7f37 0%, #27ae60 50%, #2ecc71 100%);
    --lotto-ball-bg: #fff;
    --lotto-ball-border: #1a7f37;
    --lotto-shadow: 0 4px 20px rgba(26, 127, 55, 0.2);
    --lotto-radius: 14px;
    --lotto-radius-ball: 50%;
}

.lotto-container {
    max-width: 560px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    padding-bottom: calc(50px + 20px);
    font-family: 'Pretendard', sans-serif;
    min-height: 100vh;
}

.lotto-header {
    text-align: center;
    margin-bottom: 32px;
}

.lotto-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 8px 0;
}

.lotto-subtitle {
    font-size: 0.95rem;
    color: #666;
    margin: 0;
}

.lotto-section {
    margin-bottom: 32px;
}

.lotto-card {
    background: #fff;
    border-radius: var(--lotto-radius);
    padding: 32px 24px;
    box-shadow: var(--lotto-shadow);
}

.lotto-hint {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    margin: 0 0 20px 0;
}

.lotto-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.lotto-generate-btn {
    flex: 1;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px 24px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    background: var(--lotto-gradient);
    border: none;
    border-radius: var(--lotto-radius);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.lotto-generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26, 127, 55, 0.35);
}

.lotto-generate-btn:active {
    transform: translateY(0);
}

.lotto-generate-btn .btn-icon {
    font-size: 1.3rem;
}

.lotto-reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 20px;
    font-size: 1rem;
    font-weight: 600;
    color: #555;
    background: #f0f0f0;
    border: 2px solid #e0e0e0;
    border-radius: var(--lotto-radius);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.lotto-reset-btn:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

.lotto-reset-btn .btn-icon {
    font-size: 1.1rem;
}

.lotto-history {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lotto-set {
    background: #f8faf8;
    border-radius: var(--lotto-radius);
    padding: 20px 16px;
    border: 1px solid #e8eee8;
}

.lotto-set-numbers {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.lotto-set-numbers .lotto-ball {
    flex-shrink: 0;
}

@media (max-width: 400px) {
    .lotto-set-numbers .lotto-ball {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    .lotto-set-numbers {
        gap: 6px;
    }
}

.lotto-placeholder {
    font-size: 0.95rem;
    color: #999;
    text-align: center;
    margin: 0;
    padding: 16px 0;
}

.lotto-ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--lotto-radius-ball);
    background: var(--lotto-ball-bg);
    border: 3px solid #bbb;
    color: #333;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 번호별 공 색상 (동행복권 구간: 1-10 노랑, 11-20 파랑, 21-30 빨강, 31-40 검정, 41-45 초록) */
.lotto-ball--range-1 {
    background: linear-gradient(145deg, #f5d042 0%, #e6b820 100%);
    border-color: #c9a227;
    color: #5c4a00;
}
.lotto-ball--range-2 {
    background: linear-gradient(145deg, #5b8fd9 0%, #3a6fb5 100%);
    border-color: #2d5a9e;
    color: #fff;
}
.lotto-ball--range-3 {
    background: linear-gradient(145deg, #e05a5a 0%, #c73e3e 100%);
    border-color: #a32e2e;
    color: #fff;
}
.lotto-ball--range-4 {
    background: linear-gradient(145deg, #4a4a4a 0%, #2d2d2d 100%);
    border-color: #1a1a1a;
    color: #fff;
}
.lotto-ball--range-5 {
    background: linear-gradient(145deg, #3a9d5c 0%, #2a7d44 100%);
    border-color: #1a5d2e;
    color: #fff;
}

/* 기계 안에서 돌아가는 공 */
.lotto-ball-spin {
    animation: lotto-ball-spin 0.15s ease-in-out infinite;
    opacity: 0.9;
}

@keyframes lotto-ball-spin {
    0%, 100% { transform: scale(1.05); }
    50% { transform: scale(0.95); }
}

/* 공이 나오며 확정되는 순간 */
.lotto-ball-out {
    animation: lotto-ball-out 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes lotto-ball-out {
    0% {
        transform: scale(1.2);
        box-shadow: 0 0 0 4px rgba(26, 127, 55, 0.4);
    }
    60% {
        transform: scale(1.08);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    }
}

.lotto-generate-btn:disabled.lotto-btn-busy {
    opacity: 0.85;
    cursor: not-allowed;
}

/* 당첨 확률 영역 */
.probability-section {
    background: #fff;
    border-radius: var(--lotto-radius);
    padding: 24px 20px;
    box-shadow: var(--lotto-shadow);
}

.probability-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 4px 0;
    text-align: center;
}

.probability-desc {
    font-size: 0.85rem;
    color: #666;
    text-align: center;
    margin: 0 0 20px 0;
}

.probability-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.probability-item {
    display: grid;
    grid-template-columns: 52px 1fr auto auto;
    align-items: center;
    gap: 10px 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f8faf8;
    border-left: 4px solid #ddd;
    font-size: 0.9rem;
}

.probability-item.probability-first { border-left-color: #e74c3c; }
.probability-item.probability-second { border-left-color: #e67e22; }
.probability-item.probability-third { border-left-color: #f39c12; }
.probability-item.probability-fourth { border-left-color: #3498db; }
.probability-item.probability-fifth { border-left-color: #1a7f37; }

.prob-rank {
    font-weight: 700;
    color: #333;
}

.prob-desc {
    color: #555;
}

.prob-odds {
    font-weight: 600;
    color: #1a7f37;
    white-space: nowrap;
}

.prob-pct {
    color: #666;
    font-size: 0.85rem;
}

.prob-prize {
    grid-column: 2 / -1;
    font-size: 0.8rem;
    color: #888;
}

.probability-note {
    font-size: 0.8rem;
    color: #999;
    text-align: center;
    margin: 16px 0 0 0;
}

@media (max-width: 480px) {
    .probability-item {
        grid-template-columns: 48px 1fr;
    }
    .prob-odds,
    .prob-pct {
        grid-column: 2;
    }
    .prob-prize {
        grid-column: 1 / -1;
    }
}
