@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background-color: #ffffff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #d97706;
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    text-decoration: none;
    color: #4b5563;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.nav a:hover {
    background-color: #f3f4f6;
}

/* Hero */
.hero {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('../images/hero-bg.png');
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.7));
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 5rem 1rem;
    color: white;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-size: 1.125rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: #d97706;
    color: white;
    border-color: #b45309;
}

.btn-primary:hover {
    background-color: #b45309;
}

.btn-outline {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Card */
.card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #d97706;
}

/* Lottery Ball */
.lottery-ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.125rem;
    color: white;
    margin: 0.25rem;
}

.ball-1-10 {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.ball-11-20 {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.ball-21-30 {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.ball-31-40 {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.ball-41-45 {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.ball-bonus {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

/* Sections */
.section {
    padding: 3rem 0;
}

.section-alt {
    background-color: #f9fafb;
}

.numbers-grid {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

.recommendation-set {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.recommendation-set h3 {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: #fef3c7;
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
}

.stat-card .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: #d97706;
    margin: 0.5rem 0;
}

.stat-card .label {
    color: #78350f;
    font-size: 0.875rem;
}

/* Footer */
.footer {
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 3rem 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer h3 {
    font-weight: 700;
    color: #d97706;
    margin-bottom: 1rem;
}

.footer p,
.footer a {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.8;
}

.footer a {
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
}

.footer a:hover {
    color: #d97706;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
    color: #9ca3af;
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid #f3f4f6;
    border-top-color: #d97706;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .lottery-ball {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
}

/* Theory Page */
.theory-section {
    border-left: 4px solid #d97706;
    padding-left: 1.5rem;
    margin: 2rem 0;
}

.theory-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.theory-section strong {
    color: #1a1a1a;
}

.highlight {
    color: #d97706;
    font-weight: 600;
}

/* History Page Styles */
.search-box {
    display: flex;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: 'Noto Sans KR', sans-serif;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #d97706;
}

.history-card {
    background: #fef3c7;
    border-radius: 0.5rem;
    padding: 2rem;
    margin-top: 1rem;
}

.history-table-wrapper {
    overflow-x: auto;
    margin-top: 2rem;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.history-table thead {
    background: #fef3c7;
    border-bottom: 2px solid #d97706;
}

.history-table th {
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    color: #78350f;
    font-size: 0.875rem;
}

.history-table td {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid #f3f4f6;
}

.history-table tr:hover {
    background: #fffbeb;
}

.round-cell {
    font-weight: 600;
    color: #d97706;
}

.date-cell {
    color: #6b7280;
    font-size: 0.875rem;
}

.numbers-cell {
    padding: 0.5rem;
}

.numbers-grid-small {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    flex-wrap: wrap;
}

.numbers-grid-small .lottery-ball {
    width: 2rem;
    height: 2rem;
    font-size: 0.875rem;
}

.bonus-cell .lottery-ball {
    width: 2rem;
    height: 2rem;
    font-size: 0.875rem;
}

.prize-cell {
    font-weight: 600;
    color: #d97706;
}

/* Responsive for History Page */
@media (max-width: 768px) {
    .search-box {
        flex-direction: column;
    }

    .history-table {
        font-size: 0.75rem;
    }

    .history-table th,
    .history-table td {
        padding: 0.5rem 0.25rem;
    }

    .numbers-grid-small .lottery-ball,
    .bonus-cell .lottery-ball {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.75rem;
        margin: 0.125rem;
    }
}

/* ================================================
   PHASE 1: 심리학 기반 기능 스타일
   ================================================ */

/* ===== 황금 그라데이션 시스템 ===== */
.golden-gradient {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF8C00 100%);
    color: white;
}

.golden-text {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 반짝이는 애니메이션 */
@keyframes sparkle {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
        filter: brightness(1);
    }

    50% {
        opacity: 0.9;
        transform: scale(1.05);
        filter: brightness(1.2);
    }
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.6);
    }
}

/* ===== 카운트다운 섹션 ===== */
.countdown-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 3rem 0;
}

.countdown-card {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 165, 0, 0.1) 100%);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    animation: glow 2s infinite;
}

.countdown-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.countdown-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #FFD700;
    margin-bottom: 1.5rem;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 215, 0, 0.2);
    min-width: 80px;
}

.time-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.time-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.5rem;
}

.countdown-message {
    color: #FFA500;
    font-weight: 600;
    font-size: 1.125rem;
    animation: sparkle 1.5s infinite;
}

/* ===== 후기 섹션 ===== */
.testimonials-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: #6b7280;
    font-size: 1rem;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.testimonial-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #FFD700;
    transition: transform 0.2s, box-shadow 0.2s;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.testimonial-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.testimonial-stars {
    color: #FFD700;
    font-size: 1.25rem;
}

