/* ============================================================
   Summer '26 — hand-drawn bucket list
   Palette: paper #FDFBF2 · ink #221F1A · watermelon #E8504F
            rind #3FA34D · ocean #4A90D9 · sun #F2B441
   Type:    Chewy (bubble display) · Patrick Hand (handwriting)
            Caveat (margin notes)
   Signature: wobbly hand-drawn circles that get scribbled in
   ============================================================ */

:root {
    --paper: #fdfbf2;
    --ink: #221f1a;
    --ink-soft: #5a564e;
    --melon: #e8504f;
    --rind: #3fa34d;
    --ocean: #4a90d9;
    --sun: #f2b441;
    --rule: rgba(74, 144, 217, .16);
    --wobble: 255px 18px 225px 18px / 18px 225px 18px 255px;
    --wobble-sm: 160px 12px 150px 12px / 12px 150px 12px 160px;
    --shadow: 4px 5px 0 rgba(34, 31, 26, .14);
    font-size: 17px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Patrick Hand', 'Comic Sans MS', cursive;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 8%, rgba(242, 180, 65, .25), transparent 28%),
        radial-gradient(circle at 88% 92%, rgba(74, 144, 217, .22), transparent 30%),
        #f2e8d8;
    min-height: 100vh;
    padding: 18px 10px 60px;
    -webkit-font-smoothing: antialiased;
}

/* The sheet of paper everything sits on */
.paper {
    position: relative;
    max-width: 880px;
    margin: 0 auto;
    background:
        repeating-linear-gradient(transparent 0 31px, var(--rule) 31px 32px),
        var(--paper);
    border: 2.5px solid var(--ink);
    border-radius: 14px 16px 15px 17px / 17px 14px 16px 15px;
    box-shadow: var(--shadow);
    padding: 26px 26px 40px;
    transform: rotate(-.35deg);
}

.login-paper {
    max-width: 430px;
    margin-top: 8vh;
    text-align: center;
    transform: rotate(.5deg);
}

