@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Nunito:wght@600;700;800;900&display=swap");

:root {
    --background: #17152b;
    --surface: rgba(39, 35, 65, 0.78);
    --surface-light: rgba(255, 255, 255, 0.07);
    --text: #f9f7ff;
    --muted: #b5b0cf;
    --purple: #a98cff;
    --pink: #ff9fc8;
    --green: #72e1b5;
    --orange: #ffc879;
    --red: #ff989d;
    --border: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    min-width: 320px;
    margin: 0;
    overflow-x: hidden;
    color: var(--text);
    font-family: "DM Sans", sans-serif;
    background:
        radial-gradient(circle at 15% 0%, rgba(169, 140, 255, 0.18), transparent 26rem),
        radial-gradient(circle at 90% 25%, rgba(255, 159, 200, 0.12), transparent 23rem),
        var(--background);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.background-decoration {
    position: fixed;
    z-index: -1;
    width: 360px;
    height: 360px;
    filter: blur(90px);
    border-radius: 50%;
    opacity: 0.18;
}

.decoration-one {
    top: 28%;
    left: -180px;
    background: #a98cff;
}

.decoration-two {
    right: -160px;
    bottom: 4%;
    background: #ff9fc8;
}

.app-shell {
    width: min(1420px, calc(100% - 40px));
    margin: auto;
    padding: 52px 0 32px;
}

.hero,
.dashboard,
.controls,
.section-heading,
footer {
    display: flex;
    align-items: center;
}

.hero {
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 34px;
}

.eyebrow,
.card-label {
    margin: 0 0 7px;
    color: var(--purple);
    font-size: 0.71rem;
    font-weight: 800;
    letter-spacing: 0.13em;
}

h1,
h2,
p {
    margin-top: 0;
}

h1,
h2 {
    font-family: "Nunito", sans-serif;
}

h1 {
    margin-bottom: 5px;
    font-size: clamp(2.5rem, 6vw, 4.15rem);
    font-weight: 900;
    letter-spacing: -0.07em;
    line-height: 1;
}

h1 span:not(.brain) {
    color: var(--pink);
}

.brain {
    display: inline-block;
    font-size: 0.63em;
    transform: rotate(-8deg);
}

.subtitle,
.progress-message {
    margin-bottom: 0;
    color: var(--muted);
}

.hero-badge,
.progress-card,
.stat-card,
.controls,
.items-section {
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(18px);
}

.hero-badge {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 174px;
    padding: 14px 17px;
    border-radius: 20px;
}

.hero-badge > span {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 14px;
    background: rgba(255, 159, 200, 0.16);
    font-size: 1.25rem;
}

.hero-badge strong,
.hero-badge small,
.stat-card strong,
.stat-card small {
    display: block;
}

.hero-badge strong {
    font-family: "Nunito", sans-serif;
    font-size: 1.1rem;
}

.hero-badge small,
.stat-card small {
    color: var(--muted);
    font-size: 0.77rem;
}

.dashboard {
    display: grid;
    grid-template-columns: minmax(310px, 2fr) repeat(3, minmax(130px, 0.7fr));
    gap: 14px;
    margin-bottom: 22px;
}

.progress-card {
    padding: 22px;
    border-radius: 25px;
}

.progress-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.progress-heading h2 {
    margin: 0;
    font-size: 2.8rem;
    letter-spacing: -0.07em;
}

.progress-orb {
    display: grid;
    width: 68px;
    height: 68px;
    place-items: center;
    position: relative;
    overflow: hidden;
    border-radius: 50%;
    color: #f5f1ff;
    background: conic-gradient(
        var(--purple) 0%,
        var(--pink) 0%,
        rgba(255, 255, 255, 0.10) 0% 100%
    );
    box-shadow: 0 0 22px rgba(169, 140, 255, 0.25);
    transition: background 0.45s ease;
}

.progress-orb::before {
    position: absolute;
    inset: 7px;
    z-index: 0;
    border-radius: 50%;
    background: #292442;
    content: "";
}

.progress-orb span {
    z-index: 1;
    font-size: 0.77rem;
    font-weight: 900;
}

.progress-track {
    height: 10px;
    margin: 20px 0 12px;
    overflow: hidden;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.1);
}

.progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--purple), var(--pink));
    transition: width 0.45s ease;
}

.stat-card {
    display: flex;
    gap: 11px;
    align-items: center;
    padding: 17px;
    border-radius: 23px;
}

.stat-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 15px;
    background: var(--surface-light);
    font-size: 1.2rem;
}

.stat-card strong {
    font-family: "Nunito", sans-serif;
    font-size: 1.42rem;
    line-height: 1.1;
}

.controls {
    justify-content: space-between;
    gap: 16px;
    padding: 13px;
    margin-bottom: 22px;
    border-radius: 20px;
}

.search-box {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 245px;
    padding: 0 8px;
    color: var(--muted);
}

.search-box span {
    font-size: 1.8rem;
    line-height: 0;
    transform: rotate(-20deg);
}

.search-box input {
    width: 100%;
    padding: 10px 0;
    outline: none;
    border: 0;
    color: var(--text);
    background: transparent;
}

.search-box input::placeholder {
    color: #9690ae;
}

.filters {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.filter {
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--muted);
    background: transparent;
    font-size: 0.8rem;
    font-weight: 700;
    transition: 0.2s ease;
}

.filter:hover {
    color: var(--text);
    background: var(--surface-light);
}

.filter.active {
    border-color: rgba(169, 140, 255, 0.4);
    color: #f2eeff;
    background: rgba(169, 140, 255, 0.22);
}

.filter span {
    margin-left: 3px;
    color: var(--purple);
}

