.memetic-content {
  padding-right: 18px;
}

.memetic-archive-link {
  display: inline-block;
}

.memetic-app {
  --relic-bg: #f1efe7;
  --relic-panel: #fffdf7;
  --relic-ink: #282722;
  --relic-muted: #747064;
  --relic-line: #d6d1c3;
  --relic-dark: #191815;
  --relic-acid: #5f8f35;
  --relic-danger: #9b2f22;
  --relic-gold: #b98722;
  --touch-target: 44px;
  position: relative;
  min-height: calc(100vh - 74px);
  color: var(--relic-ink);
  font-family: Arial, Helvetica, sans-serif;
}

.memetic-app button,
.memetic-app textarea {
  font: inherit;
}

.memetic-loading {
  padding: 18px;
  border: 1px solid var(--hairline);
  background: var(--panel);
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.memetic-hero {
  display: grid;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--relic-line);
  background: var(--relic-panel);
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  align-items: end;
  gap: 18px;
}

.memetic-kicker,
.battle-label {
  margin: 0 0 8px;
  color: var(--relic-muted);
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.memetic-hero h1,
.result-card h1 {
  margin: 0;
  font-size: clamp(28px, 6vw, 76px);
  line-height: 0.94;
  text-transform: uppercase;
}

.memetic-intro {
  max-width: 720px;
  margin: 12px 0 0;
  color: #565248;
  font-size: 15px;
}

.local-relics {
  display: grid;
  padding: 12px;
  border: 1px solid var(--relic-line);
  background: #f7f5ee;
  gap: 5px;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.local-relics span {
  color: var(--relic-muted);
}

.local-relics strong {
  margin-bottom: 6px;
}

.loadout-bar,
.run-hud {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  min-height: 66px;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid var(--relic-line);
  background: rgb(255 253 247 / 0.96);
  grid-template-columns: repeat(3, minmax(110px, 1fr)) auto;
  align-items: center;
  gap: 10px;
}

.loadout-bar div,
.run-hud > div,
.result-stat {
  display: grid;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--relic-line);
  background: #f8f6ee;
  gap: 3px;
}

.loadout-bar span,
.run-hud span,
.result-stat span,
.confirmation-panel span {
  color: var(--relic-muted);
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.loadout-bar strong,
.run-hud strong,
.result-stat strong,
.confirmation-panel strong {
  font-family: "Courier New", Courier, monospace;
  font-size: 15px;
  text-transform: uppercase;
}

.is-danger,
.status-cursed {
  color: var(--relic-danger);
}

.status-clean {
  color: var(--relic-acid);
}

.memetic-button {
  min-height: var(--touch-target);
  padding: 10px 12px;
  border: 1px solid #b9b2a2;
  color: var(--relic-ink);
  background: #f5f2e9;
  cursor: pointer;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.memetic-button:hover:not(:disabled) {
  background: #ebe5d5;
}

.memetic-button--primary {
  border-color: var(--relic-dark);
  color: #f8f6ee;
  background: var(--relic-dark);
}

.memetic-button--primary:hover:not(:disabled) {
  background: #343129;
}

.memetic-button:disabled {
  color: #999287;
  background: #ece8dc;
  cursor: not-allowed;
}

.weapon-grid {
  display: grid;
  gap: 14px;
}

.price-row {
  display: grid;
  padding: 14px;
  border: 1px solid var(--relic-line);
  background: var(--relic-bg);
  gap: 10px;
}

.price-row h2,
.selected-loadout h2,
.battle-log h2,
.result-loadout h2,
.share-panel h2,
.local-score-panel h2 {
  margin: 0;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  text-transform: uppercase;
}

.price-row__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.weapon-card {
  position: relative;
  display: grid;
  overflow: hidden;
  min-height: 460px;
  padding: 0;
  border: 1px solid var(--relic-line);
  color: inherit;
  background: var(--relic-panel);
  cursor: pointer;
  text-align: left;
  grid-template-rows: 190px minmax(0, 1fr);
}

.weapon-card:hover:not(:disabled),
.weapon-card:focus-visible {
  border-color: var(--relic-dark);
}

.weapon-card.is-selected {
  border-color: var(--relic-dark);
  box-shadow: inset 0 0 0 2px var(--relic-dark);
}

.weapon-card.is-selected::after {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 4px 6px;
  color: #f8f6ee;
  background: var(--relic-dark);
  content: "SELECTED";
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  font-weight: 700;
}

.weapon-card.is-disabled {
  opacity: 0.46;
}

.weapon-card__price {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 42px;
  height: 32px;
  display: grid;
  border: 1px solid rgb(255 255 255 / 0.72);
  color: #f8f6ee;
  background: rgb(25 24 21 / 0.86);
  place-items: center;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  font-weight: 700;
}

.weapon-card__media {
  display: block;
  overflow: hidden;
  min-height: 190px;
  background: #ded8c8;
}

.weapon-card__image {
  width: 100%;
  height: 190px;
  object-fit: cover;
}

.weapon-card__fallback {
  display: grid;
  width: 100%;
  height: 190px;
  padding: 16px;
  color: #f8f6ee;
  background: var(--relic-dark);
  place-items: center;
  font-family: "Courier New", Courier, monospace;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
}

.weapon-card__body {
  display: grid;
  min-height: 0;
  padding: 10px;
  gap: 7px;
}

.weapon-card__title {
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
  text-transform: uppercase;
}

.weapon-card__copy {
  color: #5b564c;
  font-size: 12px;
  line-height: 1.25;
}

.weapon-card__tags {
  color: var(--relic-muted);
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.weapon-stats {
  display: grid;
  margin-top: 2px;
  gap: 4px;
}

.weapon-stat {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.weapon-stat > span:first-child {
  color: var(--relic-muted);
  font-family: "Courier New", Courier, monospace;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.stat-pips {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
}

.stat-pip {
  height: 7px;
  border: 1px solid #cfc7b5;
  background: #f4f1e7;
}

.stat-pip.is-filled {
  border-color: var(--relic-dark);
  background: var(--relic-dark);
}

.selected-loadout,
.result-loadout,
.share-panel,
.local-score-panel {
  display: grid;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--relic-line);
  background: var(--relic-panel);
  gap: 12px;
}

.selected-loadout__head,
.battle-log__head,
.share-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.loadout-slots,
.runtime-weapons,
.result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.loadout-slot,
.runtime-weapon {
  display: grid;
  min-height: 78px;
  padding: 8px;
  border: 1px solid var(--relic-line);
  color: inherit;
  background: #f8f6ee;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  text-align: left;
}

.loadout-slot {
  cursor: pointer;
}

.loadout-slot.is-empty {
  display: grid;
  grid-template-columns: 1fr;
  color: #918b7d;
  cursor: default;
}

.loadout-slot img,
.runtime-weapon img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  background: #ded8c8;
}

.loadout-slot span,
.runtime-weapon span {
  color: var(--relic-muted);
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.loadout-slot strong,
.runtime-weapon strong {
  display: block;
  overflow-wrap: anywhere;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  text-transform: uppercase;
}

.loadout-slot__fallback,
.runtime-weapon > span:first-child {
  display: grid;
  width: 56px;
  height: 56px;
  color: #f8f6ee;
  background: var(--relic-dark);
  place-items: center;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  font-weight: 700;
}

.confirmation-panel {
  display: grid;
  padding: 10px;
  border: 1px dashed #bdb5a4;
  background: #f6f2e7;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.confirmation-panel.is-ready {
  border-style: solid;
  border-color: var(--relic-dark);
}

.run-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 14px;
}

.battlefield {
  position: relative;
  display: grid;
  min-height: 620px;
  padding: 14px;
  border: 1px solid var(--relic-line);
  color: #f6f2e7;
  background:
    linear-gradient(90deg, rgb(255 255 255 / 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgb(255 255 255 / 0.04) 1px, transparent 1px),
    var(--relic-dark);
  background-size: 22px 22px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
}

.battlefield .battle-label {
  color: #c8beab;
}

.player-side,
.enemy-side {
  display: grid;
  gap: 10px;
}

.enemy-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 10px;
}

.enemy-card {
  display: grid;
  min-height: 96px;
  padding: 10px;
  border: 1px solid rgb(246 242 231 / 0.22);
  background: rgb(255 255 255 / 0.06);
  gap: 8px;
}

.enemy-card.is-boss {
  border-color: rgb(185 135 34 / 0.86);
  background: rgb(185 135 34 / 0.13);
}

.enemy-card.is-empty {
  color: #c8beab;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.enemy-card strong {
  display: block;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  text-transform: uppercase;
}

.enemy-card span,
.enemy-card small {
  color: #c8beab;
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.enemy-health,
.health-meter__track {
  overflow: hidden;
  height: 8px;
  border: 1px solid rgb(255 255 255 / 0.2);
  background: rgb(0 0 0 / 0.2);
}

.enemy-health span,
.health-meter__track span {
  display: block;
  height: 100%;
  background: var(--relic-acid);
}

.health-meter__track {
  border-color: #d9d1c0;
  background: #e9e4d6;
}

.battle-log {
  display: grid;
  max-height: calc(100vh - 100px);
  border: 1px solid var(--relic-line);
  background: var(--relic-panel);
  grid-template-rows: auto minmax(0, 1fr);
}

.battle-log__head {
  padding: 12px;
  border-bottom: 1px solid var(--relic-line);
}

.battle-log__head span {
  color: var(--relic-muted);
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.battle-log__list {
  overflow: auto;
  padding: 10px;
}

.log-event {
  margin: 0 0 8px;
  padding: 8px;
  border-left: 3px solid #cfc7b5;
  background: #f8f6ee;
  color: #4f4a41;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.log-event--good {
  border-left-color: var(--relic-acid);
}

.log-event--bad {
  border-left-color: var(--relic-danger);
}

.log-event--chaos {
  border-left-color: var(--relic-gold);
  color: #151410;
}

.cursed-stamp {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  padding: 8px 10px;
  border: 2px solid var(--relic-danger);
  color: var(--relic-danger);
  background: rgb(255 253 247 / 0.9);
  font-family: "Courier New", Courier, monospace;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  transform: rotate(-7deg);
}

.goblin-indicator {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  display: grid;
  min-width: 126px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid #6da549;
  color: #ddffd3;
  background: rgb(16 29 11 / 0.92);
  grid-template-columns: 16px 16px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  font-weight: 700;
}

.goblin-indicator span {
  width: 12px;
  height: 12px;
  background: #8df25e;
}

.goblin-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  padding: 18px;
  background: rgb(16 14 11 / 0.76);
  place-items: center;
}

.goblin-overlay__panel {
  display: grid;
  width: min(520px, 100%);
  padding: 18px;
  border: 1px solid #8df25e;
  color: #ebffe3;
  background: #111c0d;
  box-shadow: 0 24px 80px rgb(0 0 0 / 0.34);
  gap: 10px;
}

.goblin-overlay__panel h2 {
  margin: 0;
  font-family: "Courier New", Courier, monospace;
  font-size: 24px;
  line-height: 1.05;
  text-transform: uppercase;
}

.goblin-overlay__panel p {
  margin: 0;
  color: #cbeac1;
}

.result-screen {
  display: grid;
  gap: 14px;
}

.result-card {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  padding: 18px;
  border: 1px solid var(--relic-line);
  color: #f8f6ee;
  background:
    linear-gradient(90deg, rgb(255 255 255 / 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgb(255 255 255 / 0.04) 1px, transparent 1px),
    var(--relic-dark);
  background-size: 20px 20px;
}

.result-card .memetic-kicker {
  color: #c8beab;
}

.result-eligibility {
  margin: 14px 0;
  color: #d7cfbf;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.result-code {
  display: inline-block;
  padding: 8px 10px;
  border: 1px solid rgb(255 255 255 / 0.26);
  color: #f8f6ee;
  background: rgb(255 255 255 / 0.08);
  font-family: "Courier New", Courier, monospace;
  font-size: 16px;
  font-weight: 700;
}

.result-stamp {
  right: 24px;
  bottom: 24px;
}

.share-panel textarea {
  width: 100%;
  min-height: 96px;
  padding: 10px;
  border: 1px solid var(--relic-line);
  color: var(--relic-ink);
  background: #f8f6ee;
  resize: vertical;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  line-height: 1.4;
}

.local-score-panel p {
  margin: 0;
  color: #5b564c;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.is-goblin-mode .memetic-app.is-running,
.is-goblin-mode .memetic-app.is-ended {
  animation: goblin-shake 1.9s steps(2, end) infinite;
}

.is-goblin-mode .memetic-app::after {
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgb(95 143 53 / 0.08),
    rgb(95 143 53 / 0.08) 1px,
    transparent 1px,
    transparent 6px
  );
  content: "";
}

.corrupted-label {
  color: var(--relic-danger);
}

@keyframes goblin-shake {
  0%,
  100% {
    transform: translate(0, 0);
  }

  40% {
    transform: translate(1px, 0);
  }

  70% {
    transform: translate(-1px, 1px);
  }
}

@media (max-width: 1280px) {
  .price-row__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .run-layout {
    grid-template-columns: 1fr;
  }

  .battle-log {
    max-height: none;
  }
}

@media (max-width: 900px) {
  .memetic-hero,
  .loadout-bar,
  .run-hud,
  .confirmation-panel,
  .loadout-slots,
  .runtime-weapons,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .run-hud,
  .loadout-bar {
    position: static;
  }

  .enemy-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .memetic-content {
    padding: 14px 8px 40px;
  }

  .memetic-hero h1,
  .result-card h1 {
    font-size: 40px;
  }

  .price-row__grid {
    grid-template-columns: 1fr;
  }

  .weapon-card {
    min-height: 0;
    grid-template-rows: 220px auto;
  }

  .weapon-card__image,
  .weapon-card__fallback {
    height: 220px;
  }

  .battlefield {
    min-height: 520px;
  }

  .share-actions,
  .selected-loadout__head {
    align-items: stretch;
    flex-direction: column;
  }

  .goblin-indicator {
    right: 8px;
    bottom: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .is-goblin-mode .memetic-app.is-running,
  .is-goblin-mode .memetic-app.is-ended {
    animation: none;
  }
}

/* Loadout selection refactor */
.memetic-shell {
  display: block;
}

.memetic-shell .sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  min-height: 0;
  padding: 12px 18px;
  border-bottom: 1px solid rgb(0 0 0 / 0.12);
  background: rgb(247 247 244 / 0.96);
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.memetic-shell .sidebar__top {
  display: flex;
  align-items: center;
  gap: 18px;
}

.memetic-shell .brand {
  width: 138px;
}

.memetic-shell .category-nav {
  display: flex;
  overflow-x: auto;
  align-items: center;
  gap: 14px;
  scrollbar-width: none;
}

.memetic-shell .category-nav::-webkit-scrollbar {
  display: none;
}

.memetic-shell .nav-label {
  display: none;
}

.memetic-shell .category-link {
  flex: 0 0 auto;
  font-size: 12px;
  white-space: nowrap;
}

.memetic-shell .content {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 18px 18px 64px;
}

.memetic-app {
  min-height: auto;
}

.memetic-hero {
  margin-bottom: 16px;
  padding: 18px;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.memetic-hero h1 {
  max-width: 980px;
  font-size: clamp(38px, 6.4vw, 86px);
}

.memetic-intro {
  max-width: 760px;
  font-size: 16px;
}

.status-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 8px;
}

.status-chip,
.console-meter div {
  display: grid;
  min-height: 52px;
  padding: 9px 10px;
  border: 1px solid var(--relic-line);
  background: #f8f6ee;
  gap: 3px;
}

.status-chip span,
.console-meter span {
  color: var(--relic-muted);
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-chip strong,
.console-meter strong {
  font-family: "Courier New", Courier, monospace;
  font-size: 15px;
  text-transform: uppercase;
}

.selection-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.command-console {
  position: sticky;
  top: 82px;
  margin-top: 0;
  padding: 14px;
  border-color: #beb5a3;
  background:
    linear-gradient(90deg, rgb(0 0 0 / 0.025) 1px, transparent 1px),
    linear-gradient(0deg, rgb(0 0 0 / 0.025) 1px, transparent 1px),
    var(--relic-panel);
  background-size: 18px 18px;
  box-shadow: 0 16px 42px rgb(0 0 0 / 0.06);
}

.command-console .selected-loadout__head {
  align-items: start;
}

.command-console .selected-loadout__head h2 {
  font-size: 18px;
}

.command-console .loadout-slots {
  grid-template-columns: 1fr;
}

.command-console .loadout-slot {
  min-height: 68px;
  grid-template-columns: 1fr;
  gap: 5px;
}

.command-console .loadout-slot:hover {
  border-color: var(--relic-dark);
}

.command-console .loadout-slot.is-empty {
  min-height: 58px;
  border-style: dashed;
}

.loadout-slot__index {
  color: var(--relic-muted);
}

.command-console .loadout-slot strong {
  font-size: 13px;
}

.console-meter {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.command-console .confirmation-panel {
  grid-template-columns: 1fr;
}

.start-run-button {
  width: 100%;
  min-height: 54px;
  font-size: 13px;
}

.weapon-grid {
  gap: 16px;
}

.price-row {
  padding: 16px;
  gap: 12px;
}

.price-row__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.price-row__head h2 {
  font-size: 16px;
}

.price-row__head span {
  color: var(--relic-muted);
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.price-row__grid {
  grid-template-columns: repeat(auto-fit, minmax(236px, 1fr));
  gap: 12px;
}

.weapon-card {
  min-height: 0;
  grid-template-rows: 260px auto;
}

.weapon-card__media {
  min-height: 260px;
  background: #e4dfd1;
}

.weapon-card__image {
  height: 260px;
  object-fit: contain;
  padding: 8px;
  background: #e4dfd1;
}

.weapon-card__fallback {
  height: 260px;
}

.weapon-card__body {
  padding: 12px;
  gap: 8px;
}

.weapon-card__title {
  font-size: 15px;
}

.weapon-card__copy {
  min-height: 32px;
}

.weapon-card__tags {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  padding: 4px 6px;
  border: 1px solid var(--relic-line);
  background: #f7f3e8;
  overflow-wrap: anywhere;
}

.weapon-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.weapon-stat {
  grid-template-columns: 42px minmax(0, 1fr);
}

.weapon-card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 5px 7px;
  color: #f8f6ee;
  background: var(--relic-dark);
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.weapon-card__badge--blocked {
  color: #f8f6ee;
  background: var(--relic-danger);
}

.weapon-card.is-selected::after {
  display: none;
}

.weapon-card__action {
  display: grid;
  min-height: var(--touch-target);
  margin-top: 2px;
  border: 1px solid var(--relic-dark);
  color: var(--relic-dark);
  background: transparent;
  place-items: center;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.weapon-card.is-selected .weapon-card__action {
  color: #f8f6ee;
  background: var(--relic-dark);
}

.weapon-card.is-disabled {
  opacity: 0.62;
}

.weapon-card.is-disabled .weapon-card__action {
  border-color: #c8c0af;
  color: #918879;
}

@media (min-width: 1500px) {
  .price-row__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .selection-layout {
    grid-template-columns: 1fr;
  }

  .command-console {
    position: sticky;
    top: 70px;
    z-index: 10;
  }

  .command-console .loadout-slots,
  .console-meter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .memetic-shell .sidebar {
    position: static;
    padding: 10px 12px;
  }

  .memetic-shell .sidebar__top {
    width: 100%;
    justify-content: center;
  }

  .memetic-shell .brand {
    width: min(152px, 52vw);
  }

  .memetic-shell .content {
    padding: 10px 8px 42px;
  }

  .status-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .weapon-grid {
    order: 1;
  }

  .command-console {
    position: static;
    order: 2;
  }

  .memetic-hero h1 {
    font-size: 38px;
    line-height: 1;
  }

  .price-row__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .weapon-card {
    grid-template-rows: 210px auto;
  }

  .weapon-card__media,
  .weapon-card__image,
  .weapon-card__fallback {
    height: 210px;
    min-height: 210px;
  }

  .weapon-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .memetic-archive-link {
    display: none;
  }

  .memetic-shell .content {
    padding-inline: 6px;
  }

  .memetic-hero {
    padding: 12px;
    gap: 12px;
  }

  .memetic-hero h1 {
    font-size: 30px;
  }

  .status-chips,
  .command-console .loadout-slots,
  .console-meter,
  .price-row__grid {
    grid-template-columns: 1fr;
  }

  .command-console {
    padding: 12px;
  }

  .selected-loadout__head,
  .price-row__head {
    align-items: stretch;
    flex-direction: column;
  }

  .status-chip,
  .console-meter div {
    min-height: 44px;
  }

  .price-row {
    padding: 10px;
  }

  .weapon-card {
    grid-template-columns: 124px minmax(0, 1fr);
    grid-template-rows: auto;
  }

  .weapon-card__media,
  .weapon-card__image,
  .weapon-card__fallback {
    height: 100%;
    min-height: 192px;
  }

  .weapon-card__image {
    padding: 6px;
  }

  .weapon-card__body {
    gap: 6px;
    padding: 10px;
  }

  .weapon-card__title {
    padding-right: 44px;
    font-size: 13px;
  }

  .weapon-card__copy {
    min-height: 0;
  }

  .weapon-stats {
    display: none;
  }

  .weapon-card__action {
    min-height: var(--touch-target);
  }
}

@media (max-width: 430px) {
  .memetic-shell .content {
    padding-inline: 8px;
  }

  .weapon-card {
    grid-template-columns: 1fr;
  }

  .weapon-card__media,
  .weapon-card__image,
  .weapon-card__fallback {
    height: 220px;
    min-height: 220px;
  }

  .weapon-card__title {
    padding-right: 0;
  }

  .weapon-stats {
    display: grid;
  }

  .share-actions .memetic-button,
  .selected-loadout__head .memetic-button {
    width: 100%;
  }
}

/* Running game interface refactor */
.memetic-app.is-running {
  display: grid;
  gap: 14px;
}

.memetic-app.is-running .run-hud {
  position: sticky;
  top: 61px;
  z-index: 30;
  min-height: 72px;
  margin-bottom: 0;
  padding: 8px;
  border-color: #bdb5a4;
  background:
    linear-gradient(90deg, rgb(0 0 0 / 0.025) 1px, transparent 1px),
    linear-gradient(0deg, rgb(0 0 0 / 0.025) 1px, transparent 1px),
    rgb(255 253 247 / 0.97);
  background-size: 18px 18px;
  grid-template-columns: minmax(76px, 0.65fr) minmax(180px, 1.4fr) minmax(120px, 0.9fr) minmax(130px, 0.9fr) minmax(260px, 2fr);
}

.hud-cell {
  display: grid;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid var(--relic-line);
  background: #f8f6ee;
  gap: 2px;
}

.hud-cell--wave strong {
  font-size: 26px;
  line-height: 1;
}

.hud-cell--event {
  background: #efeadc;
}

.hud-cell--event small {
  overflow: hidden;
  color: #5b564c;
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memetic-app.is-running .run-layout {
  display: grid;
  grid-template-columns: minmax(240px, 310px) minmax(0, 1fr) minmax(230px, 300px);
  gap: 14px;
}

.player-rig-panel,
.battle-feed {
  display: grid;
  min-height: calc(100vh - 170px);
  border: 1px solid var(--relic-line);
  background: var(--relic-panel);
  align-content: start;
}

.player-rig-panel {
  position: sticky;
  top: 151px;
  padding: 12px;
  gap: 12px;
}

.panel-head,
.arena-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h2,
.arena-head h2 {
  margin: 0;
  font-family: "Courier New", Courier, monospace;
  font-size: 16px;
  text-transform: uppercase;
}

.panel-head > span,
.arena-head > span {
  padding: 5px 7px;
  border: 1px solid var(--relic-line);
  color: var(--relic-muted);
  background: #f7f3e8;
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.rig-health,
.passive-summary {
  display: grid;
  padding: 9px;
  border: 1px solid var(--relic-line);
  background: #f8f6ee;
  gap: 5px;
}

.rig-health span,
.passive-summary span {
  color: var(--relic-muted);
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.rig-health strong,
.passive-summary strong {
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  text-transform: uppercase;
}

.player-rig-panel .runtime-weapons {
  grid-template-columns: 1fr;
  gap: 9px;
}

.player-rig-panel .runtime-weapon {
  min-height: 92px;
  padding: 8px;
  grid-template-columns: 66px minmax(0, 1fr);
  border-color: #cbc3b2;
  background: #f8f6ee;
}

.player-rig-panel .runtime-weapon.is-active {
  border-color: var(--relic-gold);
  background: #fff8dc;
  box-shadow: inset 0 0 0 2px rgb(185 135 34 / 0.22);
}

.player-rig-panel .runtime-weapon img,
.player-rig-panel .runtime-weapon > span:first-child {
  width: 66px;
  height: 66px;
}

.runtime-weapon em,
.runtime-weapon small {
  display: block;
  margin-top: 3px;
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
}

.runtime-weapon em {
  color: var(--relic-ink);
}

.runtime-weapon small {
  color: var(--relic-gold);
}

.rig-end-button {
  width: 100%;
  min-height: 42px;
}

.combat-arena {
  min-height: calc(100vh - 170px);
  padding: 14px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: stretch;
}

.combat-arena::before {
  position: absolute;
  inset: 46px 14px 58px;
  z-index: 0;
  border: 1px solid rgb(255 255 255 / 0.08);
  background: radial-gradient(circle at center, rgb(185 135 34 / 0.12), transparent 58%);
  content: "";
}

.combat-arena > * {
  position: relative;
  z-index: 1;
}

.combat-arena .arena-head {
  padding-bottom: 10px;
  border-bottom: 1px solid rgb(255 255 255 / 0.14);
}

.combat-arena .arena-head h2 {
  color: #f8f6ee;
  font-size: 22px;
}

.combat-arena .arena-head > span {
  border-color: rgb(255 255 255 / 0.16);
  color: #d9cfbd;
  background: rgb(255 255 255 / 0.07);
}

.combat-arena .enemy-side {
  align-content: center;
}

.combat-arena .enemy-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-content: center;
  gap: 14px;
}

.combat-arena .enemy-card {
  position: relative;
  overflow: hidden;
  min-height: 170px;
  padding: 14px;
  border-color: rgb(246 242 231 / 0.28);
  background: rgb(255 255 255 / 0.08);
  box-shadow: 0 18px 46px rgb(0 0 0 / 0.16);
}

.combat-arena .enemy-card.is-hit {
  border-color: var(--relic-gold);
  animation: enemy-hit 260ms ease;
}

.combat-arena .enemy-card.is-boss {
  min-height: 210px;
  border-color: rgb(185 135 34 / 0.94);
  background: linear-gradient(135deg, rgb(185 135 34 / 0.18), rgb(255 255 255 / 0.07));
}

.enemy-card__top,
.enemy-card__foot,
.enemy-tags {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.combat-arena .enemy-card strong {
  font-size: 17px;
  line-height: 1.05;
}

.enemy-tags {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.enemy-tags span,
.enemy-card__top span {
  padding: 4px 6px;
  border: 1px solid rgb(255 255 255 / 0.16);
  background: rgb(0 0 0 / 0.12);
}

.combat-arena .enemy-health {
  height: 12px;
  margin-top: auto;
}

.floating-damage {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  color: #fff7c4;
  font-family: "Courier New", Courier, monospace;
  font-size: 22px;
  font-weight: 700;
  animation: float-damage 700ms ease both;
}

.arena-event-strip {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.arena-callout {
  padding: 6px 8px;
  border: 1px solid rgb(255 255 255 / 0.18);
  color: #d9cfbd;
  background: rgb(255 255 255 / 0.07);
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.arena-callout--good {
  color: #dff0cf;
}

.arena-callout--bad {
  color: #ffd1ca;
}

.arena-callout--chaos {
  color: #fff1a8;
}

.battle-feed {
  max-height: calc(100vh - 170px);
  min-height: calc(100vh - 170px);
  opacity: 0.96;
}

.battle-feed .battle-log__list {
  padding: 8px;
}

.battle-feed .log-event {
  margin-bottom: 6px;
  padding: 7px 8px;
  font-size: 10px;
  line-height: 1.3;
}

.log-event > span {
  display: block;
  margin-bottom: 3px;
  color: var(--relic-muted);
  font-size: 9px;
}

.log-event--enemy-attack {
  background: #f5e7e1;
}

.log-event--weapon-hit,
.log-event--weapon-splash,
.log-event--weapon-reflect {
  background: #eef3e6;
}

.log-event--wave-start,
.log-event--wave-clear,
.log-event--run-start {
  border-left-width: 5px;
}

@keyframes enemy-hit {
  0% {
    transform: translateY(0);
  }

  45% {
    transform: translateY(-3px);
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes float-damage {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }

  20% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateY(-18px);
  }
}

@media (max-width: 1280px) {
  .memetic-app.is-running .run-layout {
    grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  }

  .battle-feed {
    grid-column: 1 / -1;
    min-height: 0;
    max-height: 260px;
  }
}

@media (max-width: 900px) {
  .memetic-app.is-running .run-hud {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hud-cell--event {
    grid-column: 1 / -1;
  }

  .memetic-app.is-running .run-layout {
    grid-template-columns: 1fr;
  }

  .player-rig-panel {
    position: static;
    min-height: 0;
  }

  .player-rig-panel .runtime-weapons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .combat-arena,
  .battle-feed {
    min-height: 0;
    max-height: none;
  }
}

@media (max-width: 560px) {
  .memetic-app.is-running .run-hud {
    grid-template-columns: 1fr;
  }

  .player-rig-panel .runtime-weapons,
  .combat-arena .enemy-list {
    grid-template-columns: 1fr;
  }

  .combat-arena .enemy-card,
  .combat-arena .enemy-card.is-boss {
    min-height: 150px;
  }

  .hud-cell {
    min-height: 46px;
  }

  .panel-head,
  .arena-head,
  .enemy-card__top,
  .enemy-card__foot {
    align-items: stretch;
    flex-direction: column;
  }

  .combat-arena {
    padding: 10px;
  }

  .combat-arena::before {
    inset: 44px 10px 52px;
  }

  .battle-feed .log-event {
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .combat-arena .enemy-card.is-hit,
  .floating-damage {
    animation: none;
  }
}

@media (max-width: 700px) {
  .memetic-shell .sidebar {
    position: sticky;
    top: 0;
    z-index: var(--z-nav);
    padding: 10px 12px 0;
  }

  .memetic-shell .sidebar__top {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) var(--touch-target);
    align-items: center;
    justify-content: stretch;
    gap: 8px;
  }

  .memetic-shell .brand {
    width: 138px;
    max-width: 58vw;
  }

  .memetic-shell .category-nav,
  .memetic-shell .junk-drawer-module {
    display: none;
  }

  .memetic-shell .sidebar.is-mobile-compact {
    padding: 6px 10px;
  }

  .memetic-shell .sidebar.is-mobile-compact .brand {
    width: 112px;
    max-width: 34vw;
  }
}
