/* Crosshair Placement trainer */
.cx-root {
  position: relative;
  z-index: 5;
  margin-top: 0.5rem;
}
.cx-root.hidden { display: none !important; }

.cx-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cx-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  justify-content: space-between;
}

.cx-title {
  font-family: var(--font-display, inherit);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
}

.cx-sub, .cx-lede, .cx-help, .cx-disclaimer, .cx-meta, .cx-mobile-note {
  color: #94a3b8;
  font-size: 0.85rem;
  margin: 0.25rem 0 0;
}

.cx-disclaimer, .cx-mobile-note {
  margin-top: 1rem;
  font-size: 0.75rem;
}

.cx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.cx-card {
  text-align: left;
  background: linear-gradient(160deg, #0f172a 0%, #111827 100%);
  border: 1px solid rgba(52, 211, 153, 0.18);
  border-radius: 0.75rem;
  padding: 1rem;
  color: #e2e8f0;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.cx-card:hover {
  border-color: rgba(52, 211, 153, 0.55);
  transform: translateY(-1px);
}
.cx-card h4 {
  font-weight: 700;
  margin: 0.5rem 0 0.35rem;
}
.cx-card p {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.4;
}
.cx-card-icon {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: rgba(52, 211, 153, 0.1);
  color: #34d399;
}

.cx-setup, .cx-results, .cx-stats-page {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cx-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: #94a3b8;
}

.cx-select {
  background: #0b1220;
  border: 1px solid #1e293b;
  color: #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.55rem 0.7rem;
}

.cx-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.cx-play {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cx-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.cx-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  background: #0b1220;
  border: 1px solid #1e293b;
  border-radius: 0.5rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.8rem;
}
.cx-pill em {
  font-style: normal;
  color: #64748b;
  font-size: 0.7rem;
}
.cx-pill[data-band="too_high"] { color: #fbbf24; }
.cx-pill[data-band="too_low"] { color: #38bdf8; }
.cx-pill[data-band="correct"] { color: #34d399; }
.cx-fps { margin-left: auto; color: #64748b; }

.cx-stage {
  position: relative;
  width: 100%;
  height: min(62vh, 560px);
  min-height: 320px;
  background: #060912;
  border: 1px solid #1e293b;
  border-radius: 0.75rem;
  overflow: hidden;
}

.cx-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  outline: none;
  cursor: none;
}

.cx-crosshair {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.cx-ch-h, .cx-ch-v {
  position: absolute;
  left: 50%;
  top: 50%;
  background: var(--cx-color, #33ff66);
  transform: translate(-50%, -50%);
}
.cx-ch-h {
  width: var(--cx-size, 12px);
  height: var(--cx-thick, 2px);
  margin-left: 0;
  box-shadow:
    calc(-1 * (var(--cx-gap, 4px) + var(--cx-size, 12px) / 2)) 0 0 var(--cx-color, #33ff66),
    calc(var(--cx-gap, 4px) + var(--cx-size, 12px) / 2) 0 0 var(--cx-color, #33ff66);
  width: var(--cx-size, 12px);
  opacity: 0.95;
}
.cx-ch-v {
  width: var(--cx-thick, 2px);
  height: var(--cx-size, 12px);
  box-shadow:
    0 calc(-1 * (var(--cx-gap, 4px) + var(--cx-size, 12px) / 2)) 0 var(--cx-color, #33ff66),
    0 calc(var(--cx-gap, 4px) + var(--cx-size, 12px) / 2) 0 var(--cx-color, #33ff66);
}

.cx-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
}
.cx-stats-grid div {
  background: #0b1220;
  border: 1px solid #1e293b;
  border-radius: 0.6rem;
  padding: 0.65rem 0.75rem;
}
.cx-stats-grid em {
  display: block;
  font-style: normal;
  font-size: 0.7rem;
  color: #64748b;
}
.cx-stats-grid strong {
  font-size: 1.15rem;
}
.cx-est {
  display: block;
  font-size: 0.65rem;
  color: #64748b;
}

.cx-tips {
  margin: 0;
  padding-left: 1.1rem;
  color: #cbd5e1;
  font-size: 0.9rem;
}

.cx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.cx-table th, .cx-table td {
  border-bottom: 1px solid #1e293b;
  padding: 0.4rem 0.35rem;
  text-align: left;
}
.cx-table th { color: #64748b; font-weight: 600; }

.cx-spark {
  width: 100%;
  max-width: 420px;
  height: 80px;
  background: #0b1220;
  border-radius: 0.5rem;
  border: 1px solid #1e293b;
}

.cx-h4 { font-size: 1.15rem; font-weight: 700; margin: 0; }
.cx-h5 { font-size: 0.95rem; font-weight: 600; margin: 0.5rem 0 0; }

@media (max-width: 640px) {
  .cx-stage { min-height: 240px; height: 45vh; }
  .cx-mobile-note { color: #fbbf24; }
}