/* ---------- Bubble title, like the sheet ---------- */
.bubble-title {
    font-family: 'Chewy', cursive;
    font-size: clamp(2.6rem, 9vw, 4.4rem);
    line-height: 1;
    margin: 0 0 2px;
    letter-spacing: 2px;
    color: var(--paper);
    user-select: none;
}
.lt {
    display: inline-block;
    -webkit-text-stroke: 2.5px var(--ink);
    text-stroke: 2.5px var(--ink);
    text-shadow: 3px 3px 0 rgba(34, 31, 26, .12);
    transform: rotate(-2deg);
}
.lt:nth-child(even) { transform: rotate(2.4deg) translateY(2px); }
.lt-wave {
    background: linear-gradient(160deg, #8ec9f5 18%, var(--ocean) 52%, #2c6cb0 88%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.lt-melon {
    background:
        radial-gradient(circle at 32% 30%, var(--ink) 0 2.5px, transparent 3px),
        radial-gradient(circle at 62% 55%, var(--ink) 0 2.5px, transparent 3px),
        radial-gradient(circle at 40% 72%, var(--ink) 0 2.5px, transparent 3px),
        linear-gradient(175deg, #f06a64 0 68%, #fff 69% 73%, var(--rind) 74%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.lt-year { font-size: .82em; color: var(--paper); }

.tagline {
    font-family: 'Caveat', cursive;
    font-size: 1.35rem;
    color: var(--ink-soft);
    margin: 0 0 22px;
}

/* ---------- Header ---------- */
.sheet-header {
    border-bottom: 2.5px solid var(--ink);
    padding-bottom: 14px;
    margin-bottom: 10px;
}
.header-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 10px 0 6px;
}
.progress-wrap { position: relative; width: 78px; height: 78px; flex: none; }
.progress-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.pr-track { fill: none; stroke: rgba(34, 31, 26, .12); stroke-width: 7; }
.pr-bar {
    fill: none;
    stroke: var(--rind);
    stroke-width: 7;
    stroke-linecap: round;
    stroke-dasharray: 207.3;
    transition: stroke-dashoffset .7s cubic-bezier(.6, 0, .2, 1.4);
}
.progress-num {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .92rem;
    white-space: nowrap;
    letter-spacing: .5px;
}
.progress-num b { color: var(--rind); font-size: 1.15rem; margin-right: 1px; }
.header-lines p { margin: 2px 0; font-size: 1.15rem; }
.countdown b { color: var(--melon); font-size: 1.3rem; }
.who { font-family: 'Caveat', cursive; font-size: 1.35rem !important; }

.header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
    font-family: 'Patrick Hand', cursive;
    font-size: 1.1rem;
    color: var(--paper);
    background: var(--ink);
    border: 2.5px solid var(--ink);
    border-radius: var(--wobble-sm);
    padding: 7px 18px;
    cursor: pointer;
    box-shadow: 3px 3px 0 rgba(34, 31, 26, .2);
    transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translate(-1px, -2px) rotate(-.6deg); box-shadow: 5px 5px 0 rgba(34, 31, 26, .22); }
.btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgba(34, 31, 26, .2); }
.btn-melon { background: var(--melon); }
.btn-ocean { background: var(--ocean); }
.btn-sun   { background: var(--sun); color: var(--ink); }
.btn-danger { background: #fff; color: var(--melon); }
.link-btn {
    background: none;
    border: none;
    font-family: 'Caveat', cursive;
    font-size: 1.15rem;
    color: var(--ink-soft);
    text-decoration: underline wavy var(--ocean) 1.5px;
    cursor: pointer;
}
.mini-btn {
    font-family: 'Caveat', cursive;
    font-size: 1.05rem;
    background: none;
    border: 2px dashed var(--ink-soft);
    border-radius: var(--wobble-sm);
    color: var(--ink-soft);
    padding: 3px 14px;
    cursor: pointer;
    margin: 4px 0 4px 46px;
}
.mini-btn:hover { color: var(--melon); border-color: var(--melon); transform: rotate(-1deg); }

/* ---------- Inputs ---------- */
.hand-label {
    display: block;
    text-align: left;
    font-family: 'Caveat', cursive;
    font-size: 1.25rem;
    margin: 12px 0 2px;
    color: var(--ink-soft);
}
.hand-input {
    width: 100%;
    font-family: 'Patrick Hand', cursive;
    font-size: 1.15rem;
    color: var(--ink);
    background: #fff;
    border: 2.5px solid var(--ink);
    border-radius: var(--wobble-sm);
    padding: 9px 14px;
    outline: none;
}
.hand-input:focus { border-color: var(--ocean); box-shadow: 3px 3px 0 rgba(74, 144, 217, .3); }
.code-input { text-align: center; font-size: 1.9rem; letter-spacing: 10px; }
.login-step .btn { margin-top: 16px; width: 100%; }
.hand-note { font-size: 1.1rem; }
.form-error {
    min-height: 1.3em;
    color: var(--melon);
    font-family: 'Caveat', cursive;
    font-size: 1.2rem;
    margin: 12px 0 0;
}

/* ---------- The list ---------- */
.list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    columns: 2;
    column-gap: 38px;
    column-rule: 2px solid var(--ink);
}
.item {
    break-inside: avoid;
    padding: 3px 0;
    line-height: 32px; /* sit on the ruled lines */
}
.item-row {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 32px;
}
.item-title { flex: 1; font-size: 1.16rem; transition: color .25s; }
.item-icon { font-size: 1.05rem; flex: none; }

/* Signature: wobbly hand-drawn circle, scribbled in when done */
.circle {
    flex: none;
    width: 27px;
    height: 27px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
}
span.circle { cursor: default; }
.circle svg { width: 100%; height: 100%; overflow: visible; }
.circle .ring {
    fill: none;
    stroke: var(--ink);
    stroke-width: 2.6;
    stroke-linecap: round;
}
.circle .scribble {
    fill: none;
    stroke: var(--melon);
    stroke-width: 3.4;
    stroke-linecap: round;
    stroke-dasharray: 90;
    stroke-dashoffset: 90;
    transition: stroke-dashoffset .45s ease-out;
}
button.circle:hover .ring { stroke: var(--ocean); }
.item.done .circle .scribble { stroke-dashoffset: 0; }
.item.done > .item-row .item-title,
.item.done > .item-row .item-title {
    color: var(--ink-soft);
    text-decoration: line-through 2px var(--melon);
    background: linear-gradient(transparent 55%, rgba(242, 180, 65, .45) 55% 92%, transparent 92%);
}
.item.pop .circle svg { animation: pop .45s; }
@keyframes pop {
    40% { transform: scale(1.45) rotate(-8deg); }
    100% { transform: scale(1); }
}

.item-edit, .memory-flag {
    flex: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: .95rem;
    opacity: 0;
    transition: opacity .15s, transform .15s;
}
.memory-flag { opacity: .85; }
.item-row:hover .item-edit { opacity: .7; }
.item-edit:hover, .memory-flag:hover { opacity: 1; transform: rotate(-8deg) scale(1.15); }

