:root {
    --bg-color: #f0f2f5;
    --container-bg: #fff;
    --text-color: #333;
    --primary-color: #4a90e2;
    --primary-hover: #357abd;
    --secondary-color: #2ecc71;
    --secondary-hover: #27ae60;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --border-color: #eee;
    --input-bg: #fff;
    --danger-color: #e74c3c;
}

.dark-mode {
    --bg-color: #121212;
    --container-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --primary-color: #5da5f5;
    --primary-hover: #7ebfff;
    --secondary-color: #2ecc71;
    --secondary-hover: #27ae60;
    --shadow-color: rgba(0, 0, 0, 0.6);
    --border-color: #333;
    --input-bg: #2d2d2d;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 15px;
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.5;
}

.container {
    text-align: center;
    background-color: var(--container-bg);
    padding: 25px 15px;
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow-color);
    width: 100%;
    max-width: 550px;
}

h1 { font-size: 1.5rem; margin-bottom: 20px; word-break: keep-all; }

.theme-toggle {
    position: fixed; top: 15px; right: 15px;
    background-color: var(--container-bg);
    border: 2px solid var(--primary-color);
    font-size: 20px; cursor: pointer; color: var(--text-color);
    padding: 0; width: 40px; height: 40px; border-radius: 50%;
    box-shadow: 0 4px 8px var(--shadow-color);
    display: flex; justify-content: center; align-items: center;
    transition: all 0.3s; z-index: 1000;
}

.admin-btn {
    position: fixed; bottom: 15px; left: 15px;
    background-color: transparent; border: none;
    font-size: 18px; cursor: pointer; color: #888;
    opacity: 0.5; padding: 5px; transition: opacity 0.3s;
    z-index: 1000;
}

.admin-btn:hover { opacity: 1; }

.selection-container { margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px dashed var(--border-color); }

.question { font-size: 1rem; font-weight: 600; margin-bottom: 12px; }

.count-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

.count-btn {
    background-color: transparent; color: var(--primary-color);
    border: 1px solid var(--primary-color); padding: 8px 12px;
    font-size: 14px; font-weight: bold; border-radius: 8px; cursor: pointer;
    transition: all 0.2s; flex: 1 1 calc(33.33% - 8px); min-width: 70px; max-width: 100px;
}

.count-btn.active { background-color: var(--primary-color); color: #fff; }

.generate-btn {
    background-color: var(--secondary-color); color: white; border: none;
    padding: 14px 20px; font-size: 1rem; font-weight: bold; border-radius: 8px;
    cursor: pointer; width: 100%; max-width: 280px; transition: all 0.3s;
}

.lotto-display-area { display: flex; flex-direction: column; gap: 12px; margin: 20px 0; }

.lotto-row { display: flex; justify-content: center; gap: 6px; padding: 10px 5px; background-color: rgba(128, 128, 128, 0.05); border-radius: 10px; }

.lotto-number { width: 36px; height: 36px; border-radius: 50%; color: #fff; font-size: 14px; font-weight: bold; display: flex; justify-content: center; align-items: center; flex-shrink: 0; }

/* Contact & Comment Form */
.contact-section, .comment-section { margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--border-color); text-align: left; }

.contact-section h3, .comment-section h3 { margin-bottom: 15px; text-align: center; font-size: 1.1rem; }

.contact-form, .comment-form { display: flex; flex-direction: column; gap: 10px; }

.contact-form input, .contact-form textarea, .comment-form input, .comment-form textarea {
    padding: 10px; border-radius: 8px; border: 1px solid var(--border-color);
    background-color: var(--input-bg); color: var(--text-color);
    font-family: inherit; font-size: 16px; width: 100%;
}

.submit-btn {
    background-color: var(--primary-color); color: white; border: none;
    padding: 12px; font-size: 1rem; font-weight: bold; border-radius: 8px;
    cursor: pointer; width: 100%;
}

.submit-btn.small { width: auto; min-width: 80px; align-self: flex-end; padding: 10px 15px; }

/* Comment List */
.comment-list { margin-top: 15px; display: flex; flex-direction: column; gap: 8px; max-height: 250px; overflow-y: auto; }

.comment-item { 
    background-color: rgba(128, 128, 128, 0.03); padding: 12px; border-radius: 8px; 
    border-left: 3px solid var(--primary-color); position: relative;
}

.comment-header { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 0.8rem; padding-right: 25px; }

.delete-comment-btn {
    position: absolute; top: 10px; right: 10px;
    background-color: var(--danger-color); color: white; border: none;
    width: 20px; height: 20px; border-radius: 4px; font-size: 12px;
    cursor: pointer; display: none; justify-content: center; align-items: center;
}

.comment-author { font-weight: bold; color: var(--primary-color); }

.comment-body { font-size: 0.85rem; word-break: break-all; }

.strategy-explanation { margin-top: 25px; padding: 15px; background-color: rgba(128, 128, 128, 0.05); border-radius: 10px; font-size: 0.8rem; line-height: 1.5; text-align: left; }

@media (max-width: 360px) {
    .lotto-number { width: 32px; height: 32px; font-size: 12px; }
    h1 { font-size: 1.3rem; }
    .count-btn { flex: 1 1 calc(50% - 8px); }
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }
