/* Rust.camp Wiki – event pages (js/views/world-events.js, world-timeline.js): page-specific layout only.
   Chips, tiles, cards and tables are the canonical classes of wiki.css / world.css (design contract); nothing here restyles
   them. Wide screens (>= 900px): horizontal axis + table; below: vertical timeline. */

.w-evpage { --evp-sea: color-mix(in srgb, var(--rc-info, #5aa9ff) 75%, transparent); --evp-docked: var(--rc-signal); --evp-leaving: var(--rc-loss); }
.evp-ph--sea { --ph: var(--evp-sea); }
.evp-ph--docked { --ph: var(--evp-docked); }
.evp-ph--leaving { --ph: var(--evp-leaving); }
.evp-stack { display: grid; gap: var(--sp-4, 16px); min-width: 0; }
.evp-ico { width: 16px; height: 16px; flex: 0 0 auto; }
.evp-narrow { display: block; min-width: 0; }
.evp-wide { display: none; min-width: 0; }
@media (min-width: 900px) {
  .evp-narrow { display: none; }
  .evp-wide { display: block; }
  .evp-wide.evp-stack { display: grid; }
}

/* stat tiles: equal heights per row, label on one line */
.evp-tiles { margin-top: var(--sp-3, 12px); }
@media (min-width: 480px) { .evp-tiles .w-tile__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }
.evp-tiles .w-tile__sub { color: var(--rc-ink-3); }

/* hackable crates: count + rule in one line */
.evp-hk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 12px; min-width: 0;
  border: 1px solid var(--rc-signal-line); border-radius: var(--rc-radius); background: var(--rc-signal-soft); }
.evp-hk__rule { flex: 1 1 260px; min-width: 0; font-size: 13px; line-height: 1.4; color: var(--rc-ink-2); }
.evp-row { min-width: 0; }

/* ---------- wide: axis ---------- */
.evp-ax { position: relative; display: grid; gap: 4px; min-width: 0; padding: 0 18px; }
.evp-ax__title { margin-left: -18px; }
.evp-ax + .evp-ax { margin-top: var(--sp-3, 12px); }
.evp-ax__track { position: relative; height: 64px; }
.evp-ax__rail { position: absolute; left: 0; right: 0; top: 44px; height: 4px; border-radius: 2px; background: var(--rc-line-2); }
.evp-ax__ph { position: absolute; top: 44px; height: 4px; left: var(--from); width: var(--w); border-radius: 2px; background: var(--ph); z-index: 1; }
.evp-ax__phl { position: absolute; left: 0; top: -44px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11px; font-weight: 700; letter-spacing: var(--rc-track-caps, .08em); text-transform: uppercase; color: var(--ph); }
.evp-mk { position: absolute; top: 32px; left: var(--at); transform: translateX(-50%); z-index: 2; display: inline-grid; place-items: center;
  width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 2px solid var(--rc-line-2); background: var(--rc-bg-2, #16181c); color: var(--rc-ink); cursor: pointer; }
.evp-mk::before { content: ""; position: absolute; inset: -7px; border-radius: 50%; }
.evp-mk:hover, .evp-mk[aria-expanded="true"] { border-color: var(--rc-signal); z-index: 3; }
.evp-mk:focus-visible { outline: 2px solid var(--rc-signal); outline-offset: 2px; }
.evp-mk.is-horn { border-color: var(--rc-warn); color: var(--rc-warn); }
.evp-mk.is-hack { border-color: var(--rc-signal); color: var(--rc-signal-text); background: color-mix(in srgb, var(--rc-signal) 22%, var(--rc-bg-2, #16181c)); }
.evp-mk.is-earliest { border-style: dashed; }
.evp-mk__n { position: absolute; top: -9px; right: -11px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  font: 700 10px/16px var(--rc-font-display); color: var(--rc-bg, #0b0c0e); background: var(--rc-ink); }
/* no phases (helicopter, Bradley, vendor): no label band above the rail */
.evp-ax__track.is-flat { height: 40px; }
.evp-ax__track.is-flat .evp-ax__rail { top: 20px; }
.evp-ax__track.is-flat .evp-mk { top: 8px; }
.evp-ax__lbls { position: relative; min-height: 22px; }
.evp-ax__lbl { position: absolute; top: 0; left: var(--at); transform: translateX(-50%); display: inline-flex; align-items: baseline; gap: 6px;
  white-space: nowrap; font-size: 12px; line-height: 20px; color: var(--rc-ink-2); }
.evp-ax__lbl.is-placed { transform: none; }
.evp-ax__lbl b { font-variant-numeric: tabular-nums; color: var(--rc-ink); }
.evp-ax__lane { display: grid; gap: 4px; margin-top: 6px; }
.evp-cr { justify-self: start; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; margin-left: var(--from); width: var(--w);
  max-width: calc(100% - var(--from)); overflow: hidden; white-space: nowrap; font-size: 12px; color: var(--rc-signal-text);
  border: 1px solid var(--rc-signal-line); border-radius: 6px; background: var(--rc-signal-soft); box-sizing: border-box; }
.evp-cr.is-cond { border-style: dashed; }
.evp-cr__t { color: var(--rc-ink-2); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.evp-pop { position: absolute; top: calc(100% + 2px); left: 0; z-index: 10; display: grid; gap: 10px; width: max-content; max-width: min(440px, 100%); padding: 10px 12px;
  background: var(--rc-bg-2, #16181c); border: 1px solid var(--rc-line-2); border-radius: var(--rc-radius); box-shadow: var(--rc-shadow, 0 8px 24px rgba(0, 0, 0, .4)); }
.evp-pop[hidden] { display: none; }
.evp-pop__head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.evp-pop__t { min-width: 48px; font-variant-numeric: tabular-nums; color: var(--rc-ink-3); }
.evp-pop__it > .w-chips { margin-top: 6px; padding-left: 56px; }
.evp-pop__it > .w-chips:empty { display: none; }

/* legend */
.evp-legend { gap: 4px 6px; }
.evp-lg__sw { display: inline-block; flex: 0 0 auto; width: 16px; height: 4px; border-radius: 2px; background: var(--ph, var(--rc-line-2)); }
.evp-lg__mk { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--rc-line-2); background: transparent; box-sizing: border-box; }
.evp-lg__mk.is-horn { border-color: var(--rc-warn); }
.evp-lg__mk.is-hack { border-color: var(--rc-signal); background: var(--rc-signal-soft); }
.evp-lg__mk.is-earliest { border-color: var(--rc-warn); border-style: dashed; }
.evp-lg__bar { width: 18px; height: 10px; border-radius: 3px; border: 1px solid var(--rc-signal-line); background: var(--rc-signal-soft); box-sizing: border-box; }

/* table (wide) */
.evp-tbl td { vertical-align: top; white-space: normal; }
.evp-tbl .evp-tbl__when, .evp-tbl .evp-tbl__what { white-space: nowrap; }
.evp-tbl__when { font-variant-numeric: tabular-nums; }
.evp-tbl .w-chips { flex-wrap: wrap; }
.evp-what { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }

/* ---------- narrow: vertical timeline ---------- */
.evp-vt__chain { display: grid; gap: var(--sp-2, 8px); min-width: 0; }
.evp-vt__chain + .evp-vt__chain { margin-top: var(--sp-5, 24px); }
.evp-vt__list { list-style: none; margin: 0; padding: 0; min-width: 0; }
.evp-st { position: relative; display: grid; grid-template-columns: 52px 32px minmax(0, 1fr); column-gap: 10px; padding-bottom: 16px; min-width: 0; }
.evp-st::before, .evp-vt__ph::before { content: ""; position: absolute; left: 76.5px; top: 0; bottom: 0; width: 3px; border-radius: 2px; background: var(--ph, var(--rc-line)); }
.evp-st:last-child::before { bottom: auto; height: 16px; }
.evp-st__t { padding-top: 6px; text-align: right; white-space: nowrap; font: 700 14px/20px var(--rc-font-display); font-variant-numeric: tabular-nums; color: var(--rc-ink); }
.evp-st__dot { position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--ph, var(--rc-line-2)); background: var(--rc-bg, #0b0c0e); color: var(--rc-ink); box-sizing: border-box; }
.evp-st.is-horn .evp-st__dot { color: var(--rc-warn); }
.evp-st.is-hack .evp-st__dot { border-color: var(--rc-signal); color: var(--rc-signal-text); background: color-mix(in srgb, var(--rc-signal) 22%, var(--rc-bg, #0b0c0e)); }
.evp-st.is-open .evp-st__dot { border-color: var(--rc-ok); color: var(--rc-ok); }
.evp-st__body { display: grid; gap: 12px; min-width: 0; padding-top: 6px; }
.evp-it { display: grid; gap: 6px; min-width: 0; }
.evp-it__name { font-weight: 700; font-size: 15px; line-height: 20px; overflow-wrap: break-word; }
.evp-it .w-chips > * { max-width: 100%; }
.evp-vt__ph { position: relative; padding: 0 0 12px 104px; font-size: 11px; font-weight: 700; letter-spacing: var(--rc-track-caps, .08em); text-transform: uppercase; color: var(--ph); }
:lang(ru) .evp-vt__ph, :lang(ru) .evp-ax__phl { text-transform: none; letter-spacing: .02em; }
/* tap targets >= 40px without growing the chips */
.evp-vt a.w-chip, .evp-set__name { position: relative; }
.evp-vt a.w-chip::after, .evp-set__name::after { content: ""; position: absolute; inset: -8px -2px; }

/* ---------- server settings (fallback layout of the shared component) ---------- */
.evp-set { display: grid; gap: var(--sp-4, 16px); min-width: 0; }
.evp-set__group { display: grid; gap: var(--sp-2, 8px); min-width: 0; }
.evp-set__ghead { display: flex; align-items: center; gap: 8px; }
.evp-set__list { list-style: none; margin: 0; padding: 0; min-width: 0; border: 1px solid var(--rc-line); border-radius: var(--rc-radius); background: var(--rc-glass); }
.evp-set__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name name" "help val"; align-items: center; gap: 6px 12px; padding: 10px 12px; min-width: 0; border-top: 1px solid var(--rc-line); }
@media (min-width: 640px) {
  .evp-set__list { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr) auto; }
  .evp-set__row { grid-column: 1 / -1; grid-template-columns: subgrid; grid-template-areas: "name help val"; column-gap: 16px; }
}
.evp-set__row:first-child { border-top: 0; }
.evp-set__name { grid-area: name; justify-self: start; max-width: 100%; min-width: 0; cursor: copy; color: var(--rc-ink); }
.evp-set__name.is-copied { border-color: var(--rc-ok); color: var(--rc-ok); }
.evp-set__val { grid-area: val; display: inline-flex; align-items: center; gap: 6px; justify-self: end; }
.evp-set__help { grid-area: help; font-size: 13px; line-height: 1.4; color: var(--rc-ink-3); overflow-wrap: break-word; }
.evp-fixed { min-width: 0; }
.evp-fixed > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; list-style: none;
  font-size: 12px; font-weight: 700; letter-spacing: var(--rc-track-caps, .08em); text-transform: uppercase; color: var(--rc-ink-3); }
.evp-fixed > summary::-webkit-details-marker { display: none; }
.evp-fixed > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.evp-fixed[open] > summary::before { transform: rotate(45deg); }
.evp-fixed > .w-chips { margin-top: var(--sp-2, 8px); }

/* ---------- NPC / event hero on phones (world-npcs.js, world-events.js): back link on its own row, plate + title side by side,
   sub line and chips full width underneath (no empty column under the plate) ---------- */
.w-npchero .w-back::before { content: "←"; margin-right: var(--sp-1, 4px); }
@media (max-width: 639px) {
  /* explicit lines (no template areas): a missing sub line leaves no empty row and no double gap */
  .w-npchero { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px var(--sp-3, 12px); margin: 8px 0 22px; }
  .w-npchero > .w-head { display: contents; }
  .w-npchero > :first-child { grid-column: 1; grid-row: 2; }
  .w-npchero .w-back { grid-column: 1 / -1; grid-row: 1; }
  .w-npchero .w-title { grid-column: 2; grid-row: 2; }
  .w-npchero .w-sub, .w-npchero .w-head > .w-chips { grid-column: 1 / -1; }
  .w-npchero .w-sub { margin: 0; }
}

/* ---------- blueprint yield row (world-loot.js yieldRow, used by the monument pages only): on phones the chips keep their
   full text ("5.1 per run") and wrap as a cluster instead of a 3-column grid that ellipsized them; the empty placeholder row
   only keeps card heights equal in multi-column grids, so it goes away in the one-column phone grid ---------- */
@media (max-width: 479px) {
  .w-page .w-bprow:not(.w-bprow--empty) { display: flex; flex-wrap: wrap; gap: 6px; }
  .w-page .w-bprow .w-bprow__chip { overflow: visible; }
}
@media (max-width: 639px) { .w-page .w-bprow--empty { display: none; } }

/* ---------- monument pages (world-monuments.js) ---------- */
/* the blueprint yield row under the head keeps the grid gap to the photo below */
.w-page > .w-bprow + * { margin-top: var(--sp-3, 12px); }
/* tile rows on world pages (monuments, NPCs, events): on two columns an odd last tile spans the row instead of standing alone
   (only where the grid has exactly two columns: plain .w-tiles < 760px, --fac < 640px, auto-fit --req phones < 480px) */
@media (max-width: 759px) { .w-tiles--fill:not(.w-tiles--fac):not(.w-tiles--req) > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (max-width: 639px) { .w-tiles--fac.w-tiles--fill > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (max-width: 479px) { .w-tiles--req.w-tiles--fill > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
/* name plate when a monument has no photo: aspect-ratio 21/6 with min-height 110px forced a 385px min-width and widened the
   phone layout viewport (ice_lake_2 at 390 px); below 520px a fixed height instead */
@media (max-width: 519px) { .w-hero .w-hero__plate { aspect-ratio: auto; height: 110px; min-height: 0; min-width: 0; } }

/* ---------- mission objectives (world-missions.js): number | text + chips ---------- */
.mi-steps .w-step { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: start; column-gap: 10px; }
.mi-step__body { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-width: 0; min-height: 26px; }
.mi-step__body .w-step__txt { min-width: 0; overflow-wrap: break-word; }

/* ---------- NPC loadouts (world-npcs.js): name over the weapon it equips ---------- */
.npc-lo { display: grid; gap: 2px; min-width: 0; }
.npc-lo__wpn { font-size: 13px; color: var(--rc-ink-3); overflow-wrap: break-word; }

/* lab pages: the three currency tiles share one row from 760px; a lone last room-type card spans the two-column grid */
@media (min-width: 760px) { .w-tiles--lab { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 640px) and (max-width: 979px) { .w-rtgrid > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
/* event stat tiles: two or three tiles fill the row on wide screens instead of leaving empty columns */
@media (min-width: 760px) { .evp-tiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .evp-tiles--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* deep links (#timeline, #settings, #orders) land below the sticky site header (57px phone, 65px desktop) */
/* deep links: html scroll-padding-top (wiki.css) keeps anchors below the sticky site bar */
/* facilities on wide screens: seven tiles in one row (~150px); a tighter label keeps single long words whole
   (de "Forschungstisch", "Reparaturbank" were hyphenated) */
@media (min-width: 980px) { .w-tiles--fac .w-tile__label { font-size: 11px; letter-spacing: .04em; hyphens: manual; } }
/* mission chain cards: the status chip ("Abgeschlossen") keeps its width, the mission name wraps instead */
.mi-chain__st { flex: 0 0 auto; }
/* lab room types: two card rooms (no green room in the sample) fill the row instead of leaving an empty third column */
@media (min-width: 980px) { .w-rtgrid:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* lab currency tiles on phones: one per row (Russian "на лабораторию" is a long unbreakable word next to the icon) */
@media (max-width: 479px) { .w-tiles--lab { grid-template-columns: minmax(0, 1fr); } }
