:root {
    --lilac: #ece1fb;
    --lilac-strong: #cda8f0;
    --green-water: #d8f8ef;
    --green-water-strong: #9ee8d3;
    --white: #ffffff;
    --ink: #372a4d;
    --ink-soft: #6b5c82;
    --danger-bg: #fde2e2;
    --danger-text: #9b2c2c;
    --radius: 18px;
    --shadow: 0 16px 36px -18px rgba(110, 72, 170, 0.3);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--white);
    color: var(--ink);
}

h1 {
    font-size: clamp(1.3rem, 4vw, 2rem);
}

.container {
    max-width: 640px;
    margin: 10vh auto;
    padding: 0 1.25rem;
    text-align: center;
}

a {
    color: var(--lilac-strong);
}

/* Marca */

.brand {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.brand-mark {
    flex-shrink: 0;
    width: clamp(96px, 28vw, 180px);
    height: auto;
    transform-origin: 75% 85%;
    filter: drop-shadow(0 10px 18px rgba(205, 168, 240, 0.4));
}

.brand:hover .brand-mark {
    animation: wiggle 0.6s ease;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-6deg); }
    75% { transform: rotate(6deg); }
}

@media (prefers-reduced-motion: reduce) {
    .brand:hover .brand-mark { animation: none; }
}

.brand-name {
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand-name-accent {
    color: var(--lilac-strong);
}


/* Tela de autenticação */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
    background: #faf8ff;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.45;
    animation: float 12s ease-in-out infinite;
}

.blob--1 {
    width: 280px;
    height: 280px;
    background: var(--lilac-strong);
    top: -70px;
    left: -90px;
}

.blob--2 {
    width: 240px;
    height: 240px;
    background: var(--green-water-strong);
    bottom: -80px;
    right: -70px;
    animation-delay: -6s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -25px) scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
    .blob { animation: none; }
}

