* {
    box-sizing: border-box;
}

:root {
    --bg: #0f0f0f;
    --panel: #1a1a1a;
    --panel-hover: #222222;
    --text: #fff7bf;
    --muted: #b8b39a;
    --coral: #7fd3bd;
    --coral-dark: #58bda2;
    --mint: #ff7b7b;
    --mint-dark: #d95f5f;
    --gold: #f3c969;
    --gold-dark: #d2a746;
    --violet: #8466df;
    --violet-dark: #6650be;
    --border: #2d2d2d;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

main {
    width: min(100%, 620px);
    margin: 0 auto;
    padding: 24px 16px 40px;
}

h1 {
    margin: 4px 0 24px;
    text-align: center;
    color: var(--coral);
    font-size: clamp(2rem, 9vw, 3rem);
    line-height: 1;
}

.add-form {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.add-form input {
    min-width: 0;
    flex: 1;
    height: 52px;
    padding: 0 16px;
    border: 2px solid var(--border);
    border-radius: 14px;
    outline: none;
    background: var(--panel);
    color: var(--text);
    font: inherit;
    font-size: 1.05rem;
}

.add-form input::placeholder {
    color: var(--muted);
}

.add-form input:focus {
    border-color: #e98f8f;
    box-shadow: 0 0 0 3px rgba(233, 143, 143, 0.15);
}

.add-form button {
    height: 52px;
    padding: 0 20px;
    border: 0;
    border-radius: 14px;
    background: var(--gold);
    color: #111111;
    font: inherit;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    touch-action: manipulation;
}

.add-form button:active {
    background: var(--gold-dark);
    transform: scale(0.98);
}

.item-form {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 60px;
    margin-bottom: 10px;
    padding: 8px 8px 8px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
}

.item-form span {
    min-width: 0;
    flex: 1;
    overflow-wrap: anywhere;
    font-size: 1.1rem;
    line-height: 1.3;
}

.item-form button {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border: 0;
    border-radius: 12px;
    background: var(--mint);
    color: #0b0b0b;
    font-size: 1.5rem;
    font-weight: 900;
    cursor: pointer;
    touch-action: manipulation;
}

.item-form button:active {
    background: var(--mint-dark);
    transform: scale(0.96);
}

.empty-message {
    margin: 42px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 1rem;
}

.completed-section {
    margin-top: 34px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.completed-toggle {
    width: 100%;
    min-height: 50px;
    border: 0;
    border-radius: 14px;
    background: var(--violet);
    color: #111111;
    font: inherit;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    touch-action: manipulation;
}

.completed-toggle:active {
    background: var(--violet-dark);
    transform: scale(0.99);
}

.completed-list {
    margin-top: 12px;
}

.completed-item {
    margin-bottom: 8px;
    padding: 13px 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #151515;
    color: var(--muted);
    text-decoration: line-through;
    overflow-wrap: anywhere;
}

.completed-empty {
    margin-top: 18px;
}

@media (hover: hover) {
    .add-form button:hover {
        background: #ffd982;
    }

    .item-form:hover {
        background: var(--panel-hover);
    }

    .item-form button:hover {
        background: #ff9090;
    }

    .completed-toggle:hover {
        background: #9578e8;
    }
}

@media (max-width: 420px) {
    main {
        padding: 18px 12px 32px;
    }

    .add-form {
        gap: 8px;
    }

    .add-form button {
        padding: 0 16px;
    }

    .item-form {
        min-height: 58px;
    }
}
