/* ==========================================================================
   yandleyick.com/aim-theory — Single-Figure 01 1:1 Scale Chart Styles (Act III)
   Blood-Moon obsidian-crimson palette, crisp >=11.5px mono & >=14.5px body.
   ========================================================================== */

.ati-suite {
  --ati-black: #000000;
  --ati-panel: #0e080d;
  --ati-white: #ffffff;
  --ati-ink: #f8fafc;
  --ati-ink-2: #cbd5e1;
  --ati-mute: #94a3b8;
  --ati-hair: rgba(255, 255, 255, 0.14);
  --ati-hair-strong: rgba(248, 113, 113, 0.34);
  --ati-cyan: #22d3ee;
  --ati-amber: #fbbf24;
  --ati-crimson: #ef4444;

  --ati-font-heading: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, sans-serif;
  --ati-font-body: "Inter", system-ui, -apple-system, sans-serif;
  --ati-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  color: var(--ati-ink);
  font-family: var(--ati-font-body);
  font-size: 15px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.ati-suite *,
.ati-suite *::before,
.ati-suite *::after {
  box-sizing: border-box;
}

/* ---------- Chamfered Surface Frame ---------- */

.ati-notch {
  --ati-c: 14px;
  --ati-bw: 1.5px;
  --ati-stroke: var(--ati-hair-strong);
  --ati-fill: var(--ati-panel);
  position: relative;
  background: var(--ati-stroke);
  clip-path: polygon(
    0 0,
    calc(100% - var(--ati-c)) 0,
    100% var(--ati-c),
    100% 100%,
    var(--ati-c) 100%,
    0 calc(100% - var(--ati-c))
  );
}

.ati-notch::before {
  --ati-ci: calc(var(--ati-c) - var(--ati-bw) * 0.586);
  content: "";
  position: absolute;
  inset: var(--ati-bw);
  background: var(--ati-fill);
  clip-path: polygon(
    0 0,
    calc(100% - var(--ati-ci)) 0,
    100% var(--ati-ci),
    100% 100%,
    var(--ati-ci) 100%,
    0 calc(100% - var(--ati-ci))
  );
  pointer-events: none;
}

.ati-notch > * {
  position: relative;
  z-index: 1;
}

/* ---------- Top Toolbar & Legend ---------- */

.ati-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 8px;
}

.ati-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  font-family: var(--ati-font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ati-ink-2);
}

.ati-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.ati-legend__dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  clip-path: polygon(0 0, calc(100% - 3px) 0, 100% 3px, 100% 100%, 3px 100%, 0 calc(100% - 3px));
}

.ati-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.ati-ctrl-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid var(--ati-hair);
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
}

.ati-btn {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 7px 12px;
  background: transparent;
  color: var(--ati-ink-2);
  font-family: var(--ati-font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ati-btn:hover,
.ati-btn:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  color: var(--ati-white);
  outline: none;
}

.ati-btn[aria-pressed="true"],
.ati-btn.is-active {
  background: var(--ati-crimson);
  color: var(--ati-white);
  font-weight: 700;
}

/* ---------- SVG Stage ---------- */

.ati-stage {
  --ati-c: 16px;
  --ati-bw: 1.5px;
  --ati-stroke: rgba(248, 113, 113, 0.34);
  --ati-fill: #070306;
  padding: 8px 10px 6px;
}

.ati-scroll-hint {
  display: none;
  margin: 0 0 8px;
  font-family: var(--ati-font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ati-crimson);
}

.ati-svg-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: rgba(239, 68, 68, 0.55) rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
}

.ati-svg-scroll::-webkit-scrollbar {
  height: 8px;
}

.ati-svg-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
}

.ati-svg-scroll::-webkit-scrollbar-thumb {
  background: rgba(239, 68, 68, 0.55);
  border-radius: 4px;
}

.ati-svg-lineup {
  display: block;
  width: 100%;
  min-width: 0;
  max-height: calc(100vh - var(--aim-top-offset) - 215px);
  height: auto;
  user-select: none;
}

.ati-subj-col {
  cursor: pointer;
  outline: none;
}

.ati-subj-col .ati-bay-hover-bg {
  opacity: 0;
  transition: opacity 0.16s ease;
}

.ati-subj-col:hover .ati-bay-hover-bg,
.ati-subj-col:focus-visible .ati-bay-hover-bg {
  opacity: 0.55;
}

.ati-subj-col.is-selected .ati-bay-hover-bg {
  opacity: 1;
}

.ati-subj-col .ati-silhouette-body {
  transition: fill-opacity 0.18s ease, stroke-width 0.18s ease;
}

.ati-subj-col:hover .ati-silhouette-body,
.ati-subj-col:focus-visible .ati-silhouette-body,
.ati-subj-col.is-selected .ati-silhouette-body {
  fill-opacity: 0.48;
  stroke-width: 2.5px;
}

.ati-subj-col.is-dimmed {
  opacity: 0.26;
}

/* ---------- Compact 1-Line Selected Subject Readout Bar ---------- */

.ati-readout {
  --ati-c: 14px;
  --ati-bw: 1.5px;
  --ati-stroke: var(--ati-active-accent, #ef4444);
  --ati-fill: #0b0509;
  margin-top: 8px;
  padding: 9px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
}

.ati-readout__left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.ati-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  font-family: var(--ati-font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.09);
  color: var(--ati-white);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.ati-readout__name {
  font-family: var(--ati-font-heading);
  font-weight: 800;
  font-size: 20px;
  color: var(--ati-white);
}

.ati-readout__stats {
  font-family: var(--ati-font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ati-cyan);
}

.ati-readout__role {
  margin: 0;
  flex: 1 1 240px;
  font-size: 14.5px;
  color: var(--ati-ink-2);
  overflow-wrap: anywhere;
}

.ati-readout__role--mystery {
  font-family: var(--ati-font-mono);
  color: #c4b5fd;
  letter-spacing: 0.04em;
}

.ati-readout__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ati-jump-btn {
  appearance: none;
  border: 0;
  padding: 9px 14px;
  background: var(--ati-white);
  color: var(--ati-black);
  font-family: var(--ati-font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ati-jump-btn:hover,
.ati-jump-btn:focus-visible {
  background: var(--ati-crimson);
  color: var(--ati-white);
  outline: none;
}

.ati-twitch-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  background: rgba(169, 112, 255, 0.16);
  border: 1px solid rgba(169, 112, 255, 0.52);
  color: #e9d5ff;
  font-family: var(--ati-font-mono);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: lowercase;
  text-decoration: none;
  white-space: nowrap;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ati-twitch-link:hover,
.ati-twitch-link:focus-visible {
  background: #9146ff;
  color: var(--ati-white);
  outline: none;
}

.ati-twitch-link svg {
  width: 13px;
  height: 13px;
  flex: none;
}

.ati-x-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.52);
  color: #d1fae5;
  font-family: var(--ati-font-mono);
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ati-x-link:hover,
.ati-x-link:focus-visible {
  background: #10b981;
  color: var(--ati-black);
  outline: none;
}

.ati-x-link svg {
  width: 13px;
  height: 13px;
  flex: none;
}

@media (max-width: 760px) {
  .ati-scroll-hint {
    display: block;
  }
  .ati-svg-lineup {
    min-width: 960px;
  }
}
