/* «Инстансы» (#7570, web/instance.js) — the instance section of the «Рейд» tab
   and the run view. Forge-Glass (ADR-0013): the one gold accent, glass panels,
   red for the enemy, green for allies. Built for a 400 px column; the raid's
   own pieces (.rd-bar, .rd-bosscard, .rd-mrow, .rd-top, .rd-leave, the leave
   sheet) are reused from app.css. */

.in-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3, 12px);
  margin-top: 6px;
}
.in-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.in-head .h2 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.1;
}
.in-retry {
  margin-top: 10px;
}

/* --- a card --- */
.in-card {
  padding: 0;
  overflow: hidden;
}
.in-card.open {
  border-color: rgba(201, 162, 75, 0.35);
}
.in-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 13px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.in-ic {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  background: radial-gradient(circle at 50% 35%, rgba(201, 162, 75, 0.32), rgba(201, 162, 75, 0.05));
  border: 1px solid rgba(201, 162, 75, 0.35);
}
.in-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.in-main b {
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.in-main .lbl {
  line-height: 1.35;
}
.in-chip {
  flex: none;
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;
  letter-spacing: 0;
  font-size: 10.5px;
}
.in-chip.ok {
  border-color: rgba(147, 213, 149, 0.5);
  color: var(--ok);
}
.in-chip.reuse {
  color: var(--warn);
  border-color: rgba(230, 193, 115, 0.45);
}
.in-chip.off {
  color: var(--ink-muted);
}
.in-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 13px 13px;
}
.in-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.in-sub {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
}
.in-npc {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid rgba(201, 162, 75, 0.22);
  background: rgba(201, 162, 75, 0.05);
}
.in-npc-ic {
  color: var(--accent-strong);
}
.in-npc-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

/* the rooms, in order */
.in-stages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.in-stages li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
  min-width: 0;
}
.in-stn {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  border: 1px solid var(--glass-border);
  color: var(--ink-muted);
}
.in-stages li.boss .in-stn {
  border-color: rgba(207, 91, 84, 0.55);
  color: var(--crit);
}
.in-stname {
  min-width: 0;
  overflow-wrap: anywhere;
}
.in-skull {
  color: var(--crit);
}

/* rewards */
.in-rws {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.in-rw {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.in-rw-ic {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  overflow: hidden;
}
.in-rw-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.in-rw-n {
  flex: none;
  font-size: 12px;
}
.in-rank-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.in-rank-row .in-rws {
  flex: 1 1 auto;
  min-width: 0;
  gap: 2px;
}
.in-rank-row .in-rw-ic {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}
.in-rank-row .in-rw-name {
  font-size: 12px;
}
.in-rank {
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: 3px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  border: 1px solid var(--glass-border);
  color: var(--ink-muted);
}
.in-rank.r3,
.in-rank.r4 {
  color: var(--ink);
  border-color: rgba(201, 162, 75, 0.35);
}
.in-rank.r5,
.in-rank.r6 {
  color: var(--accent-strong);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(201, 162, 75, 0.25);
}
.in-rank.big {
  width: 52px;
  height: 52px;
  margin: 0;
  border-radius: 14px;
  font-size: 28px;
}
.in-rule {
  line-height: 1.4;
}

/* members' reuse */
.in-mem {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  padding: 4px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.in-mem-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.in-mem-st {
  flex: none;
  max-width: 60%;
  text-align: right;
  font-size: 11.5px;
}
.in-mem-st.ok {
  color: var(--ok);
}
.in-mem-st.reuse {
  color: var(--warn);
}
.in-mem-st.off {
  color: var(--ink-muted);
}
.in-refusal {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(207, 91, 84, 0.45);
  background: rgba(207, 91, 84, 0.07);
  font-size: 12px;
  line-height: 1.4;
}
.in-refusal > b {
  color: var(--crit);
}
.in-ref-row {
  color: var(--ink-muted);
}
.in-why {
  margin-top: 0;
}

/* essences + the exchange: one compact row at the top of «Инстансы» (#7582) */
.in-essence {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
}
.in-essence .in-main {
  flex: 1 1 auto;
  gap: 1px;
}
.in-ess-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.in-ess-line .in-ess-name {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 13px;
}
.in-ess-n {
  flex: none;
  color: var(--accent-strong, #e6c173);
  font-weight: 700;
  font-size: 13.5px;
}
.in-ess-where {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
}
.in-exch {
  flex: none;
  white-space: nowrap;
}
.in-bound {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-color: rgba(230, 193, 115, 0.4);
  font-size: 12.5px;
}

/* --- the run --- */
.in-live {
  gap: 8px;
  padding-bottom: 14px;
}
.in-top-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.in-top-name {
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.in-top .rd-clock {
  flex: none;
}
.in-state {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.in-line {
  font-size: 13px;
  line-height: 1.4;
}
.in-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  grid-auto-flow: column;
  gap: 4px;
}
.in-steps li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  position: relative;
}
.in-steps li + li::before {
  content: '';
  position: absolute;
  top: 11px;
  right: calc(50% + 14px);
  width: calc(100% - 24px);
  height: 1px;
  background: var(--glass-border);
}
.in-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border: 1px solid var(--glass-border);
  color: var(--ink-muted);
  background: rgba(0, 0, 0, 0.25);
}
.in-steps li.done .in-dot {
  border-color: rgba(147, 213, 149, 0.6);
  color: var(--ok);
}
.in-steps li.cur .in-dot {
  border-color: var(--accent);
  color: var(--accent-strong);
  box-shadow: 0 0 10px rgba(201, 162, 75, 0.35);
}
.in-steps li.boss.cur .in-dot {
  border-color: var(--crit);
  color: var(--crit);
  box-shadow: 0 0 10px rgba(207, 91, 84, 0.35);
}
.in-stepname {
  max-width: 100%;
  font-size: 10.5px;
  line-height: 1.25;
  text-align: center;
  color: var(--ink-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.in-steps li.cur .in-stepname {
  color: var(--ink);
}
.in-advance {
  margin-top: 2px;
}
.in-boss {
  cursor: default;
  border-radius: 12px;
}
.in-guards {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.in-guard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 36px;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
}
.in-guard.dead {
  opacity: 0.55;
  grid-template-columns: minmax(0, 1fr) auto;
}
.in-guard .num {
  text-align: right;
}
.in-score {
  display: flex;
  align-items: center;
  gap: 12px;
}
.in-score-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.in-score-n {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.1;
}
.in-mems {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.in-mrow {
  cursor: default;
}
.in-log {
  max-height: 34vh;
}
.in-travel .rd-bar {
  margin-top: 2px;
}

/* the end */
.in-end {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
}
.in-end.win {
  border-color: rgba(201, 162, 75, 0.5);
  box-shadow: 0 0 22px rgba(201, 162, 75, 0.12);
}
.in-end.lose {
  border-color: rgba(207, 91, 84, 0.4);
}
.in-end-ic {
  align-self: center;
  font-size: 26px;
  color: var(--accent-strong);
}
.in-end.lose .in-end-ic {
  color: var(--crit);
}
.in-end-title {
  font-family: var(--font-display);
  font-size: 18px;
  text-align: center;
}
.in-reuse-end {
  color: var(--ink);
}
