/* ============================================================
   🎯 로또 당첨 확인기 v2.5 - Premium Dark Theme
   ============================================================ */

/* ── CSS Custom Properties ── */
:root {
    --bg-primary: #0f0f23;
    --bg-secondary: #161631;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --border-card: rgba(255, 255, 255, 0.08);
    --border-focus: #667eea;

    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    --gradient-upload: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    --gradient-export: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-copy: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --gradient-header: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #667eea 100%);

    --text-primary: #e8e8f0;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.35);

    --color-gold: #ffd700;
    --color-success: #2ecc71;
    --color-error: #e74c3c;
    --color-warning: #f59e0b;
    --color-info: #3b82f6;

    --ball-yellow: #fbc531;
    --ball-blue: #3498db;
    --ball-red: #e74c3c;
    --ball-gray: #95a5a6;
    --ball-green: #2ecc71;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-round: 50%;

    --shadow-glow: 0 0 30px rgba(102, 126, 234, 0.15);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);

    --font-main: 'Noto Sans KR', 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-number: 'Inter', 'Roboto Mono', monospace;

    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(102, 126, 234, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(118, 75, 162, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(46, 204, 113, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.03); }
::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(102, 126, 234, 0.5); }

/* ── Header ── */
.header {
    position: relative;
    background: var(--gradient-header);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    padding: 28px 24px 24px;
    text-align: center;
    z-index: 10;
    overflow: hidden;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

.header-content { position: relative; z-index: 2; }

.header-title {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.25);
    margin-bottom: 4px;
}

.header-subtitle {
    font-size: clamp(0.8rem, 2vw, 0.95rem);
    color: rgba(195, 207, 226, 0.85);
    font-weight: 400;
}

.header-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 12px;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.header-credit {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    font-weight: 700;
    color: #fbbf24;
    z-index: 2;
}

/* ── Container ── */
.container {
    position: relative;
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 40px;
    z-index: 1;
}

/* ── Section Cards ── */
.section-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 24px 24px 20px;
    margin-bottom: 20px;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
    animation: fadeInUp 0.6s ease both;
    overflow: hidden;
}

.section-card:nth-child(2) { animation-delay: 0.1s; }
.section-card:nth-child(3) { animation-delay: 0.2s; }
.section-card:nth-child(4) { animation-delay: 0.3s; }

.section-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    border-color: rgba(102, 126, 234, 0.15);
}

/* ── Section Titles ── */
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-left: 14px;
    border-left: 4px solid;
    border-image: var(--gradient-primary) 1;
}

.section-icon { font-size: 1.3rem; }

/* ── Input Fields ── */
.input-row { margin-bottom: 16px; }

.input-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.input-field {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-number);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
    width: 100%;
}

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

.input-field:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15), 0 0 20px rgba(102, 126, 234, 0.08);
    background: rgba(255, 255, 255, 0.08);
}

.input-field::-webkit-inner-spin-button,
.input-field::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 24px;
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

.btn:hover:not(:disabled) { transform: translateY(-1px) scale(1.02); }
.btn:active:not(:disabled) { transform: translateY(0) scale(0.98); }

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    filter: grayscale(0.3);
}

.btn-primary {
    background: var(--gradient-primary);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 6px 25px rgba(102, 126, 234, 0.45); }

.btn-success {
    background: var(--gradient-success);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}
.btn-success:hover:not(:disabled) { box-shadow: 0 6px 25px rgba(46, 204, 113, 0.45); }

.btn-upload {
    background: var(--gradient-upload);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-export {
    background: var(--gradient-export);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}
.btn-export:hover:not(:disabled) { box-shadow: 0 6px 25px rgba(245, 158, 11, 0.45); }

.btn-copy {
    background: var(--gradient-copy);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}
.btn-copy:hover:not(:disabled) { box-shadow: 0 6px 25px rgba(59, 130, 246, 0.45); }

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
    padding: 10px 20px;
    font-size: 0.85rem;
}
.btn-outline:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.25);
    color: var(--text-primary);
}

.btn-check {
    width: 100%;
    padding: 18px 24px;
    font-size: 1.3rem;
    border-radius: 16px;
}

.btn-check:not(:disabled) { animation: pulse 2.5s ease-in-out infinite; }

