/* TitanMC Prison Market — Shaft 47 / static art v2.
   Jedna zoptymalizowana scena zastępuje kosztowny renderer 3D. Obraz pozostaje
   nieruchomy, a ruch należy wyłącznie do interfejsu i stanów marketplace. */

body #marketplace .mh-hero[data-market-theme="prison"] {
  background-color: #04070a !important;
  background-image:
    radial-gradient(ellipse 76% 50% at 50% 18%, rgba(19, 30, 35, .2), transparent 72%),
    linear-gradient(180deg, #05080b 0%, #05080a 52%, #030507 100%) !important;
}

.mh-hero[data-market-theme="prison"] > .pmw-stage {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  contain: strict;
  pointer-events: none;
  background:
    radial-gradient(ellipse 54% 52% at 50% 28%, rgba(196, 72, 17, .14), transparent 72%),
    linear-gradient(180deg, #090807, #040506 72%);
}

.pmw-stage > .pmw-art,
.pmw-stage > .pmw-depth-mask,
.pmw-stage::before,
.pmw-stage::after {
  position: absolute;
  inset: 0;
  display: block;
  content: "";
  pointer-events: none;
}

.pmw-stage > .pmw-art {
  z-index: 0;
  inset: 0 0 auto;
  width: 100%;
  height: auto;
  aspect-ratio: 3344 / 1882;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 0 80%, rgba(0, 0, 0, .96) 84%, rgba(0, 0, 0, .66) 91%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0 80%, rgba(0, 0, 0, .96) 84%, rgba(0, 0, 0, .66) 91%, transparent 100%);
}

.pmw-stage > .pmw-art > img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  object-fit: cover;
  object-position: 50% 50%;
  transform: scale(1);
  animation: pmwArtReveal 1.05s cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes pmwArtReveal {
  from { opacity: 0; transform: scale(1.012); }
  to { opacity: 1; transform: scale(1); }
}

.pmw-stage > .pmw-depth-mask {
  z-index: 2;
  inset: 0 0 auto;
  width: 100%;
  height: auto;
  aspect-ratio: 3344 / 1882;
  background:
    linear-gradient(180deg, rgba(2, 3, 4, .09), rgba(2, 3, 4, .025) 24%, rgba(2, 3, 4, .08) 66%, rgba(3, 5, 7, .38) 100%),
    radial-gradient(ellipse 40% 52% at 50% 36%, rgba(1, 2, 3, .34) 0, rgba(1, 2, 3, .2) 48%, rgba(1, 2, 3, .04) 76%, transparent 100%);
}

/* Oświetlenie obrzeży ma funkcję: cyan = inspekcja, green = rozliczenie,
   copper = fizyczny tor transakcji. Nie jest pełnoekranowym gradientem. */
.pmw-stage::before {
  z-index: 3;
  background: none;
  opacity: 0;
}

.pmw-stage::after {
  z-index: 4;
  inset: auto 0 0;
  height: 36%;
  background: linear-gradient(180deg, transparent, rgba(3, 5, 7, .38) 58%, #030507 100%);
}

/* Stare dekoracyjne pseudo-karty dublowałyby fizyczne loty w scenie 3D. */
.mh-hero[data-market-theme="prison"] .mh-atmos {
  display: none !important;
}

body #marketplace .mh-hero[data-market-theme="prison"] > .mh-container {
  z-index: 3;
}

/* Forge-orange jest kolorem systemu Prison. Rzadkości przedmiotów zachowują
   własne barwy wyłącznie wewnątrz kart, więc cała scena nadal jest czytelna. */
.mh-hero[data-market-theme="prison"] .mhp2-prison {
  color: #ebe6de !important;
  -webkit-text-fill-color: #ebe6de !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .08), 0 12px 34px rgba(0, 0, 0, .42) !important;
}

.mh-hero[data-market-theme="prison"] .mhp2-market::after {
  color: #ff9a42 !important;
  -webkit-text-fill-color: #ff9a42 !important;
  text-shadow: 0 0 22px rgba(255, 105, 28, .34) !important;
  animation: pmwTitleScan 5.8s cubic-bezier(.16, 1, .3, 1) 1.6s infinite !important;
}

