/* =========================================================
   TXT-ERS — STRENGTH MAP
   ========================================================= */

.strength-map-interaction {
  width: 100%;
  min-width: 0;

  color: #17233a;
}

.strength-map-instructions {
  max-width: 680px;

  margin: 0;

  color: #31394d;

  font-size: 0.94rem;
  line-height: 1.6;
}

.strength-map-hint {
  max-width: 680px;

  margin: 6px 0 0;

  color: #747b8c;

  font-size: 0.72rem;
  line-height: 1.45;
}


/* =========================================================
   CANVAS
   ========================================================= */

.strength-map-canvas {
  position: relative;

  width: 100%;
  min-width: 0;
  min-height: 430px;

  margin-top: 18px;

  overflow: hidden;

  border:
    1px solid
    rgba(255, 255, 255, 0.92);

  border-radius: 26px;

  background:
    radial-gradient(
      circle at 50% 50%,
      rgba(201, 232, 215, 0.64) 0%,
      rgba(222, 239, 228, 0.31) 24%,
      transparent 47%
    ),

    radial-gradient(
      circle at 12% 14%,
      rgba(222, 216, 248, 0.40),
      transparent 32%
    ),

    radial-gradient(
      circle at 88% 84%,
      rgba(239, 207, 167, 0.29),
      transparent 34%
    ),

    linear-gradient(
      145deg,
      #fbfcfa,
      #f7f7fa
    );

  box-shadow:
    0 15px 38px
    rgba(35, 42, 68, 0.09),

    inset 0 1px 0
    rgba(255, 255, 255, 0.97);

  isolation: isolate;
}

.strength-map-canvas::before {
  position: absolute;
  inset: 0;

  z-index: 0;

  content: "";

  pointer-events: none;

  opacity: 0.14;

  background-image:
    radial-gradient(
      circle,
      rgba(70, 79, 101, 0.34)
      1px,
      transparent 1.5px
    );

  background-size:
    25px 25px;

  -webkit-mask-image:
    linear-gradient(
      140deg,
      #000,
      transparent 60%
    );

  mask-image:
    linear-gradient(
      140deg,
      #000,
      transparent 60%
    );
}

.strength-map-canvas::after {
  position: absolute;

  right: -42px;
  bottom: -50px;

  z-index: 0;

  width: 180px;
  height: 150px;

  content: "";

  pointer-events: none;

  border:
    1px solid
    rgba(86, 75, 169, 0.10);

  border-radius:
    100% 0 0 0;

  box-shadow:
    -28px -25px 0
    rgba(80, 145, 109, 0.04),

    -56px -50px 0
    rgba(198, 125, 91, 0.03);
}

.strength-map-motif {
  position: absolute;

  left: 7%;
  bottom: 8%;

  z-index: 0;

  width: 70px;
  height: 30px;

  pointer-events: none;

  opacity: 0.15;

  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 6px,
      rgba(76, 91, 111, 0.42)
      6px 7px
    );

  transform:
    rotate(-8deg);
}


/* =========================================================
   CENTER
   ========================================================= */

.strength-map-center {
  position: absolute;

  left: 50%;
  top: 50%;

  z-index: 4;

  width: 124px;
  height: 124px;

  display: grid;
  place-items: center;

  transform:
    translate(-50%, -50%);

  border-radius: 50%;

  pointer-events: none;
}

.strength-map-center-halo {
  position: absolute;
  inset: 0;

  border-radius: inherit;

  background:
    radial-gradient(
      circle,
      rgba(78, 156, 111, 0.25),
      rgba(78, 156, 111, 0.07)
      56%,
      transparent 73%
    );

  transform:
    scale(0.82);

  opacity: 0.58;

  transition:
    transform 260ms
      cubic-bezier(
        0.22,
        0.75,
        0.24,
        1
      ),
    opacity 200ms ease;
}

.strength-map-center-core {
  position: relative;
  z-index: 2;

  width: 82px;
  height: 82px;

  display: grid;
  place-items: center;

  border:
    1px solid
    rgba(255, 255, 255, 0.95);

  border-radius: 50%;

  background:
    linear-gradient(
      145deg,
      #386f58,
      #579879
    );

  color: #ffffff;

  box-shadow:
    0 18px 42px
    rgba(48, 112, 78, 0.26),

    inset 0 1px 0
    rgba(255, 255, 255, 0.31);

  font-size: 0.86rem;
  font-weight: 820;

  transition:
    transform 220ms ease,
    box-shadow 220ms ease;
}