/* ── Check Button Wrapper ── */
.check-button-wrapper {
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease 0.25s both;
}

/* ── Drop Zone ── */
.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 44px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
}

.drop-zone:hover {
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.04);
}

.drop-zone.dragover {
    border-color: #667eea;
    border-style: solid;
    background: rgba(102, 126, 234, 0.08);
    transform: scale(1.01);
}

.drop-zone-icon { font-size: 2.8rem; margin-bottom: 12px; }

.drop-zone-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.drop-zone-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── Progress ── */
.progress-section { margin-top: 16px; }

.progress-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    transition: width 0.4s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    animation: shimmer 1.8s ease-in-out infinite;
}

/* ── Status Text ── */
.status-text {
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.status-success { color: var(--color-success) !important; }
.status-error { color: var(--color-error) !important; }
.status-loading { color: var(--color-info) !important; }
.status-warning { color: var(--color-warning) !important; }

/* ── Cache Info ── */
.cache-info {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: rgba(5, 150, 105, 0.08);
    border: 1px solid rgba(5, 150, 105, 0.15);
    border-radius: var(--radius-sm);
    margin-top: 12px;
    font-size: 0.82rem;
    color: #34d399;
}

/* ── File Status ── */
.file-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

/* ── Info / Warning Boxes ── */
.info-box {
    background: rgba(37, 99, 235, 0.06);
    border-left: 4px solid var(--color-info);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 14px 18px;
    margin-top: 16px;
}

.info-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #60a5fa;
    margin-bottom: 6px;
}

.info-list {
    list-style: none;
    padding: 0;
}

.info-list li {
    font-size: 0.82rem;
    color: rgba(147, 197, 253, 0.8);
    padding: 2px 0;
}

.info-list li::before {
    content: '•';
    margin-right: 8px;
    color: #60a5fa;
}

.warning-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(245, 158, 11, 0.06);
    border-left: 4px solid var(--color-warning);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 12px 16px;
    margin-top: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fbbf24;
}

.warning-icon { font-size: 1.1rem; }

/* ── Manual Input Row ── */
.manual-input-row {
    margin-top: 16px;
    text-align: right;
}

/* ── Prize Section ── */
.prize-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prize-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.prize-row label {
    min-width: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.prize-row .input-field {
    max-width: 150px;
    text-align: right;
    font-family: var(--font-number);
    flex: 1;
    min-width: 100px;
}

.prize-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.prize-info-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.06);
    border-radius: var(--radius-sm);
}

/* ── Winning Numbers Display ── */
.winning-display {
    margin-top: 16px;
    padding: 18px;
    background: rgba(102, 126, 234, 0.06);
    border: 1px solid rgba(102, 126, 234, 0.12);
    border-radius: 14px;
    text-align: center;
    animation: fadeInUp 0.5s ease;
}

.winning-round {
    font-size: 1.1rem;
    font-weight: 700;
    color: #818cf8;
    margin-bottom: 4px;
}

.winning-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.balls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* ── Lotto Balls ── */
.ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-round);
    font-family: var(--font-number);
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    animation: ballAppear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    position: relative;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.ball:nth-child(1) { animation-delay: 0.05s; }
.ball:nth-child(2) { animation-delay: 0.1s; }
.ball:nth-child(3) { animation-delay: 0.15s; }
.ball:nth-child(4) { animation-delay: 0.2s; }
.ball:nth-child(5) { animation-delay: 0.25s; }
.ball:nth-child(6) { animation-delay: 0.3s; }
.ball:nth-child(7) { animation-delay: 0.35s; } /* + sign */
.ball:nth-child(8) { animation-delay: 0.4s; } /* bonus */

