/* Advent calendar + Giveaways + Pirate Token (pages advent.html and giveaway.html) */
:root { --red: #ff4d5e; --red2: #c81d3a; --pine: #1fbf74; --pine2: #0f7a49; --snow: #eaf6ff; }

.ev-main { max-width: 1180px; margin: 0 auto; padding: 96px 16px 40px; }
.ev-hero { text-align: center; padding: 10px 0 26px; position: relative; }
.ev-hero .kicker { display: inline-block; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; font-size: 13px; color: #3a2400; background: linear-gradient(90deg, #ffd96a, #ffb02e); padding: 5px 14px; border-radius: 99px; margin: 0 0 14px; }
.ev-hero h1 { font-size: clamp(40px, 7vw, 76px); margin: 0 0 10px; }
.ev-hero .lead { color: var(--muted); font-size: clamp(16px, 2.2vw, 19px); max-width: 720px; margin: 0 auto 18px; }
.ev-pills { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 0 0 6px; }
.ev-pill { background: var(--card); border: 2px solid var(--line); border-radius: 99px; padding: 7px 15px; font-weight: 800; font-size: 14.5px; color: #ddd4ff; }
.ev-pill b { color: var(--gold); }
.ev-cd { display: inline-flex; gap: 8px; margin: 14px 0 4px; }
.ev-cd span { min-width: 74px; background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 8px 6px 6px; text-align: center; }
.ev-cd b { display: block; font: 34px "Lilita One", sans-serif; color: var(--text); line-height: 1; }
.ev-cd small { color: var(--muted); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.ev-sec { margin: 34px 0; }
.ev-sec > h2 { font-size: clamp(28px, 4vw, 40px); text-align: center; margin: 0 0 6px; }
.ev-sec > .sub { text-align: center; color: var(--muted); margin: 0 auto 22px; max-width: 680px; }
.ev-card { background: var(--bg2); border: 2px solid var(--line); border-radius: 24px; padding: 22px; }
.ev-note { color: var(--muted); font-size: 13.5px; }
.ev-note a, .ev-main a.lnk { color: var(--cyan); }
.btn-gold { color: #3a2400; background: linear-gradient(180deg, #ffe08a, #ffb02e); box-shadow: 0 5px 0 #a8650b, 0 10px 24px rgba(255, 176, 46, .35); }
.btn-gold:hover { transform: translateY(-2px); }
.btn-gold:active { transform: translateY(3px); box-shadow: 0 2px 0 #a8650b; }
.btn-red { color: #fff; background: linear-gradient(180deg, #ff6b7a, var(--red2)); box-shadow: 0 5px 0 #7a0f22, 0 10px 24px rgba(255, 77, 94, .35); }
.btn-red:hover { transform: translateY(-2px); }
.btn[disabled] { opacity: .55; cursor: default; transform: none; filter: grayscale(.4); }

/* ---------- snow (advent page only, very light) ---------- */
.snow { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.snow i { position: absolute; top: -10px; width: var(--s); height: var(--s); border-radius: 50%; background: #fff; opacity: var(--o); animation: fall var(--d) linear var(--w) infinite; }
@keyframes fall { to { transform: translate(var(--x), 105vh); } }
.ev-main, footer { position: relative; z-index: 1; }

/* ---------- advent doors ---------- */
.advent-wrap { position: relative; background: radial-gradient(ellipse at 50% 0%, rgba(255, 77, 94, .18), transparent 60%), linear-gradient(180deg, #1a0f45, #120a30); border: 3px solid #3a2687; border-radius: 30px; padding: clamp(14px, 3vw, 30px); box-shadow: 0 30px 80px rgba(0, 0, 0, .5), inset 0 0 0 6px rgba(255, 201, 77, .06); }
.advent-wrap::before { content: ""; position: absolute; left: 24px; right: 24px; top: -14px; height: 26px; background: repeating-linear-gradient(90deg, var(--red) 0 22px, #fff 22px 44px, var(--pine) 44px 66px, #fff 66px 88px); border-radius: 99px; opacity: .9; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); }
.doors { display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(8px, 1.6vw, 16px); }
@media (max-width: 900px) { .doors { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 520px) { .doors { grid-template-columns: repeat(3, 1fr); } }
.door { --c1: #ff6b7a; --c2: #c81d3a; --rb: #ffd96a; position: relative; aspect-ratio: 1 / 1.08; border: 0; padding: 0; border-radius: 18px; cursor: pointer; perspective: 600px; background: none; color: #fff; font: inherit; }
.door.v1 { --c1: #3be08d; --c2: #0f7a49; --rb: #fff; }
.door.v2 { --c1: #ffd96a; --c2: #d98a00; --rb: #ff4d5e; }
.door.v3 { --c1: #8ab4ff; --c2: #2b5fd9; --rb: #fff; }
.door.v4 { --c1: #c49bff; --c2: #6b2fd6; --rb: #ffd96a; }
.door .box, .door .inside { position: absolute; inset: 0; border-radius: 18px; }
.door .inside { background: radial-gradient(circle at 50% 40%, #2a1a66, #140a2e); border: 2px dashed rgba(255, 201, 77, .4); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; text-align: center; }
.door .inside .ri { font-size: clamp(24px, 4vw, 34px); line-height: 1; }
.door .inside .rt { font-weight: 800; font-size: clamp(10.5px, 1.3vw, 13px); color: #ffe7a6; line-height: 1.15; }
.door .inside .rd { font: 13px "Lilita One", sans-serif; color: var(--muted); }
.door .box { background: linear-gradient(160deg, var(--c1), var(--c2)); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .22), 0 8px 18px rgba(0, 0, 0, .35); transform-origin: left center; transition: transform .7s cubic-bezier(.3, 1.3, .5, 1), opacity .5s; overflow: hidden; }
.door .box::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 14%; transform: translateX(-50%); background: var(--rb); opacity: .9; }
.door .box::after { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 14%; transform: translateY(-50%); background: var(--rb); opacity: .9; }
.door .num { position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 54%; aspect-ratio: 1; border-radius: 50%; background: #fff; color: var(--c2); display: flex; align-items: center; justify-content: center; font: clamp(22px, 3.6vw, 38px) "Lilita One", sans-serif; box-shadow: 0 4px 0 rgba(0, 0, 0, .25); }
.door .tag { position: absolute; z-index: 3; left: 50%; bottom: 7%; transform: translateX(-50%); font-weight: 800; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; background: rgba(13, 8, 32, .78); color: #fff; padding: 2px 9px; border-radius: 99px; white-space: nowrap; box-shadow: none; margin: 0; }
.door.locked .box { filter: saturate(.35) brightness(.7); }
.door.locked { cursor: default; }
.door.locked .tag::before { content: "\1F512  "; }
.door.ready .box { animation: wiggle 2.6s ease-in-out infinite; }
.door.today .box { box-shadow: 0 0 0 3px #fff, 0 0 28px 6px rgba(255, 217, 106, .65), inset 0 -6px 0 rgba(0, 0, 0, .22); }
.door.today .tag { background: var(--gold); color: #3a2400; }
.door.ready:hover .box { transform: rotateY(-14deg); }
.door.opened .box { transform: rotateY(-108deg); opacity: 0; pointer-events: none; }
.door.opened .inside { border-style: solid; border-color: rgba(255, 201, 77, .5); }
.door.opening .box { animation: shake .45s ease-in-out; }
@keyframes wiggle { 0%, 86%, 100% { transform: rotate(0); } 89% { transform: rotate(-3deg); } 92% { transform: rotate(3deg); } 95% { transform: rotate(-2deg); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-5px) rotate(-3deg); } 40% { transform: translateX(5px) rotate(3deg); } 60% { transform: translateX(-4px) rotate(-2deg); } 80% { transform: translateX(3px) rotate(1deg); } }
.door .star { position: absolute; z-index: 4; top: -6px; right: -6px; font-size: 20px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }

.adv-progress { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 20px 0 0; }
.adv-bar { height: 12px; border-radius: 99px; background: var(--card); border: 2px solid var(--line); overflow: hidden; max-width: 520px; margin: 14px auto 0; }
.adv-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--gold), var(--pine)); border-radius: 99px; transition: width .6s; }

/* reward dialog */
.rw { text-align: center; }
.rw h3 { font-size: 30px; margin: 0 0 4px; }
.rw .rw-sub { color: var(--muted); margin: 0 0 14px; }
.rw-part { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 14px; margin: 0 0 10px; text-align: left; display: flex; gap: 12px; align-items: center; }
.rw-part .ri { font-size: 34px; flex: 0 0 auto; }
.rw-part b { display: block; font: 19px "Lilita One", sans-serif; letter-spacing: .4px; }
.rw-part span { color: var(--muted); font-size: 14px; }
.rw-part img { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; }
.code-box { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.code-box code { flex: 1; font: 20px "Lilita One", monospace; letter-spacing: 2px; background: #0d0820; border: 2px dashed var(--gold); color: var(--gold); padding: 6px 10px; border-radius: 10px; text-align: center; }
.code-box button { padding: 8px 12px; font-size: 14px; }
.rw-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 95; overflow: hidden; }
.confetti i { position: absolute; width: 10px; height: 14px; border-radius: 3px; animation: conf 1.6s cubic-bezier(.2, .7, .4, 1) forwards; }
@keyframes conf { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; } }

.owner-plan { margin-top: 26px; border-color: var(--gold); }
.owner-plan h3 { margin: 0 0 8px; color: var(--gold); }
.owner-plan ol { columns: 2; column-gap: 30px; margin: 0; padding-left: 22px; color: #ddd4ff; font-size: 14px; }
.owner-plan li { break-inside: avoid; padding: 3px 0; }
@media (max-width: 700px) { .owner-plan ol { columns: 1; } }

/* ---------- giveaways ---------- */
.gw { position: relative; display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; background: radial-gradient(circle at 0% 0%, rgba(255, 201, 77, .14), transparent 50%), var(--bg2); border: 2px solid var(--line); border-radius: 28px; padding: clamp(18px, 3vw, 30px); margin: 0 0 22px; }
.gw.open { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(255, 201, 77, .08), 0 24px 60px rgba(0, 0, 0, .4); }
@media (max-width: 860px) { .gw { grid-template-columns: 1fr; } }
.gw-status { display: inline-block; font-weight: 800; font-size: 12.5px; letter-spacing: 1.5px; text-transform: uppercase; padding: 4px 12px; border-radius: 99px; background: var(--card); color: var(--muted); }
.gw.open .gw-status { background: var(--green); color: #052a16; }
.gw.soon .gw-status { background: var(--blue); color: #fff; }
.gw h2 { text-align: left; font-size: clamp(30px, 4vw, 42px); margin: 10px 0 6px; display: flex; align-items: center; gap: 10px; }
.gw h2 img { width: 52px; height: 52px; }
.gw .blurb { color: #ddd4ff; margin: 0 0 14px; }
.places { list-style: none; padding: 0; margin: 0 0 16px; }
.places li { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 14px; background: var(--card); margin-bottom: 7px; font-weight: 800; }
.places li .md { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 17px "Lilita One", sans-serif; background: #3a2687; flex: 0 0 auto; }
.places li:nth-child(1) .md { background: linear-gradient(180deg, #ffe08a, #e0a100); color: #3a2400; }
.places li:nth-child(2) .md { background: linear-gradient(180deg, #f0f4ff, #a9b4d0); color: #222; }
.places li:nth-child(3) .md { background: linear-gradient(180deg, #ffc08a, #b0642a); color: #2a1200; }
.places li.won { outline: 2px solid var(--gold); }
.places li small { margin-left: auto; color: var(--gold); font-weight: 800; }
.gw-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 14px; }
@media (max-width: 520px) { .gw-stats { grid-template-columns: repeat(2, 1fr); } }
.gw-stats div { background: var(--card); border-radius: 14px; padding: 10px 8px; text-align: center; }
.gw-stats b { display: block; font: 24px "Lilita One", sans-serif; color: var(--text); }
.gw-stats small { color: var(--muted); font-weight: 800; font-size: 12px; }
.gw-stats .mine b { color: var(--gold); }
.gw-time { color: var(--muted); font-weight: 800; margin: 0 0 12px; }
.gw-time b { color: var(--text); font: 20px "Lilita One", sans-serif; letter-spacing: .5px; }
.tasks { list-style: none; padding: 0; margin: 0; }
.tasks li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--card); margin-bottom: 8px; border: 2px solid transparent; }
.tasks li.done { border-color: rgba(61, 220, 132, .45); }
.tasks .ck { width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; background: #2a1a66; color: var(--muted); font-weight: 800; }
.tasks li.done .ck { background: var(--green); color: #052a16; }
.tasks .tx { flex: 1; min-width: 0; }
.tasks .tx b { display: block; font-weight: 800; }
.tasks .tx span { color: var(--muted); font-size: 13.5px; }
.tasks .pts { font: 18px "Lilita One", sans-serif; color: var(--gold); white-space: nowrap; }
.tasks .btn { padding: 8px 14px; font-size: 15px; }
.tasks h3 { margin: 0 0 10px; font-size: 22px; }
.ref-row { display: flex; gap: 6px; margin-top: 6px; }
.ref-row input { flex: 1; min-width: 0; background: #0d0820; border: 2px solid var(--line); color: var(--text); border-radius: 10px; padding: 6px 8px; font: 700 13px "Nunito", sans-serif; }

/* chest + pirate token */
.chest-sec { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: stretch; }
@media (max-width: 860px) { .chest-sec { grid-template-columns: 1fr; } }
.chest-card { text-align: center; background: radial-gradient(circle at 50% 35%, rgba(255, 201, 77, .22), transparent 60%), linear-gradient(180deg, #1b1048, #120a30); border: 2px solid #5a3fb0; border-radius: 28px; padding: 24px 18px; }
.chest { width: min(260px, 70%); margin: 0 auto 6px; display: block; overflow: visible; }
.chest .lid { transform-origin: 30px 92px; transition: transform .5s cubic-bezier(.3, 1.5, .5, 1); }
.chest.open .lid { transform: rotate(-38deg) translate(-6px, -10px); }
.chest.shake { animation: shake .5s ease-in-out 2; }
.chest .glow { opacity: 0; transition: opacity .4s; }
.chest.open .glow { opacity: 1; }
.roll-num { font: clamp(40px, 7vw, 62px) "Lilita One", sans-serif; letter-spacing: 1px; color: var(--text); min-height: 1.1em; margin: 4px 0 0; font-variant-numeric: tabular-nums; }
.roll-num.win { color: var(--gold); text-shadow: 0 0 30px rgba(255, 201, 77, .8); }
.roll-msg { color: var(--muted); font-weight: 800; min-height: 1.4em; margin: 2px 0 14px; }
.chest-btns { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.chest-btns small { color: var(--muted); font-weight: 800; }
.token-card { background: var(--bg2); border: 2px solid var(--line); border-radius: 28px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.token-top { display: flex; gap: 16px; align-items: center; }
.coin { width: 92px; height: 92px; flex: 0 0 auto; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3c4, #ffc94d 40%, #b87a00 100%); box-shadow: inset 0 0 0 6px rgba(120, 70, 0, .35), 0 0 30px rgba(255, 201, 77, .45); display: flex; align-items: center; justify-content: center; font-size: 46px; animation: spin 6s linear infinite; }
@keyframes spin { 0%, 100% { transform: rotateY(0); } 50% { transform: rotateY(180deg); } }
.token-top h3 { margin: 0; font-size: 28px; }
.token-top p { margin: 4px 0 0; color: #ddd4ff; }
.odds { font: 40px "Lilita One", sans-serif; color: var(--gold); line-height: 1; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-stats div { background: var(--card); border-radius: 14px; padding: 10px 6px; text-align: center; }
.mini-stats b { display: block; font: 21px "Lilita One", sans-serif; }
.mini-stats small { color: var(--muted); font-weight: 800; font-size: 12px; }
.math { width: 100%; border-collapse: collapse; font-size: 14px; }
.math td { padding: 6px 8px; border-bottom: 1px solid rgba(58, 38, 135, .6); }
.math td:last-child { text-align: right; color: var(--gold); font-weight: 800; }
.lucky { list-style: none; margin: 0; padding: 0; }
.lucky li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 10px; font-weight: 800; }
.lucky li:nth-child(odd) { background: rgba(255, 255, 255, .03); }
.lucky li b { color: var(--gold); font-family: "Lilita One", sans-serif; letter-spacing: .5px; }
.token-card h4 { margin: 0 0 6px; font: 18px "Lilita One", sans-serif; letter-spacing: .5px; }

/* fairness */
.fair { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; counter-reset: st; }
@media (max-width: 860px) { .fair { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .fair { grid-template-columns: 1fr; } }
.fair div { background: var(--bg2); border: 2px solid var(--line); border-radius: 18px; padding: 16px; position: relative; }
.fair div::before { counter-increment: st; content: counter(st); position: absolute; top: -12px; left: 14px; width: 28px; height: 28px; border-radius: 50%; background: var(--violet); display: flex; align-items: center; justify-content: center; font: 16px "Lilita One", sans-serif; }
.fair b { display: block; margin: 6px 0 4px; font: 18px "Lilita One", sans-serif; letter-spacing: .4px; }
.fair span { color: var(--muted); font-size: 14px; }
.hash { font: 700 12px monospace; word-break: break-all; color: var(--cyan); background: #0d0820; border-radius: 8px; padding: 6px 8px; display: block; margin-top: 6px; }
.verify-out { margin-top: 10px; font-weight: 800; }
.verify-out.ok { color: var(--green); }
.verify-out.bad { color: #ff8a9a; }

/* prizes */
.prize { border: 2px solid var(--gold); background: radial-gradient(circle at 100% 0%, rgba(255, 201, 77, .2), transparent 55%), var(--bg2); border-radius: 26px; padding: 22px; margin: 0 0 22px; }
.prize h3 { margin: 0 0 4px; font-size: 28px; color: var(--gold); }
.prize > p { margin: 0 0 14px; color: #ddd4ff; }
.claim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.claim { background: var(--card); border: 2px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.claim img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: #120a30; }
.claim img.ic { object-fit: contain; padding: 14px; }
.claim div { padding: 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.claim b { font-size: 14px; line-height: 1.2; }
.claim .btn { padding: 8px 10px; font-size: 14.5px; margin-top: auto; }
.claim.got { border-color: var(--green); }

.past { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.past .ev-card { padding: 16px; }
.past h3 { margin: 0 0 4px; font-size: 20px; }
.past p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.rules { max-width: 820px; margin: 0 auto; }
.rules li { color: #ddd4ff; margin: 0 0 6px; }

@media (prefers-reduced-motion: reduce) {
  .snow, .confetti { display: none; }
  .door .box, .coin, .chest.shake { animation: none !important; }
}

/* phones: grid columns may shrink below their content (no sideways scroll) */
.gw, .chest-sec { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.gw > div, .chest-sec > div { min-width: 0; }
@media (max-width: 860px) { .gw, .chest-sec { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .ev-hero .kicker { letter-spacing: 1px; font-size: 12px; } .gw h2 img { width: 40px; height: 40px; } }
.coin b { font: 52px "Lilita One", sans-serif; color: #7a4a00; text-shadow: 0 2px 0 #fff3c4; }

/* ---------- pictures (img/gw/, made with unelte/poze_giveaway.py) ---------- */
.ico { display: inline-block; width: 1.35em; height: 1.35em; object-fit: contain; vertical-align: -0.32em; margin-right: 6px; }
.ico-lg { display: inline-block; width: 46px; height: 46px; object-fit: contain; vertical-align: middle; margin-right: 10px; }

.ev-pill .ico { width: 26px; height: 26px; margin: -6px 6px -4px -4px; vertical-align: middle; }
.md-img { width: 40px; height: 40px; object-fit: contain; flex: 0 0 auto; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .4)); }
.places li { min-height: 52px; }
.gw h2 img { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); }
.gw-stats .ico { display: block; width: 34px; height: 34px; margin: 0 auto 2px; }
.gw-time .ico { width: 24px; height: 24px; }
.tasks .ck { width: 46px; height: 46px; background: none !important; position: relative; }
.tasks .ck .tk { width: 46px; height: 46px; object-fit: contain; }
.tasks .ck .ok { position: absolute; right: -6px; bottom: -6px; width: 22px; height: 22px; }
.tasks li.done .tk { opacity: .9; }
.fair div { padding-top: 22px; }
.fair-ic { width: 58px; height: 58px; object-fit: contain; display: block; margin: 0 0 4px; filter: drop-shadow(0 5px 8px rgba(0, 0, 0, .4)); }
.prize h3 { display: flex; align-items: center; }

/* chest: two pictures, closed and open */
.chest { position: relative; width: min(300px, 74%); aspect-ratio: 509 / 560; margin: 0 auto 4px; }
.chest img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity .25s, transform .45s cubic-bezier(.3, 1.6, .5, 1); filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .5)); }
.chest .c-open { opacity: 0; transform: scale(.92); }
.chest.open .c-open { opacity: 1; transform: scale(1.04); }
.chest.open .c-closed { opacity: 0; }
.coin-img { width: 104px; height: 104px; flex: 0 0 auto; object-fit: contain; animation: spin 6s linear infinite; filter: drop-shadow(0 6px 12px rgba(255, 201, 77, .35)); }

/* big picture behind the top of the giveaway page */
.page-bg { position: absolute; top: 0; left: 0; right: 0; height: min(760px, 92vh); overflow: hidden; z-index: 0; pointer-events: none; }
.page-bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.page-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 32%, rgba(13, 8, 32, .55), rgba(13, 8, 32, .15) 60%), linear-gradient(180deg, rgba(13, 8, 32, .35), rgba(13, 8, 32, 0) 25%, rgba(13, 8, 32, 0) 60%, var(--bg) 100%); }
body[data-page="giveaway"] .ev-hero { padding-bottom: 60px; }
body[data-page="giveaway"] .ev-hero h1, body[data-page="giveaway"] .ev-hero .lead { text-shadow: 0 3px 14px rgba(0, 0, 0, .7); }
body[data-page="giveaway"] .ev-hero .lead { color: #e6defc; }
@media (max-width: 700px) { .page-bg { height: 100svh; } .page-bg img { object-position: center top; } }
@media (prefers-reduced-motion: reduce) { .coin-img { animation: none; } }

/* ---------- advent pictures (img/adv/, made with unelte/poze_advent.py) ---------- */
body[data-page="advent"] .ev-hero h1, body[data-page="advent"] .ev-hero .lead { text-shadow: 0 3px 14px rgba(0, 0, 0, .7); }
body[data-page="advent"] .ev-hero .lead { color: #e6defc; }
body[data-page="advent"] .ev-hero { padding-bottom: 50px; }
.advent-wrap { margin-top: 30px; background: linear-gradient(180deg, rgba(26, 15, 69, .92), rgba(18, 10, 48, .95)); }
.advent-wrap::before { display: none; }
.garland { position: absolute; left: -2%; width: 104%; max-width: none; top: -34px; height: auto; z-index: 3; pointer-events: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); }
.doors { padding-top: 22px; }
.deco { position: absolute; z-index: 4; pointer-events: none; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .5)); }
.deco.d1 { width: 64px; top: -70px; left: 50%; transform: translateX(-50%); }
.deco.d2 { width: 60px; bottom: -26px; left: -22px; transform: rotate(-12deg); }
.deco.d3 { width: 66px; bottom: -30px; right: -20px; transform: rotate(8deg); }
.deco.d4 { width: 76px; top: -40px; left: -24px; transform: rotate(-18deg); }
@media (max-width: 700px) { .deco.d2, .deco.d3 { width: 44px; } .deco.d4 { width: 52px; top: -32px; left: -10px; } .deco.d1 { width: 48px; top: -56px; } .garland { top: -22px; } }

.door { aspect-ratio: .9; perspective: none; display: flex; align-items: flex-end; justify-content: center; overflow: visible; }
.door .box, .door .inside { display: none; }
.door .dwrap { position: relative; height: 100%; aspect-ratio: var(--ar); container-type: inline-size; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1), filter .25s; }
.door .dwrap img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .45)); }
.door .num { width: auto; height: auto; aspect-ratio: auto; background: none; box-shadow: none; border-radius: 0; left: var(--tx); top: var(--ty); transform: translate(-50%, -50%); font-size: 21cqw; color: #2a1366; text-shadow: none; line-height: 1; }
.door .tag { bottom: -4px; z-index: 5; }
.door.locked .dwrap { filter: saturate(.35) brightness(.62); }
.door.locked .box { filter: none; }
.door.ready .dwrap { animation: wiggle 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
.door.ready .box { animation: none; }
.door.today .dwrap { filter: drop-shadow(0 0 14px rgba(255, 217, 106, .9)); }
.door.today .box { box-shadow: none; }
.door.ready:hover .dwrap { transform: scale(1.06) rotate(-2deg); }
.door.opening .dwrap { animation: shake .45s ease-in-out; }
.door.opened .dwrap { opacity: .9; }
.door.opened .float { position: absolute; z-index: 4; left: 50%; top: 2%; transform: translateX(-50%); width: 46%; animation: bob 2.4s ease-in-out infinite; }
.door.opened .float .ri-img { width: 100%; height: auto; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .5)); }
.door.opened .rt { position: absolute; z-index: 5; left: 50%; bottom: -4px; transform: translateX(-50%); white-space: nowrap; font-weight: 800; font-size: clamp(10px, 1.2vw, 12.5px); color: #3a2400; background: var(--gold); padding: 2px 9px; border-radius: 99px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.door.missed { cursor: default; }
.door.missed .dwrap { filter: saturate(.7); }
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -8%); } }
.rw-part .ri .ri-img, .rw-part .ri-img { width: 44px; height: 44px; object-fit: contain; flex: 0 0 auto; }
.ev-hero .kicker .ico { width: 18px; height: 18px; vertical-align: -3px; }
@media (prefers-reduced-motion: reduce) { .door .dwrap, .door.opened .float { animation: none !important; } }
.door .num { font-size: 25cqw; }
.door.locked .dwrap { filter: saturate(.55) brightness(.78); }
.door.opened .rt { white-space: normal; text-align: center; line-height: 1.15; width: max-content; max-width: 112%; }
.ev-main { overflow-x: clip; }
@media (max-width: 440px) {
  .ev-cd { display: flex; width: 100%; max-width: 340px; }
  .ev-cd span { min-width: 0; flex: 1; padding: 7px 2px 5px; }
  .ev-cd b { font-size: 28px; }
  .ev-cd small { font-size: 10.5px; letter-spacing: .5px; }
}
/* the garland keeps its shape; the doors start below it */
.garland { top: -3.2%; }
.advent-wrap { padding-top: max(34px, calc(10.5% - 18px)); }
.doors { padding-top: 0; }
.door.locked .dwrap { filter: saturate(.45) brightness(.66); }
/* door numbers sit exactly in the middle of the white tag (measured on each picture) */
.door .num { font-size: var(--fs, 22cqw); transform: translate(-50%, -47%); letter-spacing: 0; }
.door.locked .dwrap { filter: none; }
.door.locked .dwrap img { filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .45)) saturate(.9); }
.door.ready:not(.today) .dwrap img { filter: drop-shadow(0 0 10px rgba(255, 255, 255, .35)) drop-shadow(0 8px 10px rgba(0, 0, 0, .45)); }
.locks { margin-top: 14px; text-align: center; color: var(--muted); font-size: 13px; }
.locks summary { cursor: pointer; font-weight: 800; display: inline-block; }
.locks #fair-hashes { text-align: left; max-width: 760px; margin: 10px auto 0; }

/* ---------- more snow: big drawn snowflakes + gingerbread men hopping behind the calendar (advent) ---------- */
.snow b { position: absolute; top: -40px; width: var(--s); height: var(--s); opacity: var(--o); background: url(../img/adv/snowflake.webp) center / contain no-repeat;
  animation: fallspin var(--d) linear var(--w) infinite; filter: drop-shadow(0 0 4px rgba(255, 255, 255, .5)); }
@keyframes fallspin { to { transform: translate(var(--x), 108vh) rotate(var(--r)); } }
.gingers { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.gingers span { position: absolute; left: 0; width: var(--g); opacity: var(--o); animation: walk-ltr var(--t) linear var(--w) infinite; }
.gingers span.rtl { animation-name: walk-rtl; }
.gingers span.rtl img { transform: scaleX(-1); }
.gingers img { display: block; width: 100%; animation: hop var(--h) cubic-bezier(.3, 0, .7, 1) infinite alternate; transform-origin: 50% 100%;
  filter: drop-shadow(0 10px 10px rgba(0, 0, 0, .45)); }
.gingers span.rtl img { animation-name: hop-flip; }
@keyframes walk-ltr { from { transform: translateX(-120px); } to { transform: translateX(calc(100vw + 120px)); } }
@keyframes walk-rtl { from { transform: translateX(calc(100vw + 120px)); } to { transform: translateX(-120px); } }
@keyframes hop { 0% { transform: translateY(0) scale(1.08, .9) rotate(-6deg); } 18% { transform: translateY(-10%) scale(.96, 1.05) rotate(-2deg); }
  100% { transform: translateY(-120%) scale(1, 1) rotate(8deg); } }
@keyframes hop-flip { 0% { transform: scaleX(-1) translateY(0) scale(1.08, .9) rotate(-6deg); } 18% { transform: scaleX(-1) translateY(-10%) scale(.96, 1.05) rotate(-2deg); }
  100% { transform: scaleX(-1) translateY(-120%) scale(1, 1) rotate(8deg); } }
/* the gingerbread on the calendar corner does a little hop too */
.deco.d3 { animation: cornerhop 3.2s ease-in-out infinite; }
@keyframes cornerhop { 0%, 70%, 100% { transform: rotate(8deg) translateY(0); } 78% { transform: rotate(-4deg) translateY(-22px); } 86% { transform: rotate(10deg) translateY(0); } 90% { transform: rotate(6deg) translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .gingers, .snow b { display: none; } .deco.d3 { animation: none; } }
