.rpg-run-overlay,
.rpg-run-tactical {
  --rpg-gold: #efc858;
  --rpg-ink: #f3f7f4;
  --rpg-muted: #9eb0aa;
  --rpg-line: rgba(179, 210, 199, 0.2);
  --rpg-panel: rgba(8, 19, 17, 0.96);
  color: var(--rpg-ink);
  font-family: "Rajdhani", "Avenir Next Condensed", sans-serif;
  text-align: left;
}

.rpg-run-overlay {
  position: absolute;
  inset: 0;
  z-index: 34;
  container: rpg-top / inline-size;
  pointer-events: none;
}

.rpg-run-overlay.is-gated {
  pointer-events: auto;
  background:
    linear-gradient(180deg, rgba(2, 7, 6, 0.9), rgba(3, 10, 8, 0.98)),
    repeating-linear-gradient(120deg, transparent 0 15px, rgba(255, 255, 255, 0.018) 15px 16px);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.75);
}

.rpg-run-header {
  height: 50px;
  padding: 8px 16px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--rpg-line);
  background: linear-gradient(180deg, rgba(11, 28, 24, 0.98), rgba(6, 16, 14, 0.92));
}

.rpg-run-header > div:first-child {
  min-width: 0;
  display: grid;
}

.rpg-run-header small,
.rpg-phase-title small,
.rpg-centered-panel > small,
.rpg-cleared-panel > small,
.rpg-tactical-hero > small,
.rpg-tactical-terminal > small {
  color: var(--rpg-gold);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.1;
  text-transform: uppercase;
}

