/* =========================================================================
   HUBTEKI FULL-VIEWPORT RESPONSIVE GAMESPACE
   Desktop (>=1180px), Tablet (768-1179px), Mobile (<768px)
   ========================================================================= */

.gs-root {
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* Dedicated deep petrol-teal + warm-cream + pastel-rose scope so the table stays high-contrast in all themes! */
  --bg: #0a2128;
  --bg-elevated: #0c2730;
  --surface: rgba(14, 42, 51, 0.92);
  --surface-2: rgba(20, 54, 65, 0.92);
  --surface-hover: rgba(28, 70, 83, 0.96);
  --border: rgba(242, 157, 163, 0.28);
  --border-strong: rgba(242, 157, 163, 0.5);
  --text: #f7f7df;
  --text-muted: #b6ced4;
  --text-dim: #7f9ea7;
  --gold: #f2be85;
  --gold-hover: #f7cfa2;
  --gold-soft: rgba(242, 157, 163, 0.16);
  --gold-ink: #0a2128;
  --cta-bg: #f29da3;
  --cta-bg-hover: #f8b7bc;
  --cta-ink: #0a2128;
  background:
    linear-gradient(155deg, rgba(10, 33, 40, 0.84) 0%, rgba(36, 26, 46, 0.78) 52%, rgba(10, 33, 40, 0.88) 100%),
    url("/assets/aidalon-bg-desktop.jpg") center / cover no-repeat;
  color: #f7f7df;
  position: relative;
  isolation: isolate;
}
/* Subtle rose-teal-gold cityscape blueprint accent layer */
.gs-root::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    #4ba8be 0%, #4ba8be 22%,
    #e26d82 52%,
    #e8b86d 82%, #e8b86d 100%
  );
  -webkit-mask:
    url("/assets/table-bg-blueprint.svg") center / cover no-repeat,
    radial-gradient(ellipse 80% 75% at 50% 42%, #000 30%, rgba(0, 0, 0, 0.45) 100%);
  -webkit-mask-composite: source-in;
  mask:
    url("/assets/table-bg-blueprint.svg") center / cover no-repeat,
    radial-gradient(ellipse 80% 75% at 50% 42%, #000 30%, rgba(0, 0, 0, 0.45) 100%);
  mask-composite: intersect;
  opacity: 0.18;
}

/* Top Notched HUD Header — Left & Right bars align cleanly with Sidebars below! */
.gs-topbar {
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 30;
  pointer-events: none;
}
.gs-hud-left, .gs-hud-right {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(145deg, rgba(16, 47, 57, 0.94), rgba(10, 33, 40, 0.96));
  border: 1px solid rgba(242, 157, 163, 0.34);
  border-top: none;
  padding: 0 12px;
  box-shadow: 0 4px 16px rgba(4, 14, 18, 0.45), inset 0 1px 0 rgba(247, 247, 223, 0.08);
  box-sizing: border-box;
}
.gs-hud-left {
  width: calc(clamp(284px, 23vw, 352px) + 10px);
  justify-content: space-between;
  border-bottom-right-radius: 10px;
  border-left: none;
  margin-left: -10px;
  padding-left: 14px;
}
.gs-topbar .brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}
.gs-topbar .brand-mark svg {
  width: 13px;
  height: 12px;
}
.gs-hud-right {
  width: calc(clamp(252px, 19.5vw, 296px) + 10px);
  justify-content: space-between;
  border-bottom-left-radius: 10px;
  border-right: none;
  margin-right: -10px;
  padding-right: 12px;
  gap: 6px;
}
.gs-live-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
}
.gs-live-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #69b88e;
  box-shadow: 0 0 8px #69b88e;
}
.gs-hud-first-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: rgba(152, 203, 220, 0.14);
  border: 1px solid rgba(152, 203, 220, 0.45);
  color: #cbe7f2;
}
.gs-hud-first-pill.is-you {
  background: linear-gradient(135deg, rgba(224, 188, 126, 0.28), rgba(224, 188, 126, 0.12));
  border-color: #e0bc7e;
  color: #f7dfa7;
  box-shadow: 0 0 10px rgba(224, 188, 126, 0.2);
}
.gs-first-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1.5px 6px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  background: linear-gradient(135deg, rgba(224, 188, 126, 0.3), rgba(224, 188, 126, 0.14));
  border: 1px solid #e0bc7e;
  color: #f7dfa7;
  box-shadow: 0 0 8px rgba(224, 188, 126, 0.22);
}
.gs-second-badge {
  display: inline-flex;
  align-items: center;
  padding: 1.5px 6px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  background: rgba(108, 126, 155, 0.14);
  border: 1px solid rgba(108, 126, 155, 0.34);
  color: #9bb0cb;
}
.gs-mobile-only { display: none !important; }

/* 3-Column Fixed-Viewport Workspace (Desktop & Tablet) */
.gs-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(284px, 23vw, 352px) minmax(0, 1fr) clamp(252px, 19.5vw, 296px);
  gap: 10px;
  padding: 4px 10px 6px;
  position: relative;
}

/* =========================================================================
   LEFT SIDEBAR: RIVAL -> CURRENT ACTIONS -> YOU
   ========================================================================= */
