/* —— Portfolio Survivor modal —— */
.survivor-modal {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(6px, 1.2vh, 12px);
  overflow: hidden;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.survivor-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.survivor-open {
  overflow: hidden;
}

.survivor-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
}

.survivor-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(96vw, 940px);
  max-height: calc(100dvh - clamp(12px, 2.4vh, 24px));
  overflow: hidden;
  padding: clamp(10px, 1.6vw, 14px);
  background:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #1c1b1a 0%, #0a0a0a 55%);
  border: 2px solid #3f3a36;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.65), 0 24px 60px rgba(0, 0, 0, 0.85);
}

.survivor-close {
  position: absolute;
  top: clamp(8px, 2vw, 12px);
  right: clamp(8px, 2vw, 12px);
  z-index: 3;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.75));
}

.survivor-close img {
  width: clamp(2rem, 6vw, 2.35rem);
  height: auto;
}

.survivor-head {
  flex-shrink: 0;
  text-align: center;
  padding: 0 clamp(2.5rem, 12vw, 3rem) clamp(6px, 1.2vw, 8px);
  border-bottom: 2px solid rgba(198, 40, 40, 0.35);
  margin-bottom: clamp(6px, 1.2vw, 8px);
}

.survivor-head__kicker {
  margin: 0;
  font-family: var(--typewriter);
  font-size: clamp(0.65rem, 1.8vw, 0.78rem);
  letter-spacing: 0.2em;
  color: #8a847c;
}

.survivor-head__title {
  margin: 0.15rem 0 0;
  font-family: var(--bebas);
  font-size: clamp(1.4rem, 4.5vw, 2rem);
  letter-spacing: 0.14em;
  color: #ece6de;
  text-shadow: 2px 2px 0 #000;
}

.survivor-head__title span {
  color: var(--red-bright);
}

.survivor-stats {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(6px, 1.2vw, 8px);
  margin-bottom: clamp(6px, 1.2vw, 8px);
}

@media (max-width: 520px) {
  .survivor-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.survivor-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 3.85rem;
  padding: 10px 8px;
  border: 1px solid #332e2c;
  background: rgba(0, 0, 0, 0.45);
  text-align: center;
}

.survivor-stat__label {
  display: block;
  width: 100%;
  margin: 0;
  font-family: var(--typewriter);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  color: #8a847c;
  text-align: center;
  line-height: 1.2;
}

.survivor-stat__val {
  display: block;
  width: 100%;
  margin: 0;
  font-family: var(--bebas);
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  letter-spacing: 0.04em;
  color: #ddd5cc;
  text-align: center;
  line-height: 1.1;
}

.survivor-stat__health {
  width: 100%;
  max-width: 4.75rem;
  height: 6px;
  margin: 2px auto 0;
  background: #1a1817;
  border: 1px solid #332e2c;
}

.survivor-stat__health-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #6d1a1a, var(--red-bright));
  transition: width 0.12s ease;
}

.survivor-viewport {
  --survivor-play-h: min(48dvh, calc(100dvh - 16rem), calc(92vw / 2));
  position: relative;
  flex: 0 1 auto;
  align-self: center;
  width: min(100%, calc(var(--survivor-play-h) * 2));
  height: var(--survivor-play-h);
  min-height: 0;
  border: 2px solid #332e2c;
  background: #000;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.75);
}

#survivor-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.survivor-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 20px);
  background: rgba(0, 0, 0, 0.82);
  text-align: center;
  line-height: 1.45;
  overflow: auto;
  overscroll-behavior: contain;
}

.survivor-overlay.is-hidden {
  display: none;
}

.survivor-overlay__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
  text-align: center;
  line-height: 1.45;
}

.survivor-overlay__copy h3 {
  margin: 0 0 0.5rem;
  font-family: var(--bebas);
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
  letter-spacing: 0.1em;
  color: var(--red-bright);
}

.survivor-overlay__copy p {
  margin: 0 0 0.75rem;
  font-family: var(--typewriter);
  font-size: clamp(0.65rem, 1.7vw, 0.78rem);
  color: #c8c0b6;
  line-height: 1.45;
}

.survivor-tips {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  font-family: var(--typewriter);
  font-size: clamp(0.6rem, 1.6vw, 0.68rem);
  color: #9a9490;
  text-align: center;
  line-height: 1.45;
}

.survivor-tips span {
  display: block;
  line-height: 1.45;
}

.survivor-enter-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 6px 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.8));
  transition: filter 0.15s ease, transform 0.15s ease;
}

.survivor-enter-btn:hover,
.survivor-enter-btn:focus-visible {
  filter: drop-shadow(0 0 14px rgba(229, 57, 53, 0.5));
  transform: translateY(-2px);
}

.survivor-enter-btn img {
  width: min(78%, 200px);
  height: auto;
}

.survivor-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin: 10px 0 14px;
}

.survivor-results > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.survivor-results span {
  display: block;
  width: 100%;
  text-align: center;
}

.survivor-results .lbl {
  font-family: var(--typewriter);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  color: #8a847c;
}

.survivor-results .val {
  font-family: var(--bebas);
  font-size: 1rem;
  color: #ece6de;
}

.survivor-post {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.survivor-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  margin: 0;
  padding: 12px 32px;
  font-family: var(--bebas);
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: #ddd5cc;
  text-decoration: none;
  text-align: center;
  border: 1px solid #4a4541;
  background: rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
}

.survivor-share:hover,
.survivor-share:focus-visible {
  border-color: var(--red-bright);
  color: #fff;
}

.survivor-legend {
  flex-shrink: 0;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(120, 32, 32, 0.45);
  font-family: var(--typewriter);
  font-size: clamp(0.5rem, 1.4vw, 0.58rem);
  color: #8a847c;
  text-align: center;
  line-height: 1.35;
}