/* PAYBACK v3: world + hurdle selector (WP-U3), target-progress line (WP-U7),
   behind-pace prompt (WP-L option b), receipt hurdle line. Loaded after the
   other game stylesheets; no inline styles anywhere. */

.title-world {
  width: 100%;
  margin: 12px 0 0;
  font-family: var(--mono);
}

.title-world .dock-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .08em;
  line-height: 1.3;
  text-align: left;
}

.title-world__options {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 6px;
  margin: 0 0 6px;
  padding: 0;
  list-style: none;
}

.title-world__option {
  display: grid;
  gap: 2px;
  min-height: 44px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
}

.title-world__option b {
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
}

.title-world__option small {
  font-size: 10px;
  line-height: 1.25;
}

.title-world__option[aria-current="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.title-world__option[aria-current="true"] b {
  color: var(--accent);
}

.title-world__option:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.title-world__fixed {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  text-align: left;
}

/* Year bar: world, hurdle, and (while planning) Gold against the target. */
.year-strip__goal {
  /* A zero basis keeps this nowrap line out of the strip's min-content
     width, so it truncates instead of widening the page on phones. */
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .06em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.year-strip__goal-short {
  display: none;
}

/* Phones: the bar keeps world and hurdle (the plan screen's target line
   carries the Gold numbers), and the guide takes its short label to make room. */
@media (max-width: 599px) {
  .year-strip__goal-long {
    display: none;
  }

  .year-strip__goal-short {
    display: inline;
  }

  .year-strip__goal {
    letter-spacing: 0;
  }

  .year-strip .ink-guide__long {
    display: none;
  }

  .year-strip .ink-guide__short {
    display: inline;
  }
}

/* Plan screen: the target-progress line under the planning heading. */
.target-progress {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.pace-nudge {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: start;
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--kiln);
  background: var(--raised);
}

.pace-nudge__title {
  grid-column: 1;
  margin: 0;
  color: var(--kiln);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}

.pace-nudge__text {
  grid-column: 1;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.pace-nudge__dismiss {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
  min-height: 44px;
}

/* Receipt: world, hurdle, and the target the verdict used. */
.verdict-hurdle {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
}

/* WP-L option (c): the REFERENCE LAB card. */
.ghost-card {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  background: var(--board);
}

.ghost-card__title {
  margin: 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}

.ghost-card__note,
.ghost-card__values {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.ghost-card__values {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
}

.ghost-chart {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
}

.ghost-chart__axis {
  stroke: var(--line);
  stroke-width: 1;
}

.ghost-chart__hurdle {
  stroke: var(--accent);
  stroke-dasharray: 2 3;
  stroke-width: 1;
}

.ghost-chart__ghost,
.ghost-chart__you {
  fill: none;
  stroke-linejoin: round;
  stroke-width: 2;
}

/* The reference line is neutral so it never reads as Parallax (FB-20). */
.ghost-chart__ghost {
  stroke: var(--reference);
  stroke-dasharray: 5 3;
}

.ghost-chart__you {
  stroke: var(--aster);
}

/* The Read link is a 44px tap target on every width (FB-24). */
.ghost-card__read {
  margin: 0;
}

.ghost-card__read a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

.ghost-card__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
}

.ghost-card__key::before {
  display: inline-block;
  width: 14px;
  margin-right: 5px;
  vertical-align: middle;
  border-top: 2px solid currentColor;
  content: "";
}

.ghost-card__key--ghost::before {
  border-top: 2px dashed var(--reference);
}

.ghost-card__key--you::before {
  border-top-color: var(--aster);
}

.ghost-card__key--hurdle::before {
  border-top: 2px dotted var(--accent);
}

/* The world selector makes the title taller than a phone screen: let the
   title scroll instead of squeezing THE SETUP under the START block. */
.title-screen .ink-screen {
  overflow-y: auto;
}

.title-screen .title-main {
  height: auto;
  min-height: 100%;
}

.title-screen .title-composition {
  flex-shrink: 0;
}

/* FB-01: the CUSTOM disclosure under the level row stays quiet. */
.title-world__custom {
  margin: 0 0 6px;
}

.title-world__custom > summary {
  display: inline-block;
  min-height: 44px;
  min-width: 44px;
  padding: 14px 0 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  letter-spacing: .08em;
}

.title-world__custom > summary:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* G3 tweak 1: a ?seed= practice run says so on the year bar, the title and
   the receipt. */
.year-strip .practice-label {
  color: var(--ink);
  font-weight: 700;
}

.verdict-head > .verdict-practice,
.title-actions .title-practice {
  color: var(--ink);
  letter-spacing: .02em;
}

/* G3 tweak 2: a quiet link to rules.json under the level picker. */
.title-agents-row {
  position: relative;
  margin: 0;
}

/* Agent kit C3: "Run your own benchmark" sits just under "Rules for agents",
   out of flow, so the title block keeps its height and no control moves
   (the desktop composition centers that block vertically). */
.title-agents-row > .title-agents + .title-agents {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.title-agents {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .08em;
}

.title-agents:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* G3 tweak 4: "Year N as text", collapsed by default. */
.year-text {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
}

.year-text > summary {
  cursor: pointer;
  text-transform: uppercase;
  white-space: nowrap;
}

.year-text > summary:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.year-text__body {
  margin: 8px 0 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Plan: the last thing in the dock, below the economist, in normal flow. */
.year-text--dock {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--soft-line);
}

.year-text--dock > summary {
  display: flex;
  min-height: 44px;
  align-items: center;
}

/* Reveal: the right end of the ring-key row. The summary keeps the row's
   height (its tap area grows past it without moving anything) and the open
   body floats over the board, so no beat moves the board. */
.board-legend-rings--year-text {
  flex-wrap: nowrap;
  /* The row is a div here (a details cannot sit in a p); keep the p's own
     margins so the board does not move. */
  margin-block: 1em;
}

.year-text--board {
  position: relative;
  flex: none;
  margin-left: auto;
  font-size: 10px;
}

/* A 44px tap target that still takes no room in the row. */
.year-text--board > summary {
  padding: 15px 0;
  margin: -15px 0;
}

/* G3b: the open panel closes on Escape, CLOSE, a pointerdown outside it,
   and any screen or beat change (main.mjs), so it never blocks the board. */
.year-text__panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  display: flex;
  width: min(360px, calc(100vw - 24px));
  max-height: 55vh;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--board);
  text-transform: none;
}

.year-text__panel > .year-text__body {
  min-height: 0;
  margin: 0;
  overflow: auto;
  padding: 0 12px 10px;
}

.year-text__close {
  align-self: flex-end;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
}

/* Phones: a bottom sheet over the lab cards and the reveal controls, never
   over the market cells; the closed board keeps its geometry. */
@media (max-width: 599px) {
  .year-text__panel {
    position: fixed;
    z-index: 40;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    height: calc(164px + var(--action-safe-bottom, 12px));
    max-height: none;
    border-width: 1px 0 0;
  }
}