.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 380px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #f0e9fb;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.25rem 2rem;
    animation: rise 0.5s ease-out;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-header {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-subtitle {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.95rem;
}

/* Lagartixa que anda pelo fundo e para perto da logo */

.walking-gecko-track {
    position: absolute;
    top: 38%;
    left: 0;
    transform: translateY(-50%);
    pointer-events: none;
}

.walking-gecko {
    width: 50px;
    height: auto;
    display: block;
    transform-origin: 50% 85%;
    animation:
        gecko-walk-move 2.4s cubic-bezier(.33, .9, .4, 1) 0.8s both,
        gecko-walk-wobble 2.4s ease-out 0.8s both;
}

@keyframes gecko-walk-move {
    0%   { translate: -230px 6px; }
    75%  { translate: -4px 0; }
    100% { translate: -4px 0; }
}

@keyframes gecko-walk-wobble {
    0%   { rotate: 0deg; }
    10%  { rotate: -8deg; }
    20%  { rotate: 8deg; }
    30%  { rotate: -8deg; }
    40%  { rotate: 8deg; }
    50%  { rotate: -5deg; }
    60%  { rotate: 5deg; }
    70%  { rotate: -2deg; }
    80%, 100% { rotate: 0deg; }
}

@media (prefers-reduced-motion: reduce) {
    .walking-gecko { animation: none; translate: -4px 0; rotate: 0deg; }
}

/* Campos com floating label */

.field {
    position: relative;
    margin-bottom: 1.25rem;
}

.field input,
.field select {
    width: 100%;
    padding: 1.1rem 0.9rem 0.5rem;
    border: 1.5px solid #e1d6f5;
    border-radius: 10px;
    font-size: 1rem;
    background: var(--white);
    color: var(--ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--lilac-strong);
    box-shadow: 0 0 0 3px rgba(205, 168, 240, 0.35);
}

.field label {
    position: absolute;
    left: 0.9rem;
    top: 0.85rem;
    font-size: 1rem;
    color: var(--ink-soft);
    pointer-events: none;
    transition: all 0.15s ease;
    background: transparent;
}

.field input:focus ~ label,
.field input:not(:placeholder-shown) ~ label,
.field select ~ label {
    top: 0.3rem;
    font-size: 0.72rem;
    color: var(--lilac-strong);
    font-weight: 600;
}

.field--password input {
    padding-right: 2.6rem;
}

.field--pin input {
    letter-spacing: 0.5em;
    font-size: 1.2rem;
    text-align: center;
}

.auth-footer-link {
    margin: 1.25rem 0 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.toggle-password {
    position: absolute;
    right: 0.3rem;
    top: 0.4rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.5rem;
    line-height: 1;
    border-radius: 8px;
    color: var(--ink-soft);
}

.toggle-password:hover {
    background: var(--lilac);
}

/* Switch "lembrar de mim" */

.switch {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--ink-soft);
    cursor: pointer;
    margin-bottom: 1.5rem;
    user-select: none;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-track {
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background: #e1d6f5;
    position: relative;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}

.switch input:checked + .switch-track {
    background: var(--lilac-strong);
}

.switch input:checked + .switch-track .switch-thumb {
    transform: translateX(16px);
}

.switch input:focus-visible + .switch-track {
    box-shadow: 0 0 0 3px rgba(205, 168, 240, 0.35);
}

/* Botões */

button {
    font-family: inherit;
}

.btn-secondary {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--lilac-strong);
    border-radius: 10px;
    background: transparent;
    color: var(--ink);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.btn-secondary:hover {
    background: var(--lilac);
}

/* Pequenos botões em pílula (secundários, reaparecem em várias telas) */

.btn-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--lilac-strong);
    background: transparent;
    color: var(--ink);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.btn-pill:hover {
    background: var(--lilac-strong);
    color: var(--white);
}

.btn-pill--muted {
    color: var(--ink-soft);
    font-size: 0.75rem;
    padding: 0.5rem 0.85rem;
}

.btn-pill--muted:hover {
    background: var(--lilac);
    color: var(--ink);
}

.btn-pill--danger {
    border-color: var(--danger-text);
    color: var(--danger-text);
}

.btn-pill--danger:hover {
    background: var(--danger-text);
    color: var(--white);
}

.btn-pill--filled {
    background: var(--lilac-strong);
    border-color: var(--lilac-strong);
    color: var(--white);
    font-weight: 700;
    padding: 0.6rem 1rem;
}

.btn-pill--filled:hover {
    background: var(--lilac);
    color: var(--ink);
}

/* Avatar circular (foto ou inicial), em alguns tamanhos */

.avatar {
    border-radius: 50%;
    background: var(--lilac-strong);
    color: var(--white);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    object-fit: cover;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar--sm {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
    font-weight: 700;
}

.avatar--md {
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
}

.avatar--lg {
    width: 72px;
    height: 72px;
    font-size: 1.8rem;
}

.avatar--xl {
    width: 96px;
    height: 96px;
    font-size: 2.2rem;
}

.btn-primary {
    width: 100%;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    background: var(--green-water-strong);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: var(--lilac-strong);
    box-shadow: 0 10px 22px -10px rgba(110, 72, 170, 0.45);
}

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

.btn-primary[disabled] {
    opacity: 0.75;
    cursor: wait;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(55, 42, 77, 0.3);
    border-top-color: var(--ink);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
}

.btn-primary[disabled] .spinner {
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.container > form button,
.home-logout {
    margin-top: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--ink);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
}

/* Alertas */

.alert {
    background: var(--danger-bg);
    color: var(--danger-text);
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
    text-align: left;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.alert p {
    margin: 0.2rem 0;
}

/* Responsividade */

@media (max-width: 480px) {
    .auth-card {
        padding: 1.75rem 1.25rem;
        border-radius: 14px;
    }

    .blob--1 { width: 180px; height: 180px; }
    .blob--2 { width: 160px; height: 160px; }
}

@media (max-width: 360px) {
    .auth-card {
        padding: 1.5rem 1rem;
    }

    .auth-page {
        padding: 1rem 0.75rem;
    }
}

/* Dashboard */

.dashboard-page {
    background: var(--white);
    min-height: 100vh;
}

.dashboard-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: var(--white);
    border-bottom: 1px solid #f0e9fb;
}

.dashboard-header-logo {
    flex-shrink: 0;
}

.dashboard-header-title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-badge {
    flex: 0 1 auto;
    max-width: 45%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--lilac);
    color: var(--ink);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
}

.group-badge:hover {
    background: var(--lilac-strong);
    color: var(--white);
}

.dashboard-header-logo .brand-mark {
    width: 40px;
    filter: none;
}


.dashboard {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.25rem 6rem;
    text-align: center;
}

.dashboard-date {
    text-transform: capitalize;
    color: var(--ink-soft);
    font-weight: 600;
    margin: 0 0 0.25rem;
}

.dashboard-subtitle {
    color: var(--ink-soft);
    margin: 0.25rem 0 1.5rem;
}

.dashboard-progress {
    font-weight: 700;
    color: var(--lilac-strong);
    margin-bottom: 1.5rem;
    min-height: 1.2em;
}

.task-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 640px) {
    .task-grid {
        grid-template-columns: 1fr;
    }
}