.rpg-run-header strong {
  overflow: hidden;
  color: var(--rpg-ink);
  font-family: "Cinzel", Georgia, serif;
  font-size: 17px;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rpg-run-resources {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rpg-run-resources span {
  min-width: 70px;
  padding: 5px 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #dce8e2;
  border: 1px solid var(--rpg-line);
  border-radius: 4px;
  background: rgba(3, 10, 8, 0.68);
  font-size: 12px;
  font-weight: 700;
}

.rpg-run-resources i {
  color: var(--rpg-gold);
  font-style: normal;
}

.rpg-route-pips {
  height: 18px;
  padding: 5px 16px;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 5px;
  background: rgba(2, 8, 7, 0.9);
}

.rpg-route-pips i {
  height: 3px;
  border-radius: 2px;
  background: rgba(179, 210, 199, 0.15);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.rpg-route-pips i.is-cleared {
  background: #65ba8d;
  box-shadow: 0 0 6px rgba(101, 186, 141, 0.45);
}

.rpg-route-pips i.is-current {
  height: 5px;
  margin-top: -1px;
  background: var(--rpg-gold);
  box-shadow: 0 0 8px rgba(239, 200, 88, 0.58);
}

.rpg-route-pips i.is-finale {
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.rpg-phase-panel {
  position: absolute;
  inset: 68px 16px 10px;
  min-height: 0;
}

.rpg-phase-title {
  min-height: 50px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(250px, 1.6fr) auto;
  align-items: center;
  gap: 14px;
}

.rpg-phase-title h2,
.rpg-centered-panel h2,
.rpg-cleared-panel h2,
.rpg-tactical-hero h2,
.rpg-tactical-terminal h2 {
  margin: 1px 0 0;
  color: var(--rpg-ink);
  font-family: "Cinzel", Georgia, serif;
  font-size: 21px;
  letter-spacing: 0.035em;
  line-height: 1.1;
}

.rpg-phase-title p {
  margin: 0;
  color: var(--rpg-muted);
  font-size: 12px;
  line-height: 1.25;
}

.rpg-phase-title > b {
  padding: 5px 9px;
  color: var(--rpg-gold);
  border: 1px solid rgba(239, 200, 88, 0.28);
  border-radius: 4px;
  background: rgba(239, 200, 88, 0.07);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rpg-party-draft,
.rpg-spell-draft,
.rpg-reward-panel,
.rpg-shop-panel {
  display: flex;
  flex-direction: column;
}

.rpg-party-offer-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.rpg-party-card,
.rpg-spell-card,
.rpg-gear-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--rpg-accent, #86a39a) 42%, transparent);
  border-radius: 6px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--rpg-accent, #86a39a) 10%, transparent), transparent 42%),
    rgba(9, 22, 19, 0.92);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
}

.rpg-party-card {
  padding: 9px 9px 7px;
  display: flex;
  flex-direction: column;
}

.rpg-party-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--rpg-accent);
  opacity: 0.8;
}

.rpg-party-card.rarity-white { --rarity-color: #e7e9ec; }
.rpg-party-card.rarity-green,
.rpg-picked-chip.rarity-green { --rarity-color: #70d886; }
.rpg-party-card.rarity-blue,
.rpg-picked-chip.rarity-blue { --rarity-color: #65aef2; }
.rpg-party-card.rarity-purple,
.rpg-picked-chip.rarity-purple { --rarity-color: #b47aec; }
.rpg-party-card.rarity-gold,
.rpg-picked-chip.rarity-gold { --rarity-color: #efc858; }

.rpg-party-card.is-picked {
  border-color: var(--rarity-color, var(--rpg-gold));
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--rarity-color, var(--rpg-gold)) 18%, transparent), transparent 52%),
    rgba(10, 25, 21, 0.96);
}

.rpg-card-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  color: var(--rarity-color, #e7e9ec);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rpg-card-kicker b {
  color: var(--rpg-muted);
  font-weight: 600;
}

.rpg-role-badge {
  min-width: 44px;
  padding: 2px 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 8px;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.rpg-role-badge.is-tank {
  color: #9bd9ff;
  background: rgba(65, 145, 199, 0.2);
}

.rpg-role-badge.is-damage {
  color: #ffc27c;
  background: rgba(204, 111, 55, 0.19);
}

.rpg-role-badge > i {
  font-size: 9px;
  font-style: normal;
}

.rpg-role-badge > b {
  color: inherit;
  font-weight: 800;
}

.rpg-party-card h3,
.rpg-spell-card h3,
.rpg-gear-card h3 {
  overflow: hidden;
  margin: 6px 0 0;
  color: #fff;
  font-family: "Cinzel", Georgia, serif;
  font-size: 15px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rpg-party-card > p,
.rpg-spell-card p,
.rpg-gear-card p {
  margin: 2px 0 0;
  color: var(--rpg-muted);
  font-size: 10px;
  line-height: 1.2;
}

.rpg-stat-row {
  margin-top: 8px;
  padding-top: 7px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  border-top: 1px solid var(--rpg-line);
}

.rpg-stat-row span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  color: #dce8e2;
  font-size: 10px;
  font-weight: 700;
}

.rpg-stat-row small {
  color: #71857d;
  font-size: 7px;
  letter-spacing: 0.08em;
}

.rpg-party-card > footer {
  margin-top: auto;
  padding: 7px 0 25px;
  color: color-mix(in srgb, var(--rpg-accent) 72%, white);
  font-size: 8px;
  line-height: 1.25;
}

.rpg-vital-bar {
  position: relative;
  height: 12px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.52);
}

.rpg-vital-bar > i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #3d9f6d, #75d79d);
}

.rpg-vital-bar > small {
  position: absolute;
  inset: 0;
  color: #f0fff5;
  font-size: 8px;
  font-weight: 700;
  line-height: 12px;
  text-align: center;
  text-shadow: 0 1px 2px #000;
}

.rpg-card-action {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 0;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: inherit;
  background: transparent;
}

.rpg-card-action > span,
.rpg-card-status {
  position: absolute;
  right: 5px;
  bottom: 5px;
  padding: 3px 7px;
  color: #06100d;
  border-radius: 3px;
  background: var(--rpg-gold);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rpg-card-status {
  color: #91a29c;
  background: rgba(5, 12, 10, 0.88);
}

.rpg-card-action.is-controller-selected,
.rpg-run-overlay button.is-controller-selected,
.rpg-run-tactical button.is-controller-selected {
  outline: none;
  border-color: var(--rpg-gold);
  box-shadow: 0 0 0 1px rgba(239, 200, 88, 0.34), 0 0 14px rgba(239, 200, 88, 0.2);
}

.rpg-picked-strip,
.rpg-spellbook-strip {
  min-height: 48px;
  padding: 5px 0;
  display: flex;
  align-items: stretch;
  gap: 5px;
}

.rpg-picked-strip > strong,
.rpg-spellbook-strip > strong {
  width: 68px;
  display: grid;
  align-content: center;
  color: var(--rpg-muted);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rpg-picked-strip > strong {
  width: 108px;
  flex: 0 0 108px;
}

.rpg-picked-strip > strong > small {
  color: var(--rpg-gold);
  font-size: 8px;
  letter-spacing: 0;
  white-space: nowrap;
}

.rpg-picked-chip,
.rpg-empty-chip,
.rpg-spellbook-chip {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--rpg-line);
  border-radius: 4px;
  background: rgba(10, 24, 20, 0.9);
}

.rpg-picked-chip {
  position: relative;
  padding: 4px 6px 4px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  align-content: center;
  gap: 5px;
  cursor: pointer;
  text-align: left;
}

.rpg-picked-chip > i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
}

.rpg-picked-copy {
  min-width: 0;
  display: grid;
}

.rpg-picked-copy > strong,
.rpg-picked-copy > small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rpg-picked-copy > strong { color: var(--rpg-ink); font-size: 10px; }
.rpg-picked-copy > small { color: var(--rpg-muted); font-size: 8px; }

.rpg-picked-chip > .rpg-picked-remove {
  color: #82958e;
  font-size: 14px;
}

.rpg-empty-chip {
  display: grid;
  place-items: center;
  color: #52645d;
  border-style: dashed;
  font-size: 9px;
  font-style: normal;
}

.rpg-draft-footer {
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--rpg-line);
}

.rpg-draft-footer > span {
  overflow: hidden;
  color: var(--rpg-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rpg-primary-action,
.rpg-secondary-action {
  min-width: 160px;
  min-height: 34px;
  padding: 7px 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  cursor: pointer;
  border: 1px solid rgba(239, 200, 88, 0.55);
  border-radius: 4px;
  background: linear-gradient(180deg, #d7b650, #9d7925);
  color: #07100d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rpg-secondary-action {
  border-color: var(--rpg-line);
  background: rgba(10, 25, 21, 0.88);
  color: #d6e4de;
}

.rpg-primary-action:disabled,
.rpg-secondary-action:disabled,
.rpg-run-overlay button:disabled,
.rpg-run-tactical button:disabled {
  cursor: default;
  filter: saturate(0.25);
  opacity: 0.43;
}

.rpg-spell-offer-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.rpg-spell-card {
  padding: 13px 13px 32px 54px;
}

.rpg-spell-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--rpg-accent);
}

.rpg-spell-card.is-picked {
  border-color: var(--rpg-accent);
  background: linear-gradient(145deg, color-mix(in srgb, var(--rpg-accent) 17%, transparent), transparent 60%), rgba(9, 22, 19, 0.96);
}

.rpg-spell-icon {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--rpg-accent);
  border: 1px solid color-mix(in srgb, var(--rpg-accent) 45%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--rpg-accent) 10%, #07110f);
  font-size: 18px;
  font-style: normal;
}

.rpg-spell-card h3 {
  margin-top: 3px;
}

.rpg-spell-card > div > small {
  color: var(--rpg-accent);
  font-size: 8px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.rpg-spell-card p {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.32;
}

.rpg-spellbook-strip {
  min-height: 52px;
}

.rpg-spellbook-chip {
  padding: 4px 6px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #dce8e2;
}

.rpg-spellbook-chip > b {
  color: #71857d;
  font-size: 8px;
}

.rpg-spellbook-chip > i {
  color: var(--rpg-accent);
  font-style: normal;
}

.rpg-spellbook-chip > span {
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rpg-spellbook-chip > small {
  color: #71857d;
}

.rpg-centered-panel,
.rpg-cleared-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.rpg-centered-panel::before,
.rpg-cleared-panel::before {
  content: "";
  position: absolute;
  width: min(560px, 80%);
  height: 320px;
  z-index: -1;
  border: 1px solid var(--rpg-line);
  border-radius: 50%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--rpg-accent, #70b99f) 11%, transparent), transparent 70%);
}

.rpg-hero-sigil {
  width: 58px;
  height: 58px;
  margin-bottom: 9px;
  display: grid;
  place-items: center;
  color: var(--rpg-accent, var(--rpg-gold));
  border: 1px solid color-mix(in srgb, var(--rpg-accent, var(--rpg-gold)) 55%, transparent);
  border-radius: 50%;
  background: rgba(6, 16, 14, 0.85);
  box-shadow: 0 0 28px color-mix(in srgb, var(--rpg-accent, var(--rpg-gold)) 16%, transparent);
  font-size: 27px;
}

.rpg-centered-panel > h3 {
  margin: 4px 0 0;
  color: var(--rpg-accent, var(--rpg-gold));
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.rpg-centered-panel > p,
.rpg-cleared-panel > p {
  width: min(540px, 85%);
  margin: 9px 0;
  color: var(--rpg-muted);
  font-size: 12px;
  line-height: 1.35;
}

.rpg-large-action {
  min-width: 210px;
  min-height: 39px;
  margin-top: 11px;
}

.rpg-challenge-objective {
  width: min(470px, 78%);
  margin-top: 13px;
  padding: 10px 12px;
  color: var(--rpg-ink);
  border: 1px solid var(--rpg-line);
  border-radius: 5px;
  background: rgba(7, 18, 15, 0.88);
  text-align: left;
}

.rpg-challenge-objective > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rpg-challenge-objective small {
  color: var(--rpg-gold);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rpg-challenge-objective strong {
  font-size: 13px;
}

.rpg-challenge-objective p,
.rpg-challenge-objective footer {
  margin: 6px 0 0;
  color: var(--rpg-muted);
  font-size: 10px;
}

.rpg-objective-progress {
  position: relative;
  height: 16px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.48);
}

.rpg-objective-progress > i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #4a9c7b, #77d1a8);
}

.rpg-objective-progress > span {
  position: absolute;
  inset: 0;
  color: white;
  font-size: 9px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  text-shadow: 0 1px 2px black;
}

.rpg-soft-fail-copy {
  margin: 7px 0 0 !important;
  color: #b8c8c2 !important;
  font-size: 10px !important;
}

.rpg-challenge-result {
  margin-top: 7px;
  padding: 5px 9px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.rpg-challenge-result.is-success {
  color: #9de1b8;
  background: rgba(70, 167, 108, 0.15);
}

.rpg-challenge-result.is-failure {
  color: #d6b69c;
  background: rgba(182, 100, 63, 0.12);
}

.rpg-exit-arrow {
  margin-bottom: 18px;
  display: grid;
  place-items: center;
  color: var(--rpg-gold);
  font-size: 28px;
  line-height: 0.7;
}

.rpg-exit-arrow i {
  width: 70px;
  height: 3px;
  margin-bottom: 8px;
  background: var(--rpg-gold);
  box-shadow: 0 0 15px rgba(239, 200, 88, 0.65);
}

.rpg-exit-arrow span {
  margin-top: 10px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.rpg-reward-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  align-items: stretch;
}

.rpg-reward-card {
  position: relative;
  min-width: 0;
  padding: 20px 17px;
  cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--rpg-accent) 45%, transparent);
  border-radius: 7px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--rpg-accent) 13%, transparent), transparent 55%), rgba(8, 20, 17, 0.96);
  text-align: left;
}

