:root {
  --red: #D92B25; --red-dark: #A51E19;
  --gold: #FFC531; --gold-dark: #D99A00;
  --cream: #FFF8EC; --cocoa: #2B1D14; --text: #3D2B1E;
  --rule-bg: #FFF1C7; --rule-line: #E0B43A; --outline: #CDB894;
  --green: #2E8B4F; --ok-bg: #E3F5E8;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--cream); color: var(--cocoa); }
body { font-family: 'Fredoka', 'Nunito', system-ui, sans-serif; font-weight: 500; font-size: 16px; line-height: 1.5; }
p { margin: 0; }
button { font: inherit; }

/* page shell */
.page { max-width: 420px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding: 24px 16px 16px; display: flex; flex-direction: column; gap: 16px; }
.page > .countdown { margin-top: auto; padding-top: 24px; }

/* splash */
body.splash-on { background: var(--red-dark); }
.splash { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; }
.splash .ring { position: relative; width: 180px; height: 180px; display: grid; place-items: center; }
.splash .wreath { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 4s linear infinite; }
.splash .santa { position: relative; width: 100px; height: 100px; }
@keyframes spin { to { transform: rotate(360deg); } }
.splash .name { position: absolute; bottom: 65px; left: 0; right: 0; text-align: center; font-weight: 600; font-size: 28px; color: var(--cream); }

/* header */
.head { display: flex; align-items: center; gap: 24px; margin-bottom: 8px; }
.head img { width: 100px; height: 100px; flex: none; }
.head h1 { margin: 0; font-weight: 600; font-size: 28px; line-height: 1.2; color: var(--cocoa); }

/* mission rules */
.mission { display: flex; flex-direction: column; gap: 8px; font-size: 16px; line-height: 24px; color: var(--cocoa); margin-bottom: 8px; }
.rules-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rules-row h2 { margin: 0; font-weight: 600; font-size: 24px; line-height: 1.2; color: var(--cocoa); }
.mission .rule { display: flex; gap: 8px; font-weight: 500; }
.mission .rule .e { flex: none; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }

/* cards */
.card { background: #fff; border: 3px solid var(--outline); border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.card.tight { padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: relative; }
.card-head h2 { margin: 0; font-weight: 600; font-size: 24px; line-height: 1.2; color: var(--cocoa); }
.pill { border-radius: 999px; padding: 4px 12px; font-weight: 600; font-size: 16px; line-height: 1.2; white-space: nowrap; }
.pill.dark { background: var(--cocoa); color: var(--cream); }

/* item rows */
.items { display: flex; flex-direction: column; gap: 24px; }
.item { display: flex; align-items: center; gap: 16px; }
.num { flex: none; width: 24px; height: 24px; border-radius: 24px; background: var(--rule-bg); border: 1px solid var(--rule-line); display: grid; place-items: center; font-weight: 600; font-size: 11.25px; color: var(--cocoa); }
.item .det { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-weight: 500; line-height: 1.2; }
.item .t { font-size: 17px; color: var(--cocoa); overflow-wrap: anywhere; }
.item .m { font-size: 16px; color: var(--text); overflow-wrap: anywhere; }
.dossier { display: flex; align-items: center; gap: 16px; }
.dossier img { width: 64px; height: 64px; flex: none; }
.dossier .facts { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dossier .facts p { display: flex; align-items: baseline; gap: 8px; color: var(--cocoa); line-height: 1.2; }
.dossier .facts b { flex: none; font-weight: 600; font-size: 14px; text-transform: uppercase; }
.dossier .facts span { font-weight: 400; font-size: 18px; overflow-wrap: anywhere; }
.empty { border: 2px dashed var(--outline); border-radius: 16px; padding: 16px; text-align: center; font-weight: 500; font-size: 16px; line-height: 24px; color: var(--cocoa); }

/* buttons */
.btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; padding: 12px 18px; border: 0; border-radius: 16px; font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 24px; line-height: 32px; letter-spacing: .96px; text-transform: uppercase; cursor: pointer; text-decoration: none; text-align: center; background: var(--red); color: #fff; border-bottom: 5px solid var(--red-dark); }
.btn.gold { background: var(--gold); color: var(--cocoa); border-bottom-color: var(--gold-dark); }
.btn.white { background: #fff; color: var(--cocoa); border: 3px solid var(--outline); border-bottom-width: 5px; }
.btn.sm { min-height: 44px; padding: 8px 14px; border-radius: 12px; font-size: 16px; line-height: 24px; letter-spacing: .64px; border-bottom-width: 4px; }
.btn.white.sm { border-width: 3px 3px 4px; }
.btn.auto { width: auto; flex: none; }
.btn.icon { padding: 8px 10px; }
.btn.icon svg { display: block; }
.btn:active:not([disabled]) { transform: translateY(2px); }
.btn[disabled] { opacity: .5; cursor: default; }

/* item screen */
.bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-bottom: 22px; }
.bar h1 { margin: 0; font-weight: 600; font-size: 28px; line-height: 1.2; text-align: center; }
.bar .r { justify-self: end; }
.bar .l { justify-self: start; }
label, .label { display: block; font-weight: 600; font-size: 19px; line-height: 1.2; color: var(--cocoa); }
.field { display: flex; flex-direction: column; gap: 6px; }
.linkbox { display: flex; flex-direction: column; gap: 6px; }
.linkbtns { display: flex; gap: 6px; }
.linkbtns .btn { flex: 1; }
textarea.grow { display: block; min-height: 54px; resize: none; overflow: hidden; overflow-wrap: anywhere; }
textarea.grow:not(:focus) { max-height: calc(3.6em + 30px); }
.linkwrap { position: relative; }
.linkpeek { position: absolute; top: 0; left: 0; right: 0; min-height: 54px; background: #fff; border: 3px solid var(--outline); border-radius: 14px; padding: 12px 14px; font-weight: 400; font-size: 19px; line-height: 1.2; color: var(--text); pointer-events: none; }
.linkpeek span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; max-height: 3.6em; overflow: hidden; overflow-wrap: anywhere; }
.linkpeek[hidden], textarea.grow:focus + .linkpeek { display: none; }
textarea.name { min-height: 112px; resize: none; }
input[type=text], input[type=url], textarea { width: 100%; font: inherit; font-weight: 400; font-size: 19px; line-height: 1.2; color: var(--text); background: #fff; border: 3px solid var(--outline); border-radius: 14px; padding: 12px 14px; min-height: 54px; }
.money { position: relative; }
.money span { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); font-weight: 500; font-size: 19px; color: var(--cocoa); pointer-events: none; }
.money input { padding-left: 30px; }
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--outline); opacity: 1; }
input:focus, textarea:focus { outline: none; border-color: var(--red); }
.note { display: flex; gap: 4px; align-items: flex-start; border-radius: 14px; padding: 10px 12px; font-weight: 500; font-size: 17px; line-height: 1.2; margin: 0 0 -6px; }
.note img { width: 24px; height: 24px; flex: none; }
.note p { padding-top: 2px; }
.note.ok { background: var(--ok-bg); border: 3px solid var(--green); color: var(--green); }
.note.fail { background: var(--outline); border: 3px solid var(--cocoa); color: var(--text); }
.note.bad { background: #FFE3E0; border: 3px solid var(--red); color: var(--red-dark); }
.note.wait { background: #fff; border: 3px solid var(--outline); color: var(--cocoa); align-items: center; gap: 8px; }
.err { color: var(--red-dark); font-weight: 600; font-size: 17px; }

/* admin */
.stats { display: flex; justify-content: center; gap: 24px; text-align: center; }
.stats b { display: block; font-weight: 600; font-size: 24px; color: var(--cocoa); }
.stats span { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 17px; color: var(--text); }
.person { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; }
.person .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.person .nm { font-weight: 600; font-size: 21px; color: var(--cocoa); }
.person .st { font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 15px; color: var(--text); text-align: right; }
.person .acts { display: flex; gap: 8px; }
.person .acts .btn { flex: 1; }
.actions { display: flex; flex-direction: column; gap: 12px; padding-top: 10px; }
.group-name { font-weight: 600; font-size: 21px; text-align: center; }

/* countdown */
.countdown { font-variant-numeric: tabular-nums; display: flex; justify-content: center; gap: 8px; font-size: 16px; color: var(--red-dark); white-space: nowrap; }
.countdown b { font-weight: 500; }
.countdown b.sec { display: inline-block; min-width: 2.2ch; text-align: right; }
.countdown span { font-weight: 400; letter-spacing: .64px; }

/* misc */
.spin { width: 28px !important; height: 28px !important; flex: none; animation: spin 1.5s linear infinite; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--cocoa); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 18px; z-index: 9; }
.msg { text-align: center; }
.msg h2 { margin: 0; font-weight: 600; font-size: 24px; }
@media (prefers-reduced-motion: reduce) { .splash .wreath, .spin { animation: none; } }

/* first reveal: redaction bars slide off each fact, then items fade up */
.revealing .dossier img { animation: fadein .4s ease-out both; }
.revealing .facts span { position: relative; }
.revealing .facts span::after { content: ''; position: absolute; inset: 1px -3px; background: var(--cocoa); border-radius: 3px; transform-origin: right center; animation: unredact .4s ease-in-out both; }
.revealing .facts p:nth-child(1) span::after { animation-delay: .15s; }
.revealing .facts p:nth-child(2) span::after { animation-delay: .3s; }
.revealing .facts p:nth-child(3) span::after { animation-delay: .45s; }
.revealing .items, .revealing .empty { animation: fadein .4s ease-out .75s both; }
@keyframes unredact { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .revealing .dossier img, .revealing .facts span::after, .revealing .items, .revealing .empty { animation: none !important; } .revealing .facts span::after { display: none; } }
