.wg-heresy-app {
  /* Base hex geometry: pointy-top regular-ish hexes */
  --wg-hex-size: 32px; /* radius-ish */
  --wg-hex-width: calc(var(--wg-hex-size) * 1.732); /* ≈ sqrt(3) * size */
  --wg-hex-height: calc(var(--wg-hex-size) * 2);    /* 2 * size */

  background: radial-gradient(circle at top, #161921 0, #05070b 55%, #000 100%);
  color: #e5e5e5;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  border: 1px solid #262a33;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.8);
  padding: 12px;
}

.wg-heresy-topbar {
  padding: 10px 14px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #10131b, #191d28);
  border: 1px solid #333949;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wg-heresy-main {
  display: flex;
  gap: 12px;
  min-height: 400px;
}

.wg-heresy-sidebar {
  width: 280px;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wg-heresy-panel {
  background: radial-gradient(circle at top, #151824 0, #0a0c11 60%, #05060a 100%);
  border: 1px solid #272b39;
  padding: 10px 10px 12px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
  font-size: 12px;
}

.wg-heresy-panel h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 8px;
  color: #f3c623;
}

.wg-heresy-panel p {
  margin: 4px 0;
}

.wg-heresy-panel--placeholder {
  opacity: 0.7;
  font-style: italic;
}

.wg-heresy-field {
  margin-bottom: 8px;
}

.wg-heresy-input,
.wg-heresy-select,
.wg-heresy-textarea {
  width: 100%;
  background: #06070b;
  border: 1px solid #343849;
  color: #f5f5f5;
  padding: 4px 6px;
  font-size: 12px;
  border-radius: 3px;
  box-sizing: border-box;
}

.wg-heresy-textarea {
  min-height: 60px;
  resize: vertical;
}

.wg-heresy-radio-label {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
  font-size: 11px;
  cursor: pointer;
}

.wg-heresy-radio-label input[type="radio"] {
  margin-right: 4px;
}

.wg-heresy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  margin-top: 4px;
  border-radius: 3px;
  border: 1px solid #f3c623;
  background: linear-gradient(135deg, #3b320e, #f3c623);
  color: #050608;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-decoration: none;
}

.wg-heresy-button:hover {
  filter: brightness(1.1);
}

.wg-heresy-button--secondary {
  border-color: #3b6ba6;
  background: linear-gradient(135deg, #203246, #3b6ba6);
  color: #e5f2ff;
}

.wg-heresy-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  color: #8fb7ff;
  text-decoration: none;
}

.wg-heresy-link:hover {
  text-decoration: underline;
}

.wg-heresy-help {
  font-size: 11px;
  color: #a0a6b8;
}

.wg-heresy-company-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  max-height: 150px;
  overflow-y: auto;
}

.wg-heresy-company-list-item {
  padding: 4px 6px;
  border-radius: 3px;
  border: 1px solid transparent;
  margin-bottom: 3px;
  font-size: 11px;
  cursor: pointer;
}

.wg-heresy-company-list-item:hover {
  border-color: #384055;
  background: rgba(40, 46, 63, 0.6);
}

.wg-heresy-company-list-item--selected {
  border-color: #42a5ff;
  background: rgba(44, 85, 130, 0.7);
}

.wg-heresy-map-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
}

.wg-heresy-map-container {
  position: relative;
  flex: 1;
  background: radial-gradient(circle at top, #05070b 0, #000 65%);
  border: 1px solid #252a34;
  overflow-x: scroll;
  overflow-y: auto;
  max-height: 75vh;
}

.wg-heresy-map-container::-webkit-scrollbar {
  height: 14px;
  width: 14px;
}

.wg-heresy-map-container::-webkit-scrollbar-track {
  background: #151821;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.8);
}

.wg-heresy-map-container::-webkit-scrollbar-thumb {
  background-image: repeating-linear-gradient(
    45deg,
    #f3c623 0,
    #f3c623 6px,
    #111 6px,
    #111 12px
  );
  border-radius: 3px;
  border: 2px solid #000;
}

.wg-heresy-map-container::-webkit-scrollbar-corner {
  background: #111;
}

.wg-heresy-map-container {
  scrollbar-width: thin;
  scrollbar-color: #f3c623 #151821;
}

.wg-heresy-map {
  padding: 24px;
  position: relative;
  width: calc(64 * var(--wg-hex-width));
  min-width: calc(64 * var(--wg-hex-width));
}

.wg-heresy-hex-row {
  display: flex;
  flex-wrap: nowrap;
  margin-bottom: calc(var(--wg-hex-height) * -0.26); /* pull rows up so points interlock */
}

.wg-heresy-hex-row--offset {
  margin-left: calc(var(--wg-hex-width) / 2);
}

.wg-heresy-hex {
  position: relative;
  flex: 0 0 var(--wg-hex-width);
  width: var(--wg-hex-width);
  height: var(--wg-hex-height);
  background: linear-gradient(145deg, #181c27, #05070c);
  border: 1px solid #343a4b;
  /* Pointy-top hexagon */
  clip-path: polygon(
    50% 0%,
    100% 25%,
    100% 75%,
    50% 100%,
    0% 75%,
    0% 25%
  );
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0;
}

.wg-heresy-hex:hover {
  border-color: #f3c623;
  box-shadow: 0 0 10px rgba(243, 198, 35, 0.7);
}

.wg-heresy-hex--selected {
  border-color: #42a5ff;
  box-shadow: 0 0 14px rgba(66, 165, 255, 0.9);
}

.wg-heresy-hex--hidden {
  filter: grayscale(0.8) brightness(0.4);
  opacity: 0.4;
}

.wg-heresy-hex-label {
  position: absolute;
  bottom: 3px;
  right: 4px;
  font-size: 9px;
  color: #8a90a3;
  pointer-events: none;
}

.wg-heresy-fob {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 4px;
  font-size: 9px;
  background: #b71c1c;
  color: #fbe9e7;
  border-radius: 3px;
  border: 1px solid #ff7961;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.wg-heresy-company-chip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 2px 6px;
  font-size: 9px;
  background: rgba(68, 99, 146, 0.95);
  color: #f2f7ff;
  border-radius: 999px;
  border: 1px solid rgba(143, 174, 216, 0.9);
  white-space: nowrap;
  pointer-events: auto;
}

.wg-heresy-company-chip--selected {
  background: rgba(66, 165, 255, 0.95);
  border-color: #bbdefb;
}

.wg-heresy-arrows-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.wg-heresy-move-arrow {
  position: absolute;
  height: 2px;
  background-image: repeating-linear-gradient(
    90deg,
    #42a5ff 0,
    #42a5ff 6px,
    transparent 6px,
    transparent 10px
  );
  transform-origin: 0 50%;
  box-shadow: 0 0 4px rgba(66, 165, 255, 0.8);
}