.task-card {
    border-radius: 16px;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 200px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.task-card--mystery {
    background: var(--lilac);
    border: 2px dashed var(--lilac-strong);
    color: var(--ink-soft);
    cursor: pointer;
}

.task-card--mystery:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    background: #f1e9fc;
}

.task-card--revealed {
    background: var(--white);
    border: 2px solid var(--green-water-strong);
    box-shadow: 0 10px 25px -15px rgba(55, 42, 77, 0.25);
    animation: card-reveal 0.4s ease;
}

.task-card--shuffling {
    background: var(--lilac);
    border: 2px solid var(--lilac-strong);
    color: var(--ink-soft);
    cursor: wait;
    animation: card-shuffle-pulse 0.3s ease-in-out infinite;
}

.task-card--shuffling .task-card-icon {
    display: inline-block;
    animation: card-shuffle-spin 0.3s linear infinite;
}

@keyframes card-shuffle-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes card-shuffle-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.task-card--done {
    background: var(--green-water);
}

.task-card--done .task-card-label {
    text-decoration: line-through;
    color: var(--ink-soft);
}

@keyframes card-reveal {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .task-card--revealed { animation: none; }
    .task-card--shuffling,
    .task-card--shuffling .task-card-icon { animation: none; }
}

.task-card-icon {
    font-size: 2.2rem;
}

.task-card-label {
    font-weight: 600;
}

.task-card-description {
    font-size: 0.8rem;
    color: var(--ink-soft);
    line-height: 1.3;
}

.task-card--done .task-card-description {
    text-decoration: line-through;
}

.task-card-actions {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0.6rem;
    width: 100%;
    margin-top: auto;
}

.task-card-actions .btn-pill {
    flex: 1 1 0;
}


.task-card--done .task-card-toggle {
    background: var(--green-water-strong);
    color: var(--ink);
}

.btn-reset-tasks {
    margin-top: 2rem;
    padding: 0.5rem 1rem;
    border: 1px dashed var(--ink-soft);
    border-radius: 8px;
    background: transparent;
    color: var(--ink-soft);
    font-size: 0.85rem;
    cursor: pointer;
}

.btn-reset-tasks:hover {
    border-color: var(--danger-text);
    color: var(--danger-text);
}

/* Menu inferior */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: var(--white);
    border-top: 1px solid #f0e9fb;
    padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom));
    z-index: 10;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    text-decoration: none;
    color: var(--ink-soft);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0;
}

.bottom-nav-icon {
    font-size: 1.3rem;
}

.bottom-nav-item.is-active {
    color: var(--lilac-strong);
}

/* Perfil */

.profile-card {
    background: var(--white);
    border: 1px solid #f0e9fb;
    border-radius: 16px;
    box-shadow: 0 10px 25px -15px rgba(55, 42, 77, 0.25);
    padding: 2rem 1.5rem;
    max-width: 320px;
    margin: 1.5rem auto 0;
}

