:root {
    --bg-color: #fdfaf6;
    --primary-color: #ffb4a2;
    --secondary-color: #ffd166;
    --text-main: #4a4e69;
    --text-light: #9a8c98;
    --card-bg: rgba(255, 255, 255, 0.85);
    --ball-size: 45px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--bg-color);
    background-image: radial-gradient(#ffd166 1px, transparent 1px);
    background-size: 40px 40px;
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.container {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
    max-width: 800px;
    width: 100%;
    padding: 3rem;
    text-align: center;
    border: 3px solid rgba(255, 255, 255, 0.5);
}

.hero {
    margin-bottom: 3rem;
}

.image-wrapper {
    width: 250px;
    height: 250px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    padding: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 10px 25px rgba(255, 180, 162, 0.4);
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #fff;
    transition: transform 0.4s ease;
}

.image-wrapper:hover img {
    transform: scale(1.05) rotate(5deg);
}

h1 {
    font-size: 2.5rem;
    font-weight: 900;
    color: #22223b;
    margin-bottom: 0.5rem;
}

.highlight {
    color: var(--primary-color);
    position: relative;
}

p {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.6;
}

.magical-btn {
    background: linear-gradient(45deg, var(--primary-color), #ff9a8b);
    border: none;
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-family: inherit;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    box-shadow: 0 8px 15px rgba(255, 154, 139, 0.3);
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.magical-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px rgba(255, 154, 139, 0.4);
    background: linear-gradient(45deg, #ff9a8b, var(--primary-color));
}

.magical-btn:active {
    transform: translateY(1px);
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.results-container.hidden {
    display: none;
    opacity: 0;
}

.lottery-set {
    background: white;
    padding: 1.5rem;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideUp 0.5s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.set-label {
    font-weight: 800;
    color: var(--text-light);
    width: 60px;
    text-align: left;
}

.numbers-group {
    display: flex;
    gap: 10px;
}

.ball {
    width: var(--ball-size);
    height: var(--ball-size);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    box-shadow: inset -3px -3px 6px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.1);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    opacity: 0;
    transform: scale(0.5);
}

/* Color coding for standard Korean Lotto ranges */
.ball.yellow { background: #fbc531; } /* 1-10 */
.ball.blue { background: #00a8ff; }   /* 11-20 */
.ball.red { background: #e84118; }    /* 21-30 */
.ball.gray { background: #7f8fa6; }   /* 31-40 */
.ball.green { background: #4cd137; }  /* 41-45 */

footer {
    margin-top: 3rem;
    font-size: 0.9rem;
    color: #ccc;
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 600px) {
    .lottery-set {
        flex-direction: column;
        gap: 1rem;
    }
    .set-label {
        width: auto;
        text-align: center;
    }
    .numbers-group {
        flex-wrap: wrap;
        justify-content: center;
    }
}
