.range-simulator {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
  }

  .range-simulator-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
  }

  .range-eyebrow {
    margin: 0 0 4px;
    color: var(--color-accent);
    font-size: 13px;
    font-weight: 700;
  }

  .range-simulator h1 {
    margin: 0;
    color: var(--color-text-title);
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 600;
    letter-spacing: 0;
    text-wrap: balance;
  }

  .range-unit-chip {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
    padding: 6px 10px 6px 6px;
    border: 1px solid var(--color-surface-elevated);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-text-title);
    font-size: 14px;
    font-weight: 700;
  }

  .range-unit-chip img,
  .range-unit-chip i {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
  }

  .range-unit-chip img {
    object-fit: contain;
  }

  .range-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    gap: 16px;
    align-items: start;
  }

  .range-map-panel,
  .range-controls {
    border: 1px solid var(--color-surface-elevated);
    border-radius: 12px;
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
  }

  .range-map-panel {
    padding: 10px;
  }

  .range-stage {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: var(--map-aspect);
    max-height: min(78vh, 980px);
    border-radius: min(1vw, 10px);
    background: var(--color-surface-container);
    touch-action: none;
  }

  .range-map-image,
  .range-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .range-map-image {
    object-fit: contain;
    outline: 1px solid rgba(0, 0, 0, 0.08);
    outline-offset: -1px;
  }

  .range-overlay {
    cursor: crosshair;
  }

  .unit-search-circle {
    fill: rgba(80, 224, 129, 0.16);
    stroke: rgba(80, 224, 129, 0.9);
    stroke-width: 4;
  }

  .attack-search-circle {
    fill: rgba(90, 159, 212, 0.12);
    stroke: rgba(90, 159, 212, 0.95);
    stroke-width: 4;
    stroke-dasharray: 14 10;
  }

  .attack-reach-shape {
    fill: rgba(255, 140, 66, 0.24);
    stroke: rgba(255, 140, 66, 0.95);
    stroke-width: 4;
  }

  .attack-reach-shape.is-line {
    fill: rgba(255, 199, 79, 0.24);
    stroke: rgba(255, 199, 79, 0.95);
  }

  .impact-aoe-shape {
    fill: rgba(232, 96, 122, 0.24);
    stroke: rgba(232, 96, 122, 0.95);
    stroke-width: 4;
    stroke-dasharray: 10 7;
  }

  .impact-aoe-shape.is-fan {
    fill: rgba(209, 112, 232, 0.22);
    stroke: rgba(209, 112, 232, 0.95);
  }

  .aim-line {
    stroke: rgba(255, 255, 255, 0.82);
    stroke-width: 3;
    stroke-dasharray: 8 8;
  }

  .unit-handle,
  .target-handle {
    cursor: grab;
  }

  .unit-handle:active,
  .target-handle:active {
    cursor: grabbing;
  }

  .unit-handle circle {
    fill: rgba(8, 12, 20, 0.62);
    stroke: rgba(255, 255, 255, 0.85);
    stroke-width: 3;
  }

  .target-handle circle {
    fill: rgba(255, 140, 66, 0.88);
    stroke: rgba(255, 255, 255, 0.9);
    stroke-width: 3;
  }

  .target-handle path {
    stroke: white;
    stroke-width: 3;
    stroke-linecap: round;
  }

  .range-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 14px;
  }

  .control-group,
  .control-grid label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
  }

  .control-group > label,
  .control-grid span,
  .reference-map span {
    color: var(--color-text-dark);
    font-size: 13px;
    font-weight: 700;
  }

  .select-wrap {
    position: relative;
  }

  .select-wrap select,
  .control-grid input {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--color-surface-elevated);
    border-radius: 8px;
    background: var(--color-surface-container);
    color: var(--color-text-title);
    font: inherit;
    font-size: 14px;
  }

  .select-wrap select {
    appearance: none;
    padding: 8px 34px 8px 10px;
  }

  .select-wrap i {
    position: absolute;
    top: 50%;
    right: 11px;
    color: var(--color-text-dark);
    transform: translateY(-50%);
    pointer-events: none;
  }

  .control-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .control-grid input {
    padding: 8px 10px;
  }

  .shape-segments {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .shape-segments label {
    min-width: 0;
  }

  .shape-segments input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }

  .shape-segments span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    gap: 6px;
    border: 1px solid var(--color-surface-elevated);
    border-radius: 8px;
    background: var(--color-surface-container);
    color: var(--color-text);
    font-size: 13px;
    font-weight: 700;
  }

  .shape-segments input:checked + span {
    border-color: var(--color-accent);
    background: color-mix(in srgb, var(--color-accent) 18%, var(--color-surface));
    color: var(--color-text-title);
  }

  .range-readout {
    display: grid;
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--color-surface-elevated);
    border-radius: 8px;
    background: var(--color-surface-elevated);
  }

  .range-readout div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px;
    background: var(--color-surface-container);
  }

  .range-readout span {
    color: var(--color-text-dark);
    font-size: 13px;
    font-weight: 700;
  }

  .range-readout strong {
    min-width: 0;
    color: var(--color-text-title);
    font-size: 13px;
    font-weight: 800;
    text-align: right;
  }

  .reference-map {
    display: grid;
    gap: 8px;
  }

  .reference-map img {
    width: 100%;
    border-radius: min(1vw, 8px);
    outline: 1px solid rgba(0, 0, 0, 0.08);
    outline-offset: -1px;
  }

  @media (max-width: 920px) {
    .range-simulator-header {
      align-items: flex-start;
      flex-direction: column;
    }

    .range-layout {
      grid-template-columns: 1fr;
    }

    .range-controls {
      order: -1;
    }

    .control-grid,
    .range-controls .control-group:has(.shape-segments),
    .range-readout,
    .reference-map {
      display: none;
    }

    .range-controls {
      padding: 10px;
      border-radius: 10px;
    }

    .range-map-panel {
      min-height: 0;
    }

    .range-stage {
      max-height: calc(100dvh - 190px);
    }
  }

  @media (max-width: 560px) {
    .range-simulator {
      gap: 10px;
      min-height: 0;
    }

    .range-layout {
      gap: 10px;
      min-height: 0;
    }

    .range-map-panel {
      padding: 6px;
      margin-inline: -6px;
      border-right: 0;
      border-left: 0;
      border-radius: 0;
    }

    .range-stage {
      max-height: calc(100dvh - 150px);
      border-radius: 0;
    }

    .range-controls {
      padding: 8px;
    }

    .select-wrap select {
      min-height: 44px;
      font-size: 16px;
    }
  }