.ball-1to10 {
    background: radial-gradient(circle at 35% 35%, #ffe066, var(--ball-yellow), #c7960c);
    box-shadow: 0 0 14px rgba(251, 197, 49, 0.4);
}

.ball-11to20 {
    background: radial-gradient(circle at 35% 35%, #6bb9f0, var(--ball-blue), #1a6dab);
    box-shadow: 0 0 14px rgba(52, 152, 219, 0.4);
}

.ball-21to30 {
    background: radial-gradient(circle at 35% 35%, #f1948a, var(--ball-red), #a93226);
    box-shadow: 0 0 14px rgba(231, 76, 60, 0.4);
}

.ball-31to40 {
    background: radial-gradient(circle at 35% 35%, #bdc3c7, var(--ball-gray), #6a7b83);
    box-shadow: 0 0 14px rgba(149, 165, 166, 0.35);
}

.ball-41to45 {
    background: radial-gradient(circle at 35% 35%, #82e0aa, var(--ball-green), #1a9e52);
    box-shadow: 0 0 14px rgba(46, 204, 113, 0.4);
}

.ball-bonus {
    outline: 3px solid var(--color-gold);
    outline-offset: 2px;
    animation: ballAppear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.45s both;
}

.ball-separator {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-muted);
    width: auto;
    height: auto;
    background: none;
    box-shadow: none;
    animation: ballAppear 0.4s ease 0.35s both;
}

/* ── Stats Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 20px 14px;
    text-align: center;
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.07);
}

.stat-value {
    font-family: var(--font-number);
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-primary .stat-value { color: #818cf8; }
.stat-danger .stat-value { color: #f87171; }
.stat-success .stat-value { color: #34d399; }
.stat-muted .stat-value { color: var(--text-muted); }

/* ── Summary Section ── */
.summary-section {
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 16px;
    overflow-x: auto;
}

.summary-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
    gap: 8px;
    flex-wrap: wrap;
}

.summary-row:hover { background: rgba(255, 255, 255, 0.03); }

.summary-rank {
    font-size: 0.88rem;
    font-weight: 600;
    min-width: 140px;
}

.summary-count {
    font-family: var(--font-number);
    font-size: 0.88rem;
    font-weight: 700;
    color: #818cf8;
}

.summary-prize {
    font-family: var(--font-number);
    font-size: 0.82rem;
    color: var(--text-secondary);
    min-width: 100px;
    text-align: right;
}

.summary-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 8px 0;
}

.summary-total {
    font-weight: 700;
    font-size: 0.95rem;
}

.summary-total .summary-rank { color: var(--color-error); }
.summary-total .summary-count { color: var(--color-error); font-size: 1rem; }

/* ── Profit Section ── */
.profit-section {
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 16px;
}

.profit-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.profit-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 12px 8px;
    text-align: center;
}

.profit-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.profit-value {
    font-family: var(--font-number);
    font-size: 1rem;
    font-weight: 700;
}

.profit-positive { color: #34d399; }
.profit-negative { color: #f87171; }
.profit-neutral { color: #818cf8; }

/* ── Detail Section ── */
.detail-section {
    margin-bottom: 20px;
}

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

.detail-count {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-family: var(--font-number);
}

.detail-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.06);
    max-height: 500px;
    overflow-y: auto;
}

/* ── Results Table ── */
.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 320px;
}

.results-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.results-table th {
    background: rgba(102, 126, 234, 0.2);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    font-weight: 600;
    padding: 12px 10px;
    text-align: center;
    white-space: nowrap;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.results-table td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-family: var(--font-number);
    font-size: 0.85rem;
}

.results-table tbody tr {
    transition: background var(--transition-fast);
}

.results-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.results-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.015);
}

