@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Allura&family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --black:        #0c0c0c;
    --black-soft:   #1a1a1a;
    --gold-dark:    #9a7b2e;
    --gold:         #d4af37;
    --gold-light:   #f3dfa3;
    --cream:        #fbf3df;
    --success:      #4caf6d;
    --danger:       #d9534f;
    --radius:       14px;
    --shadow:       0 10px 30px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Poppins', sans-serif;
    background: var(--black);
    color: var(--cream);
    background-image:
        radial-gradient(circle at 15% 10%, rgba(212,175,55,.10), transparent 40%),
        radial-gradient(circle at 85% 90%, rgba(212,175,55,.08), transparent 45%);
}

.wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 20px 60px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card {
    background: linear-gradient(160deg, var(--black-soft), #111 60%, var(--black-soft));
    border: 1px solid var(--gold-dark);
    border-radius: var(--radius);
    padding: 36px 32px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(212,175,55,.10), transparent 30%, transparent 70%, rgba(212,175,55,.10));
}

.eyebrow {
    font-family: 'Allura', cursive;
    font-size: 1.7rem;
    color: var(--gold-light);
    margin: 0 0 4px;
    line-height: 1;
}

h1.display {
    font-family: 'Archivo Black', sans-serif;
    font-size: clamp(1.7rem, 5vw, 2.6rem);
    letter-spacing: .5px;
    margin: 0 0 18px;
    color: var(--gold);
    text-transform: uppercase;
}

p.lead {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--cream);
    opacity: .92;
}

.hint {
    font-size: .92rem;
    color: var(--gold-light);
    opacity: .8;
    margin-top: 6px;
}

.btn {
    display: inline-block;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: .3px;
    padding: 14px 28px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, var(--gold-light), var(--gold) 55%, var(--gold-dark));
    color: #1a1305;
    box-shadow: 0 6px 18px rgba(212,175,55,.35);
    transition: transform .15s ease, box-shadow .15s ease;
    text-decoration: none;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(212,175,55,.45); }
.btn:active { transform: translateY(0); }

.btn:disabled {
    opacity: .4;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-row { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }

input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    font-size: 1.05rem;
    border-radius: 10px;
    border: 1px solid var(--gold-dark);
    background: #151515;
    color: var(--cream);
    outline: none;
    font-family: 'Poppins', sans-serif;
}

input[type="text"]:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212,175,55,.2);
}

.feedback {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: .98rem;
}

.feedback.ok   { background: rgba(76,175,109,.15); color: #86e0a6; border: 1px solid rgba(76,175,109,.4); }
.feedback.fail { background: rgba(217,83,79,.15); color: #ef9490; border: 1px solid rgba(217,83,79,.4); }

/* progress trail */
.progress {
    display: flex;
    gap: 6px;
    margin-bottom: 26px;
    flex-wrap: wrap;
}
.progress .dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #3a3a3a;
    border: 1px solid var(--gold-dark);
}
.progress .dot.done { background: var(--gold); border-color: var(--gold-light); }
.progress .dot.current { background: transparent; border: 2px solid var(--gold-light); box-shadow: 0 0 0 3px rgba(212,175,55,.2); }

.step-label {
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gold-dark);
    margin-bottom: 6px;
}

/* crossword */
.crossword-scroll {
    overflow-x: auto;
    padding-bottom: 6px;
    margin: 18px 0;
}
.crossword {
    display: grid;
    gap: 2px;
    width: 640px;   /* 20 kolommen x 32px: horizontaal scrollbaar op kleine schermen */
    margin: 0 auto;
}
.cw-cell {
    position: relative;
    aspect-ratio: 1/1;
    background: transparent;
}
.cw-cell.black { background: transparent; }
.cw-num {
    position: absolute;
    top: 0;
    left: 1px;
    font-size: .5rem;
    font-weight: 700;
    color: var(--gold-dark);
    line-height: 1;
    z-index: 2;
    pointer-events: none;
}
.cw-cell input {
    width: 100%;
    height: 100%;
    text-align: center;
    text-transform: uppercase;
    font-weight: 700;
    font-size: .85rem;
    padding: 0;
    background: var(--cream);
    color: #1a1a1a;
    border: 1px solid var(--gold-dark);
    border-radius: 3px;
}
.cw-cell input:focus { outline: 2px solid var(--gold); }

