:root {
    color-scheme: dark;
    --deep: #1c1c2a;
    --ink: #fff5e6;
    --muted: #e4d7cc;
    --gold: #f8d59a;
    --line: #d6e5fc40;
    --serif: Georgia, 'Times New Roman', serif;
    font-family: system-ui, sans-serif;
    color: var(--ink);
    background: var(--deep);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { --header-height: 6.25rem; min-height: 100vh; min-height: 100svh; margin: 0; text-align: center; }
button, input { font: inherit; text-align: inherit; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid #fff5cc;
    outline-offset: 4px;
}

.site-scene {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at 38% 22%, #775344 0%, #3c303a 43%, var(--deep) 85%);
    pointer-events: none;
}

.page--calendar .site-scene {
    background-color: #405c75;
    --hero-shade: radial-gradient(ellipse at 12% 38%, #ffbe802e, transparent 61%),
        linear-gradient(180deg, #292234c2 0%, #452d394d 33%, #d9945b0f 55%, #4633492e 73%, #2c2530fc 100%);
    background-image: var(--hero-shade), url('/hatter/mobil');
    background-size: cover;
    background-position: center;
}
.calendar-managed .page--calendar .site-scene { background-image: var(--hero-shade), var(--hero-photo, none); }
.calendar-loading body { overflow: hidden; }
.calendar-loading [data-day-dialog] { visibility: hidden; }

.site-shell { position: relative; min-height: 100svh; }

.site-header {
    position: relative;
    z-index: 3;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 0;
    width: min(calc(100% - 2rem), 68rem);
    min-height: var(--header-height);
    margin-inline: auto;
    padding-block: .375rem;
    border-bottom: 1px solid #f8f3e738;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 2.75rem;
    font: 400 clamp(1rem, 4.2vw, 1.2rem)/1.15 var(--serif);
    text-decoration: none;
}

.site-sparkle { color: var(--gold); font: 1.45em/1 system-ui, sans-serif; }
.site-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: clamp(.25rem, 1.5vw, .625rem); }
.site-actions form, .preview-banner form { margin: 0; }

.header-action, .snow-switch {
    display: inline-grid;
    min-height: 2.75rem;
    min-width: 2.75rem;
    place-items: center;
    padding: 0 .5rem;
    border: 0;
    border-radius: .75rem;
    color: var(--ink);
    background: transparent;
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.header-action:hover, .snow-switch:hover { background: #f8f3e71f; }

.snow-switch {
    position: relative;
    border: 1px solid #f8f3e736;
    background: #10264068;
    line-height: 1;
}

.snow-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.snow-switch span { color: var(--gold); font-size: 1.275rem; pointer-events: none; }
.snow-switch:has(input:not(:checked)) span { opacity: .48; }
.snow-switch:has(input:focus-visible) { outline: 2px solid #fff5cc; outline-offset: 3px; }

.preview-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .15rem .875rem;
    padding: .25rem .75rem;
    background: #fae4b6;
    color: #172b28;
    font-size: .875rem;
    text-align: center;
}

.preview-banner button {
    min-height: 2.75rem;
    padding: .25rem 0;
    border: 0;
    background: none;
    color: inherit;
    font-size: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.preview-banner button:focus-visible { outline-color: #172b28; }

.hero {
    display: grid;
    grid-template-rows: 1fr auto;
    justify-items: center;
    min-height: calc(100svh - var(--header-height));
    padding: clamp(1.75rem, 6svh, 4rem) 1rem 1.65rem;
    text-align: center;
}

.hero-message { position: relative; z-index: 3; align-self: start; }

.hero h1 {
    margin: 0;
    font: 400 clamp(2.45rem, 10.5vw, 6.6rem)/.99 var(--serif);
    letter-spacing: -.055em;
    text-wrap: balance;
    text-shadow: 0 3px 24px #071417af;
}
.hero h1 em { font-weight: 400; color: #ffe4ac; }

.hero p {
    width: fit-content;
    margin: 1rem auto 0;
    color: #fcf4e5;
    font-size: clamp(1rem, 3.8vw, 1.22rem);
    text-shadow: 0 2px 10px #071417;
}
.hero .hero-date {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin: 0 auto 1rem;
    font-size: .72rem;
    font-weight: 650;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.hero-date span { color: #ffe0a3; font-size: 1.35em; }

.hero-jump {
    position: relative;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: .68rem;
    min-height: 2.875rem;
    padding: .25rem 1rem;
    border: 1px solid #f7e9ca73;
    border-radius: 9rem;
    background: #352a31d9;
    color: var(--ink);
    font-size: .875rem;
    font-weight: 650;
    text-decoration: none;
}

.hero-jump:hover { background: #61423d; }
.hero-jump span { color: var(--gold); font-size: 1.2rem; }

.calendar {
    position: relative;
    padding: clamp(1.65rem, 6vw, 4.5rem) 1rem clamp(2.75rem, 8vw, 6rem);
    background-color: #231b28;
    background-image:
        radial-gradient(ellipse at 16% 35%, #b6504029, transparent 58%),
        linear-gradient(153deg, #371d2af5, #381e2adf 38%, #152a30ea 78%, #131d28fc),
        url('/assets/erdo/teli-tisztas.webp?v=advent26.3');
    background-position: center;
    background-size: cover;
    border-top: 1px solid #cbdff64a;
}

.tree-layout { max-width: 48rem; margin: auto; display: grid; gap: 1rem; }
.calendar-heading { position: relative; z-index: 3; }
.calendar-heading h2 { margin: 0; font: 400 clamp(2.2rem, 8vw, 4.5rem)/1.04 var(--serif); letter-spacing: -.045em; }
.tree-guide { max-width: 32rem; margin: .65rem auto 0; color: var(--muted); line-height: 1.5; font-size: .95rem; text-wrap: balance; }
.calendar:not(:has(.tree-ready)) .tree-guide { display: none; }
.tree-progress { width: min(100%, 18rem); margin: .8rem auto .25rem; }
.tree-progress div { display: flex; align-items: baseline; justify-content: center; gap: .45rem; }
.tree-progress span { font-size: .78rem; }
.tree-progress strong { color: var(--gold); font-size: .82rem; font-weight: 550; font-variant-numeric: tabular-nums; }
.tree-progress progress { display: block; width: 100%; height: 3px; margin-top: .42rem; border: none; appearance: none; background: #b8b38e45; color: var(--gold); }
.tree-progress progress::-webkit-progress-bar { background: #b8b38e45; }
.tree-progress progress::-webkit-progress-value { background: var(--gold); }
.tree-progress progress::-moz-progress-bar { background: var(--gold); }
.tree-exhibit { min-width: 0; }
.tree-toolbar { position: relative; z-index: 3; display: none; justify-content: center; align-items: center; gap: 1rem; margin-top: .9rem; }
.tree-stage.tree-ready + .tree-toolbar { display: flex; }
.tree-toolbar button { min-width: 2.85rem; min-height: 2.85rem; padding: .5rem .85rem; color: #fff0cc; border: 1px solid #d7a65590; border-radius: 99px; background: #38202c; cursor: pointer; }
.tree-toolbar button:hover, .tree-toolbar button[aria-pressed=true] { background: #63283b; border-color: #e1ba73; }
.tree-toolbar button:disabled { opacity: .45; }
.turn-controls { display: flex; gap: .35rem; }
.turn-controls button { padding: .35rem; font-size: 1.2rem; }


.tile-mark {
    position: relative;
    display: inline-block;
    flex: none;
    width: .875rem;
    height: .875rem;
    color: inherit;
}

.tile-mark--locked::before {
    position: absolute;
    inset: .385em .18em .05em;
    border: 1px solid currentColor;
    border-radius: .12em;
    content: '';
}

.tile-mark--locked::after {
    position: absolute;
    inset: .08em .31em auto;
    height: .37em;
    border: 1px solid currentColor;
    border-bottom: 0;
    border-radius: 9em 9em 0 0;
    content: '';
}



.auth-main {
    position: relative;
    z-index: 3;
    display: grid;
    justify-items: center;
    padding: clamp(2.8rem, 11svh, 7rem) 1rem 3rem;
}

.auth-card {
    width: min(100%, 27rem);
    padding: clamp(1.2rem, 6vw, 2.4rem);
    border: 1px solid #f0d39e5c;
    border-radius: 1.35rem;
    background: radial-gradient(ellipse at top, #815b4a8a, transparent 62%), #292534;
    box-shadow: 0 1rem 5rem #091427b0;
    text-align: center;
}

.auth-emblem, .dialog-emblem {
    display: grid;
    place-items: center;
    width: 3rem;
    aspect-ratio: 1;
    margin: 0 auto 1rem;
    border: 1px solid #f0d39e61;
    border-radius: 50%;
    color: var(--gold);
    font-size: 1.5rem;
}

.auth-card h1 {
    margin: 0;
    font: 400 clamp(1.8rem, 8vw, 2.6rem)/1.08 var(--serif);
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
}

.auth-intro { margin: .8rem 0 1.4rem; color: var(--muted); font-size: 1rem; line-height: 1.5; }
.auth-form { display: grid; gap: .95rem; }
.auth-form label { display: grid; gap: .35rem; color: var(--ink); font-size: .875rem; font-weight: 650; }

.auth-form input:not([type='checkbox']) {
    width: 100%;
    min-height: 2.875rem;
    padding: .45rem .75rem;
    border: 1px solid #c5d5cb75;
    border-radius: .625rem;
    background: #101e34;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 400;
}

.primary-button {
    display: inline-grid;
    align-items: center;
    min-height: 2.875rem;
    padding: .55rem 1.05rem;
    border: 1px solid #ffe9ba;
    border-radius: .7rem;
    background: #f0d39e;
    color: #172744;
    font-size: 1rem;
    font-weight: 720;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.primary-button:hover { background: #ffebb9; }
.primary-button:disabled { opacity: .72; cursor: wait; }
.auth-card > .primary-button { margin-top: 1.35rem; }

.form-error {
    padding: .7rem .75rem;
    border: 1px solid #efd6bb62;
    border-radius: .65rem;
    background: #583832;
    color: #fff1e8;
    font-size: .9rem;
    line-height: 1.45;
}

.has-day-dialog { overflow: hidden; }
.has-day-dialog .site-shell { filter: blur(2px); }

.day-dialog[open] {
    position: fixed;
    z-index: 5;
    inset: 0;
    width: min(calc(100% - 1.5rem), 33rem);
    max-width: none;
    max-height: calc(100svh - 1.5rem);
    margin: auto;
    padding: clamp(1.2rem, 6vw, 2.5rem);
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid #f5d59c78;
    border-radius: 1.375rem;
    background: radial-gradient(ellipse at 22% 0, #9f573947, transparent 70%), #30202d;
    color: var(--ink);
    text-align: center;
    box-shadow: 0 0 0 200vmax #071326b3, 0 1.6rem 5rem #060c1a99;
    animation: dialog-entrance .3s cubic-bezier(.2,.75,.3,1) both;
}

.day-dialog:modal { box-shadow: 0 1.6rem 5rem #060c1a99; }
.day-dialog::backdrop { background: #081528c9; }
.day-dialog--available[open], .day-dialog--opened[open] {
    width: min(calc(100% - 1rem), 35rem);
    padding: clamp(.9rem, 3.1vw, 1.4rem);
}
.day-dialog--available .gift-before, .day-dialog .gift-reveal {
    padding: 0 .55rem .6rem;
}

.dialog-close {
    position: absolute;
    top: .55rem;
    right: .55rem;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid #f8f3e743;
    border-radius: 50%;
    background: #352c39;
    color: var(--ink);
    font-size: 1.7rem;
    line-height: 1;
    text-decoration: none;
}

.dialog-close:hover { background: #5f4542; }
.dialog-date { margin: .45rem 2.7rem 1.35rem; color: var(--gold); font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; line-height: 1.4; font-weight: 650; }
.dialog-inner h2 { margin: 0; font: 400 clamp(1.75rem, 8vw, 2.6rem)/1.06 var(--serif); letter-spacing: -.025em; overflow-wrap: anywhere; }
.dialog-hint, .gift-message { margin: .85rem auto 0; color: var(--muted); font-size: 1rem; line-height: 1.55; overflow-wrap: anywhere; }
.dialog-hint { font-size: .875rem; }
.gift-message { white-space: pre-line; }
.gift-before form { margin-top: 1.15rem; }
.gift-before .primary-button { min-width: min(100%, 12rem); }
.gift-photo { display: block; width: 100%; max-height: min(52svh, 26rem); margin: 1rem auto 0; border-radius: .85rem; object-fit: contain; }
.gift-reveal h2:focus { outline: none; }
.gift-reveal.is-new { animation: reveal-gift .35s ease-out both; }
.dialog-emblem .tile-mark { font-size: 1.05rem; transform: scale(1.4); }
.day-dialog--locked .dialog-emblem { animation: lock-nudge .42s .23s ease-in-out; }

@keyframes dialog-entrance {
    from { transform: translateY(.75rem) scale(.91); opacity: .45; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes lock-nudge {
    0%, 100% { transform: rotate(0); }
    28% { transform: rotate(-8deg); }
    62% { transform: rotate(6deg); }
}
@keyframes reveal-gift {
    from { transform: translateY(.5rem); opacity: .45; }
    to { transform: translateY(0); opacity: 1; }
}

@media (min-width: 42rem) and (min-aspect-ratio: 3/4) {
    .page--calendar .site-scene {
        --hero-shade: radial-gradient(ellipse at 12% 38%, #ffc18433, transparent 57%),
            linear-gradient(180deg, #29233093 0%, #60403926 36%, #db9c730d 55%, #5b41452b 74%, #2c2530f7 100%);
        background-image: var(--hero-shade), url('/hatter/szeles');
        background-position: center 54%;
    }
}
@media (min-width: 52rem) {
    body { --header-height: 4.25rem; }
    .site-header { grid-template-columns: 1fr auto 1fr; align-items: center; }
    .site-brand { grid-column: 2; }
    .site-actions { justify-self: end; }
    .tree-guide { font-size: 1.05rem; }
}

@media (max-width: 22rem) {
    .site-header { width: calc(100% - 1rem); }
    .site-brand { gap: .25rem; }
    .header-action { padding-inline: .25rem; }
    .calendar { padding-inline: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
    .day-dialog[open], .day-dialog--locked .dialog-emblem, .gift-reveal.is-new { animation: none; }
}