.items-section {
    min-height: 450px;
    padding: 23px;
    border-radius: 27px;
}

.section-heading {
    justify-content: space-between;
    margin-bottom: 22px;
}

.section-heading h2 {
    margin: 0;
    font-size: 1.48rem;
    letter-spacing: -0.04em;
}

.section-heading > p {
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
    gap: 11px;
}

.item-card {
    position: relative;
    min-height: 125px;
    padding: 17px 13px 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 19px;
    background: rgba(255, 255, 255, 0.045);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.item-card:hover {
    z-index: 2;
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.24);
}

.done-button {
    position: absolute;
    top: 11px;
    right: 11px;
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border: 2px solid rgba(255, 255, 255, 0.24);
    border-radius: 10px;
    color: transparent;
    background: transparent;
    transition: 0.2s ease;
}

.done-button:hover {
    border-color: var(--green);
}

.checkmark {
    font-size: 1.05rem;
    font-weight: 900;
}

.item-number {
    margin: 5px 0 17px;
    font-family: "Nunito", sans-serif;
    font-size: 1rem;
    font-weight: 900;
}

.rating-row {
    display: flex;
    gap: 3px;
    margin-bottom: 10px;
}

.rating-button {
    display: grid;
    width: 20px;
    height: 20px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 7px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.63rem;
    font-weight: 800;
    transition: 0.17s ease;
}

.rating-button:hover,
.rating-button.selected {
    border-color: transparent;
    color: #2c2130;
    background: var(--pink);
    transform: scale(1.1);
}

.item-status {
    margin: 0;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
}

.state-done {
    border-color: rgba(192, 164, 255, 0.92);
    background: linear-gradient(
        145deg,
        rgba(159, 112, 255, 0.72),
        rgba(218, 117, 235, 0.46)
    );
    box-shadow:
        0 0 0 1px rgba(220, 184, 255, 0.10),
        0 10px 25px rgba(142, 83, 255, 0.27);
}

.state-done .item-number,
.state-done .item-status {
    color: #ffffff;
}

.state-review {
    border-color: rgba(255, 200, 121, 0.62);
    background: linear-gradient(145deg, rgba(255, 180, 96, 0.22), rgba(255, 255, 255, 0.04));
}

.state-good {
    border-color: rgba(114, 225, 181, 0.55);
    background: linear-gradient(145deg, rgba(114, 225, 181, 0.2), rgba(255, 255, 255, 0.04));
}

.state-mastered {
    border-color: rgba(114, 225, 181, 0.85);
    background: linear-gradient(145deg, rgba(72, 213, 163, 0.32), rgba(169, 140, 255, 0.15));
}

.state-done .done-button,
.state-review .done-button,
.state-good .done-button,
.state-mastered .done-button {
    border-color: transparent;
    color: #192529;
    background: #9effd1;
    box-shadow: 0 0 16px rgba(114, 225, 181, 0.55);
}

.state-review .done-button {
    background: var(--orange);
}

.hidden {
    display: none !important;
}

.empty-state {
    margin: 80px auto;
    color: var(--muted);
    text-align: center;
}
.todo-button {
    position: absolute;
    top: 11px;
    right: 45px;
    display: grid;
    width: 27px;
    height: 27px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 10px;
    color: #d1c9e7;
    background: rgba(255, 255, 255, 0.06);
    font-size: 1.15rem;
    line-height: 1;
    transition: 0.2s ease;
}

.todo-button:hover {
    border-color: var(--pink);
    color: #ffffff;
    background: rgba(255, 159, 200, 0.22);
    transform: scale(1.08);
}

.todo-button.active {
    border-color: transparent;
    color: #43233e;
    background: var(--pink);
    box-shadow: 0 0 17px rgba(255, 159, 200, 0.55);
}
.state-todo-priority {
    border-color: rgba(255, 159, 200, 0.9);
    background: linear-gradient(
        145deg,
        rgba(255, 107, 173, 0.58),
        rgba(198, 104, 255, 0.38)
    );
    box-shadow:
        0 0 0 1px rgba(255, 180, 220, 0.12),
        0 10px 25px rgba(255, 89, 166, 0.26);
}

.state-todo-priority .item-number,
.state-todo-priority .item-status {
    color: #ffffff;
}
footer {
    justify-content: space-between;
    gap: 20px;
    padding: 25px 5px 0;
    color: #9993b0;
    font-size: 0.75rem;
}

footer span {
    color: var(--pink);
    font-family: "Nunito", sans-serif;
    font-weight: 900;
}

#reset-button {
    padding: 0;
    border: 0;
    color: #aaa4bd;
    background: transparent;
    font-size: 0.72rem;
    text-decoration: underline;
}

#reset-button:hover {
    color: var(--red);
}

button:disabled {
    cursor: wait;
    opacity: 0.5;
}

@media (max-width: 900px) {
    .dashboard {
        grid-template-columns: repeat(3, 1fr);
    }

    .progress-card {
        grid-column: span 3;
    }

    .controls {
        align-items: stretch;
        flex-direction: column;
    }

    .filters {
        justify-content: flex-start;
    }
}

@media (max-width: 580px) {
    .app-shell {
        width: min(100% - 24px, 1420px);
        padding-top: 30px;
    }

    .hero {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 24px;
    }

    .hero-badge {
        width: 100%;
    }

    .dashboard {
        grid-template-columns: 1fr 1fr;
    }

    .progress-card {
        grid-column: span 2;
    }

    .stat-card:last-child {
        grid-column: span 2;
    }

    .items-section {
        padding: 17px 12px;
    }

    .items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .item-card {
        min-height: 118px;
    }

    footer {
        align-items: flex-start;
        flex-direction: column;
    }
}
