/* ============================================================
   Tech-Priest Payback Calculator — styles
   Lives on the wiki (reference.css, 16px root). All text is #fff
   and >=1rem per project rules. Differentiation is via background
   fills and accent borders, never dimmed text.
   ============================================================ */

:root { --tpp-purchaser: #b66ad9; --tpp-orange: #e6872e; }

.tpp-intro {
  font-size: 1.05rem;
  color: #fff;
  line-height: 1.55;
  margin: 0 0 24px;
}

/* info icon next to the page title (mechanics summary in its tooltip) */
.tpp-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  color: var(--gold);
  font-size: 1.15rem;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
  cursor: help;
  margin-left: 12px;
  vertical-align: middle;
  user-select: none;
  transition: background .15s;
}
.tpp-info:hover, .tpp-info:focus { background: var(--gold-glow); outline: none; }
/* smaller info icon for sub-section / heading labels */
.tpp-info-sm { width: 22px; height: 22px; font-size: 1rem; margin-left: 8px; }
/* let the plain-text info tooltips keep their line breaks (scoped to this page) */
.rw-tip { white-space: pre-line; }

/* rich (HTML) tooltip for the payout-timeline icon — bullets + colored break-even terms */
.tpp-tl-infowrap { position: relative; display: inline-block; vertical-align: middle; }
.tpp-tl-tip {
  position: absolute;
  left: 0;
  top: calc(100% + 7px);
  z-index: 200;
  display: none;
  width: 340px;
  max-width: 78vw;
  background: var(--surface2);
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 11px 13px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  font-size: 0.95rem;
  font-weight: 400;
  font-style: normal;
  line-height: 1.45;
  color: #fff;
  text-align: left;
  white-space: normal;
}
.tpp-tl-infowrap:hover .tpp-tl-tip,
.tpp-tl-infowrap:focus-within .tpp-tl-tip { display: block; }
.tpp-tl-tip-lead { display: block; margin-bottom: 8px; }
.tpp-tl-tip-item { display: block; position: relative; padding-left: 16px; margin-bottom: 5px; }
.tpp-tl-tip-item:last-child { margin-bottom: 0; }
.tpp-tl-tip-item::before { content: "\2022"; position: absolute; left: 2px; color: var(--gold); }
.tpp-be-group { color: var(--blue); font-weight: 700; }
.tpp-be-purchaser { color: var(--tpp-purchaser); font-weight: 700; }

.tpp-tool { display: flex; flex-direction: column; gap: 24px; }

.tpp-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
}
.tpp-panel-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px;
}

/* ============================================================
   Inputs
   ============================================================ */
.tpp-inputs { display: flex; flex-direction: column; gap: 16px; }
/* difficulty / players / current wave share one row, each its own bordered sub-card */
.tpp-settings-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: stretch; }
.tpp-setting {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  padding: 14px 16px;
}
.tpp-setting-duration { gap: 9px; flex: 1 1 340px; }
/* support-buys sub-card (turret / mines toggles fill the card) */
.tpp-setting-support { flex: 1 1 300px; }
.tpp-setting-support .tpp-seg { width: 100%; }
.tpp-setting-support .tpp-seg-btn { flex: 1 1 0; }
/* difficulty / player count / current wave cards stretch to fill the row,
   their segmented buttons fill each card so there is no gap on the right */
.tpp-settings-row > .tpp-setting:not(.tpp-setting-duration):not(.tpp-setting-support) { flex: 1 1 auto; }
.tpp-settings-row > .tpp-setting:not(.tpp-setting-duration):not(.tpp-setting-support) .tpp-seg { width: 100%; }
.tpp-settings-row > .tpp-setting:not(.tpp-setting-duration):not(.tpp-setting-support) .tpp-seg-btn { flex: 1 1 0; }
.tpp-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}
.tpp-hint {
  display: inline-block;
  margin-top: 4px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  border-bottom: 1px dotted var(--gold);
  cursor: help;
}
.tpp-sub { font-size: 1rem; color: #fff; line-height: 1.5; margin: 0; }

/* segmented controls — content-sized, uniform */
.tpp-seg { display: flex; gap: 8px; flex-wrap: wrap; }
.tpp-seg-btn {
  flex: 0 0 auto;
  min-width: 52px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 18px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.2;
}
.tpp-seg-btn:hover { border-color: var(--gold-dim); background: var(--surface3); }
.tpp-seg-btn:active { transform: translateY(1px); }
.tpp-seg-btn.active {
  border-color: var(--gold);
  background: var(--gold-glow);
  box-shadow: inset 0 0 0 1px var(--gold);
}
.tpp-seg-sub { font-size: 1rem; font-weight: 600; color: var(--gold); }

/* range slider */
.tpp-slider-row { display: flex; align-items: center; gap: 16px; width: 100%; }
.tpp-range {
  -webkit-appearance: none;
  appearance: none;
  flex: 1 1 auto;
  height: 8px;
  border-radius: 6px;
  background: var(--surface3);
  border: 1px solid var(--border);
  outline: none;
}
.tpp-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid #0b0b12;
  cursor: pointer;
}
.tpp-range::-moz-range-thumb {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid #0b0b12;
  cursor: pointer;
}
.tpp-range-out { font-size: 1.1rem; font-weight: 800; color: var(--gold); min-width: 66px; text-align: right; }

