/* Home live cards - session + trophy goal (T-007 / R-006 decisions 6-7; v3.1
   T4-002 tightening).

   Layout only: colors/surfaces/type/pills/meter/chips all come from
   web/css/tokens.css + components.css (.card, .pill, .meter, .eyebrow, .num,
   .display, .gold, .good, .bad, .card-sub, .info-tip). web/screens/session.js
   builds every node. v3.1: one header scope line on the session card, a slim
   (<= 56px) unset-goal row, a three-line set-goal card, no nested cards. */

/* The two cards sit in #home-live, above #home-body; .screen-live itself has
   no internal gap (shell.css only gives it a bottom margin), so the stack
   supplies its own. */
.session-live-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* No top offset of its own on desktop: the shell's `.content` padding owns the
   gap between the top bar and the first block (T4-010 / T4-011). */

/* ---------------- session card ---------------- */

.session-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Two rows, two columns: title | running time, then scope line + info tip |
   Battles link. Placed explicitly so the idle/empty states (no running time)
   keep the scope row where it is. */
.session-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  row-gap: 0;
}
.session-title-row { grid-area: 1 / 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.session-head-figure { grid-area: 1 / 2; justify-self: end; }
.session-scope-row { grid-area: 2 / 1; display: flex; align-items: center; gap: 2px; min-width: 0; }
.session-scope { min-width: 0; }
/* The tip sits mid-card (right after the scope text), so the shared note - which
   is right-aligned to its button and sized for a tip at a card's far-right edge -
   would run off the LEFT of a phone. Anchor it to the scope row's left edge
   instead: it opens under the line it explains and stays inside the card. */
.session-scope-row { position: relative; }
.session-scope-row .info-tip { position: static; }
.session-scope-row .info-tip-note { left: 0; right: auto; }
/* The info tip's button is a 32px hit target; its box would make this row twice
   the height of the line beside it, so the vertical overhang is pulled back
   (the target stays 32px, it just overlaps the row above, which is inert). */
.session-scope-row .info-tip > summary { margin: -8px 0; }
.session-battles-link {
  grid-area: 2 / 2;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 32px;
  margin: -8px -4px -8px 0;
  padding: 0 4px 0 8px;
  color: var(--gold);
  font-weight: 800;
  font-size: 13px;
}
.session-eyebrow { color: var(--ink-2); }

.session-mid {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.session-wl-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.session-wl {
  font-size: 38px;
  display: flex;
  align-items: baseline;
}
.session-dash { padding: 0 4px; font-weight: 500; }

.session-seq-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
/* A session of 12+ battles shows 12 pills plus the "+N" counter: at 320px that is
   wider than the card, so the row wraps (and may shrink) instead of pushing the
   page sideways or running under the trophy figure. */
.session-seq {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.pill.session-pill { width: 20px; height: 20px; padding: 0; font-size: 11px; }
.session-seq-hidden { margin-right: 2px; }
.session-count { white-space: nowrap; }

.session-net-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex: none;
}
.session-net {
  font-size: 24px;
  display: flex;
  align-items: center;
  gap: 4px;
}
/* E2: what the crown number actually measures - "6,000 -> 6,060 Trophy Road",
   or "net, all modes" for a session with no Trophy Road battle in it. */
.session-net-sub { text-align: right; }

/* Phones: the trophy figure gets a row of its own under the W-L and the pills,
   so a long pill row can never run under it. */
@media (max-width: 399px) {
  .session-mid { flex-direction: column; align-items: stretch; gap: 8px; }
  .session-net-col {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2px 8px;
    width: 100%;
  }
}

.session-tilt {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--warn-soft);
}
.session-tilt-text { color: var(--ink-2); line-height: 1.35; }
.session-tilt-text b { color: var(--ink); }

.session-idle { gap: 4px; }
.session-idle-summary { margin-top: 2px; }

/* A failed /sessions: the reason, then a Retry under it (a .btn.sm). */
.session-card .session-error-text { margin-top: 0; }
.session-retry { align-self: flex-start; margin-top: 4px; }

.session-skel { height: 140px; border-radius: 16px; }

/* ---------------- trophy goal card ---------------- */

.goal-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 12px 14px;
}

/* More > Goal is the hash deep link `#/overview?goal=1`, which scrolls this
   card into view and focuses it (web/screens/home.js route()). That focus is
   programmatic and arrives from a pointer-driven navigation, so
   :focus-visible does not match it and the card would land with no visible
   change at all - the ring is the whole point of the link (T-016). */
.goal-card:focus { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Unset: ONE slim row, 52px of button + the card's two 1px borders = 54px
   (<= 56px). The card drops its own padding; the button owns the row. */
.goal-card.goal-empty,
.goal-card.goal-loading { padding: 0; }
.goal-row-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  text-align: left;
  border-radius: 15px;
}
.goal-row-icon { display: inline-flex; flex: none; }
.goal-row-text {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  flex: 1;
  min-width: 0;
}
.goal-empty-chevron { margin-left: auto; flex: none; display: flex; align-items: center; }

/* Set: title + status on one line, the meter, the pace line. */
.goal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.goal-open {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 32px;
  text-align: left;
}
.goal-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.goal-head-right { display: flex; align-items: center; gap: 4px; flex: none; }

.goal-meter { height: 8px; border-radius: 4px; }
.goal-meter .fill { background: var(--gold); border-radius: 4px; }

.goal-line { line-height: 1.4; }

/* The pace is still on its way (a first load, the first load after a player
   switch): the goal itself is on the card, the meter and the pace line shimmer at
   their own heights - 8px, and one 12px line at 1.4 - so nothing jumps when the
   pace lands. Same 6px rhythm as the card's own gap. */
.goal-pace-loading { display: flex; flex-direction: column; gap: 6px; }
.goal-meter-skel { height: 8px; border-radius: 4px; }
.goal-line-skel { height: 17px; width: 62%; border-radius: 6px; }

.goal-skel { height: 52px; border-radius: 15px; }

/* ---------------- goal editor sheet ---------------- */

.goal-field { display: flex; flex-direction: column; gap: 6px; }
/* .field (shell.css) is built for the landing form's ROW flex container, where
   its own `flex: 1` grows the WIDTH and `height: 44px` sets the cross axis
   untouched. Inside THIS column-direction wrapper the main axis is height, so
   that same `flex: 1` (flex-basis: 0%) would hijack the height instead and
   collapse the input to its content's min-height (~21px), silently dropping
   it below the 36px hit-target floor - reset it back to a fixed block box. */
.goal-field .field { flex: none; width: 100%; }
