/* ==========================================================================
   RandoSanta – theme, layout, animations. No JavaScript anywhere: every
   animation on this site is CSS driven, state changes come from Blazor.
   ========================================================================== */

:root {
    --red: #c8102e;
    --red-dark: #9c0b22;
    --green: #1f7a3f;
    --green-dark: #155c2e;
    --gold: #f2c14e;
    --cream: #fff8ec;
    --ink: #1d1d2b;
    --ink-soft: #5b5b70;
    --night: #0b1026;
    --night-2: #1b2550;
    --card: rgba(255, 252, 246, 0.97);
    --radius: 18px;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    --shadow-soft: 0 6px 20px rgba(0, 0, 0, 0.18);
    --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Mountains of Christmas", "Nunito", cursive;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink);
    background: radial-gradient(1200px 600px at 20% -10%, #2a3a7a 0%, transparent 60%),
                radial-gradient(900px 500px at 110% 10%, #4a1030 0%, transparent 55%),
                linear-gradient(180deg, var(--night) 0%, var(--night-2) 60%, #0e1a3a 100%);
    background-attachment: fixed;
    overflow-x: hidden;
}

h1, h2, h3 { margin: 0 0 0.4em; line-height: 1.15; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.25rem; }
p { margin: 0 0 0.9em; }
a { color: var(--red); }
code { background: rgba(0, 0, 0, 0.06); padding: 0 .3em; border-radius: 4px; }

.display {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.muted { color: var(--ink-soft); }
.small { font-size: 0.875rem; }
.prewrap { white-space: pre-wrap; word-wrap: break-word; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.75rem; font-weight: 800; color: var(--gold); margin-bottom: 0.2em; }

/* --------------------------------------------------------------------------
   Shells
   -------------------------------------------------------------------------- */
.app-shell, .auth-shell {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content, .auth-main {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
    flex: 1;
}

.auth-main { display: flex; align-items: center; justify-content: center; }

.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.8rem;
    padding: 1rem;
}

/* --------------------------------------------------------------------------
   Snow (CSS only)
   -------------------------------------------------------------------------- */
.snow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.flake {
    position: absolute;
    top: -12px;
    border-radius: 50%;
    background: #fff;
    filter: blur(0.4px);
    animation-name: snowfall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

@keyframes snowfall {
    0%   { transform: translate3d(0, -12px, 0); }
    50%  { transform: translate3d(var(--drift, 20px), 50vh, 0); }
    100% { transform: translate3d(0, 105vh, 0); }
}

/* --------------------------------------------------------------------------
   Top bar + navigation
   -------------------------------------------------------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 1rem;
    background: rgba(11, 16, 38, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
}

.brand-icon { font-size: 1.6rem; animation: bob 3s ease-in-out infinite; display: inline-block; }

@keyframes bob {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50% { transform: translateY(-3px) rotate(4deg); }
}

.nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 700;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    background: transparent;
    border: 0;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.nav-link:hover { background: rgba(255, 255, 255, 0.1); color: #fff; transform: translateY(-1px); }
.nav-link.active { background: var(--red); color: #fff; }
.nav-link-accent { background: rgba(242, 193, 78, 0.18); color: var(--gold); }
.nav-link-small { font-size: 0.85rem; padding: 0.35rem 0.65rem; color: rgba(255, 255, 255, 0.65); }
.nav-ico { font-size: 1.05em; }

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35em;
    height: 1.35em;
    padding: 0 0.35em;
    border-radius: 999px;
    background: var(--gold);
    color: var(--night);
    font-size: 0.72rem;
    font-weight: 800;
    animation: pop 0.5s cubic-bezier(.2, 1.4, .4, 1);
}

@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
}

@media (max-width: 1200px) and (min-width: 961px) {
    .nav-who { display: none; }
    .nav-link { padding: 0.4rem 0.6rem; }
}

.nav-who {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-form { margin: 0; display: inline; }

.nav-burger {
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    position: relative;
}

.nav-burger span {
    position: absolute;
    left: 12px;
    right: 12px;
    height: 2.5px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s, top 0.25s;
}

.nav-burger span:nth-child(1) { top: 14px; }
.nav-burger span:nth-child(2) { top: 21px; }
.nav-burger span:nth-child(3) { top: 28px; }
.nav-burger.is-open span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.nav-burger.is-open span:nth-child(2) { opacity: 0; }
.nav-burger.is-open span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

@media (max-width: 960px) {
    .nav-burger { display: block; }

    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
        padding: 0.6rem 0.8rem 0.9rem;
        background: #0d1330;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: var(--shadow);
        transform: translateY(-8px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.22s ease, opacity 0.22s ease, visibility 0s linear 0.22s;
    }

    .nav.is-open { transform: none; opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
    .nav-link { padding: 0.7rem 0.9rem; border-radius: 12px; font-size: 1.05rem; }
    .nav-user {
        flex-direction: column;
        align-items: stretch;
        margin: 0.5rem 0 0;
        padding: 0.6rem 0 0;
        border-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
    }
    .nav-who { max-width: none; padding: 0.2rem 0.9rem 0.4rem; }
    .logout-form { display: block; }
    .logout-form .nav-link { width: 100%; justify-content: flex-start; }
}

/* --------------------------------------------------------------------------
   Cards, buttons, forms
   -------------------------------------------------------------------------- */
.card {
    position: relative;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.4rem 1.4rem 1.3rem;
    margin-bottom: 1.25rem;
    transition: transform 0.25s, box-shadow 0.25s;
}

.card-accent {
    background: linear-gradient(140deg, #fff7df, #ffe9ec);
    border: 2px solid rgba(242, 193, 78, 0.6);
}

.card-danger { border: 2px solid rgba(200, 16, 46, 0.35); }
.card-narrow { max-width: 520px; }

.card-icon { font-size: 2rem; line-height: 1; margin-bottom: 0.5rem; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.grid .card { margin-bottom: 0; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem 1.3rem;
    border-radius: 999px;
    border: 2px solid transparent;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
    line-height: 1.2;
}

.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost { background: transparent; color: var(--ink); border-color: rgba(29, 29, 43, 0.25); }
.btn-ghost:hover { background: rgba(29, 29, 43, 0.06); }
.btn-danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { padding: 0.85rem 1.6rem; font-size: 1.05rem; }
.btn-xl { padding: 1.1rem 2.2rem; font-size: 1.3rem; }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.85rem; }

.pulse { animation: pulse 2s ease-in-out infinite; }

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(200, 16, 46, 0.45); }
    50% { box-shadow: 0 0 0 14px rgba(200, 16, 46, 0); }
}

.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.75rem; }
.actions-center { justify-content: center; }

.field { display: block; margin-bottom: 0.9rem; }
.field > span { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 0.3rem; }
.field-row { display: flex; gap: 0.8rem; }
.field-row .field { flex: 1; }
.field-small { flex: 0 0 110px !important; }
.field-check { display: flex; align-items: center; gap: 0.6rem; }
.field-check > span { margin: 0; font-weight: 600; }
.field-check input { width: 1.2rem; height: 1.2rem; }

.input {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 2px solid rgba(29, 29, 43, 0.15);
    border-radius: 12px;
    background: #fff;
    font: inherit;
    color: var(--ink);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.12); }
textarea.input { resize: vertical; min-height: 3rem; }
select.input { appearance: auto; }

.validation-message { color: var(--red); font-size: 0.85rem; margin-top: 0.25rem; }

.alert { padding: 0.75rem 0.95rem; border-radius: 12px; margin-bottom: 0.9rem; font-weight: 600; }
.alert-error { background: #ffe4e8; color: var(--red-dark); border: 1px solid rgba(200, 16, 46, 0.3); }
.alert-ok { background: #e3f6e9; color: var(--green-dark); border: 1px solid rgba(31, 122, 63, 0.3); animation: fade-in 0.4s; }

.loading {
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    padding: 3rem 1rem;
    font-size: 1.1rem;
    animation: fade-in 0.6s;
}

/* --------------------------------------------------------------------------
   Page enter animation
   -------------------------------------------------------------------------- */
.page-enter > * { animation: rise 0.5s cubic-bezier(.2, .8, .2, 1) both; }
.page-enter > *:nth-child(2) { animation-delay: 0.06s; }
.page-enter > .confetti { animation: none; }
.page-enter > *:nth-child(3) { animation-delay: 0.12s; }
.grid > .card { animation: rise 0.55s cubic-bezier(.2, .8, .2, 1) both; }
.grid > .card:nth-child(2) { animation-delay: 0.08s; }
.grid > .card:nth-child(3) { animation-delay: 0.16s; }
.grid > .card:nth-child(4) { animation-delay: 0.24s; }

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */
.login-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 2rem;
    align-items: center;
    width: 100%;
    max-width: 960px;
}

.login-hero { text-align: center; color: #fff; }
.login-hero .display { font-size: 3.4rem; margin: 0.4rem 0 0; text-shadow: 0 4px 24px rgba(0, 0, 0, 0.4); }
.login-hero .tagline { color: var(--gold); font-weight: 800; font-size: 1.15rem; margin-bottom: 0.3rem; }
.login-hero .muted { color: rgba(255, 255, 255, 0.7); }

.santa-hero {
    width: min(62%, 300px);
    height: auto;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.45));
    animation: float 4s ease-in-out infinite;
    overflow: visible;
}

.santa-arm { transform-origin: 252px 262px; animation: wave 1.6s ease-in-out infinite; }

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-14deg); }
}

