/* ADDITIVE — daily/weekly rail grouping, scroll and the reroll die.
   Lifted from public/POCs/lobby-redesign/v2/css/objectives-rail.css.

   Does NOT edit objectives.css card chrome: the cards stay the duty-log fork
   that is already signed off, and everything here is grouping, scrolling and
   the one control objectives.css never had (the dice).

   The lab's collapse-preset buttons are not lifted. Collapse is a lab control,
   not the live default — both groups ship open (lock 21). The group heads are
   still buttons so a player can fold one by hand.

   Sizing follows the rail's own density bake (--tb-rail-density); there is no
   second breakpoint-authored layout here. */

.objectives--rail {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.objectives--rail .objective-list {
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--green-rgb), 0.28) transparent;
}

.rail-frame .module--objectives.objectives--rail,
.lobby-left .module--objectives.objectives--rail {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.lobby-left:has(.objectives--rail) .play-cluster {
  flex: 0 0 auto;
}

.objective-group + .objective-group {
  margin-top: 6px;
}

.objective-group__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto 10px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 26px;
  margin: 0 0 2px;
  padding: 0 4px 0 8px;
  border: 0;
  border-left: 3px solid rgba(var(--green-rgb), 0.55);
  background: rgba(var(--green-rgb), 0.04);
  color: #9ca6af;
  cursor: pointer;
  font-family: Rajdhani, sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.objective-group__head:hover {
  background: rgba(var(--green-rgb), 0.07);
  color: #c5ced6;
}

.objective-group__head:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.objective-group__name {
  justify-self: start;
  color: var(--green);
}

.objective-group__stat {
  color: #87929d;
  letter-spacing: 0.08em;
}

.objective-group__time {
  color: var(--timer-colour, #7f8b96);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.objective-group__head i {
  justify-self: end;
  font-size: 8px;
  opacity: 0.72;
  transition: transform 180ms var(--ease-out);
}

.objective-group.is-collapsed .objective-group__head i {
  transform: rotate(-90deg);
}

.objective-group__body {
  display: grid;
  gap: 2px;
}

.objective-group.is-collapsed .objective-group__body {
  display: none;
}

/* Collect owns the top-right CTA. Dice sits beside the timer, never in that slot. */
.objectives--rail .objective__meta-row:has([data-reroll]) {
  display: flex;
  align-items: center;
  gap: 6px;
}

.objectives--rail .objective__meta-row:has([data-reroll]) .objective__time-label {
  flex: 0 1 auto;
}

.objectives--rail .objective__meta-row:has([data-reroll]) .objective__delta {
  margin-left: auto;
  flex: 0 0 39px;
}

.reroll-button {
  display: none;
  place-items: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #8b96a1;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.reroll-button::before {
  content: none;
}

.reroll-button i {
  font-size: inherit;
  line-height: 1;
}

.objective[data-scope="daily"][data-state="active"] .reroll-button,
.objective[data-scope="weekly"][data-state="active"] .reroll-button {
  display: grid;
}

.objectives--rail.is-daily-reroll-spent .objective[data-scope="daily"][data-state="active"] .reroll-button,
.objectives--rail.is-reroll-spent .objective[data-scope="daily"][data-state="active"] .reroll-button,
.objectives--rail.is-weekly-reroll-spent .objective[data-scope="weekly"][data-state="active"] .reroll-button,
[data-lobby-account="guest"] .reroll-button {
  display: none;
}

.reroll-button:hover {
  color: var(--green);
  transform: scale(1.08);
}

.reroll-button:active {
  transform: scale(0.96);
}

.reroll-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.objectives--rail .objective__title.is-marquee .objective__title-track {
  display: inline-flex;
  align-items: center;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  padding-right: 0;
  gap: 28px;
  animation: objective-title-carousel var(--marquee-duration, 8s) linear infinite;
}

.objectives--rail .objective__title-copy {
  flex: 0 0 auto;
  white-space: nowrap;
}

@keyframes objective-title-carousel {
  from { transform: translateX(0); }
  to { transform: translateX(var(--marquee-shift, -50%)); }
}

@media (prefers-reduced-motion: reduce) {
  .objectives--rail .objective__title.is-marquee .objective__title-track {
    animation: none;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.resource.is-bumped,
.wallet.is-bumped {
  animation: wallet-bump 460ms var(--ease-spring);
}
