:root {
    --ink: #18332d;
    --green: #123d31;
    --gold: #e7c66c;
    --cream: #fbfaf5;
    --red: #b73b43;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: Arial, sans-serif;
    background: linear-gradient(145deg, #16382f 0%, #0d2923 100%);
    overflow-x: hidden;
}

.snowflakes {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .6;
    background-image:
        radial-gradient(circle, rgba(255,255,255,.9) 0 1px, transparent 1.5px),
        radial-gradient(circle, rgba(255,255,255,.65) 0 1px, transparent 1.5px);
    background-size: 64px 64px, 91px 91px;
}

.celebration {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(380px, 1.15fr) minmax(320px, 430px);
    align-items: center;
    gap: 22px;
    max-width: 1020px;
    margin: 0 auto;
    padding: 24px;
    position: relative;
}

.tree-panel {
    min-height: 590px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tree-title {
    text-align: center;
    color: #fff;
    z-index: 3;
}
.tree-title p {
    margin: 0 0 4px;
    color: var(--gold);
    font-size: 12px;
    letter-spacing: .18em;
    text-transform: uppercase;
}
.tree-title h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(28px, 4vw, 43px);
}

.preview-button {
    width: auto;
    height: 38px;
    margin: 12px auto 0;
    padding: 0 14px;
    border: 1px solid rgba(231,198,108,.72);
    border-radius: 999px;
    background: rgba(251,250,245,.1);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 12px;
    box-shadow: none;
}
.preview-button:hover { background: rgba(251,250,245,.18); }

.tree-panel.tree-preview .ornament-card {
    animation: previewGlow 700ms ease-in-out 2;
}
@keyframes previewGlow {
    50% { transform: scale(1.08); box-shadow: 0 0 18px rgba(231,198,108,.75); }
}

.tree-wrap {
    width: min(520px, 100%);
    height: 520px;
    position: relative;
    margin-top: 4px;
}

.christmas-tree {
    position: absolute;
    left: 50%;
    bottom: 24px;
    width: 390px;
    height: 510px;
    transform: translateX(-50%);
}

.branch {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    filter: drop-shadow(0 16px 14px rgba(0,0,0,.28));
}
.branch-1 { top: 35px; border-left: 82px solid transparent; border-right: 82px solid transparent; border-bottom: 150px solid #1b5b43; }
.branch-2 { top: 125px; border-left: 128px solid transparent; border-right: 128px solid transparent; border-bottom: 180px solid #174e39; }
.branch-3 { top: 220px; border-left: 162px solid transparent; border-right: 162px solid transparent; border-bottom: 210px solid #123f30; }
.branch-4 { top: 300px; border-left: 190px solid transparent; border-right: 190px solid transparent; border-bottom: 185px solid #0e3528; }
.trunk {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 58px;
    height: 85px;
    transform: translateX(-50%);
    border-radius: 4px;
    background: #70452f;
}

.tree-star {
    position: absolute;
    z-index: 5;
    left: 50%;
    top: 2px;
    transform: translateX(-50%);
    color: var(--gold);
    font-size: 54px;
    line-height: 1;
    text-shadow: 0 0 24px rgba(231,198,108,.65);
}

.ornament {
    position: absolute;
    z-index: 8;
    transform: translate(-50%, -50%);
    width: 86px;
    text-align: center;
    animation: ornamentIn .55s ease both;
}
.ornament-line {
    display: block;
    width: 1px;
    height: 16px;
    margin: 0 auto -2px;
    background: rgba(231,198,108,.9);
}
.ornament-card {
    display: block;
    max-width: 86px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid #e6c86d;
    border-radius: 7px;
    background: #fbfaf5;
    color: #9a2f38;
    padding: 5px 7px;
    font-family: Georgia, serif;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 5px 12px rgba(0,0,0,.18);
}
.ornament:nth-child(n+22) .ornament-card {
    max-width: 68px;
    font-size: 9px;
    padding: 4px 5px;
}
.ornament.just-added .ornament-card {
    animation: glow 1.8s ease-in-out 3;
}

@keyframes ornamentIn {
    from { opacity: 0; transform: translate(-50%, -72%) scale(.7); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes glow {
    50% { box-shadow: 0 0 0 5px rgba(231,198,108,.25), 0 5px 12px rgba(0,0,0,.18); }
}

.message-panel {
    background: rgba(251,250,245,.98);
    border: 1px solid rgba(231,198,108,.72);
    border-radius: 28px;
    padding: 26px;
    box-shadow: 0 20px 55px rgba(0,0,0,.24);
    position: relative;
    z-index: 20;
}
.panel-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}
.mini-star {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--red);
    font-size: 19px;
}
.panel-heading p {
    margin: 0 0 2px;
    color: #9a7a39;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .12em;
}
.panel-heading h2 {
    margin: 0;
    color: var(--green);
    font-family: Georgia, serif;
    font-size: 27px;
}

form { position: relative; z-index: 1; }
label, .label-row {
    display: block;
    margin: 0 0 8px;
    color: var(--ink);
    font: 700 13px/1.2 Arial, sans-serif;
}

.label-row { display: flex; justify-content: space-between; margin-top: 13px; }

#char-count {
    color: #98a1b2;
    font-size: 12px;
    font-weight: 400;
}

input, textarea {
    width: 100%;
    border: 1px solid #dce1e7;
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font: 16px Arial, sans-serif;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

input { height: 52px; padding: 0 16px; }
textarea { height: 132px; resize: vertical; padding: 12px 16px; line-height: 1.5; }

input:focus, textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(217, 182, 106, .16);
}

button {
    width: 100%;
    height: 50px;
    margin-top: 14px;
    border: 0;
    border-radius: 12px;
    background: var(--red);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    font: 700 15px Arial, sans-serif;
    box-shadow: 0 8px 18px rgba(183,59,67,.18);
}
button:hover { background: #a9323a; }
.honeypot { position:absolute; left:-9999px; }

.notice {
    border-radius: 12px;
    padding: 13px 16px;
    margin: 0 0 18px;
    font: 14px/1.45 Arial, sans-serif;
}
.notice p { margin: 0 0 4px; }
.notice p:last-child { margin: 0; }
.notice.success { background: #e8f4ed; color: #1f6547; border: 1px solid #bddcca; }
.notice.error { background: #fff0ee; color: #9a3b31; border: 1px solid #f1c5bf; }
.notice.closed { background: #edf1f5; color: #4b5a70; border: 1px solid #d5dde7; }

.privacy { margin: 12px 0 0; text-align: center; color: #7c867f; font-size: 11px; }

@media (max-width: 820px) {
    .celebration {
        grid-template-columns: 1fr;
        align-content: start;
        gap: 0;
        padding: 6px;
    }
    .tree-panel { min-height: 390px; }
    .tree-wrap { height: 330px; width: 340px; max-width: 100%; }
    .christmas-tree { transform: translateX(-50%) scale(.60); transform-origin: bottom center; bottom: 2px; }
    .tree-star { top: 12px; font-size: 36px; }
    .ornament { width: 68px; transform: translate(-50%, -50%) scale(.76); }
    .ornament-card { max-width: 68px; font-size: 9px; padding: 4px 5px; }
    .ornament:nth-child(n+22) .ornament-card { max-width: 60px; font-size: 8px; }
    .message-panel { width: min(360px, calc(100vw - 16px)); min-width: 0; justify-self: center; border-radius: 16px; padding: 14px; margin-bottom: 8px; }
    .panel-heading { margin-bottom: 8px; }
    .panel-heading h2 { font-size: 21px; }
    textarea { height: 90px; }
    button { height: 44px; margin-top: 10px; }
}

@media (max-width: 420px) {
    .celebration { padding: 4px; }
    .tree-panel { min-height: 350px; }
    .tree-wrap { height: 294px; }
    .christmas-tree { transform: translateX(-50%) scale(.53); }
    .tree-star { top: 17px; font-size: 32px; }
    .tree-title h1 { font-size: 22px; }
    .preview-button { height: 34px; margin-top: 8px; }
    .message-panel { width: calc(100vw - 20px); padding: 10px; border-radius: 14px; }
    .panel-heading { gap: 8px; margin-bottom: 7px; }
    .panel-heading h2 { font-size: 19px; }
    .panel-heading p { font-size: 9px; }
    .mini-star { width: 32px; height: 32px; font-size: 15px; }
    .message-panel label, .message-panel .label-row { font-size: 11px; margin-bottom: 5px; }
    .message-panel .label-row { margin-top: 8px; }
    #char-count { font-size: 10px; }
    .message-panel input { height: 38px; padding: 0 10px; font-size: 14px; }
    .message-panel textarea { height: 64px; min-height: 64px; padding: 8px 10px; font-size: 14px; }
    .message-panel button { height: 38px; margin-top: 8px; font-size: 13px; }
    .privacy { margin-top: 7px; font-size: 10px; }
    .notice { padding: 8px 10px; margin-bottom: 8px; font-size: 12px; }
}