.mh-hero[data-market-theme="prison"] .mhp2-market {
  color: rgba(255, 126, 36, .13) !important;
  -webkit-text-fill-color: rgba(255, 126, 36, .13) !important;
  -webkit-text-stroke-color: rgba(255, 166, 74, .88) !important;
}

@keyframes pmwTitleScan {
  0%, 58% { clip-path: inset(0 100% 0 0); opacity: 0; }
  64% { opacity: .9; }
  79% { clip-path: inset(0 0 0 0); opacity: .72; }
  88%, 100% { clip-path: inset(0 0 0 0); opacity: 0; }
}

.mh-hero[data-market-theme="prison"].pmw-pulse .mhp2-market::after {
  animation: pmwTitlePulse 1.05s cubic-bezier(.16, 1, .3, 1) both !important;
}

@keyframes pmwTitlePulse {
  0% { clip-path: inset(0 100% 0 0); opacity: 0; }
  35% { opacity: 1; }
  82% { clip-path: inset(0 0 0 0); opacity: .8; }
  100% { clip-path: inset(0 0 0 0); opacity: 0; }
}

.mh-hero[data-market-theme="prison"] :is(.mhp2-console-head .fa-cube, .mh-search-icon i, #soundToggle) {
  color: #ff8a2a !important;
}

body #marketplace .mh-hero[data-market-theme="prison"] .mh-search {
  border-color: rgba(255, 147, 68, .3) !important;
  background:
    radial-gradient(circle at 12% 0, rgba(255, 105, 28, .045), transparent 34%),
    linear-gradient(180deg, rgba(12, 14, 16, .975), rgba(5, 7, 9, .992)) !important;
  box-shadow: inset 0 1px rgba(255, 226, 201, .065), inset 0 -1px rgba(255, 105, 28, .12), 0 18px 44px rgba(0, 0, 0, .46) !important;
}

body #marketplace .mh-hero[data-market-theme="prison"] .mh-search:focus-within {
  border-color: rgba(255, 147, 68, .58) !important;
  box-shadow: inset 0 1px rgba(255, 226, 201, .08), 0 0 0 4px rgba(255, 105, 28, .1), 0 22px 52px rgba(0, 0, 0, .5) !important;
}

.mh-hero[data-market-theme="prison"].pmw-pulse .mh-search {
  animation: pmwConsolePulse 1.05s cubic-bezier(.16, 1, .3, 1);
}

@keyframes pmwConsolePulse {
  0%, 100% { border-color: rgba(255, 147, 68, .3); }
  45% {
    border-color: rgba(255, 166, 86, .72);
    box-shadow: inset 0 1px rgba(255, 229, 206, .1), 0 0 0 4px rgba(255, 105, 28, .1), 0 18px 52px rgba(148, 48, 8, .22);
  }
}

body #marketplace .mh-hero[data-market-theme="prison"] .mh-btn-solid {
  color: #ffbd78 !important;
  background: linear-gradient(90deg, rgba(255, 105, 28, .1), transparent) !important;
}

body #marketplace .mh-hero[data-market-theme="prison"] .mh-btn-solid > i { color: #ff8a2a !important; }

.mh-hero[data-market-theme="prison"] .mh-rule,
.mh-hero[data-market-theme="prison"] .mh-board-head .mh-rule {
  background: linear-gradient(90deg, rgba(255, 105, 28, .78), rgba(255, 173, 87, .18) 34%, transparent) !important;
}

body #marketplace .mh-hero[data-market-theme="prison"] .mh-tile {
  transition: transform .42s cubic-bezier(.16, 1, .3, 1), border-color .32s ease, box-shadow .42s ease, background .32s ease !important;
}

body #marketplace .mh-hero[data-market-theme="prison"] .mh-tile:hover,
body #marketplace .mh-hero[data-market-theme="prison"] .mh-tile:focus-visible {
  transform: translate3d(0, -6px, 0) scale(1.012) !important;
  box-shadow: 0 22px 52px rgba(0, 0, 0, .5), inset 0 1px rgba(255, 231, 210, .055), 0 0 0 1px rgba(var(--rar), .15) !important;
}

/* Live semantic state: this indicator follows the Prison marketplace endpoint. */
body #marketplace .mh-hero[data-market-theme="prison"] #marketStatusSignal {
  transition: color .28s ease, opacity .28s ease !important;
}