.profile-email {
    color: var(--ink-soft);
    margin: -0.5rem 0 1.25rem;
    font-size: 0.9rem;
}

.avatar-upload {
    position: relative;
    display: block;
    width: 96px;
    height: 96px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    cursor: pointer;
}

.avatar-upload-fallback-icon {
    width: 60%;
    height: 60%;
    object-fit: contain;
}

.avatar-upload-badge {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--lilac-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.avatar-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.alert--success {
    background: var(--green-water);
    color: #1f6a52;
}

/* Histórico */

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
    text-align: left;
}

.history-day {
    background: var(--white);
    border: 1px solid #f0e9fb;
    border-radius: 14px;
    padding: 1rem 1.25rem;
}

.history-day-date {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    text-transform: capitalize;
}

.history-day-tasks {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.history-day-tasks li.is-done {
    color: var(--ink-soft);
    text-decoration: line-through;
}

.history-empty {
    color: var(--ink-soft);
    margin-top: 1.5rem;
    text-align: center;
}

/* Perfil + pontuação no histórico */

.history-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.history-profile-avatar {
    margin-bottom: 0.5rem;
}

.history-profile-name {
    font-weight: 700;
    margin: 0;
}

.history-points {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--lilac-strong);
    margin: 0.25rem 0 0;
}

.history-points-message {
    color: var(--ink-soft);
    font-size: 0.85rem;
    margin: 0.1rem 0 0;
}

/* Calendário */

.history-calendar {
    background: var(--white);
    border: 1px solid #f0e9fb;
    border-radius: 16px;
    box-shadow: 0 10px 25px -15px rgba(55, 42, 77, 0.25);
    padding: 1.25rem;
    margin-top: 1.75rem;
}

.history-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.calendar-label {
    font-weight: 700;
    text-transform: capitalize;
}

.calendar-nav {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: var(--lilac);
    color: var(--ink);
    font-size: 1.1rem;
    text-decoration: none;
    cursor: pointer;
}

.calendar-nav:hover {
    background: var(--lilac-strong);
    color: var(--white);
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-weekdays {
    color: var(--ink-soft);
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.4rem;
}

.calendar-grid {
    gap: 0.3rem;
}

.calendar-cell {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #faf8ff;
    font-size: 0.8rem;
    color: var(--ink);
}

.calendar-cell--empty {
    background: transparent;
}

.calendar-cell.is-today {
    border: 2px solid var(--lilac-strong);
    font-weight: 700;
}

.calendar-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    border-radius: 999px;
    background: var(--green-water-strong);
    color: var(--ink);
    font-size: 0.65rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-list-title {
    margin-top: 1.75rem;
    font-size: 1rem;
    text-align: left;
}

/* Celebração ao marcar tarefa como feita */

.celebration-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.celebration-overlay.is-active {
    opacity: 1;
}

.celebration-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.celebration-gecko {
    width: 130px;
    height: auto;
    filter: drop-shadow(0 14px 22px rgba(55, 42, 77, 0.35));
    transform: translateY(70vh) scale(0.6);
}

.celebration-overlay.is-active .celebration-gecko {
    animation: celebration-rise 0.9s cubic-bezier(.22, 1.4, .36, 1) forwards;
}

@keyframes celebration-rise {
    0% { transform: translateY(70vh) scale(0.6) rotate(-6deg); }
    60% { transform: translateY(-10px) scale(1.05) rotate(4deg); }
    80% { transform: translateY(4px) scale(0.98) rotate(-2deg); }
    100% { transform: translateY(0) scale(1) rotate(0deg); }
}

.celebration-message {
    background: var(--white);
    color: var(--ink);
    font-weight: 700;
    padding: 0.6rem 1.25rem;
    border-radius: 999px;
    box-shadow: 0 10px 25px -10px rgba(55, 42, 77, 0.35);
    text-align: center;
    max-width: 280px;
    opacity: 0;
    transform: translateY(8px);
}

.celebration-overlay.is-active .celebration-message {
    animation: celebration-message-in 0.4s ease 0.5s forwards;
}

@keyframes celebration-message-in {
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .celebration-gecko,
    .celebration-message {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Marco de 50 pontos */

.milestone-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 60;
    opacity: 0;
    overflow: hidden;
    transition: opacity 0.4s ease;
}

.milestone-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
}

.confetti-field {
    position: absolute;
    inset: 0;
}

.confetti-piece {
    position: absolute;
    top: -20px;
    border-radius: 2px;
    opacity: 0;
    animation-name: confetti-fall;
    animation-timing-function: ease-in;
    animation-fill-mode: forwards;
}

.milestone-overlay.is-active .confetti-piece {
    opacity: 1;
}

@keyframes confetti-fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(110vh) rotate(540deg); opacity: 0; }
}