.strength-map-center.is-active
  .strength-map-center-halo {
  transform: scale(1.14);
  opacity: 0.9;
}

.strength-map-center.is-strong
  .strength-map-center-halo {
  transform: scale(1.28);
  opacity: 1;
}

.strength-map-center.is-active
  .strength-map-center-core {
  transform: scale(1.04);

  box-shadow:
    0 22px 49px
    rgba(48, 112, 78, 0.32),

    inset 0 1px 0
    rgba(255, 255, 255, 0.35);
}


/* =========================================================
   CONNECTORS
   ========================================================= */

.strength-map-connections {
  position: absolute;
  inset: 0;

  z-index: 2;

  width: 100%;
  height: 100%;

  overflow: visible;

  pointer-events: none;
}

.strength-map-connection {
  fill: none;

  stroke:
    rgba(84, 119, 99, 0.30);

  stroke-width:
    calc(
      1.5px +
      (
        var(
          --connection-strength,
          0
        ) * 1.8px
      )
    );

  stroke-linecap: round;

  opacity:
    calc(
      0.30 +
      (
        var(
          --connection-strength,
          0
        ) * 0.38
      )
    );

  transition:
    stroke 150ms ease,
    opacity 150ms ease,
    stroke-width 150ms ease;
}

.strength-map-connection.is-connected {
  stroke:
    rgba(68, 140, 98, 0.74);

  opacity: 0.88;
}

.strength-map-connection.is-close {
  stroke:
    rgba(48, 126, 83, 0.96);

  filter:
    drop-shadow(
      0 2px 4px
      rgba(69, 142, 98, 0.20)
    );
}


/* =========================================================
   NODES
   ========================================================= */

.strength-map-node-layer {
  position: absolute;
  inset: 0;

  z-index: 5;

  pointer-events: none;
}

.strength-map-node {
  position: absolute;

  width: auto;
  min-width: 116px;
  max-width: 158px;
  min-height: 56px;

  margin: 0;
  padding: 11px 16px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 9px;

  border:
    1px solid
    rgba(255, 255, 255, 0.94);

  border-radius: 999px;

  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.99),
      rgba(243, 246, 245, 0.95)
    );

  color: #293247;

  box-shadow:
    0 11px 28px
    rgba(36, 44, 67, 0.13),

    inset 0 1px 0
    rgba(255, 255, 255, 0.98);

  font: inherit;

  cursor: grab;
  pointer-events: auto;

  touch-action: none;

  -webkit-user-select: none;
  user-select: none;

  opacity: 0;

  transform:
    translateY(7px)
    scale(0.97);

  transition:
    opacity 210ms ease,
    transform 220ms
      cubic-bezier(
        0.22,
        0.75,
        0.24,
        1
      ),
    border-color 170ms ease,
    background 170ms ease,
    color 170ms ease,
    box-shadow 200ms ease;
}

.strength-map-interaction.is-ready
  .strength-map-node {
  opacity: 1;

  transform:
    translateY(0)
    scale(
      calc(
        0.99 +
        (
          var(
            --connection-strength,
            0
          ) * 0.035
        )
      )
    );
}

.strength-map-node:hover {
  transform:
    translateY(-2px)
    scale(1.02);

  box-shadow:
    0 16px 36px
    rgba(36, 44, 67, 0.17);
}

.strength-map-node.is-dragging {
  z-index: 100;

  cursor: grabbing;

  transform:
    scale(1.065);

  box-shadow:
    0 27px 60px
    rgba(29, 37, 60, 0.24);

  transition:
    opacity 90ms ease,
    box-shadow 90ms ease;
}

.strength-map-node.is-connected {
  border-color:
    rgba(85, 150, 110, 0.28);

  background:
    linear-gradient(
      145deg,
      rgba(232, 247, 238, 0.99),
      rgba(245, 250, 246, 0.96)
    );

  color: #285a3d;

  box-shadow:
    0 15px 34px
    rgba(54, 128, 84, 0.17);
}

.strength-map-node.is-close {
  border-color:
    rgba(72, 143, 100, 0.58);

  background:
    linear-gradient(
      145deg,
      #3f8861,
      #67aa81
    );

  color: #ffffff;

  box-shadow:
    0 19px 42px
    rgba(52, 126, 81, 0.27);
}

.strength-map-node-accent {
  width: 10px;
  height: 10px;

  flex: 0 0 auto;

  border-radius: 50%;

  background:
    linear-gradient(
      145deg,
      #7d72d3,
      #b6aedf
    );

  box-shadow:
    0 3px 8px
    rgba(81, 69, 170, 0.22);
}

