/* ═══ GTAVI INSIDER interactive-tools shared chrome ═══
   Shared by options-calc, book-quiz, contest-odds.
   Uses page-level CSS variables (--paper, --surface, --ink, --line, --acid,
   --acid-ink) with fallbacks, so the widgets inherit each page's theme
   (markets neon-noir, library paper, win-earn paper/green). */

:root {
  --t-paper: #0b0817;
  --t-surface: #171126;
  --t-ink: #f8f3ff;
  --t-line: #3d3160;
  --t-acid: #ff2e88;
  --t-acid-ink: #23000f;
}

.gti-tool {
  --paper: var(--t-paper);
  --surface: var(--t-surface);
  --ink: var(--t-ink);
  --line: var(--t-line);
  --acid: var(--t-acid);
  --acid-ink: var(--t-acid-ink);
  background: var(--surface, var(--t-surface));
  color: var(--ink, var(--t-ink));
  border: 1px solid var(--line, var(--t-line));
  border-radius: 18px;
  padding: clamp(20px, 4vw, 40px);
  margin-top: 56px;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
.gti-tool *, .gti-tool *::before, .gti-tool *::after { box-sizing: border-box; }

.gti-tool::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--acid, var(--t-acid)), transparent 70%);
  pointer-events: none;
}

.gti-eyebrow {
  font: 600 11px/1 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--acid, var(--t-acid));
  margin: 0 0 10px;
}

.gti-tool h2.gti-title {
  font-family: 'Pricedown', 'Arial Black', sans-serif;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.02;
  letter-spacing: .01em;
  margin: 0 0 10px;
  color: inherit;
}

.gti-sub {
  margin: 0 0 24px;
  max-width: 60ch;
  opacity: .78;
  font-size: 15px;
  line-height: 1.6;
}

.gti-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(18px, 3vw, 32px);
}
@media (max-width: 720px) { .gti-grid2 { grid-template-columns: 1fr; } }

.gti-field { display: block; margin-bottom: 14px; }
.gti-field > span {
  display: block;
  font: 600 11px/1 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .65;
  margin-bottom: 8px;
}

.gti-tool input[type="number"],
.gti-tool input[type="text"],
.gti-tool select {
  width: 100%;
  background: var(--paper, var(--t-paper));
  color: var(--ink, var(--t-ink));
  border: 1px solid var(--line, var(--t-line));
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
}
.gti-tool input:focus, .gti-tool select:focus {
  outline: 2px solid var(--acid, var(--t-acid));
  outline-offset: 1px;
}

.gti-seg { display: flex; gap: 8px; }
.gti-seg button {
  flex: 1;
  background: transparent;
  color: var(--ink, var(--t-ink));
  border: 1px solid var(--line, var(--t-line));
  border-radius: 10px;
  padding: 12px 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.gti-seg button[aria-pressed="true"] {
  background: var(--acid, var(--t-acid));
  border-color: var(--acid, var(--t-acid));
  color: var(--acid-ink, var(--t-acid-ink));
}

.gti-btn {
  display: inline-block;
  background: var(--acid, var(--t-acid));
  color: var(--acid-ink, var(--t-acid-ink));
  border: 0;
  border-radius: 12px;
  padding: 14px 26px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}
.gti-btn:hover { filter: brightness(1.12); }
.gti-btn.ghost {
  background: transparent;
  color: var(--ink, var(--t-ink));
  border: 1px solid var(--line, var(--t-line));
}

.gti-results {
  background: var(--paper, var(--t-paper));
  border: 1px solid var(--line, var(--t-line));
  border-radius: 14px;
  padding: 20px;
}
.gti-kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line, var(--t-line));
  font-size: 15px;
}
.gti-kv:last-child { border-bottom: 0; }
.gti-kv .k { opacity: .65; }
.gti-kv .v { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.gti-kv .v.pos { color: #4ade80; }
.gti-kv .v.neg { color: #f87171; }

.gti-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-left: 3px solid var(--acid, var(--t-acid));
  background: color-mix(in srgb, var(--acid, var(--t-acid)) 8%, transparent);
  font-size: 14px;
  line-height: 1.6;
  border-radius: 0 10px 10px 0;
}

.gti-tool canvas.gti-canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--line, var(--t-line));
  background: var(--paper, var(--t-paper));
  margin-top: 16px;
}

/* range sliders */
.gti-tool input[type="range"] {
  width: 100%;
  accent-color: var(--acid, var(--t-acid));
  height: 36px;
}
.gti-range-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2px; }
.gti-range-val { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 17px; }

/* quiz option buttons */
.gti-opts { display: grid; gap: 10px; margin-top: 8px; }
.gti-opt {
  text-align: left;
  background: var(--paper, var(--t-paper));
  color: var(--ink, var(--t-ink));
  border: 1px solid var(--line, var(--t-line));
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  cursor: pointer;
  line-height: 1.4;
}
.gti-opt:hover { border-color: var(--acid, var(--t-acid)); }
.gti-opt strong { display: block; font-size: 16px; margin-bottom: 2px; }
.gti-opt small { opacity: .65; }

.gti-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}
.gti-progress i {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: var(--line, var(--t-line));
}
.gti-progress i.on { background: var(--acid, var(--t-acid)); }

.gti-q { margin: 0 0 6px; font-size: clamp(19px, 3vw, 26px); font-weight: 800; line-height: 1.25; }

.gti-result-card {
  background: var(--paper, var(--t-paper));
  border: 1px solid var(--acid, var(--t-acid));
  border-radius: 16px;
  padding: clamp(20px, 3vw, 30px);
  margin-top: 10px;
}
.gti-result-card .tag {
  font: 600 11px/1 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: .18em;
  color: var(--acid, var(--t-acid));
  text-transform: uppercase;
  margin-bottom: 10px;
}
.gti-result-card h3 { margin: 0 0 8px; font-size: clamp(22px, 3.5vw, 32px); font-weight: 800; }
.gti-result-card p { opacity: .8; line-height: 1.6; margin: 0 0 14px; }
.gti-result-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.gti-price { font-size: 22px; font-weight: 800; }

.gti-hidden { display: none !important; }
