:root {
    --bg-color: #f8f9fa;
    --container-bg: #ffffff;
    --text-color: #212529;
    --primary-color: #4dabf7;
    --primary-hover: #339af0;
    --ball-bg: #e9ecef;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --container-bg: #2d2d2d;
    --text-color: #f8f9fa;
    --primary-color: #339af0;
    --primary-hover: #1c7ed6;
    --ball-bg: #404040;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    margin: 0;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    background-color: var(--container-bg);
    padding: 2rem;
    border-radius: 24px;
    box-shadow: var(--shadow);
    text-align: center;
    width: 90%;
    max-width: 450px;
}

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

h1 { margin: 0; font-size: 1.5rem; letter-spacing: -0.5px; }

.icon-btn {
    background: var(--ball-bg);
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.number-display {
    display: flex;
    justify-content: center;
    gap: 12px;
    min-height: 100px;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.placeholder {
    color: #adb5bd;
    font-size: 1rem;
}

.ball {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 1.2rem;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    animation: bounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ball.range-1 { background: linear-gradient(135deg, #fcc419, #fab005); }
.ball.range-2 { background: linear-gradient(135deg, #4dabf7, #228be6); }
.ball.range-3 { background: linear-gradient(135deg, #ff8787, #fa5252); }
.ball.range-4 { background: linear-gradient(135deg, #adb5bd, #868e96); }
.ball.range-5 { background: linear-gradient(135deg, #69db7c, #40c057); }

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1.2rem;
    font-size: 1.1rem;
    border-radius: 16px;
    cursor: pointer;
    width: 100%;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(77, 171, 247, 0.3);
}

.primary-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(77, 171, 247, 0.4);
}

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

footer {
    margin-top: 2rem;
    font-size: 0.85rem;
    color: #adb5bd;
}

@keyframes bounce {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}