/* ==========================================================================
   VZR gaming layer v2: LOBBY BOARD (home page)
   Skins the live markup (.lobby-board, .wc3-*). g2-board.js adds data-g2 / data-team / --c, the minimap and a few helpers.
   The live home-lobby.css uses container queries with !important, so the rules that must win here do too.
   ========================================================================== */

/* ---------- board shell: header + minimap, slots, stat strip ---------- */
body.g2 .lobby-board {
  display: grid; align-content: start; box-sizing: border-box; margin: 0; padding: 20px 20px 16px;
  grid-template-columns: minmax(0, 1fr) 164px; column-gap: 18px;
  grid-template-rows: auto auto auto auto 1fr auto;
  grid-template-areas: "live map" "meta map" "idle map" "cols cols" "note note" "stat stat";
}
body.g2 .lobby-board > .lobby-live { grid-area: live; }
body.g2 .lobby-board > .wc3-meta { grid-area: meta; }
body.g2 .lobby-board > .g2-idle-note { grid-area: idle; }
body.g2 .lobby-board > .g2-map { grid-area: map; align-self: start; justify-self: end; }
body.g2 .lobby-board > .wc3-columns { grid-area: cols; }
body.g2 .lobby-board > .lobby-hold-note { grid-area: note; align-self: start; }
body.g2 .lobby-board > .lobby-status { grid-area: stat; align-self: end; }

