:root {
    /* Light Mode Variables */
    --bg-color: #f8f9fa;
    --text-color: #212529;
    --container-bg: #ffffff;
    --container-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --btn-primary-bg: #007bff;
    --btn-primary-text: #ffffff;
    --btn-icon-bg: #e9ecef;
    --placeholder-color: #6c757d;
    
    /* Ball Colors */
    --ball-1: #fbc02d; /* 1-10 Yellow */
    --ball-2: #1976d2; /* 11-20 Blue */
    --ball-3: #d32f2f; /* 21-30 Red */
    --ball-4: #616161; /* 31-40 Gray */
    --ball-5: #388e3c; /* 41-45 Green */
    --ball-text: #ffffff;
}

body.dark {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --container-bg: #1e1e1e;
    --container-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --btn-primary-bg: #3700b3;
    --btn-primary-text: #ffffff;
    --btn-icon-bg: #333333;
    --placeholder-color: #9e9e9e;
}

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

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    background-color: var(--container-bg);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--container-shadow);
    width: 100%;
    max-width: 500px;
    text-align: center;
    transition: background-color 0.3s ease;
}

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

h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.btn-icon {
    background-color: var(--btn-icon-bg);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
}

.lotto-display {
    min-height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.placeholder {
    color: var(--placeholder-color);
    font-size: 1.1rem;
    font-weight: 500;
}

.ball {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--ball-text);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

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

.btn-primary {
    background-color: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: transform 0.1s ease, background-color 0.3s ease;
}

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

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

.history-section h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background-color: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease-out forwards;
}

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

.history-numbers {
    display: flex;
    gap: 5px;
}

.history-ball {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--ball-text);
}

.empty-history {
    color: var(--placeholder-color);
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

.btn-secondary {
    background: none;
    border: 1px solid var(--placeholder-color);
    color: var(--placeholder-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background-color: var(--btn-icon-bg);
    color: var(--text-color);
}

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

.contact-section h2 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.9;
}

.form-group input, 
.form-group textarea {
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--btn-icon-bg);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

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

.comments-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--btn-icon-bg);
    text-align: left;
}

.comments-section h2 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

footer {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: var(--placeholder-color);
}
