/* ==========================================================================
   CROSSHAIR GENERATOR — unique val-vpesports design
   Tokens: --primary #ff4655 · --bg #0f1923 · --surface #1f2933
           --font-display Bebas Neue · --font-tech JetBrains Mono
   ========================================================================== */

.cxg-page { padding-bottom: 5rem; }

.cxg-wrap {
  position: relative;
  z-index: 1;
  padding-top: 2.5rem;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.cxg-header { margin-bottom: 1.75rem; }

.cxg-eyebrow {
  display: inline-block;
  font-family: var(--font-tech);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.cxg-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: 0.02em;
  color: var(--foreground);
  margin: 0;
}
.cxg-title span { color: var(--primary); }

.cxg-sub {
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--muted);
  max-width: 620px;
  margin: 0.7rem 0 0;
  line-height: 1.6;
}

/* ── Preview viewport ───────────────────────────────────────────────────── */

.cxg-viewport {
  position: relative;
  width: 100%;
  height: 380px;
  overflow: hidden;
  background: #070d14;
  border: 1px solid var(--border);
  border-top: 2px solid var(--primary);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 18px 50px rgba(0,0,0,0.5), 0 0 40px rgba(255,70,85,0.06);
  /* angular cut top-right corner — VALORANT HUD vibe */
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
  margin-bottom: 1rem;
}

.cxg-viewport__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 0;
}

.cxg-viewport__bg--grid {
  background: #0a0f16;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 34px 34px;
}

/* Darkening scrim so any map keeps the crosshair readable */
.cxg-viewport__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at center, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.5) 100%),
    linear-gradient(rgba(15,25,35,0.25), rgba(15,25,35,0.45));
  pointer-events: none;
}

.cxg-viewport__tag {
  position: absolute;
  top: 0.9rem;
  left: 1rem;
  z-index: 3;
  font-family: var(--font-tech);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  pointer-events: none;
}

#cx-gen-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  background: transparent;
}

/* HUD corner brackets */
.cxg-hud {
  position: absolute;
  z-index: 3;
  width: 26px;
  height: 26px;
  pointer-events: none;
  border-color: rgba(255,70,85,0.8);
  border-style: solid;
  border-width: 0;
}
.cxg-hud--tl { top: 12px; left: 12px;  border-top-width: 2px; border-left-width: 2px; }
.cxg-hud--tr { top: 12px; right: 12px; border-top-width: 2px; border-right-width: 2px; }
.cxg-hud--bl { bottom: 12px; left: 12px;  border-bottom-width: 2px; border-left-width: 2px; }
.cxg-hud--br { bottom: 12px; right: 12px; border-bottom-width: 2px; border-right-width: 2px; }

/* ── Action bar (code + buttons) ────────────────────────────────────────── */

.cxg-actionbar {
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.cxg-code {
  flex: 1 1 320px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--primary);
  padding: 0 0.9rem;
  height: 44px;
}

.cxg-code__label {
  font-family: var(--font-tech);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  color: var(--primary);
  text-transform: uppercase;
  flex-shrink: 0;
}

.cxg-code__field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--foreground);
  font-family: var(--font-tech);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  cursor: text;
  min-width: 0;
}

.cxg-actionbar__btns {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ── Inline paste field ─────────────────────────────────────────────────── */

.cxg-paste-field {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.75rem;
  height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.cxg-paste-field:focus-within {
  border-color: var(--primary);
  background: var(--primary-dim);
  color: var(--primary);
}
.cxg-paste-field__input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--foreground);
  font-family: var(--font-tech);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  width: 150px;
}
.cxg-paste-field__input::placeholder {
  color: var(--muted);
  letter-spacing: 0.1em;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.cxg-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 44px;
  padding: 0 1.05rem;
  font-family: var(--font-tech);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform 0.08s;
  white-space: nowrap;
}
.cxg-btn:active { transform: translateY(1px); }