.rpg-reward-card > i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--rpg-accent);
  border: 1px solid color-mix(in srgb, var(--rpg-accent) 45%, transparent);
  border-radius: 50%;
  background: rgba(3, 10, 8, 0.5);
  font-size: 22px;
  font-style: normal;
}

.rpg-reward-card > small {
  display: block;
  margin-top: 16px;
  color: var(--rpg-accent);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rpg-reward-card h3 {
  margin: 4px 0;
  font-family: "Cinzel", Georgia, serif;
  font-size: 16px;
}

.rpg-reward-card p {
  margin: 0;
  color: var(--rpg-muted);
  font-size: 11px;
  line-height: 1.3;
}

.rpg-reward-card > b {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: var(--rpg-accent);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rpg-controller-hint {
  min-height: 30px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--rpg-muted);
  font-size: 9px;
}

.rpg-controller-hint b {
  color: #dce8e2;
}

.rpg-controller-hint i {
  width: 1px;
  height: 12px;
  background: var(--rpg-line);
}

.rpg-shop-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(240px, 0.9fr);
  gap: 12px;
}

.rpg-shop-layout > section {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.rpg-shop-layout h3 {
  margin: 0 0 5px;
  color: var(--rpg-muted);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rpg-shop-grid,
.rpg-tactical-shop-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.rpg-gear-card {
  min-height: 112px;
  padding: 8px 8px 22px 43px;
}

.rpg-gear-card > i {
  position: absolute;
  top: 10px;
  left: 9px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: #75bceb;
  border: 1px solid rgba(101, 174, 242, 0.35);
  border-radius: 4px;
  font-style: normal;
}

.rpg-gear-card h3 {
  margin-top: 2px;
  font-size: 11px;
}

.rpg-gear-card small {
  color: #75bceb;
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rpg-gear-card p {
  font-size: 9px;
}

.rpg-gear-card .rpg-gear-price {
  margin: 2px 0 0;
  color: var(--rpg-gold);
  font-weight: 700;
}

.rpg-shop-side-list {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 5px;
  scrollbar-color: #557269 transparent;
  scrollbar-width: thin;
}

.rpg-shop-row,
.rpg-service-row {
  min-height: 42px;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  color: #dce8e2;
  border: 1px solid var(--rpg-line);
  border-radius: 4px;
  background: rgba(8, 21, 18, 0.9);
  text-align: left;
}

.rpg-shop-row span,
.rpg-service-row span {
  min-width: 0;
  display: grid;
  font-size: 10px;
  font-weight: 700;
}

.rpg-shop-row small,
.rpg-service-row small {
  overflow: hidden;
  color: var(--rpg-muted);
  font-size: 7px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rpg-shop-row > b,
.rpg-service-row > b {
  flex: 0 0 auto;
  color: var(--rpg-gold);
  font-size: 9px;
}

.rpg-empty-copy {
  margin: 0;
  padding: 9px;
  color: #6f837b;
  border: 1px dashed var(--rpg-line);
  border-radius: 4px;
  font-size: 9px;
  text-align: center;
}

.rpg-terminal-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.rpg-terminal.is-victory .rpg-hero-sigil,
.rpg-tactical-terminal.is-victory > i {
  color: var(--rpg-gold);
  box-shadow: 0 0 34px rgba(239, 200, 88, 0.22);
}

.rpg-terminal.is-defeat .rpg-hero-sigil,
.rpg-tactical-terminal.is-defeat > i {
  color: #d27567;
  border-color: rgba(210, 117, 103, 0.5);
}

.rpg-compact-combat-hud {
  position: absolute;
  top: 62px;
  left: 50%;
  width: min(440px, calc(100% - 280px));
  min-height: 40px;
  padding: 6px 11px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(179, 210, 199, 0.16);
  border-radius: 5px;
  background: rgba(3, 11, 9, 0.78);
  backdrop-filter: blur(4px);
}

.rpg-compact-combat-hud > div:first-child {
  min-width: 0;
  display: grid;
}

.rpg-compact-combat-hud small {
  color: var(--rpg-gold);
  font-size: 7px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rpg-compact-combat-hud strong {
  overflow: hidden;
  font-family: "Cinzel", Georgia, serif;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rpg-compact-combat-hud .rpg-route-pips {
  width: 180px;
  height: auto;
  padding: 0;
  background: none;
}

.rpg-challenge-objective.is-compact {
  width: 220px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}

.rpg-challenge-objective.is-compact > div:first-child {
  display: none;
}

.rpg-challenge-objective.is-compact .rpg-objective-progress {
  margin: 0;
}

/* Bottom / tactical display */

.rpg-run-tactical {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  container: rpg-bottom / inline-size;
  background:
    radial-gradient(circle at 90% 0, rgba(94, 199, 176, 0.08), transparent 42%),
    #07120f;
}

.rpg-run-tactical .rpg-run-header {
  height: 47px;
  flex: 0 0 47px;
  padding: 6px 10px 5px;
}

.rpg-run-tactical .rpg-run-header strong {
  font-size: 14px;
}

.rpg-run-tactical .rpg-run-resources span {
  min-width: 56px;
  padding: 4px 6px;
  font-size: 10px;
}

.rpg-run-tactical > .rpg-route-pips {
  height: 15px;
  flex: 0 0 15px;
  padding: 4px 10px;
}

.rpg-tactical-body {
  min-height: 0;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px 10px 10px;
  overscroll-behavior: contain;
  scrollbar-color: #48675d transparent;
  scrollbar-width: thin;
}

.rpg-tactical-section + .rpg-tactical-section,
.rpg-tactical-hero + .rpg-tactical-section,
.rpg-challenge-objective + .rpg-tactical-section {
  margin-top: 8px;
}

.rpg-tactical-section > header {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rpg-tactical-section > header h3 {
  margin: 0;
  color: #dce8e2;
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.rpg-tactical-section > header span {
  color: var(--rpg-gold);
  font-size: 9px;
}

.rpg-party-composition {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.rpg-party-composition > b {
  color: var(--rpg-gold);
  font-size: 9px;
}

.rpg-party-composition > small {
  color: var(--rpg-muted);
  font-size: 8px;
}

.rpg-tactical-list {
  display: grid;
  gap: 4px;
}

.rpg-tactical-offer {
  position: relative;
  min-height: 50px;
  padding: 5px 61px 5px 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #e7f0ec;
  border: 1px solid color-mix(in srgb, var(--rpg-accent) 36%, transparent);
  border-radius: 5px;
  background: linear-gradient(110deg, color-mix(in srgb, var(--rpg-accent) 10%, transparent), transparent 55%), rgba(8, 21, 18, 0.92);
  text-align: left;
}

.rpg-tactical-offer > i {
  position: absolute;
  left: 8px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--rpg-accent);
  border: 1px solid color-mix(in srgb, var(--rpg-accent) 35%, transparent);
  border-radius: 50%;
  font-size: 12px;
  font-style: normal;
}

.rpg-tactical-offer > span {
  min-width: 0;
  display: grid;
}

.rpg-tactical-offer > span small {
  color: var(--rpg-accent);
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rpg-tactical-offer > span strong {
  overflow: hidden;
  font-family: "Cinzel", Georgia, serif;
  font-size: 11px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rpg-tactical-offer > span em {
  overflow: hidden;
  color: var(--rpg-muted);
  font-size: 8px;
  font-style: normal;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rpg-tactical-offer > b {
  display: grid;
  color: #cddbd5;
  font-size: 8px;
  text-align: right;
}

.rpg-tactical-offer > b small {
  color: var(--rpg-muted);
  font-size: 7px;
  font-weight: 500;
}

.rpg-tactical-offer > u {
  position: absolute;
  right: 6px;
  min-width: 46px;
  padding: 3px 5px;
  color: #07100d;
  border-radius: 3px;
  background: var(--rpg-gold);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.rpg-tactical-offer[aria-pressed="true"] {
  background: linear-gradient(110deg, color-mix(in srgb, var(--rpg-accent) 20%, transparent), transparent 60%), rgba(8, 21, 18, 0.96);
}

.rpg-tactical-offer.is-spell {
  min-height: 63px;
  grid-template-columns: 1fr;
}

.rpg-tactical-offer.is-spell > span em {
  max-width: 420px;
}

.rpg-tactical-party-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.rpg-party-card.is-compact {
  min-height: 72px;
  padding: 6px;
}

.rpg-party-card.is-compact h3 {
  margin-top: 4px;
  font-size: 10px;
}

.rpg-party-card.is-compact > p {
  overflow: hidden;
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rpg-party-card.is-compact .rpg-card-kicker {
  font-size: 6px;
}

.rpg-party-card.is-compact .rpg-vital-bar {
  height: 10px;
  margin-top: 5px;
}

.rpg-party-card.is-compact .rpg-vital-bar small {
  font-size: 6px;
  line-height: 10px;
}

.rpg-tactical-spell-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.rpg-tactical-spell {
  min-width: 0;
  min-height: 40px;
  padding: 4px 5px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  color: #dce8e2;
  border: 1px solid color-mix(in srgb, var(--rpg-accent) 30%, transparent);
  border-radius: 4px;
  background: rgba(8, 21, 18, 0.9);
  text-align: left;
}

button.rpg-tactical-spell {
  cursor: pointer;
}

.rpg-tactical-spell > b {
  color: #71857d;
  font-size: 7px;
}

.rpg-tactical-spell > i {
  color: var(--rpg-accent);
  font-size: 13px;
  font-style: normal;
}

.rpg-tactical-spell > span {
  overflow: hidden;
  display: grid;
  font-size: 8px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rpg-tactical-spell > span small {
  color: var(--rpg-muted);
  font-size: 6px;
  font-weight: 500;
}

.rpg-tactical-spell > em {
  color: #71857d;
  font-style: normal;
}

.rpg-tactical-continue {
  width: 100%;
  min-height: 42px;
  margin-top: 8px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: #07100d;
  border: 1px solid rgba(255, 225, 147, 0.5);
  border-radius: 5px;
  background: linear-gradient(180deg, #dcbc58, #a17c27);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rpg-tactical-continue > b {
  min-width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(7, 16, 13, 0.35);
  border-radius: 50%;
}

.rpg-tactical-hero {
  padding: 10px 12px 10px 55px;
  position: relative;
  min-height: 82px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--rpg-accent, #70b99f) 35%, transparent);
  border-radius: 6px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--rpg-accent, #70b99f) 12%, transparent), transparent 58%), rgba(8, 21, 18, 0.92);
}

.rpg-tactical-hero > i {
  position: absolute;
  top: 13px;
  left: 12px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--rpg-accent, var(--rpg-gold));
  border: 1px solid color-mix(in srgb, var(--rpg-accent, var(--rpg-gold)) 40%, transparent);
  border-radius: 50%;
  font-size: 18px;
  font-style: normal;
}

.rpg-tactical-hero h2 {
  margin-top: 2px;
  font-size: 15px;
}

.rpg-tactical-hero p {
  margin: 5px 0 0;
  color: var(--rpg-muted);
  font-size: 9px;
  line-height: 1.25;
}

.rpg-run-tactical .rpg-challenge-objective {
  width: 100%;
  margin-top: 0;
}

.rpg-tactical-cleared > i {
  color: var(--rpg-gold);
  font-size: 24px;
}

.rpg-tactical-rewards {
  display: grid;
  gap: 6px;
}

.rpg-tactical-reward {
  min-height: 130px;
  padding: 9px 64px 9px 49px;
  position: relative;
  cursor: pointer;
  color: #e7f0ec;
  border: 1px solid color-mix(in srgb, var(--rpg-accent) 42%, transparent);
  border-radius: 5px;
  background: linear-gradient(110deg, color-mix(in srgb, var(--rpg-accent) 12%, transparent), transparent 58%), rgba(8, 21, 18, 0.92);
  text-align: left;
}

.rpg-tactical-reward > i {
  position: absolute;
  top: 12px;
  left: 10px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--rpg-accent);
  border: 1px solid color-mix(in srgb, var(--rpg-accent) 40%, transparent);
  border-radius: 50%;
  font-size: 16px;
  font-style: normal;
}

.rpg-tactical-reward > span {
  display: grid;
}

.rpg-tactical-reward small {
  color: var(--rpg-accent);
  font-size: 7px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rpg-tactical-reward strong {
  font-family: "Cinzel", Georgia, serif;
  font-size: 12px;
}

.rpg-tactical-reward p {
  margin: 4px 0 0;
  color: var(--rpg-muted);
  font-size: 9px;
}

.rpg-tactical-reward > b {
  position: absolute;
  right: 11px;
  color: var(--rpg-accent);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rpg-gear-comparison {
  min-width: 0;
  margin-top: 7px;
  padding-top: 6px;
  display: grid;
  gap: 5px;
  color: #dce8e2;
  border-top: 1px solid var(--rpg-line);
  font-style: normal;
}

.rpg-gear-comparison > strong {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  overflow: hidden;
  color: #dce8e2;
  font-family: "Rajdhani", "Avenir Next Condensed", sans-serif;
  font-size: 9px;
  letter-spacing: 0.04em;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rpg-gear-comparison > strong > em {
  flex: 0 0 auto;
  padding: 2px 4px;
  color: #9de1b8;
  border-radius: 2px;
  background: rgba(70, 167, 108, 0.15);
  font-size: 8px;
  font-style: normal;
}

.rpg-gear-comparison > span {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
}

.rpg-gear-comparison > span > span {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.rpg-gear-comparison small,
.rpg-tactical-reward .rpg-gear-comparison small {
  overflow: hidden;
  color: #82958e;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.rpg-gear-comparison b {
  color: #f1f7f4;
  font-size: 12px;
  line-height: 1.1;
}

.rpg-gear-comparison > span > i {
  color: #75bceb;
  font-size: 11px;
  font-style: normal;
}

.rpg-run-tactical .rpg-tactical-shop-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rpg-run-tactical .rpg-gear-card {
  min-height: 112px;
}

.rpg-service-row {
  width: 100%;
}

.rpg-tactical-terminal {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.rpg-tactical-terminal > i {
  width: 58px;
  height: 58px;
  margin-bottom: 9px;
  display: grid;
  place-items: center;
  color: var(--rpg-gold);
  border: 1px solid rgba(239, 200, 88, 0.45);
  border-radius: 50%;
  font-size: 26px;
  font-style: normal;
}

.rpg-tactical-terminal h2 {
  margin-top: 3px;
  font-size: 20px;
}

.rpg-tactical-terminal p {
  margin: 7px 0 12px;
  color: var(--rpg-muted);
  font-size: 10px;
}

.rpg-tactical-terminal .rpg-secondary-action {
  width: 100%;
  min-height: 40px;
  margin-top: 6px;
}

.rpg-live-party-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.rpg-live-party-grid > button {
  min-width: 0;
  min-height: 64px;
  padding: 5px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  color: #dce8e2;
  border: 1px solid var(--rpg-line);
  border-radius: 5px;
  background: rgba(8, 21, 18, 0.92);
  text-align: left;
}

.rpg-live-party-grid > button.is-selected {
  border-color: var(--rpg-gold);
  box-shadow: inset 0 0 0 1px rgba(239, 200, 88, 0.22), 0 0 8px rgba(239, 200, 88, 0.12);
}

.rpg-live-party-grid > button.is-down {
  filter: grayscale(0.8);
  opacity: 0.5;
}

.rpg-live-party-grid > button > i {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #07100d;
  border-radius: 50%;
  background: var(--rpg-member-color);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.rpg-live-party-grid > button > span {
  min-width: 0;
  display: grid;
}

.rpg-live-party-grid strong,
.rpg-live-party-grid small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rpg-live-party-grid strong { font-size: 9px; }
.rpg-live-party-grid small { color: var(--rpg-muted); font-size: 8px; }

.rpg-live-party-grid em {
  height: 4px;
  margin-top: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.rpg-live-party-grid em b {
  height: 100%;
  display: block;
  background: #65ba8d;
}

.rpg-live-party-grid u {
  grid-column: 1 / -1;
  color: var(--rpg-muted);
  font-size: 8px;
  text-align: center;
  text-decoration: none;
}

.rpg-live-resource-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(65, 121, 171, 0.2);
}

.rpg-live-resource-bar i {
  height: 100%;
  display: block;
  background: linear-gradient(90deg, #3976b6, #62a7e5);
}

.rpg-live-resources {
  margin: 4px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.rpg-live-resources span {
  padding: 3px 6px;
  display: flex;
  justify-content: space-between;
  gap: 5px;
  color: var(--rpg-gold);
  border: 1px solid var(--rpg-line);
  border-radius: 3px;
  background: rgba(3, 10, 8, 0.68);
  font-size: 8px;
  white-space: nowrap;
}

.rpg-live-resources b { color: var(--rpg-muted); }

.rpg-live-cast {
  margin: 4px 0;
  display: grid;
  gap: 2px;
  color: #dce8e2;
  font-size: 9px;
}

.rpg-live-cast > i {
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(239, 200, 88, 0.15);
}

.rpg-live-cast > i > em {
  width: var(--rpg-cast-progress);
  height: 100%;
  display: block;
  background: var(--rpg-gold);
}

.rpg-live-spell-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.rpg-live-spell {
  min-width: 0;
  min-height: 50px;
  padding: 5px;
  display: grid;
  grid-template-columns: 20px 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  color: #dce8e2;
  border: 1px solid color-mix(in srgb, var(--rpg-accent, #71857d) 36%, transparent);
  border-radius: 4px;
  background: linear-gradient(110deg, color-mix(in srgb, var(--rpg-accent, #71857d) 8%, transparent), transparent 60%), rgba(8, 21, 18, 0.92);
  text-align: left;
}

.rpg-live-spell > b,
.rpg-live-spell > u { color: var(--rpg-gold); font-size: 8px; text-decoration: none; }
.rpg-live-spell > i { color: var(--rpg-accent); font-size: 14px; font-style: normal; }
.rpg-live-spell > span { min-width: 0; display: grid; }
.rpg-live-spell strong,
.rpg-live-spell small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rpg-live-spell strong { font-size: 9px; }
.rpg-live-spell small { color: var(--rpg-muted); font-size: 8px; }
.rpg-live-spell.is-cooling { opacity: 0.65; }
.rpg-live-spell.is-empty { grid-template-columns: auto 1fr; color: #71857d; }

/* Lower-panel text must remain readable at the 620x540 Android layout viewport. */
.rpg-run-tactical small,
.rpg-tactical-offer > u,
.rpg-party-card.is-compact .rpg-card-kicker,
.rpg-tactical-spell > b {
  font-size: max(8px, 1.3cqw);
}

.large-interface-text .rpg-run-overlay small,
.large-interface-text .rpg-run-tactical small { font-size: 10px; }
.large-interface-text .rpg-run-overlay p,
.large-interface-text .rpg-run-tactical p { font-size: 12px; }
.large-interface-text .rpg-run-overlay button,
.large-interface-text .rpg-run-tactical button { font-size: 11px; }

@container rpg-top (max-width: 720px) {
  .rpg-phase-panel {
    inset-inline: 10px;
  }

  .rpg-phase-title {
    grid-template-columns: 1fr auto;
  }

  .rpg-phase-title > p {
    display: none;
  }

  .rpg-party-offer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow-y: auto;
  }

  .rpg-party-card {
    min-height: 135px;
  }

  .rpg-spell-offer-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .rpg-spell-card {
    min-height: 92px;
  }

  .rpg-reward-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .rpg-reward-card {
    min-height: 220px;
  }

  .rpg-picked-strip,
  .rpg-spellbook-strip {
    overflow-x: auto;
  }

  .rpg-picked-chip,
  .rpg-empty-chip,
  .rpg-spellbook-chip {
    min-width: 100px;
  }

  .rpg-picked-chip {
    min-width: 142px;
  }

  .rpg-shop-layout {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
}

@container rpg-bottom (max-width: 480px) {
  .rpg-tactical-party-grid,
  .rpg-tactical-spell-grid,
  .rpg-run-tactical .rpg-tactical-shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rpg-tactical-offer > b {
    display: none;
  }

  .rpg-party-composition {
    display: grid;
    gap: 0;
    text-align: right;
  }
}

/* Single-display browser fallback gets a usable full-height draft surface. */
@media (max-width: 760px) {
  .top-display:has(.rpg-run-overlay.is-gated) {
    height: max(480px, min(540px, calc(100dvh - 20px)));
    aspect-ratio: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rpg-run-overlay *,
  .rpg-run-tactical * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
