/* Wichteln – festive standalone theme (deliberately not the shared dark "Leitstand" design, see README). */

:root {
    --night: #0b1d3a;
    --night-2: #12335e;
    --red: #c0262d;
    --red-dark: #8f1a20;
    --green: #17643a;
    --green-light: #2e9a5c;
    --gold: #f2c14e;
    --gold-dark: #c99a22;
    --cream: #fff8ec;
    --paper: #fffdf8;
    --ink: #2a1d14;
    --muted: #7a6a5c;
    --radius: 18px;
    --shadow: 0 18px 40px rgba(0, 0, 0, .35);
    --font-display: "Georgia", "Cambria", "Times New Roman", serif;
    --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.55;
    color: var(--ink);
    background:
        radial-gradient(ellipse at 20% 0%, rgba(242, 193, 78, .18), transparent 55%),
        radial-gradient(ellipse at 90% 10%, rgba(46, 154, 92, .18), transparent 50%),
        linear-gradient(180deg, var(--night) 0%, var(--night-2) 70%, #1b4a7a 100%);
    background-attachment: fixed;
    overflow-x: hidden;
}

#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }

/* String of fairy lights along the top */
.lights {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    padding: 0 8px;
    height: 34px;
    overflow: hidden;
    border-top: 2px solid #23331f;
}
.lights span {
    width: 12px;
    height: 20px;
    margin-top: 6px;
    border-radius: 50% 50% 45% 45%;
    background: var(--red);
    box-shadow: 0 0 12px 3px rgba(192, 38, 45, .7);
    animation: twinkle 1.6s ease-in-out infinite;
    position: relative;
}
.lights span::before {
    content: "";
    position: absolute;
    top: -5px; left: 3px;
    width: 6px; height: 5px;
    background: #2d3b28;
    border-radius: 2px;
}
.lights span:nth-child(4n+2) { background: var(--gold); box-shadow: 0 0 12px 3px rgba(242, 193, 78, .7); animation-delay: .4s; }
.lights span:nth-child(4n+3) { background: var(--green-light); box-shadow: 0 0 12px 3px rgba(46, 154, 92, .7); animation-delay: .8s; }
.lights span:nth-child(4n)   { background: #5bb4ff; box-shadow: 0 0 12px 3px rgba(91, 180, 255, .7); animation-delay: 1.2s; }
.lights span:nth-child(n+13) { display: none; }
@media (min-width: 700px) { .lights span:nth-child(n+13) { display: block; } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.wrap {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 8px 16px 32px;
}

/* Hero */
.hero { text-align: center; color: var(--cream); padding: 24px 0 18px; }
.hero-emoji {
    font-size: 72px;
    line-height: 1;
    display: inline-block;
    animation: bob 3s ease-in-out infinite;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .35));
}
.hero-small .hero-emoji { font-size: 52px; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-8px) rotate(4deg); } }
.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(30px, 7vw, 46px);
    font-weight: 700;
    margin: 10px 0 4px;
    letter-spacing: .5px;
    text-shadow: 0 3px 0 var(--red-dark), 0 8px 24px rgba(0, 0, 0, .4);
}
.tagline { margin: 0; color: var(--gold); font-style: italic; font-family: var(--font-display); font-size: 19px; }