.strength-map-node.is-connected
  .strength-map-node-accent {
  background:
    linear-gradient(
      145deg,
      #4f9470,
      #8ac09e
    );
}

.strength-map-node.is-close
  .strength-map-node-accent {
  background: #ffffff;

  box-shadow:
    0 0 0 4px
    rgba(255, 255, 255, 0.14);
}

.strength-map-node-label {
  min-width: 0;

  font-size: 0.78rem;
  font-weight: 780;
  line-height: 1.2;

  overflow-wrap: anywhere;
}


/* =========================================================
   STATUS
   ========================================================= */

.strength-map-status-row {
  margin-top: 14px;

  display: flex;
  align-items: center;
  justify-content: flex-start;

  min-height: 30px;
}

.strength-map-status-text {
  margin: 0;

  color: #4f6273;

  font-size: 0.76rem;
  font-weight: 720;
  line-height: 1.4;
}


/* =========================================================
   COMPACT FEEDBACK
   ========================================================= */

.strength-map-feedback {
  position: absolute;

  left: 50%;
  bottom: 18px;

  z-index: 20;

  width:
    min(
      calc(100% - 36px),
      510px
    );

  padding: 11px 13px;

  display: grid;

  grid-template-columns:
    30px minmax(0, 1fr);

  gap: 10px;

  align-items: center;

  transform:
    translateX(-50%);

  border:
    1px solid
    rgba(74, 145, 101, 0.17);

  border-radius: 15px;

  background:
    rgba(242, 250, 245, 0.94);

  -webkit-backdrop-filter:
    blur(10px);

  backdrop-filter:
    blur(10px);

  box-shadow:
    0 12px 30px
    rgba(45, 94, 65, 0.13);
}

.strength-map-feedback[hidden] {
  display: none;
}

.strength-map-feedback-mark {
  width: 30px;
  height: 30px;

  display: grid;
  place-items: center;

  border-radius: 50%;

  background:
    linear-gradient(
      145deg,
      #448f65,
      #70b48a
    );

  color: #ffffff;

  font-size: 0.78rem;
  font-weight: 900;
}

.strength-map-feedback-title {
  display: block;

  color: #315e43;

  font-size: 0.77rem;
  font-weight: 810;
  line-height: 1.25;
}

.strength-map-feedback-text {
  margin: 2px 0 0;

  color: #53665a;

  font-size: 0.68rem;
  line-height: 1.4;
}


/* =========================================================
   PRIVACY
   ========================================================= */

.strength-map-privacy {
  margin: 10px 0 0;
  padding-top: 11px;

  display: flex;
  align-items: flex-start;

  gap: 8px;

  border-top:
    1px solid
    rgba(68, 76, 102, 0.09);

  color: #72798a;

  font-size: 0.66rem;
  line-height: 1.45;
}


/* =========================================================
   FOCUS
   ========================================================= */

.strength-map-node:focus-visible {
  outline:
    3px solid
    rgba(78, 70, 180, 0.30);

  outline-offset: 3px;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media screen and (max-width: 600px) {
  .strength-map-instructions {
    font-size: 0.86rem;
    line-height: 1.55;
  }

  .strength-map-hint {
    font-size: 0.68rem;
  }

  .strength-map-canvas {
    min-height: 470px;

    border-radius: 22px;
  }

  .strength-map-center {
    width: 108px;
    height: 108px;
  }

  .strength-map-center-core {
    width: 72px;
    height: 72px;

    font-size: 0.79rem;
  }

  .strength-map-node {
    min-width: 96px;
    max-width: 126px;
    min-height: 50px;

    padding: 9px 12px;
  }

  .strength-map-node-label {
    font-size: 0.69rem;
  }

  .strength-map-feedback {
    bottom: 14px;

    width:
      calc(100% - 28px);
  }
}


/* =========================================================
   SMALL PHONES
   ========================================================= */

@media screen and (max-width: 390px) {
  .strength-map-canvas {
    min-height: 500px;
  }

  .strength-map-center-core {
    width: 66px;
    height: 66px;
  }

  .strength-map-node {
    min-width: 88px;
    max-width: 112px;

    padding: 8px 10px;
  }

  .strength-map-node-label {
    font-size: 0.65rem;
  }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (
  prefers-reduced-motion: reduce
) {
  .strength-map-node,
  .strength-map-center-halo,
  .strength-map-center-core,
  .strength-map-connection {
    transition: none;
  }

  .strength-map-node.is-dragging {
    transform: none;
  }
}