.santa-eyes { transform-origin: 170px 146px; animation: blink 4.5s ease-in-out infinite; }

@keyframes blink {
    0%, 92%, 100% { transform: scaleY(1); }
    96% { transform: scaleY(0.1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(-1.5deg); }
    50% { transform: translateY(-12px) rotate(1.5deg); }
}

.login-card { padding: 1.8rem; }
.login-help { margin: 1rem 0 0; text-align: center; }

@media (max-width: 760px) {
    .login-grid { grid-template-columns: 1fr; gap: 1rem; }
    .login-hero .display { font-size: 2.6rem; }
    .santa-hero { width: min(48%, 200px); }
}

/* --------------------------------------------------------------------------
   Dashboard
   -------------------------------------------------------------------------- */
.hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    color: #fff;
    margin-bottom: 1.25rem;
}

.hero .display { font-size: 2.6rem; margin: 0; text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4); }
.hero .tagline { color: var(--gold); font-weight: 800; margin: 0; }

.hero-stats { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.stat {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 0.6rem 1rem;
    min-width: 110px;
    text-align: center;
    backdrop-filter: blur(6px);
}

.stat-value { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.stat-value small { font-size: 0.9rem; font-weight: 700; opacity: 0.75; }
.stat-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.75; }

.page-head { color: #fff; margin-bottom: 1.25rem; }
.page-head .display { font-size: 2.4rem; margin-bottom: 0.2rem; text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4); }
.page-head .muted { color: rgba(255, 255, 255, 0.7); }
.page-head strong { color: var(--gold); }

.note-card { display: flex; gap: 1rem; align-items: flex-start; background: linear-gradient(135deg, #fff9e6, #fff4d6); }
.note-icon { font-size: 1.8rem; }

.big-name {
    font-family: var(--font-display);
    font-size: 2.2rem;
    color: var(--red);
    line-height: 1.1;
    margin: 0.1rem 0 0.4rem;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.6rem 0 0.9rem; }

.chip {
    border: 2px solid rgba(29, 29, 43, 0.18);
    background: #fff;
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font: inherit;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
}

.chip:hover { border-color: var(--green); }
.chip.is-active { background: var(--green); border-color: var(--green); color: #fff; transform: scale(1.04); }
.chip.is-active::before { content: "✓ "; }
.page-head .chip { border-color: rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.1); color: #fff; }
.page-head .chip.is-active { background: var(--green); border-color: var(--green); }

.checklist { list-style: none; padding: 0; margin: 0.5rem 0 0.75rem; }
.checklist li { padding: 0.25rem 0 0.25rem 1.7rem; position: relative; color: var(--ink-soft); }
.checklist li::before { content: "○"; position: absolute; left: 0.3rem; color: var(--ink-soft); }
.checklist li.done { color: var(--green-dark); }
.checklist li.done::before { content: "✔"; color: var(--green); font-weight: 800; }
.checklist li.attention { color: var(--red-dark); font-weight: 700; }
.checklist li.attention::before { content: "✉"; color: var(--red); }

.progress { height: 14px; border-radius: 999px; background: rgba(29, 29, 43, 0.1); overflow: hidden; margin: 0.4rem 0 0.8rem; }
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--green), #46b36a);
    border-radius: 999px;
    transition: width 0.8s cubic-bezier(.2, .8, .2, 1);
    background-size: 200% 100%;
}

.tips-list { padding-left: 0; list-style: none; margin: 0; }
.tips-list li { padding: 0.35rem 0; border-bottom: 1px dashed rgba(29, 29, 43, 0.12); }
.tips-list li:last-child { border-bottom: 0; }

/* --------------------------------------------------------------------------
   Draw page
   -------------------------------------------------------------------------- */
.draw-stage { text-align: center; max-width: 620px; margin: 2rem auto; padding: 2.2rem 1.6rem; }
.draw-stage .hat { font-size: 4.5rem; line-height: 1; animation: bob 2.5s ease-in-out infinite; display: inline-block; }
.draw-stage .display { font-size: 2.6rem; color: var(--red); }
.draw-stage .btn { margin-top: 0.5rem; }

/* ---- Santa flight (5 s) ---- */
.flight-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: radial-gradient(900px 500px at 50% 110%, #22306b 0%, transparent 60%),
                linear-gradient(180deg, #050816 0%, #0d1540 55%, #1c2a66 100%);
    animation: fade-in 0.4s;
    overflow: hidden;
}

.flight-sky { position: absolute; inset: 0; }

.star {
    position: absolute;
    border-radius: 50%;
    background: #fff;
    animation: twinkle 2.2s ease-in-out infinite;
}

@keyframes twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

.moon {
    position: absolute;
    top: 14%;
    left: 50%;
    width: min(46vmin, 360px);
    height: min(46vmin, 360px);
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle at 38% 36%, #fffbe8 0%, #f8df8a 55%, #e9c25c 100%);
    box-shadow: 0 0 60px 20px rgba(255, 236, 170, 0.35), 0 0 160px 60px rgba(255, 236, 170, 0.15);
    animation: moonrise 1s ease-out both;
}

@keyframes moonrise { from { transform: translateX(-50%) scale(0.6); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }

.sleigh {
    position: absolute;
    top: 22%;
    left: -70vw;
    width: min(70vw, 560px);
    animation: fly 5s cubic-bezier(.35, .05, .55, .95) forwards;
    filter: drop-shadow(0 0 6px rgba(255, 240, 200, 0.45));
}

.sleigh-svg { width: 100%; height: auto; fill: #05070f; stroke: none; }
.sleigh-svg .line { fill: none; stroke: #05070f; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.sleigh-svg .line.thick { stroke-width: 6; }
.sleigh-svg .line.thin { stroke-width: 2.5; }

@keyframes fly {
    0%   { left: -70vw; transform: translateY(40px) rotate(-6deg); }
    35%  { transform: translateY(-20px) rotate(2deg); }
    65%  { transform: translateY(10px) rotate(-2deg); }
    100% { left: 110vw; transform: translateY(-30px) rotate(-5deg); }
}

.gift-drop {
    position: absolute;
    top: 38%;
    font-size: 2rem;
    opacity: 0;
    animation: drop 2.4s ease-in forwards;
}

.gift-1 { left: 28%; animation-delay: 1.4s; }
.gift-2 { left: 52%; animation-delay: 2.3s; }
.gift-3 { left: 74%; animation-delay: 3.2s; }

@keyframes drop {
    0% { opacity: 0; transform: translateY(0) rotate(0); }
    10% { opacity: 1; }
    100% { opacity: 0; transform: translateY(65vh) rotate(380deg); }
}

.flight-captions {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 14%;
    text-align: center;
    color: #fff;
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 5vw, 2.6rem);
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    padding: 0 1rem;
}

.caption {
    position: absolute;
    left: 0;
    right: 0;
    opacity: 0;
    animation: caption 1.25s ease-in-out forwards;
}

.caption-1 { animation-delay: 0s; }
.caption-2 { animation-delay: 1.25s; }
.caption-3 { animation-delay: 2.5s; }
.caption-4 { animation-delay: 3.75s; font-size: 1.4em; }

@keyframes caption {
    0% { opacity: 0; transform: translateY(10px); }
    20% { opacity: 1; transform: none; }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-10px); }
}

/* ---- Reveal ---- */
.reveal-wrap { position: relative; max-width: 640px; margin: 2rem auto; }
.reveal-3d { perspective: 1200px; }

.reveal-card { text-align: center; padding: 2.4rem 1.6rem; border: 3px solid var(--gold); }
.reveal-card.flip-in { animation: flip-in 1.1s cubic-bezier(.2, .8, .2, 1) both; }
.reveal-card.fade-in { animation: rise 0.6s cubic-bezier(.2, .8, .2, 1) both; }

@keyframes flip-in {
    0% { transform: rotateY(90deg) scale(0.85); opacity: 0; }
    60% { transform: rotateY(-12deg) scale(1.02); opacity: 1; }
    100% { transform: none; opacity: 1; }
}

.reveal-eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-weight: 800; font-size: 0.8rem; color: var(--ink-soft); }
.reveal-name { font-family: var(--font-display); font-size: clamp(2.4rem, 8vw, 3.8rem); color: var(--red); line-height: 1.1; margin: 0.4rem 0; animation: glow 2s ease-in-out infinite; }
.reveal-sub { color: var(--ink-soft); margin-bottom: 0.8rem; }

@keyframes glow {
    0%, 100% { text-shadow: 0 0 0 rgba(200, 16, 46, 0); }
    50% { text-shadow: 0 0 18px rgba(200, 16, 46, 0.35); }
}

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }

.confetti-piece {
    position: absolute;
    top: -20px;
    border-radius: 2px;
    animation-name: confetti-fall;
    animation-timing-function: ease-in;
    animation-fill-mode: both;
}

@keyframes confetti-fall {
    0% { transform: translateY(0) rotate(0); opacity: 1; }
    100% { transform: translateY(110vh) rotate(var(--spin, 540deg)); opacity: 0; }
}

/* --------------------------------------------------------------------------
   Letters, wishlist, chat
   -------------------------------------------------------------------------- */
.letter-input { font-size: 1rem; line-height: 1.6; }
.letter-meta { display: flex; justify-content: space-between; margin: 0.4rem 0 0.6rem; }

.paper {
    background: repeating-linear-gradient(transparent 0 27px, rgba(29, 29, 43, 0.07) 27px 28px), #fffdf6;
    border: 1px solid rgba(29, 29, 43, 0.12);
    border-radius: 10px;
    padding: 1.1rem 1.2rem;
    line-height: 28px;
    font-size: 1.02rem;
    box-shadow: inset 0 0 40px rgba(242, 193, 78, 0.12);
    margin-bottom: 0.6rem;
}

.paper-small { max-height: 320px; overflow: auto; }
.paper-heading { font-family: var(--font-display); font-size: 1.4rem; color: var(--green-dark); margin-bottom: 0.3rem; }
.paper-image { display: block; max-width: 100%; max-height: 420px; border-radius: 10px; margin: 0.8rem auto 0.4rem; box-shadow: var(--shadow-soft); }
.letter-figure { margin: 0 0 0.6rem; }
.letter-figure img { display: block; max-width: 100%; max-height: 260px; border-radius: 10px; box-shadow: var(--shadow-soft); }
.section-gap { margin-top: 1.4rem; }
.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.signature { font-family: var(--font-display); font-size: 1.5rem; color: var(--red); text-align: right; margin-top: 0.4rem; }

.tips summary { cursor: pointer; font-weight: 700; }
.tips ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }

