:root {
    --bg-idea: #0e1a2b;
    --bg-todo: #0e1a2b;
    --accent-idea: #2e9e5b;
    --accent-todo: #d0263c;
    --text-primary: #fdf6e8;
    --text-muted: #b9c6d6;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --item-bg: rgba(255, 255, 255, 0.045);
    --item-bg-hover: rgba(255, 255, 255, 0.08);

    --night: #0a1220;
    --night-deep: #060b15;
    --holly-green: #1b7a43;
    --holly-green-bright: #2eb35e;
    --candy-red: #d0263c;
    --candy-red-bright: #ef4257;
    --gold: #f4c542;
    --ice-blue: #6ec6ff;
    --snow: #ffffff;
}

@keyframes snowfall {
    from {
        background-position: 0 0, 0 0, 0 0;
    }

    to {
        background-position: 0 1000px, -60px 1400px, 40px 1800px;
    }
}

body {
    background: linear-gradient(180deg, var(--night) 0%, var(--night-deep) 100%);
    font-family: "Inter Variable", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    color: var(--text-primary);
    padding: 2rem;
    position: relative;
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(2px 2px at 10% 10%, var(--snow) 0, transparent 60%),
        radial-gradient(2px 2px at 30% 40%, var(--snow) 0, transparent 60%),
        radial-gradient(1.5px 1.5px at 55% 15%, var(--snow) 0, transparent 60%),
        radial-gradient(2px 2px at 75% 60%, var(--snow) 0, transparent 60%),
        radial-gradient(1.5px 1.5px at 90% 25%, var(--snow) 0, transparent 60%),
        radial-gradient(1.5px 1.5px at 20% 80%, var(--snow) 0, transparent 60%),
        radial-gradient(2px 2px at 45% 90%, var(--snow) 0, transparent 60%),
        radial-gradient(1.5px 1.5px at 65% 45%, var(--snow) 0, transparent 60%),
        radial-gradient(1px 1px at 85% 85%, var(--snow) 0, transparent 60%);
    background-size: 220px 220px, 260px 260px, 300px 300px, 240px 240px,
        280px 280px, 220px 220px, 260px 260px, 300px 300px, 240px 240px;
    background-repeat: repeat;
    animation: snowfall 18s linear infinite;
    box-shadow: inset 0 -14vh 30px -20px rgba(20, 40, 70, 0.35);
}

