/* Zafran Arcade · winter theme. Loaded only when THEME=winter (the server injects it and sets
   <html data-theme="winter">). Removing it restores the default red brand look; nothing else changes.
   Brand accents stay: red #B23A3A / #740404 on a charcoal #1F1F24 base. */
html[data-theme="winter"] {
  --w-red: #B23A3A; --w-deep: #740404; --w-char: #1F1F24; --w-ink: #EAF2FA; --w-muted: #9FB3C8; --w-ice: #BFE3FF;
  --w-yard: clamp(110px, 24vh, 240px);
  --w-card: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  --w-hair: rgba(191,227,255,.18);
  background: var(--w-char);
}
html[data-theme="winter"] body {
  position: relative;
  min-height: 100dvh;
  background: radial-gradient(120% 80% at 50% 0%, #24324a 0%, #1a2233 45%, #1F1F24 100%) fixed !important;
  background-color: #1F1F24 !important;
  color: var(--w-ink);
}

/* ---- snow, frost, ground scene: always behind content, never interactive ---- */
#za-snow { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none;
  background: transparent !important; box-shadow: none !important; border-radius: 0 !important; } /* games style every <canvas> */
.za-frost { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  box-shadow: inset 0 0 120px 30px rgba(191,227,255,.10), inset 0 0 18px 2px rgba(191,227,255,.12); }
.za-yard { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: var(--w-yard); z-index: 0; pointer-events: none; overflow: hidden; }
.za-yard > svg.hills { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; display: block; }
.za-yard .actor { position: absolute; bottom: 6%; height: 42%; aspect-ratio: 60/90; }
.za-yard .actor svg { display: block; width: 100%; height: 100%; overflow: visible; }
.za-yard .s1 { left: 3%; bottom: 20%; } .za-yard .s2 { right: 3%; bottom: 16%; height: 50%; }
.za-yard .walk { animation: za-walk 40s linear infinite; }
.za-yard .walk svg { animation: za-bob .55s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.za-yard .walk.back { animation-name: za-walkback; animation-duration: 48s; animation-delay: -14s; }
.za-yard .walk.back svg { animation-name: za-bobflip; }
@keyframes za-walk { from { left: -10%; } to { left: 110%; } }
@keyframes za-walkback { from { left: 110%; } to { left: -10%; } }
@keyframes za-bob { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(-4%) rotate(4deg); } }
@keyframes za-bobflip { from { transform: scaleX(-1) translateY(0) rotate(-4deg); } to { transform: scaleX(-1) translateY(-4%) rotate(4deg); } }
.za-yard .roll { position: absolute; bottom: 5%; height: 46%; aspect-ratio: 2/1; animation: za-rollpath 22s linear infinite; animation-delay: -6s; }
.za-yard .roll svg { width: 100%; height: 100%; display: block; overflow: visible; }
.za-yard .roll .ball { transform-box: fill-box; transform-origin: 50% 100%; animation: za-grow 22s linear infinite; animation-delay: -6s; }
.za-yard .roll .pusher { transform-box: fill-box; transform-origin: 50% 100%; animation: za-push .5s ease-in-out infinite alternate; }
@keyframes za-rollpath { 0% { left: -20%; } 100% { left: 105%; } }
@keyframes za-grow { 0% { transform: scale(.35); } 100% { transform: scale(1); } }
@keyframes za-push { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
.za-yard .build { position: absolute; left: 58%; bottom: 14%; height: 56%; aspect-ratio: 3/2; }
.za-yard .build svg { width: 100%; height: 100%; display: block; overflow: visible; }
.za-yard .build .mid, .za-yard .build .head, .za-yard .build .hat, .za-yard .build .scarf { transform-box: fill-box; transform-origin: 50% 100%; }
.za-yard .build .mid { animation: za-dropMid 14s ease-out infinite; }
.za-yard .build .head { animation: za-dropHead 14s ease-out infinite; }
.za-yard .build .hat { animation: za-dropHat 14s ease-out infinite; }
.za-yard .build .scarf { animation: za-showScarf 14s linear infinite; }
.za-yard .build .lifter-arm { transform-box: fill-box; transform-origin: 10% 90%; animation: za-lift 14s ease-in-out infinite; }
.za-yard .build .whole { animation: za-reset 14s linear infinite; }
@keyframes za-dropMid { 0%, 15% { transform: translateY(-140%); opacity: 0; } 16% { opacity: 1; } 28%, 100% { transform: translateY(0); opacity: 1; } }
@keyframes za-dropHead { 0%, 38% { transform: translateY(-200%); opacity: 0; } 39% { opacity: 1; } 50%, 100% { transform: translateY(0); opacity: 1; } }
@keyframes za-dropHat { 0%, 60% { transform: translateY(-300%); opacity: 0; } 61% { opacity: 1; } 68%, 100% { transform: translateY(0); opacity: 1; } }
@keyframes za-showScarf { 0%, 72% { opacity: 0; } 76%, 100% { opacity: 1; } }
@keyframes za-lift { 0%, 10% { transform: rotate(0); } 20% { transform: rotate(-55deg); } 28%, 34% { transform: rotate(0); } 44% { transform: rotate(-60deg); } 50%, 56% { transform: rotate(0); } 64% { transform: rotate(-70deg); } 70%, 100% { transform: rotate(0); } }
@keyframes za-reset { 0%, 90% { opacity: 1; } 97%, 100% { opacity: 0; } }
@media (max-width: 600px) { .za-yard .s1, .za-yard .walk.back { display: none; } .za-yard .build { left: 52%; } }
@media (prefers-reduced-motion: reduce) {
  #za-snow { display: none; }
  .za-yard .walk, .za-yard .walk svg, .za-yard .roll, .za-yard .roll .ball, .za-yard .roll .pusher, .za-yard .build * { animation: none !important; }
  .za-yard .walk { left: 22%; } .za-yard .walk.back { left: 80%; } .za-yard .roll { left: 6%; }
  .za-yard .build .mid, .za-yard .build .head, .za-yard .build .hat, .za-yard .build .scarf { opacity: 1; }
}

/* ---- hub ---- */
/* The hub scrolls normally in winter mode so cards keep their art and the yard sits at the page bottom. */
html[data-theme="winter"]:has(body[data-za-scene="full"]) { height: auto; overflow: auto; }
html[data-theme="winter"] body[data-za-scene="full"] { height: auto; overflow-x: hidden; overflow-y: visible; }
html[data-theme="winter"] body[data-za-scene="full"] .wrap { height: auto; min-height: 100dvh; }
html[data-theme="winter"] body[data-za-scene="full"] .content { flex: none; }
html[data-theme="winter"] body[data-za-scene="full"] .grid { flex: none; grid-template-rows: auto auto; }
html[data-theme="winter"] body[data-za-scene="full"] .art { flex: none; height: clamp(110px, 19vh, 260px); }
html[data-theme="winter"] body[data-za-scene="full"] .lb { min-height: 360px; }
html[data-theme="winter"] body[data-za-scene="full"] .wrap { position: relative; z-index: 1; padding-bottom: calc(var(--w-yard) + 12px); }
html[data-theme="winter"] .hero h1 span { color: var(--w-ice); }
html[data-theme="winter"] .hero p { color: var(--w-muted); }
html[data-theme="winter"] a.card { position: relative; background: var(--w-card), rgba(20,26,38,.55); border-color: var(--w-hair); box-shadow: 0 10px 30px rgba(0,0,0,.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
html[data-theme="winter"] a.card:hover, html[data-theme="winter"] a.card:focus-visible { border-color: rgba(191,227,255,.55); box-shadow: 0 14px 36px rgba(0,0,0,.4), 0 0 24px rgba(191,227,255,.18); }
html[data-theme="winter"] a.card::before { content: ""; position: absolute; left: 14px; right: 14px; top: -1px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--w-red), var(--w-deep)); z-index: 2; }
html[data-theme="winter"] a.card .art { background: radial-gradient(ellipse at 50% 15%, #2c3a55, #151b28 80%); border-bottom-color: var(--w-hair); }
html[data-theme="winter"] a.card .kicker { color: var(--w-ice); }
html[data-theme="winter"] a.card .desc { color: #d5e1ee; }
html[data-theme="winter"] a.card .play { background: var(--w-red); color: #fff; border-radius: 10px; }
html[data-theme="winter"] a.card .badge { background: var(--w-red); color: #fff; }
html[data-theme="winter"] .tags li { background: rgba(191,227,255,.08); border-color: var(--w-hair); }
html[data-theme="winter"] .pill, html[data-theme="winter"] .me .btnlink, html[data-theme="winter"] .me button.ghost { color: var(--w-ink); border-color: var(--w-hair); background: rgba(15,20,30,.55); }
html[data-theme="winter"] .me button:not(.ghost) { background: var(--w-red); color: #fff; }
html[data-theme="winter"] .lb { background: rgba(15,20,30,.85); border-color: rgba(191,227,255,.15); }
html[data-theme="winter"] .lb-status, html[data-theme="winter"] .lb-table th { color: var(--w-muted); }
html[data-theme="winter"] .lb-table tr:nth-child(even) td { background: rgba(191,227,255,.05); }
html[data-theme="winter"] .lb-table tr.top1 .rk::after { color: var(--w-ice); }
html[data-theme="winter"] .lb-table .r { color: var(--w-ice); }
html[data-theme="winter"] .lb-tabs button { background: rgba(191,227,255,.06); border-color: var(--w-hair); }
html[data-theme="winter"] .lb-tabs button[aria-selected="true"] { background: var(--w-red); border-color: var(--w-red); color: #fff; }
html[data-theme="winter"] .lb-closed { border-color: var(--w-red); background: rgba(10,14,22,.9); }

/* ---- game pages: background, snow and frost only; playfields keep their own colours ---- */
html[data-theme="winter"] .app { position: relative; z-index: 1; }
html[data-theme="winter"] .app > .top .stat { background: rgba(15,20,30,.6); border-color: var(--w-hair); }
html[data-theme="winter"] .overlay .card { background: rgba(16,22,34,.9); border-color: var(--w-hair); }
html[data-theme="winter"] .overlay .card::before { content: ""; position: absolute; left: 18px; right: 18px; top: -1px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--w-red), var(--w-deep)); }
html[data-theme="winter"] .overlay .card p { color: #d5e1ee; }
html[data-theme="winter"] .overlay .btn { background: var(--w-red); color: #fff; }
html[data-theme="winter"] .overlay .btn.alt { background: transparent; color: #fff; border: 1px solid var(--w-hair); }

/* ---- shared modals (sign-up, finish, leave, pause) and the closed banner ---- */
html[data-theme="winter"] .za-card { background: linear-gradient(180deg, rgba(36,50,74,.97), rgba(22,28,40,.98)); border-color: var(--w-hair); position: relative; z-index: 1;
  box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 30px rgba(191,227,255,.10); }
html[data-theme="winter"] .za-card::before { content: ""; position: absolute; left: 18px; right: 18px; top: -1px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--w-red), var(--w-deep)); }
html[data-theme="winter"] .za-card p, html[data-theme="winter"] .za-card label, html[data-theme="winter"] .za-stat span { color: #c9d7e6; }
html[data-theme="winter"] .za-card input[type=text], html[data-theme="winter"] .za-card input[type=email] { background: rgba(191,227,255,.07); border-color: rgba(191,227,255,.3); }
html[data-theme="winter"] .za-btn { background: var(--w-red); border-color: var(--w-red); color: #fff; }
html[data-theme="winter"] .za-btn.alt { background: transparent; border-color: rgba(191,227,255,.4); color: #fff; }
html[data-theme="winter"] .za-btn.link { background: none; color: var(--w-ice); }
html[data-theme="winter"] .za-pb { background: var(--w-ice); color: #10233a; }
html[data-theme="winter"] .za-stat { background: rgba(10,14,22,.5); border-color: var(--w-hair); }
html[data-theme="winter"] .za-bar i { background: linear-gradient(90deg, #8fc6f0, var(--w-ice)); }
html[data-theme="winter"] .za-tiers span { color: #c9d7e6; border-color: var(--w-hair); }
html[data-theme="winter"] .za-modal { background: rgba(10,14,22,.62); }
html[data-theme="winter"] .za-back { background: rgba(15,20,30,.6); border-color: var(--w-hair); }
html[data-theme="winter"] .za-closed { background: rgba(10,14,22,.95); border-bottom-color: var(--w-red); }
html[data-theme="winter"] .za-closed a { color: var(--w-ice); }
html[data-theme="winter"] .za-pause .za-card { padding: 14px 16px; }

/* ---- admin ---- */
html[data-theme="winter"] body.admin main { position: relative; z-index: 1; }
html[data-theme="winter"] body.admin section { background: rgba(15,20,30,.85); border-color: var(--w-hair); }
html[data-theme="winter"] body.admin button:not(.alt):not(.danger) { background: var(--w-red); color: #fff; }