/* ============================================================
   Verdict
   ============================================================ */
.tpp-verdict { display: flex; flex-direction: column; gap: 16px; border-width: 2px; }
.tpp-verdict-head { display: flex; align-items: center; gap: 12px; }
.tpp-verdict.is-strong { border-color: var(--green); }
.tpp-verdict.is-worth  { border-color: var(--blue); }
.tpp-verdict.is-tossup { border-color: var(--tpp-orange); }
.tpp-verdict.is-skip   { border-color: var(--red); }

.tpp-verdict-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #0b0b12;
  padding: 8px 18px;
  border-radius: var(--radius);
}
.is-strong .tpp-verdict-badge { background: var(--green); }
.is-worth  .tpp-verdict-badge { background: var(--blue); color: #fff; }
.is-tossup .tpp-verdict-badge { background: var(--tpp-orange); }
.is-skip   .tpp-verdict-badge { background: var(--red); color: #fff; }

.tpp-verdict-line { font-size: 1.1rem; color: #fff; line-height: 1.55; }

.tpp-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.tpp-stat {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.tpp-stat-val { font-size: 1.8rem; font-weight: 800; color: #fff; line-height: 1; }
.tpp-stat-val.pos { color: var(--green); }
.tpp-stat-val.neg { color: var(--red); }
.tpp-stat-label { font-size: 1rem; font-weight: 600; color: #fff; }

/* ============================================================
   Payout timeline
   ============================================================ */
/* badge (left) + "Payout timeline" (centered) share one line */
.tpp-tl-header { position: relative; display: flex; align-items: center; min-height: 48px; margin-bottom: 14px; }
.tpp-tl-header .tpp-panel-title { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; }
.tpp-timeline {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  margin: 14px 0 44px;
}
.tpp-tick {
  position: relative;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 6px;
  min-height: 68px;
  text-align: center;
  border: 1px solid var(--border);
  background: var(--surface3);
  cursor: default;
}
.tpp-tick.is-collected {
  background: linear-gradient(160deg, var(--gold), var(--gold-dim));
  border-color: var(--gold);
}
.tpp-tick.is-lost { background: var(--surface2); opacity: 0.45; }
.tpp-tick-num { font-size: 1.05rem; font-weight: 800; color: #fff; line-height: 1.15; }
.tpp-tick-time { font-size: 1rem; font-weight: 600; color: #fff; line-height: 1.1; }
.tpp-tick.is-collected .tpp-tick-num,
.tpp-tick.is-collected .tpp-tick-time { color: #0b0b12; }
/* two break-even rings: group (blue, whole squad) and purchaser (violet, the buyer) */
/* break-even cells keep the lost-cell opacity, so an unreached marker greys out
   with its payout (no opacity override here on purpose) */
.tpp-tick.is-be-group,
.tpp-tick.is-be-purchaser,
.tpp-tick.is-be-both { outline: 3px solid var(--blue); outline-offset: 2px; }
.tpp-tick.is-be-purchaser { outline-color: var(--tpp-purchaser); }
.tpp-tick-label {
  position: absolute;
  bottom: -48px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}
.tpp-tick-label.is-group,
.tpp-tick-label.is-both { color: var(--blue); }
.tpp-tick-label.is-purchaser { color: var(--tpp-purchaser); }
.tpp-timeline-legend { font-size: 1.05rem; color: #fff; line-height: 1.5; margin: 22px 0 0; }

/* ============================================================
   Notes
   ============================================================ */
.tpp-notes-list { margin: 8px 0 0; padding-left: 22px; }
.tpp-notes-list li {
  font-size: 1.05rem;
  color: #fff;
  line-height: 1.55;
  margin-bottom: 10px;
}
.tpp-notes-list li:last-child { margin-bottom: 0; }
.tpp-notes-list strong { color: var(--gold); }

/* ============================================================
   Narrow screens (kept functional; tool is desktop-first)
   ============================================================ */
@media (max-width: 620px) {
  .tpp-field { grid-template-columns: 1fr; gap: 8px; align-items: start; }
  .tpp-stats { grid-template-columns: repeat(2, 1fr); }
  .tpp-timeline { gap: 6px; }
  .tpp-tick-num { font-size: 1rem; }
  .tpp-tick-label { bottom: -44px; }
}