.testimonial-badge {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.testimonial-content {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.testimonial-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.testimonial-author {
    font-weight: 600;
    color: #1a1a1a;
}

.testimonial-location {
    color: #9ca3af;
    font-size: 0.875rem;
}

.testimonial-helpful {
    color: #6b7280;
    font-size: 0.875rem;
}

/* ===== 슬롯머신 애니메이션 ===== */
@keyframes slot-spin {
    0% {
        transform: translateY(-100px) scale(0.5);
        opacity: 0;
        filter: blur(5px);
    }

    10% {
        transform: translateY(-80px) scale(0.7);
        opacity: 0.3;
    }

    30% {
        transform: translateY(-40px) scale(0.9);
        opacity: 0.6;
        filter: blur(2px);
    }

    60% {
        transform: translateY(10px) scale(1.1);
        opacity: 1;
        filter: blur(0);
    }

    80% {
        transform: translateY(0) scale(0.95);
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
        filter: blur(0);
    }
}

.lottery-ball.spinning {
    animation: slot-spin 2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 버튼 강화 */
.btn-primary {
    position: relative;
    overflow: hidden;
    animation: sparkle 2s infinite;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(217, 119, 6, 0.5);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .countdown-timer {
        gap: 0.75rem;
    }

    .time-unit {
        padding: 0.75rem 1rem;
        min-width: 70px;
    }

    .time-value {
        font-size: 1.75rem;
    }

    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    .countdown-title {
        font-size: 1.25rem;
    }

    .title-icon {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.75rem;
    }
}

.rank-badge.gold {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.rank-badge.silver {
    background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
    color: white;
    box-shadow: 0 4px 12px rgba(192, 192, 192, 0.4);
}

.rank-badge.bronze {
    background: linear-gradient(135deg, #CD7F32, #B8860B);
    color: white;
    box-shadow: 0 4px 12px rgba(205, 127, 50, 0.4);
}

.rank-badge.normal {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
}

/* 진행 바 */
.progress-container {
    flex: 1;
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
    height: 2rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #FF6B6B, #FF8E53);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    transition: width 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 0;
    box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}

.progress-label {
    white-space: nowrap;
}

/* 콜드 넘버 섹션 */
.cold-section {
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.1), rgba(68, 160, 141, 0.1));
    border: 2px solid rgba(78, 205, 196, 0.3);
}

.cold-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.cold-note {
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    font-style: italic;
}

/* 패턴 분석 */
.pattern-section {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.05), rgba(75, 0, 130, 0.05));
    border: 2px solid rgba(138, 43, 226, 0.2);
}

.pattern-group {
    margin-bottom: 2rem;
}

.pattern-group:last-child {
    margin-bottom: 0;
}

.pattern-group h4 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1f2937;
    font-size: 1.125rem;
}

.pattern-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.pattern-label {
    min-width: 100px;
    font-weight: 500;
    color: #374151;
}

.progress-bar-mini {
    flex: 1;
    height: 1.5rem;
    background: linear-gradient(90deg, #4ECDC4, #44A08D);
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 0.75rem;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    transition: width 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 0;
    box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.2);
}

.pattern-percent {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ================================================
   마킹 패턴 분석 스타일
   ================================================ */

.pattern-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.pattern-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: transform 0.2s;
}

.pattern-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.pattern-header {
    text-align: center;
    margin-bottom: 0.75rem;
    background: #ef4444;
    color: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-weight: 700;
    font-size: 1rem;
}

.lotto-slip {
    position: relative;
    width: 100%;
    aspect-ratio: 7 / 7;
    /* 7x7 비율 */
    background: #fff;
    border: 1px solid #e5e7eb;
    padding: 5px;
}

.slip-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(7, 1fr);
    height: 100%;
    width: 100%;
}

.slip-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #d1d5db;
    border: 1px solid #f3f4f6;
    border-radius: 2px;
    position: relative;
    /* z-index 적용을 위해 필수 */
    z-index: 1;
}

.slip-cell.active {
    background: #1f2937;
    color: white;
    font-weight: bold;
    border-color: #1f2937;
    z-index: 2;
    border-radius: 50%;
    transform: scale(0.8);
}

.pattern-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    /* 선이 맨 위에 오도록 */
}

.pattern-line {
    fill: none;
    stroke: #ef4444;
    stroke-width: 1.5;
    /* viewBox 100 기준 */
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.8;
    vector-effect: non-scaling-stroke;
    /* 스케일 무시하고 두께 유지 */
}

/* 모바일 스크롤 */
@media (max-width: 768px) {
    .pattern-grid-container {
        display: flex;
        overflow-x: auto;
        padding-bottom: 1.5rem;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .pattern-card {
        min-width: 200px;
        scroll-snap-align: center;
    }
}