/* ============================================================
   Dimension GOAT — application styles

   Organized top-down by component. Designers: edit this file
   directly; the .cljs source only assigns classes (no inline
   visual styling except for values that depend on runtime data:
   segment widths, league colors, tie-row backgrounds).
   ============================================================ */

/* ---------- Global page chrome ---------- */

.page {
  font-family: system-ui, sans-serif;
  max-width: 60rem;
  margin: 1rem auto;
  padding: 0 1rem;
  color: #111;
}

/* ---------- Hero (marquee + title block) ---------- */

/* Grid: marquee fills the rest, right column hugs its widest line
   ("Send to your friend who is wrong." / "The GOAT Dimension"). */
.hero {
  display: grid;
  grid-template-columns: 1fr max-content;
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 0.9rem;
}

.hero-right {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.5rem;
  justify-content: space-between;
}

.hero-h1 {
  font-size: 1.85rem;
  margin: 0;
  letter-spacing: -0.015em;
  text-align: center;
  line-height: 1.1;
}

/* Distinct font from the h1 — humanist serif/sans contrast. */
.hero-tagline {
  font-size: 1.25rem;
  color: #222;
  margin: 0.4rem 0 0;
  font-weight: 500;
  font-family: Optima, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-style: italic;
  letter-spacing: 0.005em;
  text-align: center;
}

.hero-steps {
  list-style-position: inside;
  padding: 0;
  margin: 1.1rem 0 0;
  color: #444;
  font-size: 0.95rem;
  line-height: 1.55;
  font-weight: 600;
}

.hero-step { margin: 0; }

/* ---------- Marquee ---------- */

.marquee {
  background: #1a1a1a;
  color: #fff;
  flex: 1;
  padding: 0.9rem 1.1rem;
  border-radius: 0.5rem;
  font-size: 1.35rem;
  font-weight: 600;
  font-style: italic;
  line-height: 1.35;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  box-shadow: 0 0.25rem 1rem rgba(0,0,0,0.15);
}

.marquee-line {
  flex: 1;
  animation: goat-marquee-in 0.45s ease-out;
}

.marquee-stat {
  color: #ffd866;
  font-weight: 800;
  letter-spacing: 0.01em;
  font-style: normal;
  padding: 0 0.05em;
}

@keyframes goat-marquee-in {
  from { opacity: 0; transform: translateY(0.6rem); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Action bar (Copy button) ---------- */

.actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 1.1rem;
}

.action-btn {
  background: white;
  border: 1px solid #bbb;
  border-radius: 0.3rem;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: #333;
  font-weight: 500;
}

.action-btn.is-primary {
  background: #0a58ca;
  color: white;
  border-color: #0a58ca;
}

.action-btn.is-ok {
  background: #2a7a2a;
  color: white;
  border-color: #2a7a2a;
}

/* ---------- League switcher ---------- */

.switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem 0;
}

.switcher-label {
  font-size: 0.8rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.switcher-pills {
  display: inline-flex;
  gap: 0.35rem;
  background: #f0eee6;
  padding: 0.25rem;
  border-radius: 999px;
}

.switcher-btn {
  border: none;
  cursor: pointer;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: white;
  opacity: 0.55;
  transition: opacity 0.12s ease, box-shadow 0.12s ease;
}

.switcher-btn.is-active {
  opacity: 1;
  box-shadow: 0 0 0 2px white, 0 0 0 3px rgba(0,0,0,0.2);
}

/* ---------- Data notes (league-scoped disclaimers) ---------- */

.data-note {
  color: #777;
  font-size: 0.8rem;
  font-style: italic;
  line-height: 1.4;
  margin-left: 0.25rem;
}

/* ---------- Active stage (selected pills) ---------- */

.stage {
  background: #f6f6f2;
  border: 1px solid #e6e6dd;
  border-radius: 0.5rem;
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stage-empty {
  color: #777;
  font-style: italic;
  align-self: center;
  width: 100%;
  text-align: center;
  padding: 0.5rem 0;
}

.stage-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
}

/* ---------- Pills ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.65rem;
  background: white;
  border: 1px solid #ddd;
  border-radius: 999px;
  font-size: 0.9rem;
}

.pill-name { font-weight: 600; color: #333; }

.pill-pct {
  font-weight: 700;
  color: #111;
  font-variant-numeric: tabular-nums;
  min-width: 2.25rem;
  text-align: right;
}

.pill-nudge {
  background: #fafafa;
  border: 1px solid #ccc;
  border-radius: 0.25rem;
  padding: 0 0.4rem;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #333;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pill-x {
  background: none;
  border: none;
  cursor: pointer;
  color: #a33;
  font-size: 1rem;
  padding: 0 0.1rem;
  line-height: 1;
}

.equalize {
  background: transparent;
  border: 1px dashed #bbb;
  border-radius: 999px;
  color: #555;
  cursor: pointer;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  margin-left: auto;
}

/* ---------- Available stat picker ---------- */

.available {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0;
}

.avail-btn {
  background: white;
  border: 1px solid #ccc;
  border-radius: 1.25rem;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: #333;
}

/* ---------- Share bar (interactive reweighting) ---------- */

.share-bar {
  display: flex;
  position: relative;
  height: 2.25rem;
  width: 100%;
  border: 1px solid #c0c0b0;
  border-radius: 0.35rem;
  overflow: hidden;
  background: #eeeae0;
  margin-bottom: 0.75rem;
  touch-action: none;
  user-select: none;
}

.share-seg {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 0.85rem;
  color: rgba(0,0,0,0.75);
  font-weight: 600;
  white-space: nowrap;
  transition: width 0.12s ease;
}

.bar-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  /* 28px hit region — exceeds WCAG 24px minimum without overlapping
     neighbors at small segment widths. */
  width: 28px;
  transform: translateX(-50%);
  cursor: col-resize;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.bar-handle-bar {
  width: 4px;
  height: 80%;
  background: #fff;
  border: 1px solid #444;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.5);
  pointer-events: none;
}

/* Share-bar segments: hover reveals an × to remove the stat.
   Default: faded out so the bar reads as color-first. */
.goat-seg { position: relative; }

.goat-seg-x {
  position: absolute;
  top: 3px; right: 4px;
  width: 18px; height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.25);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transition: opacity 0.12s ease, background 0.12s ease;
}

.goat-seg:hover .goat-seg-x,
.goat-seg:focus-within .goat-seg-x { opacity: 1; }
.goat-seg-x:hover { background: rgba(0,0,0,0.5); }

/* ---------- Ranking list ---------- */

.ranking-h2 { margin-top: 1.5rem; }

.player-row {
  border-bottom: 1px solid #eee;
  padding: 0.6rem 0.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.player-rank {
  flex: 0 0 2rem;
  font-weight: 700;
  color: #666;
  font-variant-numeric: tabular-nums;
}

.player-main { flex: 1; }

.player-name { font-weight: 600; font-size: 1.05rem; }

.player-meta { color: #888; font-size: 0.8rem; }

.player-breakdown { margin-top: 0.3rem; }

.player-breakdown-item {
  display: inline-block;
  margin-right: 0.6rem;
  font-size: 0.75rem;
  color: #555;
}

.player-score {
  flex: 0 0 4rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  font-weight: 600;
}

.empty-hint { color: #888; margin-top: 1.5rem; }

/* ---------- Filter bar ---------- */

.filters {
  margin: 1rem 0;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.filters-label { font-weight: 500; }

.filter-option { cursor: pointer; }

.filter-option > input { margin-right: 0.35rem; }

/* ---------- Status messages ---------- */

.error-msg { color: red; }
.loading-msg { color: #888; }
