/*
 * VZR Christmas v2, refreshed: LOBBY BOARD in winter dress (home page). Pure CSS: the gaming layer's g2-board.js already tags
 * every row (data-g2 = filled | open | reserved | closed | blank), gives it its colour (--c) and the host / you marks.
 *
 *   FILLED    a glossy bauble in the player's colour, hanging from a garland
 *   OPEN      a dashed ghost bauble; still the live "Hold the slot" button
 *   RESERVED  a wrapped gift in the slot colour; a candle beside the countdown burns down with the real time left
 *   CLOSED    a frozen ball under a frosty stripe
 *   MAP       the lobby minimap becomes a snow globe
 *
 * Nothing about the markup, the numbers or the behaviour changes; take this file out and the board is the live one again.
 */

/* ---------- header: live line, plaques, bulbs ---------- */
body.g2.xmas2 .lobby-live { color: var(--xm-ice); }
body.g2.xmas2 .wc3-meta-cell {
  border-color: rgba(169, 214, 255, .34); background: var(--xm-cell);
  box-shadow: inset 0 1px 0 rgba(190, 224, 255, .10), inset 0 0 0 1px rgba(0, 0, 0, .5), inset 0 -12px 22px rgba(0, 0, 0, .35);
}
body.g2.xmas2 .wc3-meta-cell::before { width: 4px; background: repeating-linear-gradient(180deg, #e3203f 0 6px, #fff8f2 6px 12px); border-radius: 0 3px 3px 0; }
body.g2.xmas2 .wc3-meta-label { color: #9fd0ff; }
body.g2.xmas2 .g2-xp { gap: 4px; }
body.g2.xmas2 .g2-xp i { height: 10px; border-radius: 999px; background: #0c1334; border: 1px solid #3a4b82; }
body.g2.xmas2 .g2-xp i.on { border-color: rgba(255, 255, 255, .85); }
body.g2.xmas2 .g2-xp i.on:nth-child(4n + 1) { background: radial-gradient(circle at 35% 30%, #ff9aa8, #e3203f); box-shadow: 0 0 8px rgba(255, 70, 100, .7); }
body.g2.xmas2 .g2-xp i.on:nth-child(4n + 2) { background: radial-gradient(circle at 35% 30%, #ffeeb0, #f0a516); box-shadow: 0 0 8px rgba(255, 200, 70, .7); }
body.g2.xmas2 .g2-xp i.on:nth-child(4n + 3) { background: radial-gradient(circle at 35% 30%, #a9f2c6, #1f9a5f); box-shadow: 0 0 8px rgba(70, 220, 140, .7); }
body.g2.xmas2 .g2-xp i.on:nth-child(4n) { background: radial-gradient(circle at 35% 30%, #bfe0ff, #2f7fe0); box-shadow: 0 0 8px rgba(90, 170, 255, .7); }
@keyframes xm-twinkle { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.45); } }
body.g2.xmas2 .g2-xp i.on { animation: xm-twinkle 2.6s ease-in-out infinite; }
body.g2.xmas2 .g2-xp i.on:nth-child(2n) { animation-delay: -1.3s; }
body.g2.xmas2 .g2-idle-note { border-color: rgba(241, 206, 134, .5); background: linear-gradient(180deg, #1d2756, #0f1636); }
body.g2.xmas2 .g2-idle-note > .g2-ico { color: #bfe0ff; filter: drop-shadow(0 0 8px rgba(150, 200, 255, .7)); }
body.g2.xmas2 .g2-idle-copy span { color: #d2e2f6; }
body.g2.xmas2 .lobby-board[data-g2-phase="idle"] .wc3-meta-cell strong::after { color: #9db4d4; }

/* ---------- snow globe instead of the minimap frame ---------- */
body.g2.xmas2 .g2-map { padding-bottom: 14px; }
body.g2.xmas2 .g2-map-frame {
  padding: 12px; border: 2px solid transparent; border-radius: 50%; overflow: visible;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, .30) 0, rgba(255, 255, 255, 0) 34%) padding-box,
    radial-gradient(circle at 50% 56%, #243d86 0, #0a1236 74%) padding-box,
    linear-gradient(145deg, #fff0c4, #7d6446 45%, #cde7ff) border-box;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, .8), 0 8px 18px rgba(0, 0, 0, .55), 0 0 24px rgba(var(--g2-glow), .38);
}
body.g2.xmas2 .g2-map-svg { border-radius: 50%; }
/* the snow base the globe stands on, with the name plate */
body.g2.xmas2 .g2-map-frame::after {
  content: ""; position: absolute; left: 12%; right: 12%; bottom: -13px; height: 20px; z-index: -1; border-radius: 10px 10px 14px 14px;
  background: linear-gradient(180deg, #8d1124, #4a0814); box-shadow: 0 4px 8px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 190, 200, .4);
}
body.g2.xmas2 .g2-map-frame::before {
  content: ""; position: absolute; inset: 9px; border-radius: 50%; pointer-events: none; z-index: 2;
  background:
    radial-gradient(2px 2px at 18% 24%, #fff, transparent 60%), radial-gradient(1.6px 1.6px at 64% 12%, #fff, transparent 60%),
    radial-gradient(2px 2px at 82% 36%, #fff, transparent 60%), radial-gradient(1.6px 1.6px at 30% 62%, #fff, transparent 60%),
    radial-gradient(2px 2px at 74% 70%, #fff, transparent 60%), radial-gradient(1.6px 1.6px at 50% 40%, #fff, transparent 60%),
    radial-gradient(2px 2px at 12% 80%, #fff, transparent 60%), radial-gradient(1.6px 1.6px at 88% 86%, #fff, transparent 60%);
  background-size: 100% 100%; animation: xm-globe-snow 5s linear infinite;
}
@keyframes xm-globe-snow { from { transform: translateY(-5%); opacity: .55; } 50% { opacity: 1; } to { transform: translateY(5%); opacity: .55; } }
body.g2.xmas2 .g2-map-tag {
  top: auto; bottom: -9px; z-index: 3; color: #fff0c4; background: none; box-shadow: none; text-shadow: 0 1px 2px #000; letter-spacing: .2em;
}
body.g2.xmas2 .g2-mm-dot { fill: #1b2a62; stroke: #5b72b8; }
body.g2.xmas2 .g2-mm-dot[data-s="closed"] { fill: #243a78; stroke: #8fb4e8; }
body.g2.xmas2 .g2-mm-dot[data-s="blank"] { fill: #1c2c68; stroke: #4b64aa; }

/* ---------- role headers ---------- */
body.g2.xmas2 .lobby-board .wc3-team h3 { position: relative; color: #fff6e4; }
body.g2.xmas2 .lobby-board .wc3-team h3::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -3px; height: 3px; border-radius: 3px; background: var(--xm-candy); opacity: .85; pointer-events: none;
}
body.g2.xmas2 .g2-team-count { background: rgba(5, 8, 24, .78); border-color: rgba(241, 206, 134, .55); }

/* ---------- slot rows ---------- */
body.g2.xmas2 .lobby-board .wc3-team :is(.wc3-filled, .wc3-open) {
  border-color: rgba(241, 206, 134, .42); background: var(--xm-row);
  box-shadow: inset 0 1px 0 rgba(190, 224, 255, .12), inset 0 -1px 0 rgba(0, 0, 0, .65), 0 2px 0 rgba(0, 0, 0, .4);
}
@supports (background: color-mix(in srgb, red 10%, transparent)) {
  body.g2.xmas2 .lobby-board .wc3-team :is(.wc3-filled, .wc3-open)[data-g2="filled"],
  body.g2.xmas2 .lobby-board .wc3-team :is(.wc3-filled, .wc3-open)[data-g2="open"],
  body.g2.xmas2 .lobby-board .wc3-team :is(.wc3-filled, .wc3-open)[data-g2="reserved"] {
    background: linear-gradient(90deg, color-mix(in srgb, var(--row-c) 20%, transparent) 0, transparent 44%), var(--xm-row);
  }
}
/* the colour strip on the left becomes a garland across the top */
body.g2.xmas2 .lobby-board .wc3-team :is(.wc3-filled, .wc3-open)::before { width: 2px; opacity: .55; box-shadow: 0 0 8px var(--row-c); }
body.g2.xmas2 .lobby-board .wc3-team :is(.wc3-filled, .wc3-open)[data-g2="filled"]::after,
body.g2.xmas2 .lobby-board .wc3-team :is(.wc3-filled, .wc3-open)[data-g2="closed"]::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; z-index: 0; pointer-events: none;
  background: url("art/strand.svg") repeat-x center top / 72px 8px; opacity: .85;
}
/* the number sits on the bauble */
body.g2.xmas2 .lobby-board .wc3-swatch {
  width: 25px; height: 25px; transform: none; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .75); margin-top: 3px;
  background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .95) 0 7%, var(--row-c) 30%, color-mix(in srgb, var(--row-c) 52%, #000) 100%) !important;
  box-shadow: 0 0 12px var(--row-c), inset 0 -3px 5px rgba(0, 0, 0, .35);
}
body.g2.xmas2 .lobby-board .wc3-swatch::after { inset: 2px 5px auto 5px; height: 7px; border-radius: 50%; background: linear-gradient(180deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, 0)); }
body.g2.xmas2 .lobby-board .wc3-swatch::before {
  content: ""; position: absolute; left: 50%; top: -6px; width: 9px; height: 6px; margin-left: -4.5px; border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, #fff0c4, #b9965a); box-shadow: 0 -1px 0 rgba(0, 0, 0, .5);
}
body.g2.xmas2 .lobby-board .wc3-num { margin-top: 3px; }

/* open slot: a ghost bauble */
body.g2.xmas2 .lobby-board [data-g2="open"] {
  border-style: dashed; border-color: rgba(169, 214, 255, .6); cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015)), #0b1130;
}
body.g2.xmas2 .lobby-board [data-g2="open"] .wc3-swatch { background: transparent !important; border: 2px dashed var(--row-c); box-shadow: none; opacity: .9; }
body.g2.xmas2 .lobby-board [data-g2="open"] .wc3-swatch::after { display: none; }
body.g2.xmas2 .lobby-board [data-g2="open"] .wc3-name.is-empty { color: #cfe3fb; }
body.g2.xmas2 .lobby-board [data-g2="open"]:hover, body.g2.xmas2 .lobby-board [data-g2="open"]:focus-visible {
  border-color: #fff0c4; box-shadow: inset 0 1px 0 rgba(190, 224, 255, .2), 0 0 18px rgba(var(--g2-glow), .5), 0 2px 0 rgba(0, 0, 0, .4);
}

/* reserved: a wrapped gift and a candy-stripe countdown */
body.g2.xmas2 .lobby-board [data-g2="reserved"] .wc3-swatch {
  width: 24px; height: 22px; border-radius: 4px; margin-top: 5px; opacity: 1;
  background:
    linear-gradient(90deg, transparent 40%, #ffd36a 40% 60%, transparent 60%),
    linear-gradient(0deg, transparent 40%, #ffd36a 40% 60%, transparent 60%),
    var(--row-c) !important;
  box-shadow: 0 0 10px var(--row-c), inset 0 -3px 5px rgba(0, 0, 0, .3);
}
body.g2.xmas2 .lobby-board [data-g2="reserved"] .wc3-swatch::before { top: -7px; left: 50%; width: 14px; height: 8px; margin-left: -7px; border-radius: 8px 8px 2px 2px; background: #ffd36a; box-shadow: none; }
body.g2.xmas2 .lobby-board [data-g2="reserved"] .wc3-swatch::after { display: none; }
body.g2.xmas2 .lobby-board [data-g2="reserved"]::after {
  left: 3px; height: 4px; border-radius: 0 3px 3px 0; background: var(--xm-candy); background-size: 14px 14px; box-shadow: 0 0 8px var(--hold);
}
body.g2.xmas2 .lobby-board .hold-kicker { background: rgba(5, 8, 24, .72); }
body.g2.xmas2 .lobby-board .hold-time { background: rgba(5, 8, 24, .8); color: #eaf2ff; position: relative; padding-left: 20px; }
/* a candle that burns down with the real time left (--left comes from the row, 1 = a full reservation) */
body.g2.xmas2 .lobby-board .hold-time::before {
  content: ""; position: absolute; left: 7px; bottom: 3px; width: 5px; height: calc(8px + 9px * var(--left, 1)); border-radius: 1px 1px 0 0;
  background:
    radial-gradient(ellipse 3px 4.5px at 50% 3.5px, #fff6bf 0 28%, #ffa63a 62%, rgba(255, 140, 40, 0) 72%) top / 100% 8px no-repeat,
    linear-gradient(90deg, #fff8f2, #e3203f) bottom / 100% calc(100% - 8px) no-repeat;
  transition: height 1s linear; animation: xm-flame 1.2s ease-in-out infinite; transform-origin: bottom center;
}
body.g2.xmas2 .lobby-board [data-g2="reserved"][data-low="1"] .hold-time::before { animation-duration: .45s; }
@keyframes xm-flame { 0%, 100% { filter: brightness(1); } 35% { filter: brightness(1.35); } 70% { filter: brightness(.9); } }

/* closed: frozen */
body.g2.xmas2 .lobby-board [data-g2="closed"] {
  border-color: rgba(169, 214, 255, .3); color: #9db4d4;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .06) 0 7px, transparent 7px 14px), linear-gradient(180deg, #17224f, #0a0f2a);
}
body.g2.xmas2 .lobby-board [data-g2="closed"] .wc3-swatch {
  filter: none; background: radial-gradient(circle at 34% 28%, #fff 0 9%, #cfe6fb 34%, #6f93bd 100%) !important; box-shadow: 0 0 8px rgba(170, 214, 255, .5);
}
body.g2.xmas2 .lobby-board [data-g2="closed"] .wc3-name { color: #b3c6e2; }

/* idle skeleton */
body.g2.xmas2 .lobby-board .wc3-team > [data-g2="blank"] { border-color: rgba(169, 214, 255, .3); background-color: #0a102c; }
body.g2.xmas2 .lobby-board .wc3-team > [data-g2="blank"]::before { border-color: #3a4b82; background: #111a42; color: #8fa4c4; }
body.g2.xmas2 .lobby-board .wc3-team > [data-g2="blank"]::after { color: #a2b8d8; }

/* race / handicap pills */
body.g2.xmas2 .lobby-board :is(.wc3-race, .wc3-hand) { border-color: rgba(169, 214, 255, .35); background: linear-gradient(180deg, #17214d, #0a1030); color: #e4efff; }
body.g2.xmas2 .lobby-board .lobby-role { border-color: #e1be78; }

/* hold menu + note */
body.g2.xmas2 .lobby-board .wc3-hold-menu { border-color: #e1be78; background: linear-gradient(180deg, #1c2858, #080d26); box-shadow: 0 14px 30px rgba(0, 0, 0, .8), inset 0 0 0 1px rgba(190, 224, 255, .14); }

/* ---------- the stat strip ---------- */
body.g2.xmas2 .lobby-board .lobby-status.mi-lobby-rail {
  border-color: rgba(169, 214, 255, .34); background: linear-gradient(180deg, #121b44, #080d26);
  box-shadow: inset 0 0 0 1px rgba(190, 224, 255, .06), inset 0 3px 14px rgba(0, 0, 0, .7);
}
body.g2.xmas2 .lobby-board .mi-lobby-rail .status-cell { border-color: rgba(169, 214, 255, .26); background: linear-gradient(180deg, #0e1538, #070b22); box-shadow: inset 0 1px 0 rgba(190, 224, 255, .06); }
body.g2.xmas2 .lobby-board .mi-lobby-rail .status-cell[data-g2-tip-title]:hover { border-color: var(--xm-gold-line); }
body.g2.xmas2 .lobby-board .mi-lobby-rail .status-kicker { color: #9fd0ff; }
body.g2.xmas2 .lobby-board .mi-lobby-rail .status-cell small { color: #aebfd8; }
body.g2.xmas2 .lobby-board .mi-lobby-rail .status-cell:nth-child(n + 5) { background: linear-gradient(180deg, #151f4c, #0a1030); border-color: rgba(241, 206, 134, .4); }
body.g2.xmas2 .lobby-board .lobby-status.is-ingame .status-value { color: #bfe0ff; }
body.g2.xmas2 .lobby-board .lobby-status.is-closed .status-value { color: #9db4d4; }
body.g2.xmas2 .lobby-board .mi-lobby-rail .vis-bar { border-color: #3d5aa4; background: #070b22; }
body.g2.xmas2 .vis-bar span { background: linear-gradient(180deg, #cde7ff 0, #4f90ea 45%, #2a56c2 100%); box-shadow: 0 0 8px rgba(110, 170, 255, .8); }