body.g2 .lobby-live {
  display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font: 800 12px/1 var(--g2-ui); letter-spacing: .18em; text-transform: uppercase; color: #dcc2f7;
}
body.g2 .lobby-dot {
  flex: none; align-self: center; box-sizing: border-box; width: 10px; height: 10px; min-width: 10px; min-height: 10px;
  border-radius: 50%; aspect-ratio: 1; background: var(--g2-green); box-shadow: 0 0 0 0 rgba(57, 226, 125, .7);
  animation: g2-board-pulse 1.9s ease-out infinite;
}
body.g2 .lobby-dot.is-off { background: #8d839b; box-shadow: none; animation: none; }
@keyframes g2-board-pulse { 0% { box-shadow: 0 0 0 0 rgba(57, 226, 125, .65); } 70% { box-shadow: 0 0 0 9px rgba(57, 226, 125, 0); } 100% { box-shadow: 0 0 0 0 rgba(57, 226, 125, 0); } }

/* header plaques */
body.g2 .wc3-meta { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.05fr); gap: 10px; margin-bottom: 16px; }
body.g2 .wc3-meta-cell {
  position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 92px; padding: 12px 16px 12px 16px; border: 1px solid #6a5370; border-radius: 6px;
  background: linear-gradient(180deg, #1d1527 0, #0e0a15 100%);
  box-shadow: inset 0 1px 0 rgba(255, 226, 170, .08), inset 0 0 0 1px rgba(0, 0, 0, .5), inset 0 -12px 22px rgba(0, 0, 0, .35);
}
body.g2 .wc3-meta-cell::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(180deg, #ffe6ad, #8a6a3c); }
body.g2 .wc3-meta-label { color: #d1aef2; font: 800 11.5px/1.2 var(--g2-ui); letter-spacing: .14em; text-transform: uppercase; }
body.g2 .wc3-meta-cell strong { margin-top: 6px; color: var(--g2-gold); font: 800 21px/1.15 var(--g2-serif); text-shadow: 0 2px 3px #000; }
body.g2 .wc3-meta-cell small { margin-top: 3px; color: var(--g2-muted); font: 12px/1.3 var(--g2-ui); }
body.g2 .g2-xp { display: flex; gap: 3px; margin-top: 9px; }
body.g2 .g2-xp i { flex: 1 1 0; height: 9px; border-radius: 2px; background: #1b1326; border: 1px solid #45355a; transition: background .4s ease, box-shadow .4s ease, border-color .4s ease; }
body.g2 .g2-xp i.on { background: linear-gradient(180deg, #ffe9b0, #c78a2c); border-color: #fff0c4; box-shadow: 0 0 7px rgba(255, 200, 100, .55); }

/* ---------- lobby minimap ---------- */
.g2-map { width: 164px; }
.g2-map-frame {
  position: relative; padding: 7px; border: 2px solid transparent; border-radius: 7px;
  background: linear-gradient(#08050d, #08050d) padding-box, linear-gradient(145deg, #ffe9b4, #7d6446 45%, #c9a36a) border-box;
  box-shadow: inset 0 0 16px rgba(0, 0, 0, .85), 0 8px 18px rgba(0, 0, 0, .55), 0 0 22px rgba(var(--g2-glow), .3);
}
.g2-map-svg { display: block; width: 100%; height: auto; border-radius: 4px; }
.g2-map-tag {
  position: absolute; left: 50%; top: -10px; transform: translateX(-50%); white-space: nowrap; padding: 3px 10px; border-radius: 3px;
  font: 800 9.5px/1 var(--g2-ui); letter-spacing: .18em; text-transform: uppercase; color: #2a1706; background: linear-gradient(180deg, #f6dc9e, #b8893a); box-shadow: 0 2px 6px rgba(0, 0, 0, .6);
}
.g2-map-legend { display: none; list-style: none; margin: 0; padding: 0; }
.g2-mm-dot { fill: #241c33; stroke: #4a3d5a; stroke-width: 1; transition: fill .45s ease, stroke .45s ease, r .45s ease, opacity .45s ease; cursor: default; }
.g2-mm-dot[data-s="filled"] { fill: var(--c); stroke: #fff; stroke-width: 1.4; filter: drop-shadow(0 0 3px var(--c)); }
.g2-mm-dot[data-s="open"] { fill: transparent; stroke: var(--c); stroke-width: 1.4; stroke-dasharray: 2.4 2; opacity: .85; }
.g2-mm-dot[data-s="reserved"] { fill: var(--c); fill-opacity: .3; stroke: #f0b429; stroke-width: 1.5; stroke-dasharray: 2.4 2; animation: g2-dot-hold 1.6s ease-in-out infinite; }
.g2-mm-dot[data-s="reserved"][data-hold="phone"] { stroke: #3ec6dc; }
.g2-mm-dot[data-s="reserved"][data-hold="lobby"] { stroke: #c084fc; }
.g2-mm-dot[data-s="closed"] { fill: #1a1424; stroke: #3d3350; opacity: .8; }
.g2-mm-dot[data-s="blank"] { fill: #211a2e; stroke: #3d3350; opacity: .7; }
.g2-mm-dot.g2-hl { stroke: #fff0c4; stroke-width: 2; opacity: 1; }
@keyframes g2-dot-hold { 0%, 100% { fill-opacity: .22; } 50% { fill-opacity: .5; } }
body.g2 .lobby-board[data-g2-phase="idle"] .g2-map-svg { filter: saturate(.5) brightness(.8); }

/* "no lobby" note */
.g2-idle-note {
  display: flex; align-items: center; gap: 14px; margin: -2px 0 16px; padding: 12px 16px; border: 1px solid #8a6f44; border-radius: 6px;
  background: linear-gradient(180deg, #2c2335, #17111f); box-shadow: inset 0 0 0 1px rgba(255, 226, 170, .07), inset 0 0 22px rgba(var(--g2-glow), .14);
}
.g2-idle-note > .g2-ico { flex: none; font-size: 28px; color: #cdb8ff; filter: drop-shadow(0 0 8px rgba(190, 170, 255, .7)); }
.g2-idle-copy { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.g2-idle-copy b { font: 800 15px/1.25 var(--g2-serif); color: var(--g2-gold); letter-spacing: .04em; }
.g2-idle-copy span { font: 13px/1.5 var(--g2-ui); color: #d8cde4; }
body.g2 .lobby-board[data-g2-phase="idle"] .wc3-meta-cell strong { font-size: 0; }
body.g2 .lobby-board[data-g2-phase="idle"] .wc3-meta-cell strong::after { font: italic 700 17px/1.2 var(--g2-serif); color: #a99bb8; text-shadow: none; }
body.g2 .lobby-board[data-g2-phase="idle"] .wc3-meta-cell:nth-child(1) strong::after { content: "Waiting for the next lobby"; }
body.g2 .lobby-board[data-g2-phase="idle"] .wc3-meta-cell:nth-child(2) strong::after { content: "Host will appear here"; }
body.g2 .lobby-board[data-g2-phase="idle"] .wc3-meta-cell:nth-child(3) strong::after { content: "0 players"; }

/* ---------- teams ---------- */
/* ONE row grid for both columns. The live wrappers (.wc3-col, .wc3-team) become display:contents, so every team header and every
   slot row is a direct grid item: row n of the left column and row n of the right column share top, bottom and height.
   g2-board.js sets --g2-rows (the longer column). The grid flows down the left column first, then the right one. */
body.g2 .lobby-board .wc3-columns {
  display: grid; grid-auto-flow: column; grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(var(--g2-rows, 8), minmax(50px, auto)); column-gap: 18px; row-gap: 7px; align-items: stretch;
}
body.g2 .lobby-board :is(.wc3-col, .wc3-team) { display: contents; }
body.g2 .lobby-board .wc3-team > h3 { margin: 0; }
body.g2 .lobby-board .wc3-team { --tc: 164, 113, 192; }
body.g2 .lobby-board .wc3-team[data-team="base"] { --tc: 84, 134, 232; }
body.g2 .lobby-board .wc3-team[data-team="slayer"] { --tc: 255, 128, 64; }
body.g2 .lobby-board .wc3-team[data-team="vampire"] { --tc: 226, 56, 108; }
body.g2 .lobby-board .wc3-team[data-team="observer"] { --tc: 150, 162, 196; }
body.g2 .lobby-board .wc3-team h3 {
  display: flex; align-items: center; gap: 10px; margin: 0; padding: 6px 10px 6px 8px; border-radius: 6px; border: 1px solid rgba(var(--tc), .6); box-sizing: border-box;
  background: linear-gradient(90deg, rgba(var(--tc), .34), rgba(var(--tc), .10) 72%, rgba(var(--tc), .02));
  font: 800 13px/1.2 var(--g2-serif); letter-spacing: .1em; text-transform: uppercase; color: #fff2d6; text-shadow: 0 2px 3px #000;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 2px 0 rgba(0, 0, 0, .35);
}
body.g2 .lobby-board .wc3-team h3::before { content: ""; flex: none; width: 26px; height: 26px; background: center / contain no-repeat; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .7)); }
body.g2 .lobby-board .wc3-team[data-team="base"] h3::before { background-image: var(--g2-emb-role-base); }
body.g2 .lobby-board .wc3-team[data-team="slayer"] h3::before { background-image: var(--g2-emb-role-slayer); }
body.g2 .lobby-board .wc3-team[data-team="vampire"] h3::before { background-image: var(--g2-emb-role-vampire); }
body.g2 .lobby-board .wc3-team[data-team="observer"] h3::before { background-image: var(--g2-emb-role-observer); }
.g2-team-count {
  margin-left: auto; padding: 3px 9px; border-radius: 999px; border: 1px solid rgba(255, 230, 173, .5); background: rgba(8, 6, 14, .72);
  font: 800 11px/1 var(--g2-ui); letter-spacing: .06em; color: var(--g2-gold-hi);
}
body.g2 .lobby-board[data-g2-phase="idle"] .g2-team-count { display: none; }

/* ---------- slot rows ---------- */
body.g2 .lobby-board .wc3-slot { margin: 0; display: flex; align-items: stretch; min-width: 0; }
body.g2 .lobby-board .wc3-slot > .wc3-open { flex: 1 1 auto; }
body.g2 .lobby-board .wc3-team :is(.wc3-filled, .wc3-open) {
  --row-c: var(--c, #a471c0);
  position: relative; display: grid !important; grid-template-columns: 30px 34px minmax(0, 1fr) auto auto !important; align-items: center; gap: 10px;
  box-sizing: border-box; width: 100%; min-height: 50px; margin: 0; padding: 5px 11px 5px 9px; overflow: hidden;
  border: 1px solid #6e5a46; border-radius: 6px; text-align: left; letter-spacing: 0; line-height: 1.2;
  font: 700 15px/1.2 var(--g2-ui); color: var(--g2-ink);
  background:
    linear-gradient(90deg, rgba(164, 113, 192, .14) 0, transparent 40%),
    linear-gradient(180deg, #2b2137 0, #160f1e 100%);
  box-shadow: inset 0 1px 0 rgba(255, 226, 170, .10), inset 0 -1px 0 rgba(0, 0, 0, .65), 0 2px 0 rgba(0, 0, 0, .4);
  transition: border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease;
}
@supports (background: color-mix(in srgb, red 10%, transparent)) {
  body.g2 .lobby-board .wc3-team :is(.wc3-filled, .wc3-open)[data-g2="filled"],
  body.g2 .lobby-board .wc3-team :is(.wc3-filled, .wc3-open)[data-g2="open"],
  body.g2 .lobby-board .wc3-team :is(.wc3-filled, .wc3-open)[data-g2="reserved"] {
    background:
      linear-gradient(90deg, color-mix(in srgb, var(--row-c) 22%, transparent) 0, transparent 44%),
      linear-gradient(180deg, #2b2137 0, #160f1e 100%);
  }
}
body.g2 .lobby-board .wc3-team .wc3-slot > .wc3-open { margin: 0; }
body.g2 .lobby-board .wc3-team :is(.wc3-filled, .wc3-open)::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--row-c); opacity: .85; box-shadow: 0 0 10px var(--row-c);
}
/* the slot number sits inside the colour gem */
body.g2 .lobby-board .wc3-num {
  grid-column: 1; grid-row: 1; z-index: 2; display: grid; place-items: center; width: 30px; height: 30px; background: none; border: 0;
  font: 800 12.5px/1 var(--g2-ui); color: #fff; text-align: center; -webkit-text-stroke: 3px rgba(0, 0, 0, .75); paint-order: stroke fill; text-shadow: 0 1px 2px #000;
}
body.g2 .lobby-board .wc3-swatch {
  grid-column: 1; grid-row: 1; position: relative; justify-self: center; width: 21px; height: 21px; transform: rotate(45deg); border-radius: 4px; border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: 0 0 12px var(--row-c), inset 0 0 0 1px rgba(0, 0, 0, .4);
}
body.g2 .lobby-board .wc3-swatch::after { content: ""; position: absolute; inset: 1px; border-radius: 2px; background: linear-gradient(135deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0) 55%, rgba(0, 0, 0, .28)); }
body.g2 .lobby-board .lobby-role-slot { width: 34px; height: 34px; }
body.g2 .lobby-board .lobby-role { width: 34px; height: 34px; border-radius: 5px; border: 1px solid #c9a36a; box-shadow: 0 0 0 1px #000, inset 0 0 6px rgba(0, 0, 0, .6); }
body.g2 .lobby-board .wc3-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 15.5px/1.2 var(--g2-ui); color: #f6f0fa; letter-spacing: .01em; text-shadow: 0 1px 2px #000; }
body.g2 .lobby-board .wc3-name.is-empty { color: #d6c3ee; letter-spacing: .1em; text-transform: uppercase; font-size: 13px; font-weight: 800; }
body.g2 .lobby-board .wc3-race {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: none; box-sizing: border-box; padding: 3px 10px 3px 4px; border: 1px solid #54426a; border-radius: 999px;
  background: linear-gradient(180deg, #1c1427, #0d0912); color: #eadff6; font: 800 10px/1 var(--g2-ui); letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
body.g2 .lobby-board .wc3-race::before { content: ""; flex: none; width: 22px; height: 22px; background: center / contain no-repeat; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .7)); }
body.g2 .lobby-board .wc3-race.human::before { background-image: var(--g2-emb-race-human); }
body.g2 .lobby-board .wc3-race.orc::before { background-image: var(--g2-emb-race-orc); }
body.g2 .lobby-board .wc3-race.nightelf::before { background-image: var(--g2-emb-race-nightelf); }
body.g2 .lobby-board .wc3-race.undead::before { background-image: var(--g2-emb-race-undead); }
body.g2 .lobby-board .wc3-hand {
  min-width: 54px; box-sizing: border-box; padding: 5px 9px; border: 1px solid #54426a; border-radius: 6px; background: linear-gradient(180deg, #1c1427, #0d0912);
  color: #d9ccea; font: 800 12px/1 var(--g2-ui); text-align: center;
}

/* host + you */
body.g2 .lobby-board [data-host] .wc3-name::after {
  content: ""; display: inline-block; width: 16px; height: 16px; margin-left: 8px; vertical-align: -2px; background: linear-gradient(180deg, #fff3d0, #e0a93c);
  -webkit-mask: var(--g2-ico-crown) center / contain no-repeat; mask: var(--g2-ico-crown) center / contain no-repeat; filter: drop-shadow(0 1px 1px #000);
}
body.g2 .lobby-board [data-you] { border-color: #e6c15a; box-shadow: inset 0 1px 0 rgba(255, 226, 170, .16), inset 0 0 0 1px rgba(230, 193, 90, .5), 0 0 16px rgba(230, 193, 90, .28); }
body.g2 .lobby-board [data-you] .wc3-name::before {
  content: "YOU"; display: inline-block; margin-right: 8px; padding: 3px 6px 2px; border-radius: 3px; vertical-align: 1px; font: 800 9.5px/1 var(--g2-ui); letter-spacing: .12em;
  color: #2a1706; background: linear-gradient(180deg, #f6dc9e, #c1923c);
}

/* states */
body.g2 .lobby-board [data-g2="open"] { border-style: dashed; border-color: #8269a8; cursor: pointer; background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .01)), #120d19; }
body.g2 .lobby-board [data-g2="open"] .wc3-swatch { opacity: .5; }
body.g2 .lobby-board [data-g2="open"] .wc3-name::before {
  content: ""; display: inline-block; width: 13px; height: 13px; margin-right: 8px; vertical-align: -1px; background: currentColor;
  -webkit-mask: var(--g2-ico-plus) center / contain no-repeat; mask: var(--g2-ico-plus) center / contain no-repeat;
}
body.g2 .lobby-board [data-g2="open"]:hover, body.g2 .lobby-board [data-g2="open"]:focus-visible { border-color: #fff0c4; border-style: solid; transform: translateX(3px); box-shadow: inset 0 1px 0 rgba(255, 226, 170, .2), 0 0 18px rgba(var(--g2-glow), .45), 0 2px 0 rgba(0, 0, 0, .4); }
body.g2 .lobby-board [data-g2="open"]:hover .wc3-name { color: #fff; }
body.g2 .lobby-board .wc3-filled.g2-hl, body.g2 .lobby-board .wc3-open.g2-hl { border-color: #fff0c4; }

body.g2 .lobby-board [data-g2="reserved"] { --hold: #c084fc; min-height: 52px; padding-bottom: 8px; }
body.g2 .lobby-board [data-g2="reserved"].hold-browser { --hold: #f0b429; border-color: #c9842a; }
body.g2 .lobby-board [data-g2="reserved"].hold-phone { --hold: #3ec6dc; border-color: #1a9bb5; }
body.g2 .lobby-board [data-g2="reserved"].hold-lobby { --hold: #c084fc; border-color: #9b5de8; }
body.g2 .lobby-board [data-g2="reserved"] .wc3-swatch { opacity: .75; }
body.g2 .lobby-board [data-g2="reserved"]::after {
  content: ""; position: absolute; left: 3px; right: 0; bottom: 0; height: 3px; transform-origin: left center; transform: scaleX(var(--left, 1));
  background: var(--hold); box-shadow: 0 0 8px var(--hold); transition: transform 1s linear;
}
body.g2 .lobby-board [data-g2="reserved"][data-low="1"]::after { animation: g2-low .8s ease-in-out infinite; }
@keyframes g2-low { 50% { opacity: .35; } }
body.g2 .lobby-board .wc3-name.is-hold { gap: 4px 9px; flex-wrap: wrap !important; white-space: normal; overflow: visible; line-height: 1.1; }
body.g2 .lobby-board .hold-who { flex: 1 1 auto; }
body.g2 .lobby-board .hold-kicker { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px 4px 6px; border-radius: 999px; border: 1px solid currentColor; background: rgba(8, 6, 14, .6); font: 800 10.5px/1 var(--g2-ui); letter-spacing: .08em; }
body.g2 .lobby-board .hold-who .hold-name { font: 800 15.5px/1 var(--g2-ui); color: #fff; }
body.g2 .lobby-board .hold-time { padding: 3px 7px; border-radius: 4px; background: rgba(8, 6, 14, .75); border: 1px solid rgba(255, 255, 255, .14); color: #e8dcf7; font: 800 13px/1 var(--g2-ui); font-variant-numeric: tabular-nums; }
body.g2 .lobby-board .hold-time.is-critical { color: #ff9a9a; border-color: #a83a3a; }

body.g2 .lobby-board [data-g2="closed"] {
  border-color: #4a3d5a; color: #8f84a0;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .035) 0 7px, transparent 7px 14px), linear-gradient(180deg, #1b1524, #0f0b15);
}
body.g2 .lobby-board [data-g2="closed"]::before { opacity: .35; box-shadow: none; }
body.g2 .lobby-board [data-g2="closed"] .wc3-swatch { filter: grayscale(1) brightness(.6); box-shadow: none; }
body.g2 .lobby-board [data-g2="closed"] .lobby-role { filter: grayscale(1) brightness(.55); }
body.g2 .lobby-board [data-g2="closed"] .wc3-name { color: #a399b3; }
body.g2 .lobby-board [data-g2="closed"] .wc3-name::before {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; background: currentColor;
  -webkit-mask: var(--g2-ico-lock) center / contain no-repeat; mask: var(--g2-ico-lock) center / contain no-repeat;
}
body.g2 .lobby-board [data-g2="closed"] :is(.wc3-race, .wc3-hand) { opacity: .5; }

/* empty state: skeleton rows with a shimmer */
body.g2 .lobby-board .wc3-team > [data-g2="blank"] {
  display: flex !important; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px 0 8px; font-size: 0 !important; color: transparent; border: 1px dashed rgba(125, 100, 70, .55);
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, .07) 50%, rgba(255, 255, 255, 0) 70%) 0 0 / 250% 100% no-repeat, #100b17;
  animation: g2-shimmer 2.4s linear infinite; box-shadow: none;
}
body.g2 .lobby-board .wc3-team > [data-g2="blank"]::before {
  content: attr(data-n); position: static; display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 5px; border: 1px solid #4a3d5a; background: #1a1226;
  font: 800 12px/1 var(--g2-ui); color: #85799a; opacity: 1; box-shadow: none;
}
body.g2 .lobby-board .wc3-team > [data-g2="blank"]::after {
  content: "Awaiting players..."; position: static; display: block; height: auto; width: auto; background: none; transform: none; box-shadow: none; transition: none;
  font: italic 600 13.5px/1 var(--g2-serif); letter-spacing: .06em; color: #9f93b0;
}
@keyframes g2-shimmer { from { background-position: 150% 0, 0 0; } to { background-position: -50% 0, 0 0; } }

/* hold menu (live "Hold the slot" popup) */
body.g2 .lobby-board .wc3-hold-menu {
  min-width: 190px; padding: 8px; border: 1px solid #d6b06a; border-radius: 6px; background: linear-gradient(180deg, #221a2e, #0d0912);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .8), inset 0 0 0 1px rgba(255, 226, 170, .12);
}
body.g2 .lobby-board .wc3-hold-menu button {
  min-height: 40px; border: 1.5px solid #fff1c8; border-radius: 5px; background: var(--g2-gold-btn); color: #2a1706;
  font: 800 12px/1 var(--g2-ui); letter-spacing: .08em; text-transform: uppercase; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 3px 0 rgba(0, 0, 0, .6);
}
body.g2 .lobby-board .wc3-hold-menu button:hover { filter: brightness(1.12); }
body.g2 .lobby-hold-note { margin: 12px 0 0; padding: 10px 14px; border: 1px solid #a83a3a; border-radius: 6px; background: linear-gradient(180deg, #3a1218, #1f0a10); color: #ffc7c7; font: 13.5px/1.45 var(--g2-ui); }

/* ---------- stat strip: lobby info + the WC3 resource bar ---------- */
body.g2 .lobby-board .lobby-status.mi-lobby-rail {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin: 14px 0 0; padding: 11px; border: 1px solid #6a5370; border-radius: 6px;
  background: linear-gradient(180deg, #181022, #0c0811); box-shadow: inset 0 0 0 1px rgba(255, 226, 170, .06), inset 0 3px 14px rgba(0, 0, 0, .7);
}
body.g2 .lobby-board .mi-lobby-rail .status-cell {
  position: relative; padding: 9px 11px 10px; border: 1px solid #44345a; border-radius: 5px; background: linear-gradient(180deg, #120d19, #0a0710);
  box-shadow: inset 0 1px 0 rgba(255, 226, 170, .05); min-width: 0;
}
body.g2 .lobby-board .mi-lobby-rail .status-cell[data-g2-tip-title]:hover { border-color: #8a6f44; }
body.g2 .lobby-board .mi-lobby-rail .status-kicker { color: #d1aef2; font: 800 10.5px/1.1 var(--g2-ui); letter-spacing: .11em; }
body.g2 .lobby-board .mi-lobby-rail .status-cell strong { margin-top: 6px; color: #f6d98c; font: 800 18px/1.15 var(--g2-serif); text-shadow: 0 2px 2px #000; }
body.g2 .lobby-board .mi-lobby-rail .status-cell small { color: #b3a7c2; font: 12px/1.3 var(--g2-ui); }
body.g2 .lobby-board .lobby-status.is-waiting .status-value { color: #7bf8a8; }
body.g2 .lobby-board .lobby-status.is-full .status-value { color: #f6e29b; }
body.g2 .lobby-board .lobby-status.is-starting .status-value { color: #f6ac66; }
body.g2 .lobby-board .lobby-status.is-ingame .status-value { color: #d6b8ff; }
body.g2 .lobby-board .lobby-status.is-closed .status-value { color: #aaa0b8; }
body.g2 .mi-lobby-rail .sync-status { width: 9px; height: 9px; }
/* the four counters become resources: icon medallion + gold number */
body.g2 .lobby-board .mi-lobby-rail .status-cell:nth-child(n + 5) {
  display: grid; grid-template-columns: 38px minmax(0, 1fr); column-gap: 11px; align-items: center;
  background: linear-gradient(180deg, #1c1427, #0d0912); border-color: #6e5a46;
}
body.g2 .lobby-board .mi-lobby-rail .status-cell:nth-child(n + 5)::before {
  content: ""; grid-column: 1; grid-row: 1 / span 3; width: 38px; height: 38px; background: center / contain no-repeat; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .7));
}
body.g2 .lobby-board .mi-lobby-rail .status-cell:nth-child(n + 5) > * { grid-column: 2; }
body.g2 .lobby-board .mi-lobby-rail .status-cell:nth-child(5)::before { background-image: var(--g2-emb-coin); }
body.g2 .lobby-board .mi-lobby-rail .status-cell:nth-child(6)::before { background-image: var(--g2-emb-lumber); }
body.g2 .lobby-board .mi-lobby-rail .status-cell:nth-child(7)::before { background-image: var(--g2-emb-hourglass); }
body.g2 .lobby-board .mi-lobby-rail .status-cell:nth-child(8)::before { background-image: var(--g2-emb-farm); }
body.g2 .lobby-board .mi-lobby-rail .status-cell:nth-child(n + 5) strong { font-size: 24px; color: #ffe08a; }
body.g2 .lobby-board .mi-lobby-rail .status-cell:nth-child(7) strong { font-size: 16px; line-height: 1.2; }
/* visibility timer = a mana bar */
body.g2 .lobby-board .mi-lobby-rail .vis-bar {
  height: 10px; margin-top: 8px; border: 1px solid #3d4f9a; border-radius: 5px; background: #0a0c1f; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .8); overflow: hidden;
}
body.g2 .vis-bar span {
  position: relative; background: linear-gradient(180deg, #7fa0ff 0, #3b5bdb 45%, #7b4fe0 100%); transition: width .9s linear; box-shadow: 0 0 8px rgba(99, 130, 255, .8);
}
body.g2 .vis-bar span::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 40%; background: linear-gradient(180deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0)); }
body.g2 .vis-value.is-low { color: #f6ac66; }
body.g2 .vis-value.is-critical { color: #ff9a9a; }

/* ---------- wider lobby + chat ----------
   The live page gave the chat a 270px strip at 1440. The chat is now a third of the width (clamped), the board takes the rest. */
@media (min-width: 1101px) {
  body.g2 .mi-grid { grid-template-columns: minmax(0, 1fr) clamp(340px, 28vw, 560px); gap: 18px; }
  body.g2 .mi-chat { min-height: max(740px, 100%); }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  body.g2 .lobby-board .lobby-status.mi-lobby-rail { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  body.g2 .lobby-board .lobby-status.mi-lobby-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  body.g2 .lobby-board {
    padding: 16px 12px 12px; grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none; grid-template-areas: "live" "meta" "map" "idle" "cols" "note" "stat";
  }
  body.g2 .lobby-board > .g2-map { justify-self: stretch; width: auto; margin: 0 0 16px; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; align-items: center; }
  .g2-map-legend { display: grid; gap: 8px; align-content: center; }
  .g2-map-legend li { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border: 1px solid rgba(var(--tc), .55); border-radius: 6px; background: linear-gradient(90deg, rgba(var(--tc), .26), rgba(var(--tc), .06)); font: 800 12px/1 var(--g2-ui); letter-spacing: .06em; color: #f6ecff; text-transform: uppercase; }
  .g2-map-legend li[data-team="base"] { --tc: 84, 134, 232; }
  .g2-map-legend li[data-team="slayer"] { --tc: 255, 128, 64; }
  .g2-map-legend li[data-team="vampire"] { --tc: 226, 56, 108; }
  .g2-map-legend li .g2-emb { font-size: 20px; }
  .g2-map-legend li b { margin-left: auto; color: var(--g2-gold-hi); }
  body.g2 .wc3-meta { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  body.g2 .wc3-meta-cell:last-child { grid-column: 1 / -1; min-height: 78px; }
  .g2-idle-note { flex-wrap: wrap; }
  .g2-idle-note .g2-btn { flex: 1 1 100%; }
}

/* The live board drops to one column at 980px; the compact rows still fit two columns down to 720px (see the grid above).
   Below that the columns become one list, with a gap before each team header. */
@container lobby (max-width: 719px) {
  body.g2 .lobby-board .wc3-columns { grid-auto-flow: row; grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: none; }
  body.g2 .lobby-board .wc3-team > h3 { margin-top: 12px; }
  body.g2 .lobby-board .wc3-col:first-child > .wc3-team:first-child > h3 { margin-top: 0; }
}
/* Below about 1000px of board the race chip keeps its emblem only (the race name stays in the tooltip),
   so a reserved row (chip, name, countdown) still fits on one line. */
@container lobby (max-width: 1000px) {
  body.g2 .lobby-board .wc3-race { padding: 3px; gap: 0; font-size: 0; border-radius: 6px; }
  body.g2 .lobby-board .wc3-race::before { width: 24px; height: 24px; }
}

/* narrow board (container) rules beat the live ones: they use !important too, with a higher selector */
@container lobby (max-width: 720px) {
  body.g2 .lobby-board .wc3-team :is(.wc3-filled, .wc3-open) { grid-template-columns: 30px 32px minmax(0, 1fr) auto auto !important; gap: 8px; }
}
@container lobby (max-width: 560px) {
  body.g2 .lobby-board .wc3-team :is(.wc3-filled, .wc3-open) { grid-template-columns: 30px 30px minmax(0, 1fr) auto !important; min-height: 52px; padding: 5px 9px 5px 7px; gap: 7px; }
  body.g2 .lobby-board .wc3-race { display: inline-flex !important; min-width: 0; padding: 3px; gap: 0; font-size: 0; border-radius: 6px; }
  body.g2 .lobby-board .wc3-race::before { width: 24px; height: 24px; }
  body.g2 .lobby-board .wc3-hand { display: none !important; }
  body.g2 .lobby-board .lobby-role-slot, body.g2 .lobby-board .lobby-role { width: 30px; height: 30px; }
  body.g2 .lobby-board .wc3-name { white-space: normal; line-height: 1.2; font-size: 15px; }
  body.g2 .lobby-board .wc3-name.is-hold { flex-wrap: wrap !important; row-gap: 4px; }
  body.g2 .lobby-board .hold-who { flex: 1 1 100%; }
  body.g2 .lobby-board [data-g2="reserved"] { padding-bottom: 10px; }
}
@media (max-width: 420px) {
  body.g2 .lobby-board .mi-lobby-rail .status-cell:nth-child(n + 5) { grid-template-columns: 30px minmax(0, 1fr); column-gap: 8px; }
  body.g2 .lobby-board .mi-lobby-rail .status-cell:nth-child(n + 5)::before { width: 30px; height: 30px; }
  body.g2 .lobby-board .mi-lobby-rail .status-cell:nth-child(n + 5) strong { font-size: 20px; }
  body.g2 .lobby-board .mi-lobby-rail .status-cell:nth-child(7) strong { font-size: 13.5px; }
  body.g2 .lobby-board .mi-lobby-rail .status-kicker { font-size: 9.5px; letter-spacing: .06em; }
  body.g2 .lobby-board > .g2-map { grid-template-columns: 128px minmax(0, 1fr); gap: 12px; }
}
