@font-face {
    font-family: 'MaruBuri';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_20-10-21@1.0/MaruBuri-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
}

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

body {
    font-family: 'MaruBuri', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(to bottom, #e3ebf1 0%, #dbe5ed 100%);
    min-height: 100vh;
    padding: 40px 20px 0;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    flex: 1;
    padding-bottom: 40px;
}

.title-section {
    text-align: center;
    margin-bottom: 50px;
}

.title-section h1 {
    font-size: 42px;
    font-weight: 800;
    color: #1e3a5f;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.title-section p {
    font-size: 17px;
    color: #666;
    font-weight: 400;
}

.button-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 30px;
}

.btn {
    background: white;
    border: 2px solid #cbd5e1;
    padding: 28px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'MaruBuri', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #1e3a5f;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.btn:hover {
    background: #fff;
    border-color: #4a7ba7;
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(74, 123, 167, 0.15), 0 4px 6px -2px rgba(74, 123, 167, 0.05);
}

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

.btn i {
    display: block;
    font-size: 26px;
    margin-bottom: 10px;
    color: #4a7ba7;
}

.btn small {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #4a7ba7;
    margin-top: 6px;
}

.lucky-input-section {
    background: white;
    border: 1px solid #e0e0e0;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: none;
}

.lucky-input-section.active {
    display: block;
}

.lucky-input-section h3 {
    margin-bottom: 20px;
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 700;
}

.lucky-inputs {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.lucky-inputs input {
    flex: 1;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 20px;
    text-align: center;
    font-family: 'MaruBuri', sans-serif;
    font-weight: 700;
    color: #1a1a1a;
}

.lucky-inputs input:focus {
    outline: none;
    border-color: #4a7ba7;
}

.result-card {
    background: white;
    border: 1px solid #e0e0e0;
    padding: 40px 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: none;
}

.result-card.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

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

.loading {
    text-align: center;
    padding: 60px 20px;
    color: #4a7ba7;
}

.loading i {
    font-size: 48px;
    animation: spin 1s linear infinite;
    color: #4a7ba7;
}

.loading p {
    margin-top: 20px;
    font-size: 16px;
    font-weight: 600;
    color: #1e3a5f;
}

.loading-steps {
    margin-top: 12px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

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

.result-title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 30px;
}

.numbers {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 30px 0;
    flex-wrap: wrap;
}

@keyframes popIn {
    0% { transform: scale(0) translateY(30px); opacity: 0; }
    50% { transform: scale(1.15) translateY(-10px); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.number-ball {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 900;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.number-ball.y { background: linear-gradient(135deg, #fbc400 0%, #daa520 100%); }
.number-ball.b { background: linear-gradient(135deg, #69c8f2 0%, #007bff 100%); }
.number-ball.r { background: linear-gradient(135deg, #ff7272 0%, #dc3545 100%); }
.number-ball.g { background: linear-gradient(135deg, #aaa 0%, #888 100%); }
.number-ball.p { background: linear-gradient(135deg, #b0d840 0%, #28a745 100%); }

.ai-comment {
    background: #f0f7ff;
    padding: 24px;
    border-radius: 8px;
    margin: 30px 0;
    border-left: 3px solid #4a7ba7;
}

.ai-comment h4 {
    color: #1e3a5f;
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-comment p {
    color: #4a4a4a;
    line-height: 1.7;
    font-size: 15px;
}

.confidence {
    text-align: center;
    margin: 25px 0;
    font-size: 15px;
    color: #666;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 30px;
}

.action-btn {
    flex: 1;
    padding: 16px;
    border: 1px solid #4a7ba7;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'MaruBuri', sans-serif;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.2s;
    background: white;
    color: #4a7ba7;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-btn.primary {
    background: #4a7ba7;
    color: white;
    border-color: #4a7ba7;
}

.action-btn:hover {
    background: #eef4f9;
}

.action-btn.primary:hover {
    background: #3d6a8f;
    border-color: #3d6a8f;
}

.action-btn:active {
    transform: scale(0.98);
}

.history {
    background: white;
    border: 1px solid #e0e0e0;
    padding: 30px;
    border-radius: 12px;
}

.history h3 {
    color: #1e3a5f;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-item {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.history-item .date {
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
    font-weight: 600;
}

.history-item .numbers {
    gap: 8px;
    margin: 0;
}

.history-item .number-ball {
    width: 44px;
    height: 44px;
    font-size: 18px;
    animation: none;
}

.set-container {
    margin-bottom: 24px;
}

.set-label {
    font-size: 14px;
    color: #888;
    margin-bottom: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==================== 하단 푸터 ==================== */
.app-footer {
    background: white;
    border-top: 1px solid #d0d0d0;
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: #4a7ba7;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.footer-links a:hover {
    color: #1e3a5f;
    transform: translateY(-2px);
}

.footer-copyright {
    font-size: 0.8rem;
    color: #666;
    margin-top: 1rem;
}

.shin-calligraphy-small {
    font-family: 'Zhi Mang Xing', cursive !important;
    font-size: 1.2rem;
    font-weight: 400;
    display: inline-block;
    margin: 0 0.1em;
}

@media (max-width: 480px) {
    body {
        padding: 30px 16px 0;
    }

    .title-section h1 {
        font-size: 36px;
    }

    .button-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .btn {
        padding: 24px 20px;
    }

    .numbers {
        gap: 8px;
    }

    .number-ball {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }

    .result-card {
        padding: 30px 20px;
    }

    .footer-links {
        gap: 1.5rem;
    }

    .footer-links a {
        font-size: 0.85rem;
    }
}

/* 모달 스타일 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 300px;
    width: 90%;
    transform: translateY(20px);
    transition: all 0.3s;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-icon {
    font-size: 40px;
    color: #4a7ba7;
    margin-bottom: 20px;
}

.modal-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 25px;
}

.modal-btn {
    background: #4a7ba7;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-btn:hover {
    background: #3d6a8f;
}