.cxg-btn--ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--foreground);
}
.cxg-btn--ghost:hover { border-color: var(--muted); }

.cxg-btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 18px rgba(255,70,85,0.3);
}
.cxg-btn--primary:hover { background: var(--primary-glow); }
.cxg-btn--primary.is-copied { background: #22c55e; box-shadow: 0 0 18px rgba(34,197,94,0.4); }

/* ── Control deck ───────────────────────────────────────────────────────── */

.cxg-deck {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1rem;
  align-items: start;
}

.cxg-panel {
  background: linear-gradient(180deg, var(--surface) 0%, rgba(31,41,51,0.7) 100%);
  border: 1px solid var(--border);
  /* angular cut top-right */
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
}

.cxg-panel__title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--foreground);
  text-transform: uppercase;
  padding: 0.85rem 1.1rem;
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.cxg-panel__bar {
  width: 3px;
  height: 18px;
  background: var(--primary);
  flex-shrink: 0;
}

/* Toggle inside a panel header sits flush right */
.cxg-panel__title .cxg-onoff { margin-left: auto; }

.cxg-panel__body {
  padding: 1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

/* ── Field (slider / control row) ───────────────────────────────────────── */

.cxg-field { display: flex; flex-direction: column; gap: 0.4rem; }

.cxg-field--row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.cxg-field__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.cxg-field__label {
  font-family: var(--font-tech);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.cxg-field__val {
  font-family: var(--font-tech);
  font-size: 0.74rem;
  color: var(--foreground);
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border);
  padding: 0.1rem 0.45rem;
  min-width: 34px;
  text-align: center;
}

/* ── Range slider (accent fill thumb) ───────────────────────────────────── */

.cxg-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  outline: none;
  cursor: pointer;
}
.cxg-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  background: var(--primary);
  border: 2px solid var(--bg);
  box-shadow: 0 0 8px rgba(255,70,85,0.5);
  cursor: pointer;
  transition: transform 0.12s, background 0.12s;
}
.cxg-range::-webkit-slider-thumb:hover { transform: scale(1.2); background: var(--primary-glow); }
.cxg-range::-moz-range-thumb {
  width: 16px; height: 16px;
  background: var(--primary);
  border: 2px solid var(--bg);
  cursor: pointer;
}

/* ── On/Off pill ────────────────────────────────────────────────────────── */

.cxg-onoff {
  display: inline-flex;
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}
.cxg-onoff__btn {
  padding: 0.3rem 0.8rem;
  font-family: var(--font-tech);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(0,0,0,0.25);
  border: none;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.cxg-onoff__btn + .cxg-onoff__btn { border-left: 1px solid var(--border); }
.cxg-onoff__btn:hover { color: var(--foreground); }
.cxg-onoff__btn.is-active { background: var(--primary); color: #fff; }

/* ── Select ─────────────────────────────────────────────────────────────── */

.cxg-select {
  width: 100%;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border);
  color: var(--foreground);
  font-family: var(--font-tech);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  padding: 0.45rem 0.6rem;
  outline: none;
  cursor: pointer;
}
.cxg-select:focus { border-color: var(--primary); }
.cxg-select option { background: #0d1117; color: var(--foreground); }

/* ── Color row ──────────────────────────────────────────────────────────── */

.cxg-color-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}
.cxg-color-swatch {
  width: 30px; height: 30px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  cursor: pointer;
}
.cxg-color-code {
  flex: 1;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border);
  color: var(--foreground);
  font-family: var(--font-tech);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  padding: 0.4rem 0.55rem;
  outline: none;
  text-transform: uppercase;
}
.cxg-color-code:focus { border-color: var(--primary); }
.cxg-color-picker {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
  pointer-events: none;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .cxg-viewport { height: 280px; }
  .cxg-actionbar__btns { width: 100%; }
  .cxg-paste-field__input { width: 100px; }
}