.chat-card { margin-top: 0; }
.chat-log {
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
    max-height: 360px;
    overflow-y: auto;
    padding: 0.6rem;
    background: rgba(29, 29, 43, 0.04);
    border-radius: 12px;
    margin-bottom: 0.75rem;
}

.chat-empty { text-align: center; color: var(--ink-soft); padding: 1rem; }

.chat-msg {
    max-width: 85%;
    padding: 0.55rem 0.8rem;
    border-radius: 14px;
    animation: rise 0.3s both;
}

.chat-msg.mine { align-self: flex-end; background: var(--green); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.theirs { align-self: flex-start; background: #fff; border: 1px solid rgba(29, 29, 43, 0.12); border-bottom-left-radius: 4px; }
.chat-author { font-size: 0.72rem; font-weight: 800; opacity: 0.92; text-transform: uppercase; letter-spacing: 0.06em; }
.chat-text { white-space: pre-wrap; word-wrap: break-word; }
.chat-time { font-size: 0.72rem; opacity: 0.9; text-align: right; }
.chat-compose { display: flex; gap: 0.5rem; align-items: flex-end; }
.chat-compose textarea { flex: 1; }

/* --------------------------------------------------------------------------
   Admin
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid rgba(29, 29, 43, 0.1); vertical-align: top; white-space: nowrap; }
.table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }

/* --------------------------------------------------------------------------
   Misc
   -------------------------------------------------------------------------- */
.notfound { max-width: 520px; text-align: center; padding: 2rem; }

@media (max-width: 560px) {
    .content { padding: 1rem 0.8rem 2.5rem; }
    .card { padding: 1.15rem 1rem; border-radius: 14px; }
    .hero .display { font-size: 2.1rem; }
    .page-head .display { font-size: 2rem; }
    .hero-stats { width: 100%; }
    .stat { flex: 1; min-width: 0; padding: 0.5rem 0.4rem; }
    .btn-xl { padding: 0.95rem 1.6rem; font-size: 1.15rem; }
    .field-row { flex-direction: column; gap: 0; }
    .field-small { flex: 1 !important; }
    .chat-msg { max-width: 92%; }
}

@media (prefers-reduced-motion: reduce) {
    .flake, .brand-icon, .santa-hero, .santa-arm, .santa-eyes, .draw-stage .hat, .pulse, .reveal-name,
    .confetti-piece, .star, .gift-drop, .page-enter > *, .grid > .card { animation: none !important; }
    .sleigh { animation-duration: 5s; animation-timing-function: linear; }
}

@media (max-width: 760px) {
    /* fixed backgrounds repaint on every scroll on phones */
    body { background-attachment: scroll; }
}

/* Blazor's own "connection lost" banner (shown by blazor.web.js, no custom script) */
#blazor-error-ui {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    background: #fff3cd;
    color: #5a4300;
    padding: 0.8rem 3rem 0.8rem 1.2rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    font-weight: 700;
}

#blazor-error-ui .reload { color: var(--red-dark); }
#blazor-error-ui .dismiss { position: absolute; right: 1rem; top: 0.7rem; cursor: pointer; }
