:root {
    --ui-bg: #f3f7fb;
    --ui-surface: #ffffff;
    --ui-surface-soft: #f9fcff;
    --ui-text: #162534;
    --ui-muted: #52697a;
    --ui-border: #d7e3eb;
    --ui-shadow: 0 14px 34px rgba(18, 46, 63, 0.08);
    --ui-shadow-soft: 0 8px 20px rgba(18, 46, 63, 0.06);
    --ui-brand: #1a9b6a;
    --ui-brand-dark: #13784f;
    --ui-accent: #0e6f99;
    --ui-danger: #b92b2b;
}

html,
body {
    background:
        radial-gradient(circle at 8% 0%, rgba(100, 173, 255, 0.12) 0%, transparent 28%),
        radial-gradient(circle at 95% 16%, rgba(72, 202, 135, 0.11) 0%, transparent 30%),
        linear-gradient(180deg, #f8fbff 0%, var(--ui-bg) 100%);
    color: var(--ui-text);
    font-family: "Manrope", "Segoe UI", "Trebuchet MS", sans-serif;
}

main {
    padding: 18px 0 30px;
}

h1,
h2,
h3 {
    color: #102435;
    letter-spacing: 0.01em;
}

p,
label,
span,
li {
    color: inherit;
}

a {
    color: var(--ui-accent);
}

.container-fluid {
    max-width: 1240px;
}

/* Shared cards */
.task-card,
.streak-card,
.reward-card,
.history-card,
.journal-card,
.village-card,
.profile-card,
.calendar-column,
.modal-content,
.auth-box,
.task-filter-form,
.assign-points-form,
.budget-table,
.summary-table,
.table-wrapper {
    border: 1px solid var(--ui-border);
    box-shadow: var(--ui-shadow-soft);
}

.task-card,
.streak-card,
.reward-card,
.history-card,
.journal-card,
.village-card,
.profile-card,
.calendar-column,
.task-filter-form,
.assign-points-form {
    border-radius: 16px;
    background: var(--ui-surface);
}

.task-card:hover,
.streak-card:hover,
.reward-card:hover,
.history-card:hover,
.journal-card:hover,
.village-card:hover {
    box-shadow: var(--ui-shadow);
}

/* Inputs and form controls */
input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"],
select,
textarea,
.form-input,
.journal-date,
.journal-textarea {
    border: 1px solid #bfd1dd;
    border-radius: 10px;
    background: #fcfeff;
    color: #173142;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus,
.form-input:focus,
.journal-date:focus,
.journal-textarea:focus {
    border-color: #1a9b6a;
    box-shadow: 0 0 0 4px rgba(26, 155, 106, 0.16);
    outline: none;
}

/* Buttons */
button,
.btn-submit,
.btn-primary,
.btn-filter,
.give-btn,
.toggle-done-btn,
.give-malus-btn,
.buy-btn,
.bought-btn,
.redeem-btn,
.delete-btn,
.submit-btn,
.cancel-btn,
.lobby-btn.primary,
.guest-btn.primary {
    border-radius: 10px;
    border: 1px solid transparent;
    transition: transform 0.16s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

button:hover,
.btn-submit:hover,
.btn-primary:hover,
.btn-filter:hover,
.give-btn:hover,
.toggle-done-btn:hover,
.give-malus-btn:hover,
.buy-btn:hover,
.bought-btn:hover,
.redeem-btn:hover,
.delete-btn:hover,
.submit-btn:hover,
.cancel-btn:hover {
    transform: translateY(-1px);
    filter: saturate(1.05);
}

.btn-submit,
.btn-primary,
.submit-btn,
.buy-btn,
.btn-filter,
.give-btn {
    background: linear-gradient(135deg, var(--ui-brand) 0%, var(--ui-brand-dark) 100%);
    color: #fff;
}

.cancel-btn,
.delete-btn,
.give-malus-btn {
    background: linear-gradient(135deg, #d95353 0%, var(--ui-danger) 100%);
    color: #fff;
}

.toggle-done-btn,
.redeem-btn {
    background: linear-gradient(135deg, #1786bc 0%, #0d648d 100%);
    color: #fff;
}

/* Tables */
table {
    border-radius: 14px;
    overflow: hidden;
}

th {
    color: #243b4c;
}

/* Alerts */
.message {
    border-radius: 12px;
    border: 1px solid rgba(20, 40, 58, 0.08);
    backdrop-filter: blur(3px);
}

/* Modal */
.modal {
    backdrop-filter: blur(4px);
}

.modal-content {
    border-radius: 16px;
}

/* Section visual improvements */
.task-section-title {
    border-radius: 999px;
    border-color: #c6dcf8;
    color: #174f85;
    background: linear-gradient(130deg, #edf5ff 0%, #e9fff4 100%);
}

.category-title,
.summary-title,
.budget-title {
    color: #173247;
}

.rewards-grid,
.history-grid,
.villages-grid {
    gap: 16px;
}

.journal-card,
.reward-card,
.history-card,
.village-card {
    padding: 16px;
}

.profile-card-points {
    background: linear-gradient(135deg, #11778d 0%, #0f8286 100%);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

/* Better touch targets on mobile */
@media (max-width: 860px) {
    main {
        padding-top: 14px;
    }

    .container-fluid {
        padding: 0 12px;
    }

    .messages {
        right: 12px;
        top: 72px;
        max-width: calc(100% - 24px);
    }
}

@media (max-width: 520px) {
    h1 {
        font-size: 1.6rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    .task-section-title {
        font-size: 1rem;
    }

    .task-actions,
    .state-options,
    .profiles-wrapper {
        flex-wrap: wrap;
    }
}