/* Counter (books) */
.counter-badge {
    font-family: 'Caveat', cursive;
    font-size: 1.15rem;
    color: var(--ink-soft);
    flex: none;
}
.counter-badge b, .group-count { color: var(--rind); font-size: 1.25rem; }
.counter-bar {
    height: 11px;
    margin: 2px 0 2px 36px;
    border: 2px solid var(--ink);
    border-radius: var(--wobble-sm);
    background: #fff;
    overflow: hidden;
}
.counter-fill {
    height: 100%;
    background: repeating-linear-gradient(-45deg, var(--rind) 0 8px, #57bd64 8px 16px);
    transition: width .5s cubic-bezier(.6, 0, .2, 1.3);
}

/* Movie group */
.group-row { cursor: pointer; }
.group-arrow { transition: transform .2s; font-size: .9rem; color: var(--ink-soft); }
.item.open .group-arrow { transform: rotate(180deg); }
.children {
    list-style: none;
    margin: 2px 0 4px 14px;
    padding: 2px 0 2px 14px;
    border-left: 2.5px solid var(--ink);
}
.children .item-title { font-size: 1.05rem; }
.children .circle { width: 22px; height: 22px; }
.add-child { padding-left: 0; }
.add-child .mini-btn { margin-left: 0; }

/* ---------- Modals ---------- */
.modal {
    border: none;
    background: transparent;
    padding: 12px;
    max-width: 440px;
    width: calc(100% - 24px);
}
.modal::backdrop { background: rgba(34, 31, 26, .45); }
.modal-inner {
    background:
        repeating-linear-gradient(transparent 0 31px, var(--rule) 31px 32px),
        var(--paper);
    border: 2.5px solid var(--ink);
    border-radius: var(--wobble);
    box-shadow: var(--shadow);
    padding: 22px 22px 18px;
    transform: rotate(.4deg);
}
.modal-title {
    font-family: 'Chewy', cursive;
    font-size: 1.7rem;
    margin: 0 0 4px;
    color: var(--melon);
    letter-spacing: 1px;
}
.modal-sub {
    margin: 0 0 12px;
    font-family: 'Caveat', cursive;
    font-size: 1.25rem;
    color: var(--ink-soft);
}
.modal-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 16px;
    flex-wrap: wrap;
}
textarea.hand-input { resize: vertical; margin-top: 8px; }

.photo-drop {
    display: grid;
    place-items: center;
    min-height: 110px;
    border: 2.5px dashed var(--ocean);
    border-radius: var(--wobble-sm);
    background: rgba(74, 144, 217, .07);
    cursor: pointer;
    overflow: hidden;
    font-family: 'Caveat', cursive;
    font-size: 1.2rem;
    color: var(--ocean);
}
.photo-drop img { width: 100%; max-height: 240px; object-fit: cover; }

.memory-photo {
    width: 100%;
    border: 2.5px solid var(--ink);
    border-radius: 10px 12px 11px 13px;
    box-shadow: var(--shadow);
    margin-bottom: 8px;
}
.view-note { font-family: 'Caveat', cursive; font-size: 1.35rem; margin: 4px 0; }

.emoji-row { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-opt {
    font-size: 1.3rem;
    background: #fff;
    border: 2px solid transparent;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    cursor: pointer;
}
.emoji-opt:hover { transform: scale(1.15) rotate(-6deg); }
.emoji-opt.picked { border-color: var(--melon); background: rgba(232, 80, 79, .12); }

.entry-list { list-style: none; padding: 0; margin: 0 0 10px; max-height: 220px; overflow-y: auto; }
.entry-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    padding: 3px 0;
    border-bottom: 1.5px dashed rgba(34, 31, 26, .2);
}
.entry-del { background: none; border: none; cursor: pointer; color: var(--melon); font-size: 1rem; }
.entry-form { display: flex; gap: 8px; }
.entry-form .hand-input { flex: 1; }

/* ---------- Confetti + toast ---------- */
#confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
}
.toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%) rotate(-1deg);
    background: var(--ink);
    color: var(--paper);
    font-size: 1.1rem;
    padding: 9px 22px;
    border-radius: var(--wobble-sm);
    box-shadow: var(--shadow);
    z-index: 1000;
    animation: toast-in .25s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(14px); } }

.share-footer {
    margin-top: 26px;
    text-align: center;
    font-family: 'Caveat', cursive;
    font-size: 1.3rem;
    color: var(--ink-soft);
}
.share-footer a { color: var(--melon); }

/* ---------- Responsive + a11y ---------- */
@media (max-width: 640px) {
    .list { columns: 1; }
    .paper { padding: 18px 14px 30px; }
    .header-actions .btn { flex: 1; }
}
:focus-visible { outline: 3px solid var(--ocean); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