.results-table tbody tr:nth-child(even):hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Rank cell colors */
.rank-1 { color: #ffd700; font-weight: 800; text-shadow: 0 0 8px rgba(255,215,0,0.4); }
.rank-2 { color: #c0c0c0; font-weight: 700; }
.rank-3 { color: #cd7f32; font-weight: 700; }
.rank-4 { color: #34d399; font-weight: 600; }
.rank-5 { color: #6ee7b7; font-weight: 600; }

/* Mini balls in table */
.mini-ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-round);
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    margin: 0 1px;
}

/* ── Winner Banner ── */
.winner-banner {
    position: relative;
    padding: 28px;
    margin-bottom: 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24, #ffd32a, #ee5a24, #ff6b6b);
    background-size: 300% 300%;
    animation: gradientShift 3s ease infinite;
    text-align: center;
    overflow: hidden;
}

.winner-text {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    position: relative;
    z-index: 2;
}

/* ── Export Buttons ── */
.export-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    animation: scaleIn 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast), background var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.modal-body { padding: 20px 24px; }

.modal-input-group {
    margin-bottom: 16px;
}

.modal-input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.modal-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 20px 0;
}

.modal-footer {
    padding: 16px 24px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ── Toast ── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 500;
    color: #fff;
    min-width: 260px;
    max-width: 400px;
    backdrop-filter: blur(12px);
    animation: slideInRight 0.4s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.toast-success {
    background: rgba(46, 204, 113, 0.9);
    border: 1px solid rgba(46, 204, 113, 0.5);
}
.toast-error {
    background: rgba(231, 76, 60, 0.9);
    border: 1px solid rgba(231, 76, 60, 0.5);
}
.toast-info {
    background: rgba(59, 130, 246, 0.9);
    border: 1px solid rgba(59, 130, 246, 0.5);
}

.toast-exit { animation: slideOutRight 0.3s ease forwards; }

/* ── Footer ── */
.footer {
    background: var(--gradient-primary);
    padding: 14px 20px;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(195, 207, 226, 0.7);
    position: relative;
    z-index: 1;
}

/* ── Loading Spinner ── */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ── Result Section ── */
.result-section {
    animation: fadeInUp 0.7s ease;
    border: 1px solid rgba(102, 126, 234, 0.15);
}

/* ══════════════════════════════════════
   KEYFRAME ANIMATIONS
   ══════════════════════════════════════ */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes ballAppear {
    0% { opacity: 0; transform: scale(0) rotate(-180deg); }
    60% { transform: scale(1.15) rotate(10deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3); }
    50% { transform: scale(1.015); box-shadow: 0 6px 25px rgba(46, 204, 113, 0.5); }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(60px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(60px); }
}

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

/* ══════════════════════════════════════
   RESPONSIVE - 태블릿
   ══════════════════════════════════════ */

@media (max-width: 768px) {
    .container { padding: 16px 12px 30px; }

    .section-card { padding: 20px 18px; border-radius: 16px; }

    .input-group { flex-direction: column; }
    .input-group .btn { width: 100%; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-value { font-size: 1.4rem; }

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

    .balls-row { gap: 6px; }
    .ball { width: 42px; height: 42px; font-size: 0.95rem; }

    .header-credit {
        position: static;
        transform: none;
        text-align: center;
        margin-top: 8px;
    }

    .export-buttons { flex-direction: column; }
    .export-buttons .btn { width: 100%; }

    .summary-row { flex-direction: column; align-items: flex-start; gap: 4px; }
    .summary-prize { text-align: left; }

    .prize-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .prize-row .input-field { max-width: 100%; }

    .detail-header { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ══════════════════════════════════════
   RESPONSIVE - 작은 스마트폰
   ══════════════════════════════════════ */

@media (max-width: 480px) {
    .header { padding: 18px 14px; }
    .header-title { font-size: 1.2rem; }
    .header-subtitle { font-size: 0.75rem; }
    .section-title { font-size: 0.95rem; padding-left: 10px; }
    .ball { width: 36px; height: 36px; font-size: 0.8rem; }
    .stat-card { padding: 12px 8px; }
    .stat-value { font-size: 1.2rem; }
    .stat-label { font-size: 0.72rem; }
    
    .drop-zone { padding: 28px 16px; }
    .drop-zone-icon { font-size: 2.2rem; margin-bottom: 10px; }
    .drop-zone-text { font-size: 0.9rem; }
    .drop-zone-hint { font-size: 0.72rem; }
    
    .btn-check { padding: 14px 20px; font-size: 1.1rem; }
    .btn { padding: 10px 18px; font-size: 0.88rem; }
    
    .modal-content { max-width: 95%; margin: 10px; }
    .modal-header { padding: 16px 18px; }
    .modal-body { padding: 16px 18px; }
    .modal-footer { padding: 14px 18px 16px; }
    
    .toast-container { 
        left: 12px; 
        right: 12px; 
        bottom: 16px; 
    }
    .toast { min-width: auto; max-width: 100%; font-size: 0.82rem; padding: 12px 16px; }
}

/* ══════════════════════════════════════
   RESPONSIVE - 초소형 화면 (320px~360px)
   ══════════════════════════════════════ */

@media (max-width: 360px) {
    .container { padding: 12px 10px 24px; }
    
    .header { padding: 14px 10px; }
    .header-title { font-size: 1.1rem; }
    .header-badge { font-size: 0.65rem; padding: 2px 8px; }
    
    .section-card { 
        padding: 16px 12px; 
        margin-bottom: 16px; 
        border-radius: 12px;
    }
    .section-title { 
        font-size: 0.9rem; 
        gap: 6px;
        margin-bottom: 14px;
    }
    .section-icon { font-size: 1.1rem; }
    
    .input-field { 
        padding: 10px 12px; 
        font-size: 0.9rem; 
    }
    .input-label { font-size: 0.82rem; }
    .input-hint { font-size: 0.72rem; }
    
    .btn { 
        padding: 10px 14px; 
        font-size: 0.85rem; 
        border-radius: 10px;
    }
    .btn-check { 
        padding: 12px 16px; 
        font-size: 1rem; 
        border-radius: 12px;
    }
    
    .ball { width: 32px; height: 32px; font-size: 0.75rem; }
    .ball-separator { font-size: 1.1rem; }
    
    .stats-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 8px; 
    }
    .stat-card { 
        padding: 10px 6px; 
        border-radius: 12px;
    }
    .stat-value { font-size: 1.05rem; }
    .stat-label { font-size: 0.68rem; }
    
    .profit-grid { gap: 10px; }
    .profit-card { padding: 12px 10px; }
    .profit-label { font-size: 0.72rem; }
    .profit-value { font-size: 1rem; }
    
    .summary-section, .profit-section { 
        padding: 14px 12px; 
        border-radius: 12px;
    }
    .summary-title { font-size: 0.9rem; margin-bottom: 12px; }
    .summary-rank { font-size: 0.82rem; min-width: auto; }
    .summary-count { font-size: 0.82rem; }
    .summary-prize { font-size: 0.78rem; min-width: auto; }
    
    .drop-zone { 
        padding: 20px 12px; 
        border-radius: 12px;
    }
    .drop-zone-icon { font-size: 1.8rem; margin-bottom: 8px; }
    .drop-zone-text { font-size: 0.85rem; }
    .drop-zone-hint { font-size: 0.68rem; }
    
    .info-box, .warning-box { 
        padding: 10px 12px; 
        margin-top: 12px;
        border-radius: 0 10px 10px 0;
    }
    .info-title { font-size: 0.8rem; }
    .info-list li { font-size: 0.75rem; }
    
    .winning-display { 
        padding: 16px 12px; 
        border-radius: 12px;
    }
    .winning-round { font-size: 1rem; }
    .winning-date { font-size: 0.72rem; }
    
    .prize-info-text { font-size: 0.78rem; padding: 8px 10px; }
    .prize-row label { min-width: auto; font-size: 0.82rem; }
    .prize-hint { font-size: 0.72rem; }
    
    .modal-content { 
        max-width: 98%; 
        margin: 6px; 
        border-radius: 14px;
    }
    .modal-title { font-size: 1rem; }
    .modal-input-group { margin-bottom: 12px; }
    .modal-input-group label { font-size: 0.8rem; }
    .modal-input-group .input-field { font-size: 0.85rem; padding: 9px 10px; }
    
    .winner-banner { padding: 18px 14px; border-radius: 12px; }
    .winner-text { font-size: 1rem; }
    
    .export-buttons { gap: 8px; }
    
    .detail-table-wrapper { max-height: 350px; }
    .results-table { font-size: 0.78rem; }
    .results-table th { padding: 8px 6px; font-size: 0.72rem; }
    .results-table td { padding: 8px 4px; font-size: 0.75rem; }
    
    .cache-info { font-size: 0.72rem; padding: 8px 10px; }
    .file-status { font-size: 0.8rem; padding: 10px 12px; }
    
    .toast-container { bottom: 12px; left: 8px; right: 8px; }
    .toast { font-size: 0.78rem; padding: 10px 14px; }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── Print ── */
@media print {
    body { background: #fff; color: #000; }
    body::before { display: none; }
    .header, .footer, .drop-zone, .export-buttons, .btn, .progress-section,
    .info-box, .warning-box, .manual-input-row, .modal-overlay, .toast-container { display: none !important; }
    .section-card {
        background: #fff;
        border: 1px solid #ddd;
        box-shadow: none;
        backdrop-filter: none;
    }
    .results-table th { background: #f0f0f0; color: #000; }
    .results-table td { color: #000; border-color: #ddd; }
}
