/* Hexpansion — host board HUD + phone controller styles. */

/* ---------- host ---------- */
.game-hexpansion { position: relative; }
.hx-stage { position: absolute; inset: 0; }
.hx-stage canvas { display: block; }

.hx-hud { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.hx-hud-top {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
}
.hx-round {
  background: rgba(18, 4, 31, 0.85);
  border: 2px solid var(--green);
  border-radius: 999px;
  padding: 6px 18px;
  font-weight: 900; font-size: 15px;
}
.hx-timer {
  background: rgba(18, 4, 31, 0.85);
  border: 2px solid var(--cyan);
  border-radius: var(--r-md);
  font-family: var(--display);
  font-size: 30px;
  padding: 4px 18px;
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}
.hx-timer.is-low { color: var(--red); border-color: var(--red); animation: timerPulse 0.7s infinite; }
.hx-timer.is-hidden { display: none; }

.hx-side {
  position: absolute; right: 12px; top: 12px;
  display: flex; flex-direction: column; gap: 6px; width: 250px;
}
.hx-side-head { font-family: var(--display); color: var(--ink-dim); letter-spacing: 0.3em; font-size: 13px; }
.hx-siderow {
  display: flex; align-items: center; gap: 7px;
  background: rgba(18, 4, 31, 0.82);
  border-left: 4px solid hsl(var(--hue, 280) 85% 60%);
  border-radius: var(--r-sm);
  padding: 5px 9px;
  font-size: 12.5px;
}
.hx-siderow.is-dead { opacity: 0.4; filter: grayscale(0.8); }
.hx-sr-name { font-weight: 900; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hx-sr-detail { color: var(--ink-dim); font-size: 11px; }
.hx-sr-vp { font-weight: 900; color: var(--green); font-size: 14px; }

.hx-ticker {
  position: absolute; left: 12px; bottom: 12px;
  display: flex; flex-direction: column; gap: 4px;
  max-width: 46vw;
}
.hx-tickline {
  background: rgba(18, 4, 31, 0.85);
  border-radius: var(--r-sm);
  padding: 5px 12px;
  font-weight: 700; font-size: 13px;
  animation: tickIn 0.3s ease;
}
.hx-tickline.is-bad { color: var(--orange); }
.hx-tickline.is-good { color: var(--green); }

.hx-banner {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.hx-banner.is-hidden { display: none; }
.hx-plan-banner {
  background: rgba(18, 4, 31, 0.92);
  border: 3px solid var(--green);
  border-radius: var(--r-lg);
  padding: 20px 44px;
  text-align: center;
  animation: tilePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hx-plan-title { font-family: var(--display); font-size: clamp(26px, 4.4vw, 44px); color: var(--green); }
.hx-plan-sub { color: var(--ink-dim); font-weight: 700; margin-top: 6px; }

/* ---------- phone ----------
   The whole controller is a touch surface (map pans, sheet scrolls its OWN
   area) — never the page. Same containment as Vamporium/FloorDash. */
.pgame-hexpansion {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: contain;
}
.hxp {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  gap: 6px;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  overflow: hidden;
}
.hxp-top { display: flex; align-items: center; gap: 8px; }
.hxp-round { font-weight: 900; font-size: 12px; color: var(--green); flex: 0 0 auto; }
.hxp-res { display: flex; gap: 5px; flex: 1; justify-content: flex-end; flex-wrap: wrap; }
.hxp-res-chip {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--card);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
}
.hxp-res-chip b { font-size: 12.5px; }
.hxp-res-chip i { color: var(--green); font-style: normal; font-size: 10.5px; font-weight: 900; }

.hxp-mapwrap {
  position: relative; flex: 1.1; min-height: 34vh;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 2px solid var(--card2);
  background: #0a0616;
}
.hxp-map { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.hxp-mode {
  position: absolute; top: 6px; left: 6px; right: 6px;
  background: rgba(255, 213, 30, 0.94);
  color: #3c2c00;
  font-weight: 900; font-size: 13px;
  border-radius: var(--r-sm);
  padding: 7px 10px;
  text-align: center;
  animation: tickIn 0.25s ease;
}
.hxp-mode.is-hidden { display: none; }

.hxp-sheet {
  flex: 1; min-height: 0;
  background: var(--card);
  border-radius: var(--r-md);
  overflow: hidden;
}
.hxp-sheet-scroll {
  height: 100%; overflow-y: auto;
  padding: 8px 10px;
  display: flex; flex-direction: column; gap: 6px;
  touch-action: pan-y;          /* the ONE place vertical touch scrolling lives */
  overscroll-behavior: contain;
}
.hxp-sheet-hint { color: var(--ink-dim); font-weight: 700; font-size: 13px; padding: 12px; text-align: center; }
.hxp-sheet-head { display: flex; align-items: center; gap: 8px; font-size: 14px; flex-wrap: wrap; }
.hxp-owner { color: hsl(var(--hue, 280) 85% 65%); font-weight: 900; font-size: 12px; }
.hxp-yield { color: var(--green); font-weight: 900; font-size: 12px; }
.hxp-diff { color: var(--orange); font-weight: 900; font-size: 11px; }
.hxp-sheet-sub { color: var(--ink-dim); font-weight: 700; font-size: 12.5px; }
.hxp-sheet-sub.is-foe { color: var(--red); }

.hxp-action {
  display: flex; align-items: center; gap: 8px;
  background: var(--card2);
  border: 0; border-radius: var(--r-sm);
  padding: 9px 11px;
  color: var(--ink);
  font-weight: 700; font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.hxp-action.is-off { opacity: 0.42; }
.hxp-action.is-match { outline: 2px solid var(--green); }
.hxp-action-label { flex: 0 0 auto; }
.hxp-action-blurb { flex: 1; color: var(--ink-dim); font-size: 10.5px; font-weight: 700; }
.hxp-action-cost { flex: 0 0 auto; font-size: 12px; }

.hxp-squadrow { display: flex; align-items: center; gap: 6px; }
.hxp-squad-label { flex: 1; font-weight: 900; font-size: 13px; }
.hxp-mini {
  border: 0; border-radius: var(--r-sm);
  background: var(--purple); color: #fff;
  font-weight: 900; font-size: 11.5px;
  padding: 7px 10px;
  cursor: pointer;
}
.hxp-mini.is-wide { width: 100%; background: var(--card2); color: var(--ink); }

.hxp-orders { display: flex; gap: 6px; overflow-x: auto; flex: 0 0 auto; padding: 2px 0; }
.hxp-orders-empty { color: var(--ink-dim); font-size: 11.5px; font-weight: 700; padding: 4px 2px; }
.hxp-order {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card);
  border: 2px solid var(--green);
  border-radius: 999px;
  color: var(--ink);
  padding: 5px 10px;
  font-weight: 700; font-size: 11.5px;
  white-space: nowrap;
  cursor: pointer;
}
.hxp-order b { color: var(--red); }
.hxp-lockrow { flex: 0 0 auto; }

.hxp-resolve {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 24px;
}
.hxp-resolve-emoji { font-size: 56px; }
.hxp-resolve-title { font-family: var(--display); font-size: 24px; color: var(--green); }
.hxp-resolve-sub { color: var(--ink-dim); font-weight: 700; }
.hxp-battles { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.hxp-battle { font-weight: 900; font-size: 14px; border-radius: var(--r-sm); padding: 8px 14px; background: var(--card); }
.hxp-battle.is-win { color: var(--green); }
.hxp-battle.is-loss { color: var(--red); }