.cw-cell input.cw-wrong {
    border: 2px solid var(--danger) !important;
    background: #fbdcda !important;
    box-shadow: 0 0 0 2px rgba(217,83,79,.35) !important;
}
.cw-cell input.cw-ok {
    border: 2px solid var(--success) !important;
    background: #e2f5e8 !important;
    box-shadow: 0 0 0 2px rgba(76,175,109,.3) !important;
}

.clues {
    font-size: .88rem;
    line-height: 1.7;
    color: var(--gold-light);
    opacity: .9;
    margin-top: 18px;
}

/* sliding puzzle */
.slider {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    max-width: 300px;
    margin: 18px auto;
    aspect-ratio: 1/1;
}
.slider .tile {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--gold-light), var(--gold));
    color: #1a1305;
    font-family: 'Archivo Black', sans-serif;
    font-size: 1.6rem;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 4px 10px rgba(0,0,0,.35);
    transition: transform .05s;
}
.slider .tile.empty {
    background: transparent;
    box-shadow: none;
    cursor: default;
}
.slider .tile:active { transform: scale(.96); }

/* voucher reveal */
.voucher-scene {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 20%, #1b1305, var(--black) 70%);
}
.voucher-image {
    position: relative;
    z-index: 5;
    max-width: 92vw;
    width: 720px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 0 3px var(--gold-dark);
    opacity: 0;
    transform: scale(.85);
    animation: revealVoucher 1.1s .4s cubic-bezier(.2,.9,.2,1.2) forwards,
               voucherGlow 2.6s 1.6s ease-in-out infinite;
    overflow: hidden;
}
@keyframes revealVoucher {
    to { opacity: 1; transform: scale(1); }
}
@keyframes voucherGlow {
    0%, 100% { box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 0 3px var(--gold-dark), 0 0 0 rgba(212,175,55,0); }
    50%      { box-shadow: 0 20px 70px rgba(0,0,0,.6), 0 0 0 3px var(--gold-light), 0 0 40px rgba(212,175,55,.55); }
}

.voucher-wrap {
    position: relative;
}
.voucher-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 6;
    pointer-events: none;
    border-radius: 16px;
    background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.55) 48%, transparent 66%);
    background-size: 250% 250%;
    background-position: -120% -120%;
    opacity: 0;
    animation: shimmerSweep 3.4s 1.6s ease-in-out infinite;
}
@keyframes shimmerSweep {
    0%   { background-position: -120% -120%; opacity: 0; }
    8%   { opacity: .9; }
    28%  { background-position: 120% 120%; opacity: 0; }
    100% { background-position: 120% 120%; opacity: 0; }
}

