/* Herald · Trail — a survival trek across the high country. Animated
   parallax scene at the top, resource bars, party row, D-pad action
   strip. Orchid per-app accent stays — the icon is a path with peaks.
   Built from light — dark pixels render transparent on the additive
   display. Original concept; not Oregon Trail. */

.tr-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tr-scene {
  position: relative;
  align-self: stretch;
  margin: 0 auto;
  width: 540px;
  max-width: 100%;
  height: 200px;
  border-radius: 16px;
  overflow: hidden;
  background:
    linear-gradient(180deg, #18223a 0%, #2a3157 55%, #4a3a52 90%);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow:
    0 0 32px rgba(213,156,255,0.18),
    inset 0 0 0 1px rgba(255,255,255,0.04);
}
#tr-cv {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.tr-prog {
  position: absolute;
  left: 12px; right: 12px; bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.tr-prog-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(0,0,0,0.35);
  overflow: hidden;
}
.tr-prog-fill {
  display: block; height: 100%;
  background: linear-gradient(90deg, #d59cff, #ffd166);
  box-shadow: 0 0 10px rgba(213,156,255,0.6);
}
.tr-prog-label { color: var(--app-accent, #d59cff); }

/* Resource bars — Food / Water / Wheels / Morale */
.tr-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  padding: 4px 8px 0;
}
.tr-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-secondary, rgba(255,255,255,0.7));
}
.tr-bar-name { width: 56px; text-transform: uppercase; }
.tr-bar-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
}
.tr-bar-fill {
  display: block; height: 100%; border-radius: 999px;
  background: var(--app-accent, #d59cff);
  box-shadow: 0 0 6px rgba(213,156,255,0.5);
  transition: width 320ms ease;
}
.tr-bar-fill.low { background: var(--danger, #ff6b81); box-shadow: 0 0 6px rgba(255,107,129,0.55); }

/* Party row */
.tr-party {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 2px 8px;
}
.tr-mem {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 2px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-primary);
}
.tr-mem-name { font-size: 10px; opacity: 0.9; letter-spacing: 0.04em; }
.tr-mem-hp { display: flex; gap: 2px; }
.tr-pip {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.18);
}
.tr-pip.on { background: #6affb4; box-shadow: 0 0 4px rgba(106,255,180,0.6); }
.tr-pip.on.low { background: #ff6b81; box-shadow: 0 0 4px rgba(255,107,129,0.6); }
.tr-mem.dead { opacity: 0.35; filter: saturate(0.3); }
.tr-mem.dead .tr-mem-name::after { content: ' ✕'; color: var(--danger, #ff6b81); }
.tr-mem.ailing {
  background: rgba(255,107,129,0.10);
  border-color: rgba(255,107,129,0.35);
}
.tr-mem.ailing .tr-mem-name {
  color: #ffb6c0;
  text-shadow: 0 0 6px rgba(255,107,129,0.35);
}

/* Action strip — same pattern as Pet */
.tr-actions {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 4px 2px 0;
}
.tr-act {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 2px 6px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary);
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}
.tr-act svg { width: 24px; height: 24px; }
.tr-act-name { font-size: 9px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.tr-act.sel {
  background: rgba(213,156,255,0.16);
  border-color: var(--app-accent, #d59cff);
  color: var(--app-accent, #d59cff);
  box-shadow: 0 0 12px rgba(213,156,255,0.4);
  transform: translateY(-2px);
}
.tr-act:focus { outline: none; }

/* Event modal — floats over scene */
.tr-event {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 28px;
  background: linear-gradient(180deg, rgba(13,15,28,0.92), rgba(13,15,28,0.96));
  z-index: 30;
}
.tr-event.hidden { display: none; }
.tr-event-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--app-accent, #d59cff);
  text-shadow: 0 0 18px rgba(213,156,255,0.45);
  letter-spacing: 0.02em;
}
.tr-event-body {
  font-size: 14px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 480px;
  text-align: center;
}
.tr-event-choices {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 360px;
}
.tr-ev-choice {
  display: block;
  padding: 9px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.tr-ev-choice.sel {
  background: rgba(213,156,255,0.18);
  border-color: var(--app-accent, #d59cff);
  color: var(--app-accent, #d59cff);
  box-shadow: 0 0 10px rgba(213,156,255,0.35);
}

.tr-hint {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary, rgba(255,255,255,0.45));
}

/* Trail Journal — recent events log, fills the previously empty lower
   third of the home screen. Soft frosted panel, mono-feel typography. */
.tr-journal {
  margin: 6px 4px 0;
  padding: 8px 12px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  min-height: 96px;
  max-height: 132px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tr-journal-hd {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--app-accent, #d59cff);
  text-shadow: 0 0 12px rgba(213,156,255,0.35);
  padding-bottom: 2px;
}
.tr-journal-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  line-height: 1.35;
}
.tr-jl-row {
  display: flex;
  gap: 8px;
  color: var(--text-secondary, rgba(255,255,255,0.7));
}
.tr-jl-row.first {
  color: var(--text-primary, #fff);
  font-weight: 600;
}
.tr-jl-row.faded { opacity: 0.55; }
.tr-jl-day {
  flex-shrink: 0;
  width: 46px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--app-accent, #d59cff);
  opacity: 0.85;
}
.tr-jl-row.faded .tr-jl-day { opacity: 0.5; }
.tr-jl-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tr-journal-empty {
  font-size: 12px;
  color: var(--text-tertiary, rgba(255,255,255,0.45));
  font-style: italic;
}

/* Game-over splash */
.tr-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  border-radius: 16px;
  background: rgba(13,15,28,0.6);
  border: 1px solid rgba(255,255,255,0.08);
}
.tr-end-headline {
  font-size: 20px;
  font-weight: 800;
  color: var(--app-accent, #d59cff);
  text-shadow: 0 0 20px rgba(213,156,255,0.45);
}