.mh-hero[data-market-theme="prison"] #marketStatusSignal .mh-signal-dot,
.mh-hero[data-market-theme="prison"] #marketStatusSignal .mh-signal-dot::after {
  transition: background-color .28s ease, border-color .28s ease, box-shadow .28s ease;
}

.mh-hero[data-market-theme="prison"] #marketStatusSignal[data-state="checking"] .mh-signal-dot,
.mh-hero[data-market-theme="prison"] #marketStatusSignal[data-state="empty"] .mh-signal-dot,
.mh-hero[data-market-theme="prison"] #marketStatusSignal[data-state="unavailable"] .mh-signal-dot {
  background: #f0a641 !important;
  box-shadow: 0 0 9px rgba(240, 166, 65, .48);
}

.mh-hero[data-market-theme="prison"] #marketStatusSignal[data-state="checking"] .mh-signal-dot::after,
.mh-hero[data-market-theme="prison"] #marketStatusSignal[data-state="empty"] .mh-signal-dot::after,
.mh-hero[data-market-theme="prison"] #marketStatusSignal[data-state="unavailable"] .mh-signal-dot::after {
  border-color: rgba(240, 166, 65, .5);
}

.mh-hero[data-market-theme="prison"] #marketStatusSignal[data-state="open"] .mh-signal-dot {
  background: #46d38a !important;
  box-shadow: 0 0 10px rgba(70, 211, 138, .56);
}

.mh-hero[data-market-theme="prison"] #marketStatusSignal[data-state="error"] {
  color: rgba(244, 111, 90, .9) !important;
}

.mh-hero[data-market-theme="prison"] #marketStatusSignal[data-state="error"] .mh-signal-dot {
  background: #f46f5a !important;
  box-shadow: 0 0 9px rgba(244, 111, 90, .5);
}

.mh-hero[data-market-theme="prison"] #marketStatusSignal[data-state="error"] .mh-signal-dot::after {
  border-color: rgba(244, 111, 90, .46);
  animation: none !important;
}

.mh-hero[data-market-theme="prison"] #marketScannerStatus {
  transition: color .24s ease;
}

.mh-hero[data-market-theme="prison"] #marketScannerStatus > i {
  transition: background-color .24s ease, box-shadow .24s ease;
}

.mh-hero[data-market-theme="prison"] #marketScannerStatus[data-state="loading"] > i {
  background: #ff8a2a !important;
  box-shadow: 0 0 8px rgba(255, 138, 42, .58);
  animation: pmStatusPulse 1.35s ease-out infinite;
}

.mh-hero[data-market-theme="prison"] #marketScannerStatus[data-state="success"] > i {
  background: #46d38a !important;
  box-shadow: 0 0 8px rgba(70, 211, 138, .52);
}

.mh-hero[data-market-theme="prison"] #marketScannerStatus[data-state="empty"] > i {
  background: #f0a641 !important;
  box-shadow: 0 0 8px rgba(240, 166, 65, .45);
}

.mh-hero[data-market-theme="prison"] #marketScannerStatus[data-state="unavailable"] {
  color: rgba(233, 168, 83, .76) !important;
}

.mh-hero[data-market-theme="prison"] #marketScannerStatus[data-state="unavailable"] > i {
  background: #e9a853 !important;
  box-shadow: 0 0 8px rgba(233, 168, 83, .4);
}

.mh-hero[data-market-theme="prison"] #marketScannerStatus[data-state="error"] {
  color: rgba(244, 111, 90, .84) !important;
}

.mh-hero[data-market-theme="prison"] #marketScannerStatus[data-state="error"] > i {
  background: #f46f5a !important;
  box-shadow: 0 0 8px rgba(244, 111, 90, .48);
}

.mh-hero[data-market-theme="prison"] .mh-board-grid > li[hidden] {
  display: none !important;
}

.mh-hero[data-market-theme="prison"] .mh-board-grid[data-source="live-market"] {
  grid-template-columns: repeat(var(--pm-live-count, 6), minmax(0, 1fr));
}

.mh-hero[data-market-theme="prison"] .mh-board-grid[data-source="live-market"]:is([data-count="1"], [data-count="2"], [data-count="3"]) {
  grid-template-columns: repeat(var(--pm-live-count), minmax(190px, 238px));
  justify-content: center;
}

