/* ==========================================================================
   VZR gaming layer v2: HOME page
   alert banner, panel rhythm, command card, quest log, lobby chat. (the hero is in g2-hero.css)
   (the lobby board is in g2-board.css, the charts in g2-charts.css)
   ========================================================================== */


/* alert banner: "your base is under attack" */
.g2-alert {
  display: flex; align-items: center; gap: 14px; margin: 0 0 12px; padding: 8px 14px; border-radius: 6px; border: 1px solid #ff7a66;
  background: linear-gradient(90deg, rgba(122, 24, 30, .9), rgba(66, 14, 28, .92) 60%, rgba(42, 12, 32, .92)); color: #ffeae5;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .65), 0 0 26px rgba(255, 84, 60, .32), inset 0 0 24px rgba(255, 110, 84, .18);
  animation: g2-alarm 2.2s ease-in-out infinite;
}
.g2-alert[hidden] { display: none; }
.g2-alert-ico { flex: none; font-size: 24px; color: #ffcf7a; filter: drop-shadow(0 0 8px rgba(255, 190, 90, .8)); }
.g2-alert-text { flex: 1 1 auto; min-width: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; font: 13px/1.4 var(--g2-ui); }
.g2-alert-text b { font: 800 14.5px/1.2 var(--g2-serif); letter-spacing: .06em; text-transform: uppercase; color: #fff; text-shadow: 0 2px 4px #000; }
@keyframes g2-alarm { 0%, 100% { box-shadow: 0 0 0 1px rgba(0, 0, 0, .65), 0 0 22px rgba(255, 84, 60, .26), inset 0 0 24px rgba(255, 110, 84, .14); } 50% { box-shadow: 0 0 0 1px rgba(0, 0, 0, .65), 0 0 36px rgba(255, 84, 60, .55), inset 0 0 28px rgba(255, 110, 84, .26); } }

/* ---------- activity row ---------- */
body.g2 .mi-activity.g2-activity {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr) minmax(0, .96fr); gap: 16px; margin-top: 18px; align-items: start;   /* each panel is as tall as its own content */
}
body.g2 .g2-activity .mi-panel { min-height: 0; padding: 18px 18px 16px; }
.g2-panel-head h3, body.g2 .mi-panel .g2-panel-head h3, body.g2 .g2-quests .g2-panel-head h3 {
  margin: 0; display: flex; align-items: center; gap: 10px; font: 800 14px/1.2 var(--g2-serif); letter-spacing: .14em; text-transform: uppercase; color: var(--g2-gold); text-shadow: 0 2px 4px #000;
}
.g2-panel-head h3::before { content: ""; width: 8px; height: 8px; flex: none; transform: rotate(45deg); background: linear-gradient(135deg, #fff0c4, #b8893a); box-shadow: 0 0 8px rgba(255, 220, 140, .6); }
.g2-panel-head p { margin: 6px 0 0; font: 12.5px/1.5 var(--g2-ui); color: var(--g2-muted); }
.g2-chart { flex: 1 1 auto; min-height: 0; margin-top: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }

/* command card */
.g2-cmdgrid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-top: 14px; padding: 13px; border-radius: 6px;
  background: linear-gradient(180deg, #120d1a, #0a0710); border: 1px solid #4f3e5c; box-shadow: inset 0 3px 14px rgba(0, 0, 0, .75), inset 0 0 0 1px rgba(255, 226, 170, .05);
}
.g2-cmd { position: relative; display: block; aspect-ratio: 1; border-radius: 7px; text-decoration: none; color: var(--g2-gold-hi); }
.g2-cmd-face {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 7px; border: 2px solid transparent; overflow: hidden;
  background:
    radial-gradient(circle at 35% 22%, rgba(255, 255, 255, .20), transparent 52%) padding-box,
    linear-gradient(180deg, #4d366e, #1d1231 72%) padding-box,
    linear-gradient(145deg, #ffeab4, #8b6b3a 45%, #e8c685) border-box;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6), inset 0 -8px 14px rgba(0, 0, 0, .35), 0 4px 0 rgba(0, 0, 0, .6), 0 9px 14px rgba(0, 0, 0, .45);
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
}
.g2-cmd-face .g2-ico { font-size: clamp(26px, 2.5vw, 34px); background: linear-gradient(180deg, #fff3d0 0, #f0c26a 55%, #b5822e 100%); filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .6)); }
.g2-cmd-face.is-portrait { padding: 0; }
.g2-cmd-face.is-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 4px; }
.g2-cmd:hover .g2-cmd-face, .g2-cmd:focus-visible .g2-cmd-face { filter: brightness(1.28); transform: translateY(-2px); }
.g2-cmd:focus-visible { outline-offset: 5px; }
.g2-cmd:active .g2-cmd-face, .g2-cmd.is-pressed .g2-cmd-face { transform: translateY(2px) scale(.96); filter: brightness(1.4); box-shadow: inset 0 0 18px rgba(255, 230, 173, .55), inset 0 0 0 1px rgba(0, 0, 0, .6), 0 1px 0 rgba(0, 0, 0, .6); }
.g2-cmd kbd {
  position: absolute; right: 5px; bottom: 2px; padding: 0; border: 0; background: none; font: 800 12.5px/1 var(--g2-ui); color: #ffd23f; text-shadow: 0 1px 2px #000, 0 0 5px #000, 0 0 8px #000; pointer-events: none;
}
.g2-cmd.is-locked .g2-cmd-face { filter: grayscale(.85) brightness(.62); }
.g2-cmd.is-locked:hover .g2-cmd-face, .g2-cmd.is-locked:focus-visible .g2-cmd-face { filter: grayscale(.6) brightness(.85); }
.g2-cmd.is-locked::after {
  content: ""; position: absolute; left: 6px; top: 6px; width: 15px; height: 15px; background: #ffb0b0; pointer-events: none;
  -webkit-mask: var(--g2-ico-lock) center / contain no-repeat; mask: var(--g2-ico-lock) center / contain no-repeat; filter: drop-shadow(0 1px 1px #000);
}
.g2-cmd-hint { margin: 12px 0 0; font: 12px/1.45 var(--g2-ui); color: var(--g2-dim); text-align: center; }
.g2-cmd-hint span { color: #ffd23f; font-weight: 800; }
.g2-cmd-hint.is-off span { color: var(--g2-red); }

/* quest log */
.g2-quests {
  position: relative; margin-top: 18px; padding: 18px 18px 18px; border: 2px solid transparent; border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(214, 170, 90, .08), transparent 90px) padding-box,
    linear-gradient(180deg, #2a222f, #16111b) padding-box,
    linear-gradient(140deg, #f5d99b 0, #9b7b4c 20%, #5e4a3b 40%, #8a6f44 60%, #f5d99b 100%) border-box;
  box-shadow: var(--g2-depth);
}
.g2-quests::before { content: ""; position: absolute; inset: -3px; z-index: 3; pointer-events: none; background:
  var(--g2-corner-tl) left top / 22px 22px no-repeat, var(--g2-corner-tr) right top / 22px 22px no-repeat,
  var(--g2-corner-bl) left bottom / 22px 22px no-repeat, var(--g2-corner-br) right bottom / 22px 22px no-repeat; }
.g2-quest-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.g2-quest {
  position: relative; padding: 16px 16px 15px 66px; border-radius: 6px; border: 1px solid #6e5b47;
  background: linear-gradient(180deg, #31283a, #1b151f);
  box-shadow: inset 0 0 0 1px rgba(255, 226, 170, .07), inset 0 0 26px rgba(214, 170, 90, .07), 0 6px 14px rgba(0, 0, 0, .4);
}
.g2-qmark {
  position: absolute; left: 14px; top: 15px; width: 38px; height: 38px; display: grid; place-items: center;
  font: 900 26px/1 var(--g2-serif); color: #ffd23f; text-shadow: 0 0 14px rgba(255, 210, 63, .95), 0 2px 0 #4a3000;
  border: 1.5px solid #c9a36a; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #4d3c1c, #1a1208);
  box-shadow: 0 0 18px rgba(255, 210, 63, .32), inset 0 0 8px rgba(0, 0, 0, .8);
}
.g2-quest.is-notice .g2-qmark { color: #ece6f7; border-color: #a79ec2; text-shadow: 0 0 14px rgba(200, 180, 255, .9), 0 2px 0 #1a1230; background: radial-gradient(circle at 35% 30%, #3d3560, #130d24); box-shadow: 0 0 18px rgba(190, 170, 255, .28), inset 0 0 8px rgba(0, 0, 0, .8); }
.g2-quest h4 { margin: 0 0 7px; font: 800 15.5px/1.25 var(--g2-serif); color: #ffd98a; text-shadow: 0 2px 3px #000; }
.g2-quest p { margin: 0; font: 13px/1.6 var(--g2-ui); color: #e6dcee; }
.g2-quest-link {
  display: inline-block; margin-top: 11px; padding: 2px 0; font: 800 11px/1.3 var(--g2-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--g2-gold-hi);
  text-decoration: none; border-bottom: 1px solid rgba(255, 230, 173, .45);
}
.g2-quest-link:hover { color: #fff; border-bottom-color: #fff; }
.g2-quest-link::after { content: " \203A"; }
body.mk-chat-fs-open .g2-quests { visibility: hidden; }

/* ---------- lobby chat: the WC3 message log ---------- */
body.g2 .mi-chat { padding: 18px 16px 15px; }
body.g2 .mk-chat-head { margin: 0 0 12px; padding: 0 0 11px; border-bottom: 1px solid rgba(201, 163, 106, .32); }
body.g2 .mi-chat h3, body.g2 .mk-chat-head h3 {
  display: flex; align-items: center; gap: 9px; font: 800 14px/1.2 var(--g2-serif); letter-spacing: .14em; color: var(--g2-gold); text-shadow: 0 2px 4px #000;
}
body.g2 .mk-chat-head h3::before {
  content: ""; width: 19px; height: 19px; flex: none; background: linear-gradient(180deg, #fff3d0, #c9923e);
  -webkit-mask: var(--g2-ico-chat-lines) center / contain no-repeat; mask: var(--g2-ico-chat-lines) center / contain no-repeat;
}
/* Full screen chat. The panel frame above sets `position: relative` with a higher specificity than the live
   `.mi-chat.is-fullscreen { position: fixed }`, which kept the chat inside the page grid. These rules restore the live behaviour. */
body.g2 .mi-chat.is-fullscreen {
  position: fixed; inset: 0; z-index: 1200; box-sizing: border-box; margin: 0; padding: 12px;
  padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: max(12px, env(safe-area-inset-bottom));
  border: 0; border-radius: 0; box-shadow: none; overflow: hidden;
  background: linear-gradient(180deg, #251c33 0, #0b0810 220px);
}
body.g2 .mi-chat.is-fullscreen::before { display: none; }
body.g2 .mi-chat.is-fullscreen .mk-chat { flex: 1 1 auto; min-height: 0; }
body.g2 .mi-chat.is-fullscreen .mk-chat-log { flex: 1 1 auto; min-height: 0; max-height: none; }
@media (min-width: 900px) {
  body.g2 .mi-chat.is-fullscreen {
    inset: 4vh 6vw; padding: 18px 20px 16px; border: 2px solid transparent; border-radius: 7px;
    background: var(--g2-frame); box-shadow: var(--g2-depth), 0 0 0 9999px rgba(0, 0, 0, .62);
  }
  body.g2 .mi-chat.is-fullscreen::before { display: block; }
}
body.mk-chat-fs-open .g2-dock, body.mk-chat-fs-open .g2-tip { visibility: hidden; }
body.g2 .mk-fs-btn { padding: 6px 10px; border: 1px solid #8a6f44; border-radius: 4px; background: linear-gradient(180deg, #33264a, #17101f); color: var(--g2-gold); font: 800 10px/1 var(--g2-ui); letter-spacing: .08em; }
body.g2 .mk-fs-btn:hover { border-color: #fff0c4; color: #fff; }
body.g2 .mk-chat-log {
  gap: 2px; padding: 8px; margin-bottom: 10px; border: 1px solid #6a5370; border-radius: 5px;
  background: linear-gradient(180deg, rgba(10, 7, 16, .94), rgba(6, 4, 10, .97));
  box-shadow: inset 0 0 0 1px rgba(255, 226, 170, .07), inset 0 8px 20px rgba(0, 0, 0, .7);
  scrollbar-width: thin; scrollbar-color: #7a58a0 #120d19;
}
body.g2 .mk-msg { --src: #c48cf3; padding: 6px 9px 7px 11px; border: 0; border-left: 3px solid var(--src); border-radius: 0 4px 4px 0; background: transparent; font: 13.5px/1.45 var(--g2-ui); }
body.g2 .mk-msg:hover { background: rgba(255, 255, 255, .04); }
body.g2 .mk-msg[data-source="browser"] { --src: #4fd1c5; }
body.g2 .mk-msg[data-source="phone"] { --src: #f08cff; }
body.g2 .mk-msg:has(.mk-who.lobby) { --src: #7ebff1; }
body.g2 .mk-msg:has(.mk-who.bot) { --src: #6ff59d; }
body.g2 .mk-when { color: #a094b0; font-size: 11px; margin-left: 8px; }
body.g2 .mk-who { color: var(--src); font-weight: 800; font-size: 13.5px; }
body.g2 .mk-who.lobby { color: #7ebff1; }
body.g2 .mk-who.bot { color: #6ff59d; }
body.g2 .mk-who.sys { color: var(--g2-gold); }
body.g2 .mk-msg[data-source] .mk-who::before, body.g2 .mk-who.lobby::before, body.g2 .mk-who.bot::before {
  content: ""; display: inline-block; width: 13px; height: 13px; margin-right: 6px; vertical-align: -2px; background: currentColor;
  -webkit-mask: var(--g2-ico-device-lobby) center / contain no-repeat; mask: var(--g2-ico-device-lobby) center / contain no-repeat;
}
body.g2 .mk-msg[data-source="browser"] .mk-who::before { -webkit-mask-image: var(--g2-ico-device-browser); mask-image: var(--g2-ico-device-browser); }
body.g2 .mk-msg[data-source="phone"] .mk-who::before { -webkit-mask-image: var(--g2-ico-device-phone); mask-image: var(--g2-ico-device-phone); }
body.g2 .mk-who.bot::before { -webkit-mask-image: var(--g2-ico-spark); mask-image: var(--g2-ico-spark); }
body.g2 .mk-txt { color: #eee6f3; margin-top: 2px; }
body.g2 .mk-typing { color: #b4a7c6; font: italic 12px/1.3 var(--g2-serif); min-height: 16px; }

/* empty and locked states of the log */
body.g2 .mk-chat-log:empty { align-items: center; justify-content: center; text-align: center; gap: 10px; }
body.g2 .mk-chat-log:empty::before {
  content: ""; width: 34px; height: 34px; background: linear-gradient(180deg, #fff3d0, #b5822e);
  -webkit-mask: var(--g2-ico-lock) center / contain no-repeat; mask: var(--g2-ico-lock) center / contain no-repeat; opacity: .8;
}
body.g2 .mk-chat-log:empty::after { content: "Chat is locked until your BattleTag is linked"; max-width: 22ch; font: 13px/1.5 var(--g2-ui); color: #b9aec8; }
body.g2 .mk-chat.is-verified:not(.is-connected) .mk-chat-log:empty::before { -webkit-mask-image: var(--g2-ico-chat-lines); mask-image: var(--g2-ico-chat-lines); }
body.g2 .mk-chat.is-verified:not(.is-connected) .mk-chat-log:empty::after { content: "Lobby messages will appear here once you connect."; }
body.g2 .mk-chat.is-connected .mk-chat-log:empty::before { -webkit-mask-image: var(--g2-ico-chat-lines); mask-image: var(--g2-ico-chat-lines); }
body.g2 .mk-chat.is-connected .mk-chat-log:empty::after { content: "Connected. Say hello to the lobby."; }

body.g2 .mk-gate { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
body.g2 .mk-gate-note {
  position: relative; width: 100%; box-sizing: border-box; padding: 12px 14px 12px 52px; border: 1px solid #8a6f44; border-radius: 6px;
  background: linear-gradient(180deg, #2c2335, #17111f); color: #e5dbee; font: 13px/1.55 var(--g2-ui);
  box-shadow: inset 0 0 0 1px rgba(255, 226, 170, .07), inset 0 0 22px rgba(214, 170, 90, .06);
}
body.g2 .mk-gate-note::before {
  content: ""; position: absolute; left: 14px; top: 13px; width: 26px; height: 26px; background: linear-gradient(180deg, #fff3d0, #c9923e);
  -webkit-mask: var(--g2-ico-lock) center / contain no-repeat; mask: var(--g2-ico-lock) center / contain no-repeat;
}
body.g2 .mk-chat.is-verified:not(.is-connected) .mk-gate-note { color: #bdf0cf; border-color: #3f8a5c; }
body.g2 .mk-chat.is-verified:not(.is-connected) .mk-gate-note::before { background: linear-gradient(180deg, #d4ffe4, #39c97a); -webkit-mask-image: var(--g2-ico-spark); mask-image: var(--g2-ico-spark); }
body.g2 .mk-chat:not(.is-locked) .g2-gate-cta { display: none !important; }

body.g2 .mk-compose { gap: 7px; }
body.g2 .mk-chat:not(.is-connected) .mk-compose { opacity: .55; }
body.g2 .mk-compose input {
  padding: 10px 12px; border: 1px solid #8a6f44; border-radius: 5px; background: #090610; color: #fff; font: 13.5px var(--g2-ui);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .8);
}
body.g2 .mk-compose input::placeholder { color: #a99bb8; }
body.g2 .mk-compose input:focus-visible { outline-offset: 1px; border-color: #fff0c4; }
body.g2 .mk-emoji-btn { width: 38px; height: 38px; border: 1px solid #8a6f44; border-radius: 5px; background: linear-gradient(180deg, #33264a, #17101f); }
body.g2 .mk-emoji-panel { border: 1px solid #8a6f44; border-radius: 6px; background: linear-gradient(180deg, #221a2e, #120d19); }
body.g2 .mi-btn {
  border: 1.5px solid #fff1c8; border-radius: 5px; padding: 0 16px; min-height: 38px; font: 800 12px/1 var(--g2-ui); letter-spacing: .08em; text-transform: uppercase;
  background: var(--g2-gold-btn); color: #2a1706; text-shadow: 0 1px 0 rgba(255, 240, 200, .55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 3px 0 rgba(0, 0, 0, .6);
}
body.g2 .mi-btn.primary { background: var(--g2-gold-btn); color: #2a1706; border-color: #fff1c8; }
body.g2 .mi-btn:disabled { filter: grayscale(.8) brightness(.7); }

/* status chips */
body.g2 .mk-verify-row { gap: 8px; margin-top: 10px; }
body.g2 .mk-verified, body.g2 .mk-unverified, body.g2 .mk-connect, body.g2 .mk-disconnect {
  padding: 6px 12px 6px 10px; border-radius: 999px; font: 800 10.5px/1 var(--g2-ui); letter-spacing: .07em; text-transform: uppercase;
}
body.g2 .mk-verified { color: #7bf8a8; border: 1px solid #36b068; background: linear-gradient(180deg, rgba(57, 226, 125, .22), rgba(57, 226, 125, .06)); box-shadow: 0 0 12px rgba(57, 226, 125, .25); }
body.g2 .mk-unverified { color: #ffa3a3; border: 1px solid #a83a3a; background: linear-gradient(180deg, rgba(255, 90, 90, .18), rgba(255, 90, 90, .05)); }
body.g2 .mk-unverified::before {
  content: ""; width: 11px; height: 11px; background: currentColor; -webkit-mask: var(--g2-ico-lock) center / contain no-repeat; mask: var(--g2-ico-lock) center / contain no-repeat;
}
body.g2 .mk-connect { color: #2a1706; border: 1.5px solid #fff1c8; background: var(--g2-gold-btn); box-shadow: 0 2px 0 rgba(0, 0, 0, .6); }
body.g2 .mk-disconnect { color: #ffb0b0; border: 1px solid #a83a3a; background: linear-gradient(180deg, #3a1218, #1f0a10); }
body.g2 .mk-connected-count { margin-top: 10px; color: var(--g2-gold); font: 800 11px/1.2 var(--g2-ui); letter-spacing: .08em; text-transform: uppercase; }
body.g2 .mk-connected-count::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--g2-green); box-shadow: 0 0 8px var(--g2-green); vertical-align: 0; }
body.g2 .mk-connected-list { border: 1px solid #5a4868; border-radius: 5px; background: linear-gradient(180deg, #120d19, #0a0710); }
body.g2 .mk-connected-title { color: var(--g2-gold); }
body.g2 .mk-connected-nick { color: #d7b3fa; }
body.g2 .g2-gate-cta { align-self: flex-start; }

/* saved note / hold popups keep the live structure but wear the frame */
body.g2 .saved-pop p, body.g2 .lobby-hold-pop .lobby-hold-note { border: 2px solid transparent; border-radius: 8px; background: var(--g2-frame); color: #fff0c4; font-family: var(--g2-ui); }

/* ---------- responsive ---------- */
@media (max-width: 1260px) {
  body.g2 .mi-activity.g2-activity { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
  body.g2 .g2-cmdpanel { grid-column: 1 / -1; }
  body.g2 .g2-cmdgrid { grid-template-columns: repeat(6, minmax(0, 88px)); justify-content: center; }
  .g2-quest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* The command card is for a keyboard: phones and touch screens never see it, and the grid closes up. */
@media (hover: none), (pointer: coarse), (max-width: 760px) {
  body.g2 .g2-cmdpanel { display: none; }
  body.g2 .mi-activity.g2-activity { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
}
@media (max-width: 800px) {
  body.g2 .mi-activity.g2-activity { grid-template-columns: minmax(0, 1fr); }
  .g2-quest-grid { grid-template-columns: minmax(0, 1fr); }
}