.milestone-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: var(--white);
    padding: 2rem 1.75rem;
    border-radius: 20px;
    box-shadow: 0 20px 45px -15px rgba(55, 42, 77, 0.45);
    max-width: 300px;
    text-align: center;
    transform: scale(0.6) translateY(40px);
    opacity: 0;
}

.milestone-overlay.is-active .milestone-content {
    animation: milestone-pop 0.6s cubic-bezier(.22, 1.4, .36, 1) forwards;
}

@keyframes milestone-pop {
    0% { transform: scale(0.6) translateY(40px); opacity: 0; }
    60% { transform: scale(1.08) translateY(-6px); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.milestone-gecko {
    width: 150px;
    height: auto;
    filter: drop-shadow(0 14px 22px rgba(55, 42, 77, 0.35));
}

.milestone-overlay.is-active .milestone-gecko {
    animation: wiggle 0.8s ease 0.5s 2;
}

.milestone-message {
    font-weight: 800;
    font-size: 1.1rem;
    margin: 0;
    color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
    .confetti-piece {
        display: none;
    }

    .milestone-content,
    .milestone-gecko {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Grupo */

.group-section {
    text-align: left;
    max-width: 380px;
    margin: 0 auto 2rem;
}

.group-section-title {
    font-size: 1rem;
    margin: 0 0 0.75rem;
}

.group-active-tag {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ink-soft);
}

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

.group-members {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.group-member {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    border: none;
    background: transparent;
    padding: 0.6rem 0.4rem;
    border-radius: 8px;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.group-member:hover {
    background: var(--lilac);
}

.group-member-name {
    font-weight: 600;
}

.group-admin-tag {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--white);
    background: var(--lilac-strong);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.group-member-rank {
    width: 28px;
    flex-shrink: 0;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.group-member-meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.group-member-points {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--lilac-strong);
    white-space: nowrap;
}

.group-view-only {
    color: var(--ink-soft);
    font-size: 0.9rem;
}

/* Catálogo de tarefas do grupo */

.menu-list.task-list {
    margin: 0 auto 1.5rem;
    max-width: 420px;
}

.task-list {
    text-align: left;
}

.task-row > summary,
.task-row-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.9rem 1.1rem;
    border: none;
    background: transparent;
    font: inherit;
    text-align: left;
    color: var(--ink);
    cursor: pointer;
    list-style: none;
}

.task-row-add {
    color: var(--lilac-strong);
    font-weight: 700;
}

.task-row-add:hover {
    background: #faf8ff;
}

.task-row > summary::-webkit-details-marker {
    display: none;
}

.task-row > summary::before {
    content: '›';
    order: 1;
    margin-left: auto;
    flex-shrink: 0;
    color: var(--ink-soft);
    font-weight: 800;
    font-size: 1.2rem;
    transition: transform 0.15s ease;
}

.task-row[open] > summary::before {
    transform: rotate(90deg);
}

.task-row-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.task-row-title {
    font-weight: 600;
    flex: 1 1 auto;
    min-width: 0;
}

.task-row-points {
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--lilac-strong);
    white-space: nowrap;
}

.task-row-body {
    padding: 0 1.1rem 1.1rem;
    background: #faf8ff;
}

.task-row-description {
    color: var(--ink-soft);
    font-size: 0.85rem;
    margin: 0 0 0.9rem;
}

.task-row-body .group-form {
    margin-bottom: 0.9rem;
}

.task-row-summary--static {
    cursor: default;
}


.group-section-title--toggle {
    cursor: pointer;
    padding: 0.5rem 0;
    list-style: none;
}

.group-section-title--toggle::-webkit-details-marker {
    display: none;
}

.group-section-title--toggle::before {
    content: '›';
    display: inline-block;
    margin-right: 0.4rem;
    font-weight: 800;
    transition: transform 0.15s ease;
}

details[open] > .group-section-title--toggle::before {
    transform: rotate(90deg);
}

.group-collapsible {
    background: #faf8ff;
    border: 1px solid #f0e9fb;
    border-radius: 12px;
    padding: 0.25rem 1rem 1rem;
}

.group-collapsible .group-section-title {
    margin: 0;
}

.group-reward-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0e9fb;
    color: var(--ink-soft);
    font-size: 0.85rem;
    text-align: center;
}

/* Modal de estatísticas do membro */

.member-modal {
    position: fixed;
    border: none;
    border-radius: 18px;
    padding: 1.5rem;
    max-width: 360px;
    width: calc(100% - 2rem);
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    box-shadow: 0 20px 45px -15px rgba(55, 42, 77, 0.45);
}

.member-modal::backdrop {
    background: rgba(55, 42, 77, 0.45);
}

.member-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: var(--lilac);
    color: var(--ink);
    cursor: pointer;
}

.member-modal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.5rem 0 1rem;
    padding-right: 2.5rem;
}