.congrats-text {
    position: relative;
    z-index: 5;
    text-align: center;
    font-family: 'Allura', cursive;
    font-size: clamp(2rem, 7vw, 3.4rem);
    color: var(--gold-light);
    text-shadow: 0 4px 20px rgba(212,175,55,.5);
    margin-bottom: 18px;
    animation: floatIn 1s ease forwards, titleGlow 2.4s 1.2s ease-in-out infinite;
}
@keyframes floatIn {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes titleGlow {
    0%, 100% { text-shadow: 0 4px 20px rgba(212,175,55,.5); }
    50%      { text-shadow: 0 4px 34px rgba(212,175,55,.9), 0 0 50px rgba(243,223,163,.5); }
}

.voucher-download-link {
    display: inline-block;
    position: relative;
    text-decoration: none;
    cursor: pointer;
    border-radius: 16px;
}
.voucher-download-link:hover .voucher-image,
.voucher-download-link:focus-visible .voucher-image {
    transform: scale(1.015);
}
.voucher-download-link:active .voucher-image {
    transform: scale(.99);
}

.download-badge {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 7;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(12,12,12,.72);
    border: 1px solid var(--gold-dark);
    color: var(--gold-light);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: .82rem;
    letter-spacing: .2px;
    opacity: 0;
    transform: translateY(6px);
    animation: badgeFadeIn .6s 2s ease forwards;
    pointer-events: none;
    backdrop-filter: blur(3px);
}
@keyframes badgeFadeIn {
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
    .download-badge { font-size: .74rem; padding: 6px 11px; right: 10px; bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .download-badge { animation: none; opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .voucher-image, .congrats-text { animation: none; opacity: 1; transform: none; }
    .voucher-wrap::after { display: none; }
}

footer.note {
    text-align: center;
    font-size: .78rem;
    color: var(--gold-dark);
    margin-top: 34px;
    opacity: .8;
}

@media (max-width: 480px) {
    .card { padding: 26px 20px; }
}

/* ============ Feestscène (confetti / ballonnen / slingers) ============ */

#partyStage {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.confetti-piece {
    position: absolute;
    top: -20px;
    border-radius: 2px;
    animation-name: confettiFall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    opacity: .9;
}
@keyframes confettiFall {
    from { transform: translateY(-20px) rotate(0deg); opacity: .95; }
    to   { transform: translateY(110vh) rotate(360deg); opacity: .6; }
}

.balloon {
    position: absolute;
    bottom: -140px;
    width: 46px;
    height: 58px;
    border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%;
    animation-name: balloonFloat;
    animation-timing-function: ease-in;
    animation-iteration-count: infinite;
    box-shadow: inset -6px -6px 12px rgba(0,0,0,.15), inset 6px 6px 14px rgba(255,255,255,.25);
}
.balloon-string {
    position: absolute;
    bottom: -60px;
    left: 50%;
    width: 1px;
    height: 60px;
    background: rgba(255,255,255,.35);
}
@keyframes balloonFloat {
    from { transform: translateY(0) translateX(0); }
    50%  { transform: translateY(-60vh) translateX(12px); }
    to   { transform: translateY(-125vh) translateX(-8px); }
}

.horn {
    position: absolute;
    bottom: -60px;
    animation-name: hornFloat;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}
@keyframes hornFloat {
    from { transform: translateY(0) rotate(-8deg); opacity: 0; }
    10%  { opacity: 1; }
    to   { transform: translateY(-115vh) rotate(8deg); opacity: 0; }
}

.streamer {
    position: absolute;
    top: -10px;
    width: 8px;
    height: 140px;
    border-radius: 0 0 8px 8px;
    clip-path: polygon(0 0,100% 0,100% 85%,50% 100%,0 85%);
    animation-name: streamerSway;
    animation-duration: 3.2s;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    transform-origin: top center;
    opacity: .85;
}
@keyframes streamerSway {
    0%, 100% { transform: rotate(-6deg); }
    50%      { transform: rotate(6deg); }
}

@media (prefers-reduced-motion: reduce) {
    .confetti-piece, .balloon, .horn, .streamer { animation: none; display: none; }
}

/* ============ Vuurwerk-canvas & spotlight ============ */

#fireworksCanvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    display: block;
}

.spotlight {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: conic-gradient(
        from 0deg at 50% 35%,
        rgba(212,175,55,.16),
        rgba(212,175,55,0) 25%,
        rgba(212,175,55,.10) 50%,
        rgba(212,175,55,0) 75%,
        rgba(212,175,55,.16)
    );
    animation: spotlightSpin 14s linear infinite;
    mix-blend-mode: screen;
}
@keyframes spotlightSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

#partyStage { z-index: 2; }

.voucher-content {
    position: relative;
    z-index: 5;
    text-align: center;
    padding: 20px;
}

.voucher-subtext {
    max-width: 600px;
    margin: 0 auto 26px;
}

.voucher-wrap {
    display: inline-block;
    transition: transform .15s ease-out;
    transform-style: preserve-3d;
}

.icon-btn {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 6;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--gold-dark);
    background: rgba(20,20,20,.6);
    color: var(--gold-light);
    font-size: 1.3rem;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: transform .15s ease;
}
.icon-btn:hover { transform: scale(1.08); }
.icon-btn.pulsed { animation: pulseOnce .4s ease; }
@keyframes pulseOnce {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* Belangrijk: NIET een generieke .replay-pulse{animation:...} gebruiken — dat
   zou de eigen (blijvende) animaties van de bon/titel overschrijven, waardoor
   ze terugvallen op hun opacity:0 beginstaat (het "verdwijnt uit het frame"-
   effect). Daarom herhalen we hier expliciet ALLE animaties die moeten
   blijven lopen, plus de nieuwe pulse erbovenop. */
.voucher-image.replay-pulse {
    animation: revealVoucher 0s forwards,
               voucherGlow 2.6s ease-in-out infinite,
               replayPop .7s cubic-bezier(.2,.9,.2,1.3);
}
.congrats-text.replay-pulse {
    animation: floatIn 0s forwards,
               titleGlow 2.4s ease-in-out infinite,
               replayPop .7s cubic-bezier(.2,.9,.2,1.3);
}
@keyframes replayPop {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.08); }
    100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .spotlight { animation: none; }
    #fireworksCanvas { display: none; }
}

@media (max-width: 480px) {
    .icon-btn { top: 10px; right: 10px; width: 40px; height: 40px; font-size: 1.1rem; }
}