/* Cards look like gift tags / paper */
.card {
    position: relative;
    background: var(--paper);
    border-radius: var(--radius);
    padding: 22px 20px;
    margin: 18px 0;
    box-shadow: var(--shadow);
    border-top: 8px solid var(--red);
    background-image:
        repeating-linear-gradient(-45deg, transparent 0 10px, rgba(192, 38, 45, .035) 10px 20px);
}
.card:nth-of-type(even) { border-top-color: var(--green); }
.card h2 {
    font-family: var(--font-display);
    font-size: 22px;
    margin: 0 0 10px;
    color: var(--red-dark);
}
.card:nth-of-type(even) h2 { color: var(--green); }
.card p { margin: 8px 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.hint { font-size: 14px; color: var(--muted); margin-top: 14px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: inherit;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(180deg, #d9363d, var(--red));
    border: 0;
    border-radius: 999px;
    padding: 12px 22px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 0 var(--red-dark), 0 8px 18px rgba(192, 38, 45, .3);
    transition: transform .08s ease, box-shadow .08s ease, filter .15s;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--red-dark), 0 3px 8px rgba(192, 38, 45, .3); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.btn-big { font-size: 22px; padding: 18px 34px; }
.btn-sm { font-size: 14px; padding: 8px 14px; box-shadow: 0 3px 0 var(--red-dark); }
.btn-gold { color: var(--ink); background: linear-gradient(180deg, #ffd873, var(--gold)); box-shadow: 0 4px 0 var(--gold-dark), 0 8px 18px rgba(242, 193, 78, .35); }
.btn-gold:active { box-shadow: 0 1px 0 var(--gold-dark); }
.btn-ghost { color: var(--green); background: #eef7f0; box-shadow: 0 3px 0 #c9e3d1; }
.btn-ghost:active { box-shadow: 0 1px 0 #c9e3d1; }
.btn-danger { background: #fff; color: var(--red); box-shadow: 0 3px 0 #f0c7c9; border: 1px solid #f0c7c9; }
.btn[disabled] { opacity: .7; cursor: wait; }

/* Draw */
.draw-form { margin-top: 14px; }
.sack { font-size: 84px; line-height: 1; margin: 8px 0 18px; display: inline-block; }
.is-drawing .sack { animation: shake .35s ease-in-out infinite; }
@keyframes shake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-14deg) translateY(-4px); }
    75% { transform: rotate(14deg) translateY(-4px); }
}
.draw-status { min-height: 1.5em; font-style: italic; }

/* Reveal */
.reveal { margin-top: 16px; }
.reveal summary { list-style: none; }
.reveal summary::-webkit-details-marker { display: none; }
.reveal .when-open { display: none; }
.reveal[open] .when-open { display: inline; }
.reveal[open] .when-closed { display: none; }
.reveal-card {
    margin: 20px auto 4px;
    max-width: 420px;
    padding: 26px 18px;
    border-radius: 16px;
    color: var(--cream);
    background:
        linear-gradient(90deg, transparent calc(50% - 14px), var(--gold) calc(50% - 14px), var(--gold) calc(50% + 14px), transparent calc(50% + 14px)),
        linear-gradient(180deg, var(--green-light), var(--green));
    box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .15), 0 12px 28px rgba(23, 100, 58, .4);
    animation: pop .45s cubic-bezier(.2, 1.6, .4, 1);
}
.reveal-kicker { font-size: 14px; text-transform: uppercase; letter-spacing: 2px; opacity: .9; }
.reveal-name {
    font-family: var(--font-display);
    font-size: clamp(32px, 9vw, 48px);
    font-weight: 700;
    margin: 6px 0;
    text-shadow: 0 3px 0 rgba(0, 0, 0, .25);
    background: var(--green);
    display: inline-block;
    padding: 0 14px;
    border-radius: 10px;
}
.reveal-note { font-size: 14px; opacity: .95; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.is-fresh h2 { animation: pop .5s ease-out; }

/* Rules */
.rules ol { list-style: none; padding: 0; margin: 0; }
.rules li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px dashed #e6d8c3; }
.rules li:last-child { border-bottom: 0; }
.rule-ico {
    flex: 0 0 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 22px;
    background: var(--cream);
    box-shadow: inset 0 0 0 2px #f0e2c8;
}
.rules strong { display: block; color: var(--ink); }

/* Flash */
.flash { position: relative; z-index: 1; padding: 12px 16px; border-radius: 12px; margin: 12px 0; font-weight: 600; box-shadow: var(--shadow); }
.flash-success { background: #e6f6ea; color: #14532d; border-left: 6px solid var(--green-light); }
.flash-error { background: #fdecec; color: var(--red-dark); border-left: 6px solid var(--red); }

/* Forms */
input[type="text"], input[type="password"], input[type="number"], textarea, select {
    font: inherit;
    font-size: 16px; /* avoids zoom on iOS */
    color: var(--ink);
    background: #fff;
    border: 2px solid #eadcc6;
    border-radius: 12px;
    padding: 10px 12px;
    width: 100%;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 193, 78, .3); }
.stack { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.stack .btn { align-self: flex-start; margin-top: 6px; }
.label { font-size: 14px; font-weight: 700; color: var(--muted); }
.inline { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.inline input[type="text"] { width: auto; min-width: 0; flex: 1 1 160px; }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 15px; }
.row-center { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 14px; }

/* Admin */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.stat { background: var(--cream); border-radius: 14px; padding: 12px 6px; }
.stat-num { display: block; font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--red-dark); line-height: 1.1; }
.stat-label { font-size: 13px; color: var(--muted); }
.pill { display: inline-block; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: #f3ece0; color: var(--muted); white-space: nowrap; }
.pill-green { background: #e3f4e8; color: var(--green); }
.people { list-style: none; padding: 0; margin: 0; }
.person { padding: 14px 0; border-bottom: 1px dashed #e6d8c3; }
.person:last-child { border-bottom: 0; }
.person.is-paused { opacity: .6; }
.person-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.person-name { font-weight: 700; font-size: 18px; }
.link-row { display: flex; gap: 8px; flex-wrap: wrap; }
.link-input { flex: 1 1 220px; font-family: ui-monospace, Consolas, monospace; font-size: 13px !important; color: var(--muted) !important; }
.person-more { margin-top: 8px; }
.person-more summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.person-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.exclusion-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.exclusion-form select { width: auto; flex: 1 1 130px; }
.exclusions { list-style: none; padding: 0; margin: 10px 0 0; }
.exclusions li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed #e6d8c3; }
.danger-zone { border-top-color: #555 !important; }
.danger-zone h2 { color: #444 !important; }

.foot {
    position: relative;
    z-index: 1;
    text-align: center;
    color: rgba(255, 248, 236, .6);
    font-size: 13px;
    padding: 10px 16px 28px;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .card { padding: 18px 16px; }
    .btn-big { width: 100%; }
    .stat-num { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Login and logout */
.login-card { max-width: 420px; margin-left: auto; margin-right: auto; }
.logout { text-align: center; margin: -6px 0 6px; }
.logout .btn { color: var(--cream); background: rgba(255, 255, 255, .12); box-shadow: none; }