/* One restrained instrument rail makes the scene contract legible without
   turning the hero into a dashboard. Values are real, diagnostic mode is
   exposed only by the localhost script. */
.mh-hero[data-market-theme="prison"] .pmw-readout {
  display: grid;
  grid-template-columns: auto auto auto auto minmax(150px, 1fr) auto;
  align-items: center;
  gap: 0;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid rgba(255, 142, 59, .13);
  color: rgba(226, 218, 209, .66);
  font-family: var(--font-mono, monospace);
}

.mh-hero[data-market-theme="prison"] .pmw-readout-cell {
  min-width: 0;
  padding: 0 16px;
  border-left: 1px solid rgba(255, 255, 255, .07);
}

.mh-hero[data-market-theme="prison"] .pmw-readout-cell:first-child {
  padding-left: 0;
  border-left: 0;
}

.mh-hero[data-market-theme="prison"] .pmw-readout-cell small,
.mh-hero[data-market-theme="prison"] .pmw-readout-cell strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mh-hero[data-market-theme="prison"] .pmw-readout-cell small {
  margin-bottom: 3px;
  color: rgba(205, 195, 184, .38);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.mh-hero[data-market-theme="prison"] .pmw-readout-cell strong {
  color: rgba(239, 233, 225, .8);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .055em;
}

.mh-hero[data-market-theme="prison"] .pmw-readout-cell strong[data-state="ready"],
.mh-hero[data-market-theme="prison"] .pmw-readout-cell strong[data-state="online"],
.mh-hero[data-market-theme="prison"] .pmw-readout-cell strong[data-state="open"],
.mh-hero[data-market-theme="prison"] .pmw-readout-cell strong[data-state="active"] { color: #61d69b; }

.mh-hero[data-market-theme="prison"] .pmw-readout-cell strong[data-state="unavailable"],
.mh-hero[data-market-theme="prison"] .pmw-readout-cell strong[data-state="fallback"],
.mh-hero[data-market-theme="prison"] .pmw-readout-cell strong[data-state="empty"] { color: #e9a853; }

.mh-hero[data-market-theme="prison"] .pmw-readout-cell strong[data-state="error"] { color: #f0806d; }
.mh-hero[data-market-theme="prison"] .pmw-readout-cell strong[data-state="testing"] { color: #ff9b47; }

.mh-hero[data-market-theme="prison"] .pmw-scene-test {
  min-height: 32px;
  margin-left: 12px;
  padding: 0 13px;
  border: 1px solid rgba(255, 148, 71, .28);
  border-radius: 8px;
  color: #f5b06e;
  background: rgba(255, 112, 24, .055);
  font: 700 8px/1 var(--font-mono, monospace);
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .24s ease, background .24s ease, color .24s ease, transform .24s cubic-bezier(.16, 1, .3, 1);
}

.mh-hero[data-market-theme="prison"] .pmw-scene-test:hover,
.mh-hero[data-market-theme="prison"] .pmw-scene-test:focus-visible {
  border-color: rgba(255, 166, 92, .65);
  color: #ffd0a1;
  background: rgba(255, 112, 24, .11);
  transform: translateY(-1px);
}

.mh-hero[data-market-theme="prison"] .pmw-scene-test:disabled {
  cursor: progress;
  opacity: .72;
}

.mh-hero[data-market-theme="prison"] .mh-submit {
  position: relative;
  overflow: hidden;
}

.mh-hero[data-market-theme="prison"] .mh-submit > * { position: relative; z-index: 1; }

.mh-hero[data-market-theme="prison"] .mh-submit[data-state="loading"]::after {
  position: absolute;
  z-index: 0;
  inset: auto 0 0;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, transparent, #fff0d5 50%, transparent);
  transform: translateX(-100%);
  animation: pmwSearchProgress .95s ease-in-out infinite;
}

.mh-hero[data-market-theme="prison"] .mh-submit[data-state="success"] { filter: saturate(.82) hue-rotate(32deg); }
.mh-hero[data-market-theme="prison"] .mh-submit[data-state="empty"] { filter: saturate(.72); }
.mh-hero[data-market-theme="prison"] .mh-submit[data-state="error"] { filter: saturate(.72) hue-rotate(322deg); }

@keyframes pmwSearchProgress { to { transform: translateX(100%); } }

.mh-hero[data-market-theme="prison"] .mh-board-context {
  margin: -2px 0 13px;
  color: rgba(221, 211, 201, .52);
  font: 500 9px/1.45 var(--font-mono, monospace);
  letter-spacing: .045em;
}

.mh-hero[data-market-theme="prison"] .mh-board-grid[data-source="shortcuts"] .mh-tile::after {
  position: absolute;
  top: 9px;
  right: 10px;
  content: "SKRÓT";
  color: rgba(235, 224, 213, .32);
  font: 700 6px/1 var(--font-mono, monospace);
  letter-spacing: .16em;
}

body #marketplace .trend-evidence {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 10px;
  margin-top: 8px;
  color: var(--text-dim);
  font: 500 9px/1.2 var(--font-mono, monospace);
  letter-spacing: .035em;
}

body #marketplace .trend-evidence span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

body #marketplace .trend-evidence i { color: var(--pm-diamond); }
body #marketplace .trend-evidence b { color: var(--pm-ivory); font-weight: 700; }

@media (max-width: 760px) {
  body #marketplace .mh-hero[data-market-theme="prison"] {
    background-image: linear-gradient(180deg, #05080b, #030507) !important;
  }

  .pmw-stage > .pmw-art,
  .pmw-stage > .pmw-depth-mask {
    aspect-ratio: 9 / 16;
  }

  .pmw-stage > .pmw-art {
    -webkit-mask-image: linear-gradient(to bottom, #000 0 78%, rgba(0, 0, 0, .92) 84%, rgba(0, 0, 0, .5) 92%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0 78%, rgba(0, 0, 0, .92) 84%, rgba(0, 0, 0, .5) 92%, transparent 100%);
  }

  .pmw-stage > .pmw-art > img {
    object-position: 50% 50%;
    opacity: .96;
    transform: scale(1);
    animation-name: pmwArtRevealMobile;
  }

  .pmw-stage > .pmw-depth-mask {
    background:
      linear-gradient(180deg, rgba(2, 3, 4, .16), rgba(2, 3, 4, .04) 24%, rgba(2, 3, 4, .16) 70%, rgba(3, 5, 7, .46) 100%),
      radial-gradient(ellipse 76% 45% at 50% 31%, rgba(1, 2, 3, .42), rgba(1, 2, 3, .2) 58%, transparent 88%);
  }

  .pmw-stage::before { opacity: .48; }
  .pmw-stage::after { height: 48%; }

  .mh-hero[data-market-theme="prison"] .mh-board-grid[data-source="live-market"],
  .mh-hero[data-market-theme="prison"] .mh-board-grid[data-source="live-market"]:is([data-count="1"], [data-count="2"], [data-count="3"]) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .mh-hero[data-market-theme="prison"] .mh-board-grid[data-source="live-market"][data-count="1"] {
    grid-template-columns: minmax(0, 1fr);
  }

  /* The diagnostic rail is useful on a wide exchange desk, but on a phone it
     competes with the real market controls and makes the suspended evidence
     block read like another widget. Status remains available through the
     masthead and the existing live regions. */
  .mh-hero[data-market-theme="prison"] .pmw-readout { display: none !important; }
}

@keyframes pmwArtRevealMobile {
  from { opacity: 0; transform: scale(1.012); }
  to { opacity: .96; transform: scale(1); }
}

@media (min-width: 2200px) {
  .pmw-stage > .pmw-depth-mask {
    background:
      linear-gradient(180deg, rgba(2, 3, 4, .08), rgba(2, 3, 4, .02) 24%, rgba(2, 3, 4, .08) 66%, rgba(3, 5, 7, .36) 100%),
      radial-gradient(ellipse 38% 50% at 50% 36%, rgba(1, 2, 3, .32), rgba(1, 2, 3, .16) 52%, transparent 86%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pmw-stage > .pmw-art > img { animation-duration: .72s; }

  .mh-hero[data-market-theme="prison"] .mhp2-market::after {
    animation: pmwTitleScan 5.8s cubic-bezier(.16, 1, .3, 1) 1.6s infinite !important;
  }
}
