:root {
    --color-1: #fbc400; /* 1-10 */
    --color-2: #69c8f2; /* 11-20 */
    --color-3: #ff7272; /* 21-30 */
    --color-4: #aaa;    /* 31-40 */
    --color-5: #b0d840; /* 41-45 */
    
    /* Light Mode */
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-color: #333;
    --sub-text: #666;
    --placeholder-color: #ccc;
    --history-bg: #eee;
    --history-item-border: #f0f0f0;
    --button-bg: #4a90e2;
    --button-hover: #357abd;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --text-color: #f0f0f0;
    --sub-text: #aaa;
    --placeholder-color: #555;
    --history-bg: #444;
    --history-item-border: #3d3d3d;
    --button-bg: #357abd;
    --button-hover: #4a90e2;
}

body {
    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;
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    text-align: center;
    width: 90%;
    max-width: 500px;
    position: relative;
    transition: background-color 0.3s;
}

.theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

#theme-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    box-shadow: none;
    transition: transform 0.2s;
}

#theme-btn:hover {
    transform: scale(1.1);
    background: none;
}

h1 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

p {
    color: var(--sub-text);
    margin-bottom: 2rem;
}

.ball-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 2rem;
    min-height: 60px;
    flex-wrap: wrap;
}

.placeholder {
    color: var(--placeholder-color);
    font-style: italic;
    line-height: 60px;
}

.ball {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: inset -3px -3px 5px rgba(0,0,0,0.2), 2px 2px 5px rgba(0,0,0,0.1);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

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

.ball.range-1 { background-color: var(--color-1); }
.ball.range-2 { background-color: var(--color-2); }
.ball.range-3 { background-color: var(--color-3); }
.ball.range-4 { background-color: var(--color-4); }
.ball.range-5 { background-color: var(--color-5); }

button {
    background-color: var(--button-bg);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

button:hover {
    background-color: var(--button-hover);
}

button:active {
    transform: scale(0.95);
}

.history {
    margin-top: 2rem;
    border-top: 1px solid var(--history-bg);
    padding-top: 1rem;
    text-align: left;
}

.history h3 {
    font-size: 0.9rem;
    color: var(--sub-text);
    margin-bottom: 0.5rem;
}

#history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 150px;
    overflow-y: auto;
}

.history-item {
    font-size: 0.85rem;
    color: var(--text-color);
    padding: 5px 0;
    border-bottom: 1px dashed var(--history-item-border);
    display: flex;
    justify-content: space-between;
}

.contact-section {
    margin-top: 2rem;
    border-top: 1px solid var(--history-bg);
    padding-top: 1rem;
    text-align: left;
}

.contact-section h3 {
    font-size: 0.9rem;
    color: var(--sub-text);
    margin-bottom: 0.8rem;
}

.form-group {
    margin-bottom: 10px;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--history-item-border);
    border-radius: 8px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.form-group input:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--button-bg);
}

.form-group textarea {
    height: 80px;
    resize: vertical;
}

.btn-small {
    padding: 8px 20px;
    font-size: 0.9rem;
    width: 100%;
}