body::after {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 14vh;
    min-height: 90px;
    pointer-events: none;
    z-index: 0;
    clip-path: polygon(0% 55%, 4% 40%, 9% 58%, 14% 30%, 19% 48%,
            25% 20%, 31% 42%, 37% 15%, 44% 38%, 50% 10%,
            56% 35%, 63% 18%, 69% 45%, 75% 22%, 81% 50%,
            87% 28%, 93% 46%, 97% 32%, 100% 50%,
            100% 100%, 0% 100%);

    background:
        radial-gradient(1.5px 1.5px at 12% 70%, #a9d8ff 0, transparent 60%),
        radial-gradient(1.5px 1.5px at 33% 60%, #ffffff 0, transparent 60%),
        radial-gradient(1.5px 1.5px at 58% 75%, #a9d8ff 0, transparent 60%),
        radial-gradient(1.5px 1.5px at 78% 65%, #ffffff 0, transparent 60%),
        radial-gradient(1.5px 1.5px at 90% 72%, #a9d8ff 0, transparent 60%),
        linear-gradient(180deg, #e8f2fb 0%, #fdfefe 30%, #ffffff 100%);
}

.container {
    z-index: 1;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 1;
        filter: drop-shadow(0 0 4px currentColor);
    }

    50% {
        opacity: 0.55;
        filter: drop-shadow(0 0 1px currentColor);
    }
}

.container {
    max-width: 720px;
    margin: 0 auto 2.75rem;
    padding: 1.75rem 1.25rem 1.25rem;
    border-radius: 12px;
    background: linear-gradient(180deg, #142440 0%, #0e1a2f 100%);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.5);
    position: relative;
}

.container::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 6%;
    right: 6%;
    height: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
}

.container::after {
    content: "\1F534 \1F7E2 \1F7E1 \1F535 \1F534 \1F7E2 \1F7E1 \1F535 \1F534 \1F7E2 \1F7E1 \1F535 \1F534 \1F7E2 \1F7E1 \1F535 \1F534 \1F7E2 \1F7E1 \1F535 \1F534 \1F7E2 \1F7E1 \1F535 \1F534 \1F7E2";
    position: absolute;
    top: -18px;
    left: 4%;
    right: 4%;
    font-size: 14px;
    letter-spacing: 10px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    animation: twinkle 1.6s ease-in-out infinite;
    text-shadow: 0 0 6px currentColor;
}

.container h1 {
    color: var(--gold);
    letter-spacing: 0.01em;
    text-shadow: 0 0 12px rgba(244, 197, 66, 0.5);
}

.container p {
    color: var(--text-primary);
    line-height: 1.6;
}

.container em strong {
    color: var(--candy-red-bright);
    text-shadow: 0 0 8px rgba(239, 66, 87, 0.4);
}

.item {
    padding: 0.7rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    background: var(--item-bg);
    border-left: 3px solid transparent;
    transition: background 0.15s ease, transform 0.15s ease;
}

.item:last-child {
    margin-bottom: 0;
}

.item:hover {
    background: var(--item-bg-hover);
    transform: translateY(-2px);
}

.bound.item {
    text-align: center;
    position: relative;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 0 0 10px 10px;
    padding-top: 1rem;
    padding-bottom: 1.1rem;
    border-top: 6px solid transparent;
    border-left: none;
    border-image: repeating-linear-gradient(-45deg,
            var(--candy-red) 0 10px,
            var(--snow) 10px 20px) 6;
}

.bound.item::before,
.bound.item::after {
    content: "\1F381";
    position: absolute;
    bottom: 8px;
    font-size: 1.1rem;
}

.bound.item::before {
    left: 12px;
}

.bound.item::after {
    right: 12px;
}

.countdown-timer {
    display: inline-flex;
    gap: 0.6rem;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 1.5rem;
    font-variant-numeric: tabular-nums;
    color: var(--ice-blue);
    letter-spacing: 0.02em;
    text-shadow: 0 0 10px rgba(110, 198, 255, 0.5);
}

.countdown-timer span {
    color: var(--ice-blue);
    font-weight: 700;
}

.countdown-timer.countdown-finished {
    color: var(--candy-red-bright);
    text-shadow: 0 0 10px rgba(239, 66, 87, 0.6);
}

.local-datetime {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.item-main {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
    flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {

    body,
    .container::after {
        animation: none;
    }
}

#target-display {
    position: relative;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

button {
    position: relative;
    z-index: 2;
    font-size: 1.1rem;
    padding: 0.7rem 1.8rem;
    border-radius: 8px;
    border: 1px solid var(--gold);
    background: rgba(244, 197, 66, 0.12);
    color: var(--gold);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

button:hover {
    background: rgba(244, 197, 66, 0.22);
}

button.shrink-fade {
    animation: shrink-fade 0.5s ease forwards;
    pointer-events: none;
}

@keyframes shrink-fade {
    to {
        opacity: 0;
        transform: scale(0.3);
    }
}

.confetti-piece {
    position: absolute;
    /* left/top set inline by JS to the button's screen center */
    width: var(--size, 8px);
    height: var(--size, 8px);
    background: var(--color, var(--gold));
    opacity: 0;
    animation: confetti-burst var(--duration, 1s) cubic-bezier(0.15, 0.6, 0.4, 1) forwards;
    animation-delay: var(--delay, 0s);
}

@keyframes confetti-burst {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(0deg);
    }

    10% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) rotate(var(--rot));
    }
}

.reveal-name {
    position: relative;
    z-index: 2;
    display: none;
}

.reveal-name.show {
    display: block;
    animation: name-pop 0.6s ease-out forwards;
    animation-delay: 0.55s;
    opacity: 0;
}

@keyframes name-pop {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.reveal-name h1 {
    margin: 0;
}

.reveal-name p {
    color: #b9c6d6;
    margin: 0 0 8px 0;
}