/*
 * VZR Christmas v2, refreshed: "Frosted candy night" on top of the CURRENT site (gaming layer g2-*).
 * Base theme for EVERY page. Loaded after the live css and gaming2/*.css, scoped to body.xmas2, nothing live is edited.
 *
 * Look: midnight-indigo frosted glass, gold + ice hairlines, snowflake corners, candy-cane trims, icicles under the nav bar,
 * a snow drift above the footer, Santa hats. Colours come from the gaming layer's own tokens (--g2-*) wherever it has one,
 * so the structure, spacing and behaviour stay exactly the live ones.
 *
 * Perf: no blur, no big filters, all art is small SVG / CSS gradients. January: delete the <link>/<script> lines and the body class.
 */
:root {
  --xm-gold: #f1ce86;
  --xm-gold-hi: #fff0c4;
  --xm-gold-line: rgba(241, 206, 134, .5);
  --xm-ice: #a9d6ff;
  --xm-ice-soft: #d4eaff;
  --xm-red: #e3203f;
  --xm-red-hi: #ff5468;
  --xm-red-deep: #8d1124;
  --xm-pine: #2fa468;
  --xm-night: #060914;
  --xm-glass: linear-gradient(168deg, rgba(36, 48, 100, .78), rgba(13, 17, 42, .86) 52%, rgba(17, 11, 32, .9));
  --xm-line: rgba(169, 214, 255, .22);
  --xm-candy: repeating-linear-gradient(-45deg, #e3203f 0 7px, #fff8f2 7px 14px);
  --xm-row: linear-gradient(180deg, #232f63 0, #121a3d 100%);
  --xm-cell: linear-gradient(180deg, #16204a 0, #0b1130 100%);
}

/* ---------- tokens: the gaming layer reads these, so one block re-colours the whole site ---------- */
body.g2.xmas2 {
  --g2-ink: #eef3fb;
  --g2-muted: #c0cfe4;
  --g2-dim: #a2b4d0;
  --g2-violet: #8fbcff;
  --g2-violet-hi: #c6e0ff;
  --g2-violet-deep: #1c2f66;
  --g2-glow: 96, 156, 240;
  --g2-sky-light: radial-gradient(46% 42% at 82% 3%, rgba(150, 200, 255, .20), transparent 72%);
  --g2-corner-tl: url("../xmas2/art/corner-tl.svg");
  --g2-corner-tr: url("../xmas2/art/corner-tr.svg");
  --g2-corner-bl: url("../xmas2/art/corner-bl.svg");
  --g2-corner-br: url("../xmas2/art/corner-br.svg");
  --g2-emb-divider: url("../xmas2/art/divider.svg");
  --g2-frame:
    linear-gradient(180deg, rgba(255, 255, 255, .07), transparent 64px) padding-box,
    radial-gradient(100% 70% at 50% 0, rgba(var(--g2-glow), .30), transparent 72%) padding-box,
    linear-gradient(180deg, #1e2a5a 0, #121a3e 46%, #0a0f28 100%) padding-box,
    linear-gradient(140deg, #fff0c4 0, #b9965a 16%, #6479ad 34%, #cde7ff 50%, #6479ad 66%, #b9965a 84%, #fff0c4 100%) border-box;
  --g2-frame-hi:
    linear-gradient(180deg, rgba(255, 255, 255, .10), transparent 64px) padding-box,
    radial-gradient(100% 70% at 50% 0, rgba(var(--g2-glow), .42), transparent 72%) padding-box,
    linear-gradient(180deg, #27356f 0, #16204a 46%, #0c1230 100%) padding-box,
    linear-gradient(140deg, #fff0c4 0, #e1be78 18%, #9ec6ff 50%, #e1be78 82%, #fff0c4 100%) border-box;
  --g2-depth: inset 0 0 0 1px rgba(190, 224, 255, .10), inset 0 0 30px rgba(var(--g2-glow), .16),
    0 14px 34px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .55);
  background: var(--xm-night);
}
html[data-g2-time="day"] body.g2.xmas2 { --g2-glow: 120, 176, 245; }
body.xmas2 ::selection { background: var(--xm-red); color: #fff; }

/* ---------- page backdrop: the approved Christmas splash, veiled in indigo ---------- */
body.g2.xmas2::after {
  background:
    var(--g2-sky-light),
    radial-gradient(48% 32% at 88% 4%, rgba(255, 92, 124, .12), transparent 72%),
    linear-gradient(180deg, rgba(5, 8, 24, .34) 0, rgba(5, 8, 24, .70) 52%, rgba(5, 8, 24, .90) 100%),
    url("../assets/xmas-banner.webp?v=6") center top / cover no-repeat,
    var(--xm-night);
}
body.g2.xmas2.art-page, body.g2.xmas2.guide-stage, body.g2.xmas2.vzr-v2 { background: var(--xm-night); }
@media (max-width: 800px) {
  body.g2.xmas2::after {
    background:
      var(--g2-sky-light),
      linear-gradient(180deg, rgba(5, 8, 24, .40) 0, rgba(5, 8, 24, .78) 46%, rgba(5, 8, 24, .93) 100%),
      url("../assets/xmas-banner.webp?v=6") 62% 0 / cover no-repeat,
      var(--xm-night);
  }
}
body.g2.xmas2.guide-stage .wrap {
  background: linear-gradient(180deg, rgba(10, 14, 38, .94), rgba(6, 9, 26, .97));
  box-shadow: 0 0 0 1px rgba(241, 206, 134, .3), 0 0 0 5px rgba(5, 8, 24, .8), 0 24px 60px rgba(0, 0, 0, .75);
}

/* ---------- top bar + icicles ---------- */
body.g2.xmas2 .topbar {
  z-index: 20; overflow: visible;
  background: linear-gradient(180deg, rgba(22, 32, 76, .96), rgba(8, 12, 32, .96));
  box-shadow: 0 1px 0 rgba(255, 236, 190, .34), 0 2px 0 rgba(0, 0, 0, .8), 0 14px 30px rgba(0, 0, 0, .55);
}
body.g2.xmas2 .topbar::after {
  left: 0; right: 0; top: 100%; bottom: auto; height: 30px; pointer-events: none;
  background: url("art/icicles.svg") repeat-x left top / 240px 30px;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .35));
}
body.g2.xmas2 .topbar nav a.nav-banner[aria-current] img {
  filter: drop-shadow(0 0 8px rgba(255, 224, 150, .9)) drop-shadow(0 0 16px rgba(160, 210, 255, .5)) brightness(1.14);
}
@media (hover: hover) and (pointer: fine) {
  body.g2.xmas2 .topbar nav a.nav-banner:hover img {
    filter: drop-shadow(0 0 8px rgba(255, 224, 150, .9)) drop-shadow(0 0 16px rgba(160, 210, 255, .5)) brightness(1.14);
  }
}
body.g2.xmas2 .topbar .logo img.wordmark { object-fit: contain; filter: drop-shadow(0 0 10px rgba(var(--g2-glow), .75)); }
@media (max-width: 1180px) { body.g2.xmas2 .topbar::after { height: 24px; background-size: 192px 24px; } }
@media (max-width: 700px) { body.g2.xmas2 .topbar::after { height: 20px; background-size: 160px 20px; } }

/* ---------- panels: the frame comes from the tokens above; add a candy-cane trim on the big ones ---------- */
body.g2.xmas2 :is(.lobby-board, .mi-chat, .mi-panel, .g2-quests)::after {
  content: ""; position: absolute; left: 22px; right: 22px; top: -2px; height: 4px; z-index: 5; pointer-events: none;
  border-radius: 0 0 5px 5px; background: var(--xm-candy); opacity: .94;
}
body.g2.xmas2 .mi-chat.is-fullscreen::after { display: none; }
body.g2.xmas2 .g2-panel-head h3::before {
  background: none; width: 14px; height: 14px; transform: none; box-shadow: none;
  -webkit-mask: url("art/sparkle.svg") center / contain no-repeat; mask: url("art/sparkle.svg") center / contain no-repeat;
  background-color: #ffe08a; filter: drop-shadow(0 0 5px rgba(255, 220, 140, .8));
}
body.g2.xmas2 .g2-panel-head p { color: var(--g2-muted); }

/* ---------- buttons: gold stays gold; the purple ones become candy red / frosted indigo ---------- */
body.g2.xmas2 :is(.g2-btn, .chapter-nav button, .log-open, .gold-links a, .log-more) { --b-top: #3a4f94; --b-bot: #17214d; --b-edge: #9cc4f5; }
body.g2.xmas2 :is(.g2-btn-gold, .gold-links a:not(.primary)) { --b-top: #f0cc84; --b-bot: #b5852f; --b-edge: #fff1c8; --b-text: #2a1706; }
body.g2.xmas2 :is(.g2-btn-violet, .gold-links a.primary) { --b-top: #d9263f; --b-bot: #7c1022; --b-edge: #ffb3c0; }
body.g2.xmas2 .g2-btn-ghost { --b-top: #26325f; --b-bot: #121a3a; --b-edge: #8fb4de; }
body.g2.xmas2 .g2-switch { background: #0f1636; border-color: rgba(169, 214, 255, .5); }
body.g2.xmas2 .g2-switch::after { background: linear-gradient(145deg, #e6f1ff, #8fa7c9); }
body.g2.xmas2 .g2-switch[aria-checked="true"] { background: linear-gradient(180deg, #d9263f, #7c1022); border-color: #ffb3c0; }
body.g2.xmas2 .g2-switch[aria-checked="true"]::after { background: linear-gradient(145deg, #fff0c4, #d6a64c); }
body.g2.xmas2 .g2-seg button { background: rgba(8, 12, 32, .85); }
body.g2.xmas2 .g2-seg button[aria-pressed="true"] { background: var(--g2-gold-btn); color: #2a1706; }
body.g2.xmas2 .g2-chip { background: rgba(8, 12, 32, .72); border-color: rgba(169, 214, 255, .4); }

/* ---------- tooltip ---------- */
body.xmas2 .g2-tip {
  background: linear-gradient(180deg, #1b2652 0, #090e28 100%); border-color: #e1be78;
  box-shadow: 0 0 0 1px #000, inset 0 0 0 1px rgba(190, 224, 255, .18), 0 12px 30px rgba(0, 0, 0, .8);
}
body.xmas2 .g2-tip-sub { color: #bcd2ef; }

/* ---------- settings gear: icy halo, a Santa hat, and the winter switches live in its panel ---------- */
body.g2.xmas2 .g2-dock-btn {
  background: radial-gradient(circle at 35% 30%, #35508f, #101a40 70%) padding-box, linear-gradient(145deg, #fff0c4, #8a6a3c 50%, #e6c387) border-box;
  overflow: visible;
}
body.g2.xmas2 .g2-dock-btn::before { background: radial-gradient(circle, rgba(170, 214, 255, .55) 0, rgba(120, 180, 255, .22) 46%, rgba(120, 180, 255, 0) 70%); }
body.g2.xmas2 .g2-dock-btn::after {
  content: ""; position: absolute; left: -7px; top: -14px; width: 26px; height: 22px; z-index: 3; pointer-events: none;
  background: url("art/santa-hat.svg") no-repeat center / contain; transform: rotate(-18deg); transform-origin: 20% 90%;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5));
}
body.g2.xmas2 .g2-dock-panel { background: var(--g2-frame); }
body.g2.xmas2 .g2-dock-title { color: var(--xm-gold); }
body.g2.xmas2 .g2-dock-row { border-top-color: rgba(169, 214, 255, .16); }
body.g2.xmas2 .g2-dock-row.xm-row b::before { content: "\2744"; margin-right: 6px; color: var(--xm-ice); }

/* ---------- footer: snow drift with a winter divider, Santa hat on the wordmark ---------- */
body.g2.xmas2 :is(footer, .site-footer) { margin-top: 84px; padding-top: 48px; isolation: isolate; }
body.g2.xmas2 :is(footer, .site-footer)::after {
  content: ""; position: absolute; left: 0; right: 0; top: -62px; height: 84px; z-index: 0; pointer-events: none;
  background: url("art/drift.svg") repeat-x left bottom / 520px 84px;
}
body.g2.xmas2 :is(footer, .site-footer)::before { z-index: 1; top: 26px; }
body.g2.xmas2 :is(footer, .site-footer) > * { position: relative; z-index: 1; }
body.g2.xmas2 .footer-brand { position: relative; display: block; width: fit-content; max-width: 100%; margin: 0 auto; }
body.g2.xmas2 .footer-brand::after {
  content: ""; position: absolute; left: -16px; top: -34px; width: 78px; height: 66px; pointer-events: none;
  background: url("art/santa-hat.svg") no-repeat center / contain; transform: rotate(-14deg); transform-origin: 20% 90%;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .5));
}
body.g2.xmas2 .footer-wordmark,
body.g2.xmas2 .topbar .logo img.wordmark { aspect-ratio: 900 / 150; object-fit: contain; }
body.g2.xmas2 .footer-wordmark { filter: drop-shadow(0 4px 14px rgba(var(--g2-glow), .7)); }
body.g2.xmas2 :is(footer, .site-footer) a:not(.footer-brand) { color: #ffb4bd; }
body.g2.xmas2 .site-footer .footer-also { color: #b8c8e0; }
body.g2.xmas2 .site-footer nav a, body.g2.xmas2 .g2-foot-nav a { color: #e9e0ca; }
body.g2.xmas2 .site-footer nav a:hover, body.g2.xmas2 .g2-foot-nav a:hover { color: #fff; border-bottom-color: var(--xm-gold-line); }
body.g2.xmas2 .site-footer small, body.g2.xmas2 .visit-count { color: #8fa4c4; }
body.g2.xmas2.art-page, body.g2.xmas2.guide-stage { display: flex; flex-direction: column; min-height: 100vh; }
body.g2.xmas2.art-page > .wrap, body.g2.xmas2.guide-stage > .wrap { flex: 0 0 auto; }
body.g2.xmas2.art-page > footer, body.g2.xmas2.guide-stage > footer { margin-top: auto; }

/* ---------- inner pages: the accents that were lilac / violet ---------- */
body.g2.xmas2 :is(.guide-title .eyebrow, .info-card .card-tag, .chapter-kicker) { color: #ff9fb0; }
body.g2.xmas2 :is(.guide-title .eyebrow, .info-card .card-tag, .chapter-kicker)::before { background: linear-gradient(135deg, #fff0c4, #e3203f); box-shadow: 0 0 8px rgba(255, 110, 130, .6); }
body.g2.xmas2 .guide-title h1 span { color: #ffb3c0; -webkit-text-fill-color: #ffb3c0; }
/* the live headings are gradient-filled text (transparent fill): a text-shadow would show through as a black fill, so glow with filter instead */
body.g2.xmas2 .guide-title h1, body.g2.xmas2 .info-card h1, body.g2.xmas2 .chapter-info h2 {
  background-image: linear-gradient(180deg, #ffffff 0, #ffe9b0 50%, #e4b45a 100%);
  filter: drop-shadow(0 2px 0 #000) drop-shadow(0 0 14px rgba(var(--g2-glow), .55));
}
body.g2.xmas2 .info-card.players h2 { background: none; filter: none; text-shadow: 0 2px 0 #000, 0 0 26px rgba(var(--g2-glow), .6); }
body.g2.xmas2 .info-card .credits-thanks { color: #d4eaff; text-shadow: 0 0 22px rgba(var(--g2-glow), .8); }
body.g2.xmas2 .info-card.players h2 { text-shadow: 0 2px 0 #000, 0 0 26px rgba(var(--g2-glow), .7); }
body.g2.xmas2 .credits-quiet { color: #eaf2ff; }
body.g2.xmas2 .notice {
  border-color: rgba(241, 206, 134, .55); border-left: 3px solid var(--xm-red);
  background: linear-gradient(180deg, #1d2756, #0f1636); color: #d9e4f2;
  box-shadow: inset 0 0 0 1px rgba(190, 224, 255, .08), inset 0 0 26px rgba(120, 180, 255, .07), 0 8px 22px rgba(0, 0, 0, .5);
}
body.g2.xmas2 .notice::before { color: #fff0c4; border-color: #e1be78; background: radial-gradient(circle at 35% 30%, #8d1124, #3a0912); text-shadow: 0 0 14px rgba(255, 210, 63, .9), 0 2px 0 #3a0912; }
body.g2.xmas2 .controlbar { border-color: rgba(169, 214, 255, .3); background: linear-gradient(180deg, #17214d, #0b1130); box-shadow: inset 0 0 0 1px rgba(190, 224, 255, .06), 0 6px 16px rgba(0, 0, 0, .45); }
body.g2.xmas2 .screen-search { border-color: rgba(241, 206, 134, .5); background: #070b22; }
body.g2.xmas2 .toggle:not(.active), body.g2.xmas2 .menu-switch { border-color: rgba(169, 214, 255, .3); background: #101842; }
body.g2.xmas2 .topic { border-color: rgba(241, 206, 134, .32); background: linear-gradient(180deg, #243166, #101738); }
body.g2.xmas2 .topic:hover { border-color: #cde7ff; background: linear-gradient(180deg, #31428a, #16204d); }
body.g2.xmas2 .topic[aria-current="true"] { border-color: var(--xm-gold-hi); background: linear-gradient(100deg, #8d1124, #141c42); box-shadow: inset 0 0 12px rgba(227, 32, 63, .35), 0 0 10px rgba(227, 32, 63, .4); }
body.g2.xmas2 :is(.topic img, .chapter-head > img) { border-color: #e1be78; }
body.g2.xmas2 .chapter-head { border-color: rgba(241, 206, 134, .5); background: linear-gradient(95deg, #3a2a58 0, #121a42 72%); }
body.g2.xmas2 .chapter-lead { background: linear-gradient(180deg, #121a42, #0a0f2a); border-color: rgba(169, 214, 255, .22); color: #dbe6f4; }
body.g2.xmas2 .chapter-notes { border-color: rgba(241, 206, 134, .5); background: linear-gradient(130deg, #2d2748, #11183c); }
body.g2.xmas2 .chapter-notes p:before { color: #ff9fb0; }
body.g2.xmas2 .step-no { background: var(--xm-red); border-color: var(--xm-gold-hi); }
body.g2.xmas2 .step-card .card-header { border-bottom-color: rgba(241, 206, 134, .3); }
body.g2.xmas2 .tip, body.g2.xmas2 .step-points li { background: rgba(255, 255, 255, .05); border-left-color: var(--xm-red-hi); }
body.g2.xmas2 .log-nav a { border-color: rgba(241, 206, 134, .5); background: linear-gradient(180deg, #243166, #101738); }
body.g2.xmas2 .log-nav a:hover { border-color: #cde7ff; }
body.g2.xmas2 .thumb.selected { border-color: var(--xm-gold-hi); box-shadow: 0 0 8px rgba(255, 224, 150, .45); }
body.g2.xmas2 .topic-list, body.g2.xmas2 .shot-strip { scrollbar-color: #3c63a8 #0b1230; }
body.g2.xmas2 a { text-decoration-color: rgba(241, 206, 134, .5); }

/* ---------- phone alerts page ---------- */
body.g2.xmas2.g2-phone::after {
  background:
    var(--g2-sky-light),
    linear-gradient(180deg, rgba(5, 8, 24, .5), rgba(5, 8, 24, .86) 40%, rgba(5, 8, 24, .96)),
    url("../assets/xmas-banner.webp?v=6") 60% 0 / cover no-repeat, var(--xm-night);
}
body.xmas2.g2-phone header { position: relative; }
body.xmas2.g2-phone header::after {
  content: ""; position: absolute; left: 12px; right: 12px; top: 100%; height: 22px; pointer-events: none;
  background: url("art/icicles.svg") repeat-x left top / 180px 22px;
}
body.xmas2.g2-phone h1 { margin-top: 26px; }
body.xmas2.g2-phone .tag { display: block; }
body.xmas2.g2-phone :is(.row, .link-timer, .link-help, .install) { border-color: rgba(241, 206, 134, .5); background: linear-gradient(180deg, #1c2655, #0f1636); }
body.xmas2.g2-phone .tag input, body.xmas2.g2-phone .quiet-times input { background: #070b22; border-color: rgba(241, 206, 134, .5); }
body.xmas2.g2-phone .ico { background: radial-gradient(circle at 35% 30%, #35508f, #101a40); }
body.xmas2.g2-phone .switch input:checked + i { background: linear-gradient(180deg, #d9263f, #7c1022); border-color: #ffb3c0; }
body.xmas2.g2-phone :is(.pills button, .roles button, .actions button) { border-color: rgba(241, 206, 134, .5); background: linear-gradient(180deg, #243166, #101738); }
body.xmas2.g2-phone :is(.pills button.on, .roles button.on) { background: var(--g2-gold-btn); border-color: #fff1c8; color: #2a1706; }
body.xmas2.g2-phone #save { background: linear-gradient(180deg, #d9263f, #7c1022); border-color: #ffb3c0; color: #fff4dc; }
body.xmas2.g2-phone .link-bar { background: #15203f; }
body.xmas2.g2-phone .link-bar span { background: linear-gradient(90deg, var(--xm-red), var(--xm-gold-hi)); }
body.xmas2.g2-phone a { color: #ffb4bd; }
body.xmas2.g2-phone header span { color: var(--xm-ice); }

/* ---------- snow canvas (xmas2-fx.js) ---------- */
canvas.xm-snow { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
html.g2-calm canvas.xm-snow { display: none; }
body.mk-chat-fs-open canvas.xm-snow { z-index: 1; }
@media (prefers-reduced-motion: reduce) { canvas.xm-snow { display: none; } }

/* Phone: the same Christmas pieces as on a wide screen. The gaming layer hides the settings gear, and the
   guide stylesheet hides the nav tiles under 700px. Both come back while winter is on. */
@media (max-width: 800px) {
  body.g2.xmas2 .g2-dock { display: block !important; }
}
@media (max-width: 700px) {
  body.g2.xmas2 .topbar nav a.nav-banner { display: inline-flex; }
}