.gs-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-height: 0;
  min-width: 0;
  z-index: 10;
}
.gs-player-card {
  background: linear-gradient(145deg, rgba(16, 47, 57, 0.93), rgba(10, 33, 40, 0.96));
  border: 1px solid rgba(242, 157, 163, 0.3);
  border-radius: 9px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  box-shadow: 0 6px 18px rgba(4, 14, 18, 0.4), inset 0 1px 0 rgba(247, 247, 223, 0.09);
}
.gs-player-card.active-turn {
  border-color: #ffe07a;
  box-shadow:
    inset 0 0 0 1px rgba(255, 224, 122, 0.6),
    inset 0 0 14px rgba(255, 224, 122, 0.14),
    0 0 16px rgba(255, 218, 102, 0.45),
    0 0 34px rgba(255, 214, 92, 0.22),
    0 5px 16px rgba(3, 12, 24, 0.35);
}
.gs-player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}
.gs-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.gs-avatar {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #354c70;
  flex-shrink: 0;
  background: #101b2e;
}
.gs-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.gs-counters {
  display: flex;
  align-items: center;
  gap: 4px;
}
.gs-counter-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(16, 31, 50, 0.72);
  border: 1px solid rgba(108, 126, 155, 0.42);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #eeeae1;
  position: relative;
}
.gs-counter-btn.editable:hover {
  border-color: #e0bc7e;
  background: rgba(224, 188, 126, 0.16);
}
.gs-icon-svg {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
}
.gs-counter-btn .ic-act { color: #e0bc7e; width: 16px; height: 15px; }
.gs-counter-btn .ic-shd { color: #e0bc7e; width: 14px; height: 16px; }
.gs-counter-btn .ic-heat { color: #e0bc7e; width: 14px; height: 16px; }
.gs-btn-primary .gs-icon-svg,
.gs-btn-secondary .gs-icon-svg { width: 15px; height: 15px; }
.gs-cache-pill .gs-icon-svg { width: 10px; height: 12px; }

/* Animated Resource Delta Popups (+1 / -1) */
@keyframes gsDeltaFloat {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(0.85); }
  20% { opacity: 1; transform: translate(-50%, -4px) scale(1.05); }
  80% { opacity: 1; transform: translate(-50%, -14px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -22px) scale(0.95); }
}
.gs-delta-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 5px;
  border-radius: 9px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  pointer-events: none;
  z-index: 40;
  animation: gsDeltaFloat 1.5s ease-out forwards;
}
.gs-delta-badge.pos { background: #26593f; color: #b7f5d4; border: 1px solid #69b88e; }
.gs-delta-badge.neg { background: #5c2727; color: #ffc5c5; border: 1px solid #e06c6c; }

/* Inline Counter Editor Popover */
.gs-counter-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  width: 214px;
  background: #101b2e;
  border: 1px solid var(--gold);
  border-radius: 6px;
  padding: 10px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.78);
  z-index: 70;
}

/* Council Fans (Left Sidebar — generous full-proportion 63:88 hand cards, zero clipping!) */
.gs-council-fan {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  min-height: 98px;
  padding: 10px 4px 2px 2px;
  overflow: visible;
}
.gs-council-fan.is-crowded { gap: 0; }
.gs-council-fan.is-crowded .gs-my-hand-card:not(:first-child) { margin-left: -14px; }
.gs-council-fan.is-very-crowded { gap: 0; }
.gs-council-fan.is-very-crowded .gs-my-hand-card:not(:first-child) { margin-left: -26px; }
.gs-rival-hand-card {
  width: 48px;
  height: 67px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #304564;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}
.gs-rival-hand-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gs-my-hand-card {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  max-width: 84px;
  aspect-ratio: 63 / 88;
  border-radius: 5px;
  border: 1.5px solid #354c70;
  background: #0d1626;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.55);
}
.gs-my-hand-card:hover {
  transform: translateY(-10px) scale(1.07);
  border-color: var(--gold);
  z-index: 12;
}
.gs-my-hand-card.selected {
  transform: translateY(-12px) scale(1.08);
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(222, 192, 124, 0.48), 0 12px 22px rgba(0, 0, 0, 0.65);
  z-index: 14;
}
.gs-my-hand-card .gs-hand-art {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.gs-my-hand-card .gs-hand-art img {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  background: #0c1320;
}
.gs-card-badge-circle {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f0c869;
  color: #0b1322;
  font-size: 10.5px;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 2px solid #0b1322;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.72);
  z-index: 8;
  pointer-events: none;
}
.gs-card-badge-circle.is-multi {
  width: 19px;
  height: 14px;
  border-radius: 999px;
  background: #0c2138;
  color: #5ee7ff;
  border: 1.5px solid #5ee7ff;
  box-shadow: 0 0 7px rgba(94, 231, 255, 0.5), 0 2px 6px rgba(0, 0, 0, 0.75);
}
@keyframes gsTriggerPulse {
  0%, 100% { box-shadow: 0 0 0 2px #5ee7ff, 0 0 16px rgba(94, 231, 255, 0.75), inset 0 0 14px rgba(94, 231, 255, 0.25); }
  50% { box-shadow: 0 0 0 3px #ffe07a, 0 0 24px rgba(255, 224, 122, 0.9), inset 0 0 18px rgba(255, 224, 122, 0.32); }
}
.is-trigger-glow {
  border-color: #5ee7ff !important;
  animation: gsTriggerPulse 1.15s ease-in-out infinite;
  cursor: pointer !important;
  z-index: 25;
}
.gs-trigger-pill {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #5ee7ff, #ffe07a);
  color: #091321;
  font-family: var(--font-mono);
  font-size: clamp(7.5px, 1.15cqw, 9.5px);
  font-weight: 900;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.7);
  z-index: 15;
  white-space: nowrap;
  pointer-events: none;
}
.gs-discard-highlight {
  border-color: #ff9c6e !important;
  box-shadow: 0 0 0 2px rgba(255, 156, 110, 0.55), 0 6px 14px rgba(0, 0, 0, 0.55) !important;
}

/* Current Actions Zone */
.gs-actions-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
}
.gs-prompt-banner {
  background: rgba(15, 27, 46, 0.94);
  border: 1px solid #2e4568;
  border-left: 3px solid var(--gold);
  border-radius: 5px;
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.35;
}
.gs-action-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.gs-btn-primary {
  background: #e0bc7e;
  color: #201b13;
  border: 1px solid #e0bc7e;
  border-radius: 6px;
  min-height: 38px;
  padding: 8px 8px;
  font-weight: 700;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(3, 12, 24, 0.25), inset 0 1px 0 rgba(255, 248, 232, 0.35);
}
.gs-btn-primary:hover:not(:disabled) {
  background: #ebd09c;
  border-color: #ebd09c;
}
.gs-btn-primary:disabled {
  background: #26344b;
  border-color: #35455f;
  color: #b7c2d4;
  box-shadow: none;
  cursor: not-allowed;
}
.gs-btn-secondary {
  background: #18304a;
  color: #eeeae1;
  border: 1px solid #6c7e9b;
  border-radius: 6px;
  min-height: 38px;
  padding: 8px 8px;
  font-weight: 600;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(23, 36, 59, 0.18), inset 0 1px 0 rgba(201, 230, 255, 0.08);
}
.gs-btn-secondary:hover:not(:disabled) {
  border-color: #e0bc7e;
  background: #2d3d56;
}
.gs-btn-secondary:disabled {
  background: #26344b;
  border-color: #35455f;
  color: #b7c2d4;
  box-shadow: none;
  opacity: 0.7;
  cursor: not-allowed;
}

/* =========================================================================
   CENTER PROPORTIONAL DUAL BLUEPRINT PLAYMATS (1.62:1 + Container Queries!)
   ========================================================================= */
.gs-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 0;
  min-width: 0;
  position: relative;
}

.gs-playmat {
  /* 1.70:1 playmat with compact minmax(0, 0.66fr) side zones so every 3x3 grid slot is a true 1:1 square! */
  aspect-ratio: 1.70 / 1;
  width: min(100%, calc((100dvh - 58px) / 2 * 1.70));
  max-height: calc((100dvh - 58px) / 2);
  container-type: inline-size;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, #b38743 65%, #25365e);
  background-color: #25365e;
  background-image:
    linear-gradient(rgba(37, 54, 94, 0.36), rgba(37, 54, 94, 0.36)),
    url("/assets/playmat-blueprint.svg");
  background-position: 50%;
  background-size: cover;
  box-shadow:
    0 0 0 2px #b38743,
    0 0 0 3px color-mix(in srgb, #b38743 55%, #101827),
    0 4px 12px rgba(3, 12, 24, 0.45);
  padding: 1cqw 1.35cqw 1.3cqw;
  display: grid;
  grid-template-columns: minmax(0, 0.66fr) minmax(0, 0.66fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto repeat(3, minmax(0, 1fr));
  gap: 1.15cqw 1.25cqw;
  position: relative;
}
.gs-playmat.is-rival {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.66fr) minmax(0, 0.66fr);
}
.gs-playmat.active-owner {
  border-color: color-mix(in srgb, #ffe07a 88%, #25365e);
  box-shadow:
    0 0 0 2px #ffe07a,
    0 0 0 3px color-mix(in srgb, #ffe07a 60%, #101827),
    0 0 20px rgba(255, 218, 102, 0.42),
    0 0 38px rgba(255, 214, 92, 0.18),
    0 6px 18px rgba(3, 12, 24, 0.5);
}

/* Exact Hubteki Lane Color Tokens */
.lane-network { --lane: #a7bf7f; --lane-soft: #a7bf7f; --slot-wash: 7%; }
.lane-council { --lane: #d6a254; --lane-soft: #d6a254; --slot-wash: 17%; }
.lane-archives { --lane: #98cbdc; --lane-soft: #98cbdc; --slot-wash: 7%; }

.gs-lane-head {
  grid-row: 1;
  text-align: center;
  font-size: clamp(9px, 1.45cqw, 12px);
  font-weight: 600;
  color: #dce9f9;
  padding: 0.25cqw 0.4cqw 0.45cqw;
  border-bottom: 2px solid var(--lane, #6ea7dc);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4cqw;
  line-height: 1;
  user-select: none;
  z-index: 4;
}
.gs-lane-head.clickable-delve {
  cursor: pointer;
  background: rgba(238, 157, 63, 0.2);
  border-radius: 4px 4px 0 0;
}
.gs-lane-head.clickable-delve:hover { background: rgba(238, 157, 63, 0.38); }
.gs-lane-head.delve-active {
  background: rgba(245, 161, 59, 0.28);
  color: #ffe0ad;
  border-radius: 4px 4px 0 0;
}

/* Unified Playmat Card / Pile / Score Slots with Hubteki's 7%/17% luminous glass washes */
.gs-slot, .gs-pile-box, .gs-seeker-slot, .gs-score-area {
  position: relative;
  border: 1px solid var(--lane-soft, #c6d4ed);
  border-radius: 5px;
  background: color-mix(in srgb, #eef3ff var(--slot-wash, 7%), transparent);
  box-shadow: inset 0 0 0 1px rgba(238, 243, 255, 0.04);
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 140ms, background 140ms, box-shadow 140ms;
}
.gs-slot.is-occupied {
  background:
    linear-gradient(rgba(37, 54, 94, 0.46), rgba(37, 54, 94, 0.46)),
    color-mix(in srgb, #eef3ff var(--slot-wash, 7%), transparent);
}
.gs-score-area, .gs-pile-box.is-scrap {
  border-color: #c6d4ed;
  background: color-mix(in srgb, #eef3ff 17%, transparent);
}
.gs-pile-box {
  flex-direction: column;
  justify-content: space-between;
  padding: 0.45cqw 0.4cqw;
  cursor: pointer;
}
.gs-pile-box:hover { border-color: var(--gold); }
.gs-pile-label {
  font-size: clamp(8px, 1.25cqw, 11px);
  color: #c2d6f0;
  font-weight: 500;
  line-height: 1;
}
.gs-pile-art {
  flex: 1;
  min-height: 0;
  aspect-ratio: 63 / 88;
  max-height: 66%;
  border-radius: 0.5cqw;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  margin: 0.2cqw 0;
}
.gs-pile-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gs-pile-count {
  font-family: var(--font-mono);
  font-size: clamp(9.5px, 1.5cqw, 13px);
  font-weight: 700;
  color: #f0f5fc;
  line-height: 1;
}

.gs-score-area {
  flex-direction: column;
  justify-content: flex-start;
  padding: 0.55cqw 0.65cqw;
  gap: 0.45cqw;
}
.gs-score-cards {
  display: flex;
  flex-direction: column;
  gap: 0.45cqw;
  width: 100%;
  flex: 1;
  min-height: 0;
  align-items: center;
  justify-content: flex-start;
}
.gs-score-slot {
  height: 30%;
  width: auto;
  max-width: 94%;
  aspect-ratio: 88 / 63;
  border-radius: 0.55cqw;
  overflow: hidden;
  border: 1.5px solid var(--gold);
  cursor: pointer;
  position: relative;
  background: #0b1424;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
}
.gs-score-slot.is-new {
  animation: gsCardPop 260ms ease-out;
}
.gs-score-slot-rot {
  height: 139.68%;
  width: auto;
  aspect-ratio: 63 / 88;
  transform: rotate(90deg);
  flex-shrink: 0;
}
.gs-score-slot-rot img {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  background: #0b1424;
}
.gs-score-slot-label {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 18%;
  background: rgba(9, 16, 28, 0.9);
  color: #edf1f8;
  font-size: clamp(7px, 1.05cqw, 9px);
  font-weight: 700;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 3;
}

.gs-seeker-slot {
  border-color: rgba(222, 192, 124, 0.48);
  padding: 0.35cqw;
  cursor: pointer;
}
.gs-seeker-slot:hover { border-color: var(--gold); }
.gs-seeker-art {
  height: 86%;
  aspect-ratio: 63 / 88;
  max-width: 86%;
  border-radius: 0.55cqw;
  overflow: hidden;
  position: relative;
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
}
.gs-seeker-art.exhausted {
  transform: rotate(90deg) scale(0.95);
}

/* Slot Interactive States & Drag-and-Drop Highlights */
.gs-slot.has-floating-ui { z-index: 60; }
.gs-slot.slot-target-gold,
.gs-slot.slot-drag-ready {
  border-color: var(--gold);
  background: rgba(222, 192, 124, 0.16);
  box-shadow: inset 0 0 14px rgba(222, 192, 124, 0.22);
  cursor: pointer;
}
.gs-slot.slot-target-gold:hover,
.gs-slot.slot-drag-over {
  border-color: #ffe07a;
  background: rgba(255, 224, 122, 0.34);
  box-shadow: 0 0 16px rgba(255, 224, 122, 0.35), inset 0 0 16px rgba(255, 224, 122, 0.28);
}
.gs-my-hand-card[draggable="true"] { cursor: grab; }
.gs-my-hand-card.is-dragging { opacity: 0.45; transform: scale(0.96); cursor: grabbing; }
.gs-moment-dropzone {
  position: absolute;
  inset: 14px;
  border-radius: 12px;
  border: 2px dashed #ffe07a;
  background: rgba(16, 31, 50, 0.78);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 45;
  pointer-events: none;
}
.gs-moment-dropzone.active {
  display: flex;
  pointer-events: auto;
}
.gs-moment-dropzone.drag-over {
  background: rgba(224, 188, 126, 0.28);
  box-shadow: inset 0 0 28px rgba(255, 224, 122, 0.35);
}
.gs-moment-drop-pill {
  background: linear-gradient(145deg, #1b3654, #101f32);
  border: 1.5px solid #ffe07a;
  color: #fff2cc;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
.gs-slot.slot-approaching {
  border-color: #f5a13b;
  box-shadow: 0 0 0 2px rgba(245, 161, 59, 0.65), inset 0 0 18px rgba(245, 161, 59, 0.25);
}
.gs-slot.slot-passed { border-color: #69b88e; }
.gs-slot-prompt {
  font-size: clamp(8.5px, 1.35cqw, 11.5px);
  font-weight: 700;
  color: var(--gold);
  text-align: center;
}

/* =========================================================================
   HUBTEKI DIRECTIONAL DELVE PATH ARROWS (Larger, Clearer, Tighter!)
   ========================================================================= */
.gs-route-mark {
  position: absolute;
  width: 10.6cqw;
  height: 2.6cqw;
  pointer-events: none;
  z-index: 8;
}
.gs-route-mark.pos-bottom {
  bottom: -1.95cqw;
  left: 50%;
  transform: translateX(-50%);
}
.gs-route-mark.pos-top {
  top: -1.95cqw;
  left: 50%;
  transform: translateX(-50%);
}
.gs-route-mark.pos-left {
  left: -5.9cqw;
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
}
.gs-route-mark.pos-right {
  right: -5.9cqw;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
}
.gs-route-arrows { fill: var(--lane, #8cb4e0); opacity: 0.98; }
.gs-route-disc { fill: #f1f5fc; stroke: #0d182b; stroke-width: 1.6; }
.gs-route-bolt { fill: #0d182b; }
.gs-route-mark.lit .gs-route-arrows { fill: #ffd085; }
.gs-route-mark.lit .gs-route-disc { fill: #f5a13b; stroke: #fff4df; }
.gs-route-mark.lit .gs-route-bolt { fill: #0b1424; }

/* LIVE ANIMATED DELVE SVG OVERLAY — sits UNDER cards & decide buttons so UI is always clickable! */
.gs-delve-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}
@keyframes gsDashFlow {
  from { stroke-dashoffset: 24; }
  to { stroke-dashoffset: 0; }
}
.gs-delve-dotted {
  fill: none;
  stroke-width: 3;
  stroke-dasharray: 7 5;
  stroke-linecap: round;
  opacity: 0.85;
  animation: gsDashFlow 0.85s linear infinite;
}
.gs-delve-trail {
  fill: none;
  stroke: #f5a13b;
  stroke-width: 4.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(245, 161, 59, 0.8));
}
.gs-delve-lane-halo {
  fill: rgba(245, 161, 59, 0.1);
  stroke: rgba(245, 161, 59, 0.5);
  stroke-width: 1.5;
}
@keyframes gsMarkerPulse {
  0%, 100% { r: 15; opacity: 0.45; }
  50% { r: 19; opacity: 0.15; }
}
.gs-marker-group {
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}
.gs-marker-halo {
  fill: #f5a13b;
  animation: gsMarkerPulse 1.4s ease-in-out infinite;
}
.gs-marker-disc {
  fill: #f5a13b;
  stroke: #fff7e8;
  stroke-width: 2;
}
.gs-marker-chevron {
  fill: none;
  stroke: #0e1624;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Card inside Square Grid Slot — animation runs ONLY on newly placed cards (.is-new) so chat never flashes! */
@keyframes gsCardPop {
  from { opacity: 0; transform: scale(0.84); }
  to { opacity: 1; transform: scale(1); }
}
.gs-grid-card {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 6;
}
.gs-grid-card.is-new {
  animation: gsCardPop 220ms ease-out;
}
.gs-grid-card-visual {
  height: 86%;
  width: auto;
  max-width: 86%;
  aspect-ratio: 63 / 88;
  border-radius: 0.55cqw;
  overflow: hidden;
  border: 1.5px solid #48638a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}
.gs-grid-card.is-forged .gs-grid-card-visual { border-color: var(--gold); }
.gs-grid-card.is-exhausted .gs-grid-card-visual { transform: rotate(90deg) scale(0.95); }

/* Hubteki frosted translucent slate-grey name bubble (top-left) & offset B / S stat bubble (bottom-right) */
.gs-grid-card-name {
  position: absolute;
  top: 4.5%;
  left: 5%;
  max-width: 84%;
  background: rgba(44, 56, 76, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(226, 236, 250, 0.22);
  color: #f4f7fc;
  font-size: clamp(8px, 1.28cqw, 10.5px);
  font-weight: 600;
  line-height: 1.2;
  padding: 2px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 7;
  border-radius: 5px;
  box-shadow: 0 2px 6px rgba(4, 10, 20, 0.42);
  pointer-events: none;
}
.gs-grid-card-stats {
  position: absolute;
  bottom: 4.5%;
  right: 5%;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(24, 34, 50, 0.84);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(226, 236, 250, 0.24);
  color: #f4f7fc;
  font-family: var(--font-mono);
  font-size: clamp(7.5px, 1.22cqw, 10px);
  font-weight: 700;
  line-height: 1.2;
  padding: 2px 6px;
  border-radius: 5px;
  white-space: nowrap;
  z-index: 7;
  box-shadow: 0 2px 6px rgba(4, 10, 20, 0.48);
  pointer-events: none;
}
.gs-grid-card-stats .st-k {
  color: rgba(210, 224, 245, 0.76);
  font-weight: 600;
}
.gs-grid-card-stats .st-v {
  color: #ffffff;
  font-weight: 800;
}
.gs-grid-card-stats .st-sep {
  color: rgba(180, 198, 224, 0.55);
  margin: 0 1px;
}
.gs-replace-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(14, 21, 34, 0.96);
  color: var(--gold);
  border-top: 1px solid var(--gold);
  font-size: clamp(8px, 1.25cqw, 10.5px);
  font-weight: 700;
  text-align: center;
  padding: 2px;
  z-index: 5;
}
.gs-cache-pill {
  position: absolute;
  top: 22%;
  left: 3px;
  background: rgba(15, 24, 40, 0.94);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: clamp(7.5px, 1.1cqw, 9.5px);
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  z-index: 4;
}

/* Floating Card Action Popover & Decide Bar */
.gs-card-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 168px;
  background: #0d1728;
  border: 1px solid var(--gold);
  border-radius: 6px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.85);
  z-index: 80;
}
.gs-card-menu-item {
  background: rgba(20, 34, 56, 0.94);
  border: 1px solid #2b4062;
  border-radius: 4px;
  color: var(--text);
  padding: 6px 9px;
  font-size: 12px;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.gs-card-menu-item:hover:not(:disabled) {
  border-color: var(--gold);
  background: rgba(222, 192, 124, 0.16);
}
.gs-card-menu-item:disabled { opacity: 0.45; cursor: not-allowed; }

.gs-decide-bar {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(11, 20, 36, 0.98);
  border: 1.5px solid var(--gold);
  border-radius: 6px;
  padding: 5px 7px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.85);
  z-index: 90;
}

/* Floating Delve Target Pills over Rival Playmat */
.gs-delve-pills {
  position: absolute;
  bottom: 1.4cqw;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 40;
}
.gs-delve-pill {
  background: rgba(14, 24, 42, 0.96);
  border: 1.5px solid #f5a13b;
  color: #ffe0ad;
  padding: 5px 10px;
  border-radius: 18px;
  font-size: clamp(10px, 1.45cqw, 12px);
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7);
}
.gs-delve-pill:hover { background: #f5a13b; color: #101722; }

/* =========================================================================
   RIGHT SIDEBAR: CARD READER + UNIFIED MATCH LOG & INLINE CHAT
   ========================================================================= */
.gs-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  min-width: 0;
  z-index: 10;
}
.gs-reader {
  background: linear-gradient(145deg, rgba(16, 47, 57, 0.93), rgba(10, 33, 40, 0.96));
  border: 1px solid rgba(242, 157, 163, 0.3);
  box-shadow: 0 6px 18px rgba(4, 14, 18, 0.4), inset 0 1px 0 rgba(247, 247, 223, 0.09);
  border-radius: 9px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1.38 1 0;
  min-height: 0;
  overflow: visible;
  position: relative;
}
.gs-reader-rules {
  background: rgba(11, 20, 35, 0.62);
  border: 1px solid rgba(54, 89, 118, 0.55);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.45;
  color: #d7e3f4;
  max-height: 76px;
  overflow-y: auto;
  flex-shrink: 0;
}
.gs-reader-rules .rule-line + .rule-line {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(108, 126, 155, 0.22);
}
.kw-trigger {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(224, 188, 126, 0.14);
  border: 1px solid rgba(224, 188, 126, 0.42);
  color: #f4d898;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.45;
  cursor: help;
  vertical-align: baseline;
  transition: background 120ms, border-color 120ms;
}
.kw-trigger:hover, .kw-trigger:focus-visible {
  background: rgba(224, 188, 126, 0.28);
  border-color: #ffe07a;
  color: #fff6dc;
}
.kw-inline {
  color: #f4d898;
  text-decoration: underline dotted rgba(224, 188, 126, 0.7);
  text-underline-offset: 2px;
  cursor: help;
  font-weight: 600;
}
.gs-kw-popover {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(100% + 6px);
  background: linear-gradient(155deg, #172e47, #0d192b);
  border: 1.5px solid #e0bc7e;
  border-radius: 8px;
  padding: 9px 11px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.82);
  z-index: 110;
  font-size: 11.5px;
  line-height: 1.42;
  color: #e6eef9;
}
.gs-reader .gs-kw-popover {
  bottom: auto;
  top: 42px;
}
.gs-reader-art {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.gs-reader-card-frame {
  height: 100%;
  width: auto;
  max-width: 100%;
  aspect-ratio: 63 / 88;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid #354d73;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55);
  flex-shrink: 0;
  background: #0c1320;
}
.gs-reader-card-frame img {
  object-fit: contain !important;
  background: #0c1320;
}
.gs-match-panel {
  flex: 1 1 0;
  min-height: 0;
  background: linear-gradient(145deg, rgba(16, 47, 57, 0.93), rgba(10, 33, 40, 0.96));
  border: 1px solid rgba(242, 157, 163, 0.3);
  box-shadow: 0 6px 18px rgba(4, 14, 18, 0.4), inset 0 1px 0 rgba(247, 247, 223, 0.09);
  border-radius: 9px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.gs-match-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  padding-right: 4px;
}
.gs-feed-event {
  line-height: 1.35;
}
.gs-feed-event small {
  display: block;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10.5px;
  margin-top: 1px;
}
.gs-feed-chat {
  background: rgba(24, 39, 64, 0.72);
  border-left: 2px solid var(--gold);
  border-radius: 0 5px 5px 0;
  padding: 5px 8px;
  line-height: 1.35;
}
.gs-feed-chat .chat-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}
.gs-feed-card-link {
  color: var(--gold);
  cursor: pointer;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(222, 192, 124, 0.45);
}

/* Practice Jev AI Debug Tab & Decision Trace Cards */
.gs-panel-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.gs-panel-tab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.gs-panel-tab:hover { color: #fff; }
.gs-panel-tab.active {
  background: rgba(224, 188, 126, 0.16);
  border-color: rgba(224, 188, 126, 0.55);
  color: #f7dfa7;
}
.gs-panel-tab.is-jev.active {
  background: rgba(94, 231, 255, 0.15);
  border-color: rgba(94, 231, 255, 0.6);
  color: #7ef0ff;
}
.gs-jev-card {
  background: rgba(11, 21, 37, 0.85);
  border: 1px solid rgba(94, 231, 255, 0.25);
  border-left: 3px solid #5ee7ff;
  border-radius: 6px;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
}
.gs-jev-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}
.gs-jev-opt {
  position: relative;
  border-radius: 4px;
  padding: 4px 6px;
  background: rgba(24, 39, 64, 0.55);
  border: 1px solid rgba(108, 126, 155, 0.24);
  overflow: hidden;
}
.gs-jev-opt.is-chosen {
  border-color: rgba(224, 188, 126, 0.75);
  background: rgba(224, 188, 126, 0.12);
}
.gs-jev-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: rgba(94, 231, 255, 0.14);
  pointer-events: none;
}
.gs-jev-opt.is-chosen .gs-jev-bar {
  background: rgba(224, 188, 126, 0.22);
}
.gs-jev-opt-row {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  line-height: 1.3;
}

/* =========================================================================
   OVERLAYS: MULLIGAN (FULL VIEWPORT, ZERO CLIPPING), MOVABLE BREACH DISCOVERY, VICTORY, DRAWER
   ========================================================================= */
.gs-overlay-center {
  position: fixed;
  inset: 44px 0 0 0;
  background: radial-gradient(ellipse 72% 62% at 50% 52%, rgba(16, 31, 50, 0.86), rgba(10, 17, 29, 0.94));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 75;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px 20px;
}
.gs-discovery-float {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(350px, 92vw);
  background: linear-gradient(155deg, rgba(20, 38, 60, 0.97), rgba(11, 20, 36, 0.98));
  border: 1.5px solid #e0bc7e;
  border-radius: 10px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.78), 0 0 24px rgba(224, 188, 126, 0.22);
  z-index: 88;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
}
.gs-discovery-float.is-positioned {
  transform: none;
}
.gs-discovery-dragbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(224, 188, 126, 0.14);
  border-bottom: 1px solid rgba(224, 188, 126, 0.35);
  cursor: grab;
  touch-action: none;
}
.gs-discovery-dragbar:active { cursor: grabbing; }
.gs-discovery-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
}
.gs-discovery-float.is-minimized .gs-discovery-body {
  display: none;
}
.gs-mulligan-title {
  border: 1px solid rgba(222, 192, 124, 0.55);
  background: rgba(14, 24, 42, 0.94);
  padding: 7px 22px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.gs-mulligan-title::before,
.gs-mulligan-title::after {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--gold);
}
.gs-mulligan-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  max-width: 100%;
}
.gs-mulligan-rival-card {
  width: clamp(58px, 8vw, 102px);
  aspect-ratio: 63 / 88;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #354c70;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.6);
}
.gs-mulligan-rival-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gs-mulligan-my-card {
  position: relative;
  width: clamp(64px, 10vw, 134px);
  aspect-ratio: 63 / 88;
  border-radius: 7px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 160ms, border-color 160ms;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.65);
}
.gs-mulligan-my-card:hover { transform: translateY(-6px); }
.gs-mulligan-my-card.swap-selected {
  border-color: var(--gold);
  transform: translateY(-9px);
  opacity: 0.88;
}
.gs-swap-pill {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--gold);
  color: #101722;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  z-index: 6;
}
.gs-mulligan-my-card .gs-swap-ring {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #101b2e;
  border: 1.5px solid #4c648a;
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  z-index: 6;
}
.gs-mulligan-my-card.swap-selected .gs-swap-ring {
  background: var(--gold);
  border-color: var(--gold);
  color: #101722;
}
.gs-mulligan-zoom-btn {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: rgba(11, 20, 36, 0.92);
  border: 1px solid rgba(224, 188, 126, 0.65);
  color: #f7dfa7;
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: zoom-in;
  z-index: 8;
  transition: background 120ms, transform 120ms;
}
.gs-mulligan-zoom-btn:hover {
  background: #e0bc7e;
  color: #101722;
  transform: scale(1.1);
}

/* Interactive D20 First-Player Roll Overlay */
.gs-d20-card {
  background: linear-gradient(155deg, rgba(20, 38, 60, 0.96), rgba(11, 20, 36, 0.98));
  border: 1.5px solid #e0bc7e;
  border-radius: 12px;
  padding: 24px 28px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.78), 0 0 28px rgba(224, 188, 126, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 520px;
  width: 94%;
}
.gs-d20-arena {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}
.gs-d20-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 128px;
}
@keyframes gsD20Tumble {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-18deg) scale(1.12); }
  50% { transform: rotate(16deg) scale(1.06); }
  75% { transform: rotate(-10deg) scale(1.1); }
  100% { transform: rotate(0deg) scale(1); }
}
.gs-d20-die {
  width: 92px;
  height: 92px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: default;
  position: relative;
  display: grid;
  place-items: center;
  transition: transform 160ms ease, filter 160ms ease;
}
.gs-d20-die.can-roll {
  cursor: pointer;
  filter: drop-shadow(0 0 14px rgba(224, 188, 126, 0.45));
}
.gs-d20-die.can-roll:hover {
  transform: scale(1.09) rotate(6deg);
  filter: drop-shadow(0 0 20px rgba(255, 224, 122, 0.72));
}
.gs-d20-die.is-rolling {
  animation: gsD20Tumble 0.48s ease-in-out infinite;
}
.gs-d20-die.is-winner {
  filter: drop-shadow(0 0 18px rgba(105, 184, 142, 0.72));
}
.gs-d20-num {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 900;
  color: #fff6dc;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

/* Large Floating Chat Card Hover Preview */
.gs-chat-hover-preview {
  position: fixed;
  width: 246px;
  aspect-ratio: 63 / 88;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #e0bc7e;
  background: #0b1424;
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.85), 0 0 18px rgba(224, 188, 126, 0.25);
  pointer-events: none;
  z-index: 140;
  display: none;
}
.gs-chat-hover-preview.visible {
  display: block;
}
.gs-chat-hover-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gs-discovery-card {
  background: rgba(13, 23, 40, 0.97);
  border: 1.5px solid var(--gold);
  border-radius: 10px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.78);
  max-width: 400px;
  width: 92%;
}

.gs-drawer {
  position: fixed;
  top: 44px;
  right: 0;
  bottom: 0;
  width: min(350px, 100vw);
  background: #0d1728;
  border-left: 1px solid var(--gold);
  z-index: 95;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: -14px 0 40px rgba(0, 0, 0, 0.72);
}

/* =========================================================================
   TABLET BREAKPOINT (768px – 1179px): Compressed 3-Column, FULL 100dvh FIT!
   ========================================================================= */
@media (max-width: 1179px) and (min-width: 768px) {
  .gs-hud-left { width: calc(clamp(192px, 23vw, 232px) + 8px); margin-left: -8px; }
  .gs-hud-right { width: calc(clamp(192px, 23.5vw, 234px) + 8px); margin-right: -8px; }
  .gs-body {
    grid-template-columns: clamp(192px, 23vw, 232px) minmax(0, 1fr) clamp(192px, 23.5vw, 234px);
    gap: 8px;
    padding: 6px 8px 8px;
  }
  .gs-overlay-center {
    inset: 44px 0 0 0;
  }
  .gs-player-card { padding: 6px 8px; }
  .gs-action-row-2 { grid-template-columns: 1fr; }
  .gs-council-fan { min-height: 80px; padding: 8px 2px 2px; gap: 3px; }
  .gs-my-hand-card { max-width: 62px; }
  .gs-rival-hand-card { width: 32px; height: 45px; }
  .gs-btn-primary, .gs-btn-secondary { padding: 6px 6px; font-size: 11.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .gs-counter-btn { padding: 2px 4px; font-size: 11px; }
}

/* =========================================================================
   MOBILE BREAKPOINT (< 768px): Tabbed Single-Mat + Docked Hand + Drawers!
   ========================================================================= */
@media (max-width: 767px) {
  .gs-mobile-only { display: inline-flex !important; }
  .gs-desktop-only { display: none !important; }

  .gs-topbar { height: 42px; padding: 0 6px; }
  .gs-hud-left, .gs-hud-right { width: auto; margin: 0; padding: 0 10px; gap: 6px; }

  .gs-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px 8px 8px;
    overflow: hidden;
  }
  .gs-left, .gs-right { display: none; }

  .gs-mobile-strips {
    display: flex !important;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
  }
  .gs-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    background: rgba(13, 22, 37, 0.94);
    border: 1px solid #263957;
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 12px;
  }
  .gs-mobile-bar.active-turn {
    border-color: #ffe07a;
    box-shadow:
      0 0 14px rgba(255, 218, 102, 0.42),
      0 0 24px rgba(255, 214, 92, 0.18),
      inset 0 0 0 1px rgba(255, 224, 122, 0.5);
  }

  .gs-mobile-tabs {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    flex-shrink: 0;
    position: relative;
    z-index: 12;
  }
  .gs-mobile-tab {
    background: rgba(15, 25, 42, 0.92);
    border: 1px solid #2b4062;
    border-radius: 5px;
    padding: 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
  }
  .gs-mobile-tab.active {
    background: var(--gold-soft);
    border-color: var(--gold);
    color: var(--gold);
  }

  .gs-center {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    padding: 4px 0;
    justify-content: center;
  }
  .gs-playmat {
    width: min(100%, calc(100%));
    max-height: calc(100% - 4px);
    height: auto;
    aspect-ratio: 1.70 / 1;
  }
  .gs-playmat.mobile-hidden { display: none; }

  .gs-mobile-dock {
    display: flex !important;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
    background: rgba(12, 21, 36, 0.96);
    border: 1px solid #2b4062;
    border-radius: 7px;
    padding: 7px 8px;
  }
  .gs-mobile-dock .gs-council-fan {
    min-height: 76px;
    padding: 4px 2px 2px;
  }
  .gs-mobile-dock .gs-my-hand-card {
    max-width: 64px;
  }
  .gs-mobile-dock .gs-council-fan { min-height: 64px; padding-top: 4px; }
  .gs-mobile-dock .gs-my-hand-card { width: 52px; height: 72px; min-width: 52px; margin-right: -8px; }

  .gs-overlay-center { inset: 42px 0 0 0; padding: 12px; }
}
