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

:root {
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --container-bg: rgba(255, 255, 255, 0.15);
    --container-border: rgba(255, 255, 255, 0.3);
    --text-color: #ffffff;
    --title-color: #ffffff;
    --machine-bg: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.2);
    --btn-gradient-start: #ff6b6b;
    --btn-gradient-end: #feca57;
    --label-bg: rgba(255, 255, 255, 0.25);
}

body.dark-mode {
    --bg-gradient-start: #0f0c29;
    --bg-gradient-end: #302b63;
    --container-bg: rgba(255, 255, 255, 0.08);
    --container-border: rgba(255, 255, 255, 0.15);
    --text-color: #e0e0e0;
    --title-color: #ffffff;
    --machine-bg: rgba(255, 255, 255, 0.05);
    --shadow-color: rgba(0, 0, 0, 0.4);
    --btn-gradient-start: #a855f7;
    --btn-gradient-end: #6366f1;
    --label-bg: rgba(255, 255, 255, 0.15);
}

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

body {
    font-family: 'Noto Sans KR', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    margin: 0;
    color: var(--text-color);
    transition: all 0.5s ease;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    background: var(--container-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 50px;
    border-radius: 30px;
    border: 1px solid var(--container-border);
    box-shadow: 0 25px 50px -12px var(--shadow-color);
    text-align: center;
    position: relative;
    z-index: 1;
    transition: all 0.5s ease;
    animation: fadeIn 0.8s ease-out;
}

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

h1 {
    font-size: 2.8em;
    font-weight: 900;
    color: var(--title-color);
    margin-bottom: 30px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: color 0.3s ease;
    letter-spacing: -1px;
}

.lotto-machine {
    background: var(--machine-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 25px;
    margin-bottom: 35px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

#lotto-numbers {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lotto-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.lotto-row:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.row-label {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--label-bg);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.numbers-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex: 1;
}

.number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.number::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, transparent 50%);
    border-radius: 50%;
}

.number:hover {
    transform: translateY(-8px) scale(1.1);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    70% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.number.animate {
    animation: popIn 0.5s ease-out forwards;
}

#generate-btn {
    padding: 18px 50px;
    font-size: 20px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--btn-gradient-start) 0%, var(--btn-gradient-end) 100%);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

#generate-btn:hover::before {
    left: 100%;
}

#generate-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(255, 107, 107, 0.5);
}

#generate-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
}

#theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    transition: all 0.3s ease;
}

#theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    background: rgba(255, 255, 255, 0.2);
}

#theme-toggle .icon-sun {
    display: block;
}

#theme-toggle .icon-moon {
    display: none;
}

body.dark-mode #theme-toggle .icon-sun {
    display: none;
}

body.dark-mode #theme-toggle .icon-moon {
    display: block;
}

@media (max-width: 600px) {
    .container {
        padding: 30px 20px;
        margin: 20px;
        border-radius: 24px;
    }

    h1 {
        font-size: 2em;
    }

    .number {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .numbers-container {
        gap: 6px;
    }

    .lotto-row {
        gap: 8px;
        padding: 6px 8px;
    }

    .row-label {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    #generate-btn {
        padding: 15px 35px;
        font-size: 16px;
    }
}
