* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Georgia, 'Times New Roman', serif;
    color: #fdf6e3;
    background: radial-gradient(ellipse at top, #1e4d3a 0%, #0f2a20 60%, #08170f 100%);
    overflow-x: hidden;
}

/* Sneeuw */
.sneeuw {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(3px 3px at 20px 30px, #fff, transparent),
        radial-gradient(2px 2px at 80px 120px, #fff, transparent),
        radial-gradient(3px 3px at 150px 60px, #fff, transparent),
        radial-gradient(2px 2px at 220px 170px, #fff, transparent),
        radial-gradient(2px 2px at 300px 90px, #fff, transparent);
    background-size: 320px 200px;
    animation: sneeuwval 12s linear infinite;
    opacity: .7;
}
.sneeuw.langzaam {
    background-size: 450px 300px;
    animation-duration: 20s;
    opacity: .4;
}
@keyframes sneeuwval {
    from { background-position: 0 0; }
    to   { background-position: 60px 600px; }
}

.kaart {
    position: relative;
    width: min(92vw, 560px);
    padding: 2.5rem 2rem;
    text-align: center;
    background: rgba(120, 20, 25, .85);
    border: 3px solid #d4af37;
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}

h1 {
    margin: 0 0 1rem;
    font-size: 2.2rem;
    color: #f5d77a;
}

p { font-size: 1.15rem; line-height: 1.6; }

.knop, button {
    display: inline-block;
    margin-top: 1rem;
    padding: .8rem 1.8rem;
    font: inherit;
    font-size: 1.1rem;
    color: #0f2a20;
    background: #f5d77a;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s, background .15s;
}
.knop:hover, button:hover { background: #fff1b8; transform: scale(1.05); }

input[type=text], input[type=password], textarea {
    width: 100%;
    padding: .8rem 1rem;
    font: inherit;
    font-size: 1.1rem;
    border: 2px solid #d4af37;
    border-radius: 10px;
    text-align: center;
}

/* Kerstslinger */
.slinger {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.lampje {
    width: 22px;
    height: 30px;
    border-radius: 50% 50% 45% 45%;
    background: #3a3a3a;
    position: relative;
}
.lampje::before {
    content: '';
    position: absolute;
    top: -7px; left: 6px;
    width: 10px; height: 8px;
    background: #888;
    border-radius: 2px;
}
.lampje.aan:nth-child(3n+1) { background: #ff4d4d; box-shadow: 0 0 18px #ff4d4d; }
.lampje.aan:nth-child(3n+2) { background: #ffd94d; box-shadow: 0 0 18px #ffd94d; }
.lampje.aan:nth-child(3n) { background: #4dff88; box-shadow: 0 0 18px #4dff88; }

/* Meerkeuze */
.keuzes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .8rem;
    margin-top: 1rem;
}
.keuzes .keuze { margin: 0; width: 100%; }
.keuzes .keuze.fout {
    background: #5a2a2a;
    color: #c99;
    text-decoration: line-through;
    cursor: not-allowed;
    transform: none;
}
@media (max-width: 420px) {
    .keuzes { grid-template-columns: 1fr; }
}

.opnieuw {
    display: inline-block;
    margin-top: 1.5rem;
    font-size: .95rem;
    color: #f5d77a;
    opacity: .8;
}
.opnieuw:hover { opacity: 1; }

.melding { margin-top: 1rem; font-style: italic; color: #ffd0d0; }
.goed    { color: #c8ffd6; }

.gedicht {
    white-space: pre-line;
    font-size: 1.2rem;
    line-height: 1.8;
}

.knoppen {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .8rem;
}

/* Bij printen / opslaan als PDF: alleen het gedicht, zwart op wit */
@media print {
    body { background: #fff; color: #000; display: block; }
    .sneeuw, .slinger, .knoppen, .opnieuw { display: none; }
    .kaart {
        width: auto;
        margin: 2cm auto;
        background: none;
        border: none;
        box-shadow: none;
    }
    h1 { color: #000; }
}

/* ---------- Beheer ---------- */
.formulier { display: grid; gap: 1rem; text-align: left; }
.formulier label { display: grid; gap: .35rem; font-size: 1rem; }
.formulier small, .uitleg { font-size: .85rem; opacity: .8; margin: 0; }
.formulier button { justify-self: center; }

body.beheer { align-items: flex-start; padding: 2rem 0; }
.kaart.breed { width: min(95vw, 820px); text-align: left; }
.kaart.breed input[type=text], .kaart.breed textarea { text-align: left; }
textarea { resize: vertical; line-height: 1.6; }

.balk {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}
.balk h1 { margin: 0; }
.balk a { color: #f5d77a; margin-left: 1rem; }

fieldset {
    display: grid;
    gap: .7rem;
    border: 1px solid rgba(212, 175, 55, .6);
    border-radius: 12px;
    padding: 1rem 1.2rem 1.2rem;
}
fieldset.nieuw { border-style: dashed; opacity: .85; }
legend { padding: 0 .5rem; color: #f5d77a; font-size: 1.1rem; }

.keuze-regel { display: flex; align-items: center; gap: .6rem; }
.keuze-regel input[type=radio] { width: 1.3rem; height: 1.3rem; accent-color: #4dff88; flex: none; }
.keuze-regel input[type=text] { padding: .5rem .8rem; font-size: 1rem; }

label.verwijder { display: flex; align-items: center; gap: .5rem; color: #ffd0d0; font-size: .95rem; }

.succes { background: #1e4d3a; padding: .6rem 1rem; border-radius: 8px; }
.fouten { background: #4a1015; padding: .8rem 1rem .8rem 2rem; border-radius: 8px; color: #ffd0d0; }

/* Overzicht gedichten */
.overzicht { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: .95rem; }
.overzicht th { text-align: left; color: #f5d77a; font-weight: normal; border-bottom: 1px solid rgba(212, 175, 55, .6); padding: .4rem; }
.overzicht td { padding: .6rem .4rem; border-bottom: 1px solid rgba(255, 255, 255, .1); vertical-align: middle; }
.overzicht td:nth-child(4) { white-space: nowrap; }
.acties a { color: #f5d77a; margin-right: .6rem; white-space: nowrap; }
.uitleg a { color: #f5d77a; }

input.link {
    width: 15rem;
    max-width: 100%;
    padding: .35rem .6rem;
    font-size: .85rem;
    text-align: left;
}
button.klein { margin: 0 0 0 .3rem; padding: .35rem .8rem; font-size: .85rem; }
button.gevaar { background: #3a0a0d; color: #ffd0d0; border: 1px solid #ff8080; }
button.gevaar:hover { background: #5a1015; }
.verwijder-gedicht { text-align: center; margin-top: 2rem; }

@media (max-width: 640px) {
    .overzicht thead { display: none; }
    .overzicht tr { display: grid; padding: .6rem 0; border-bottom: 1px solid rgba(255, 255, 255, .15); }
    .overzicht td { border: none; padding: .2rem 0; }
}