.member-modal-name {
    font-weight: 700;
    margin: 0;
}

.member-modal-points {
    color: var(--lilac-strong);
    font-weight: 800;
    margin: 0.15rem 0 0;
}

.member-modal-reset {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #f0e9fb;
}

.member-modal-reset-message {
    font-size: 0.85rem;
    min-height: 1.2em;
    margin: 0 0 0.5rem;
}

.member-modal-reset-message.is-success {
    color: #1f6a52;
}

.member-modal-reset-message.is-error {
    color: var(--danger-text);
}

.member-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}


.task-card-points {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--lilac-strong);
}

.task-card-points--pending {
    color: var(--danger-text);
}

.history-day-task-points {
    font-size: 0.75rem;
    color: var(--lilac-strong);
    font-weight: 700;
    margin-left: 0.3rem;
}

.profile-actions {
    max-width: 320px;
    margin: 1rem auto 0;
}

/* Menu "Mais" */

.menu-section-label {
    max-width: 380px;
    margin: 1.5rem auto 0.5rem;
    padding: 0 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--ink-soft);
    text-align: left;
}

.menu-list-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.menu-list-title {
    font-weight: 700;
}

.menu-list-subtitle {
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--ink-soft);
}

.menu-list {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 380px;
    background: var(--white);
    border: 1px solid #f0e9fb;
    border-radius: 14px;
    box-shadow: 0 10px 25px -18px rgba(55, 42, 77, 0.25);
    overflow: hidden;
}

.menu-list li + li {
    border-top: 1px solid #f0e9fb;
}

.menu-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    text-align: left;
    transition: background 0.15s ease;
}

.menu-list-item:hover {
    background: #faf8ff;
}

.menu-list-item::after {
    content: '›';
    margin-left: auto;
    flex-shrink: 0;
    color: var(--ink-soft);
    font-weight: 800;
    font-size: 1.2rem;
}

button.menu-list-item {
    width: 100%;
    border: none;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.menu-list-item--static {
    cursor: default;
}

.menu-list-item--static:hover {
    background: transparent;
}

.menu-list-item--static::after {
    content: none;
}

.menu-list-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.task-row-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* .member-modal também é usada como estilo genérico de modal (foto no nome, mas serve pra qualquer dialog) */
.modal-title {
    margin: 0.5rem 2.5rem 1.25rem 0;
    font-size: 1.1rem;
}
