/* =========================================================
   HOMEPAGE — SECTION 4
   Recently Unlocked Evidence + Sealed Cases
   ========================================================= */

.home-section-four {
  position: relative;
  z-index: 4;
  width: min(calc(100% - 32px), var(--page-width));
  margin: -65px auto 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.home-section-four__panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(194, 159, 108, 0.46);
  border-radius: 7px;
  background:
    radial-gradient(circle at 50% 8%, rgba(135, 91, 48, 0.11), transparent 42%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 4px),
    linear-gradient(145deg, #14110d 0%, #0b0a08 55%, #060605 100%);
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.74),
    inset 0 0 0 3px rgba(194, 159, 108, 0.15),
    inset 0 0 0 6px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(232, 201, 153, 0.12),
    0 18px 34px rgba(0, 0, 0, 0.32);
}

.home-panel-corner {
  position: absolute;
  z-index: 5;
  width: 42px;
  height: 42px;
  pointer-events: none;
  background: url("../ui/mythical-mind-panel-corner.png") center / 145% 145% no-repeat;
  opacity: 0.94;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.72));
}

.home-panel-corner--tl { top: -3px; left: -3px; }
.home-panel-corner--tr { top: -3px; right: -3px; transform: rotate(90deg); }
.home-panel-corner--br { right: -3px; bottom: -3px; transform: rotate(180deg); }
.home-panel-corner--bl { bottom: -3px; left: -3px; transform: rotate(270deg); }

.home-section-four__header {
  position: relative;
  z-index: 1;
  min-height: 40px;
  padding: 12px 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.home-section-four__title {
  margin: 0;
  color: #d7c19d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-section-four__link,
.backroom-live-state {
  flex: 0 0 auto;
  color: var(--red-bright);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-section-four__link:hover,
.home-section-four__link:focus-visible {
  color: #cf5a50;
  outline: none;
}

/* Evidence ------------------------------------------------ */

.recent-evidence-grid {
  position: relative;
  z-index: 1;
  padding: 1px 16px 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.recent-evidence-card {
  position: relative;
  min-width: 0;
  min-height: 185px;
  display: grid;
  grid-template-rows: 115px auto;
  overflow: hidden;
  border: 1px solid rgba(194, 159, 108, 0.32);
  background: rgba(7, 7, 6, 0.82);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.42);
}

.recent-evidence-card__visual {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid rgba(194, 159, 108, 0.18);
  background:
    radial-gradient(circle at center, rgba(117, 86, 49, 0.09), transparent 62%),
    #090908;
}

.recent-evidence-card__visual img {
  width: 74%;
  height: 74%;
  object-fit: contain;
  filter: sepia(0.34) brightness(0.7) contrast(1.12);
  opacity: 0.62;
}

.recent-evidence-card__visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.018), transparent 42%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 4px);
  pointer-events: none;
}

.recent-evidence-card__body {
  min-height: 64px;
  padding: 9px 8px 10px;
  display: grid;
  align-content: center;
  gap: 4px;
  text-align: center;
}

.recent-evidence-card__type {
  color: #bda47c;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.recent-evidence-card__state {
  color: #766b5c;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.52rem;
  line-height: 1.25;
}

.recent-evidence-card.is-sealed::before {
  content: "SEALED";
  position: absolute;
  z-index: 3;
  top: 9px;
  right: 7px;
  padding: 2px 4px;
  border: 1px solid rgba(127, 31, 29, 0.4);
  color: rgba(168, 55, 47, 0.72);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.46rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  transform: rotate(-3deg);
}

.recent-evidence-empty-note {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0 16px 10px;
  color: #706758;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.56rem;
  line-height: 1.5;
  text-align: right;
}


/* Sealed Cases --------------------------------------------- */

.sealed-cases-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.sealed-cases-grid {
  position: relative;
  z-index: 1;
  padding: 1px 16px 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.sealed-case-card {
  position: relative;
  min-width: 0;
  min-height: 185px;
  padding: 12px 9px 11px;
  display: grid;
  grid-template-rows: 108px auto;
  overflow: hidden;
  border: 1px solid rgba(194, 159, 108, 0.32);
  background:
    radial-gradient(circle at 50% 34%, rgba(117, 86, 49, 0.09), transparent 58%),
    rgba(7, 7, 6, 0.82);
  box-shadow:
    inset 0 0 20px rgba(0, 0, 0, 0.46),
    inset 0 0 0 1px rgba(194, 159, 108, 0.055);
}

.sealed-case-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.014), transparent 44%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.01) 0 1px, transparent 1px 4px);
}

.sealed-case-card__seal {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
}

.sealed-case-card__seal img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  opacity: 0.68;
  filter: sepia(0.34) brightness(0.69) contrast(1.14);
}

.sealed-case-card__copy {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  text-align: center;
}

.sealed-case-card__type {
  color: #bda47c;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sealed-case-card__code {
  color: #b84238;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.sealed-case-card__state {
  color: #766b5c;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.47rem;
  line-height: 1.25;
  text-transform: uppercase;
}

.sealed-cases-note {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0 16px 10px;
  color: #706758;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.56rem;
  line-height: 1.5;
  text-align: right;
}

/* Backroom ------------------------------------------------ */

.backroom-panel {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

.backroom-heading-group {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.backroom-channel {
  color: #8b7257;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.55rem;
  letter-spacing: 0.04em;
  text-transform: none;
}

.backroom-live-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.backroom-live-state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7c2823;
  box-shadow: 0 0 8px rgba(168, 55, 47, 0.28);
}

.backroom-context {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0 16px 7px;
  color: #776d5f;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.55rem;
  line-height: 1.45;
}

.backroom-feed {
  position: relative;
  z-index: 1;
  margin: 0 16px;
  min-height: 116px;
  display: grid;
  align-content: center;
  border-top: 1px solid rgba(194, 159, 108, 0.13);
  border-bottom: 1px solid rgba(194, 159, 108, 0.13);
}

.backroom-pending {
  padding: 10px 3px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}

.backroom-bot-stack {
  display: flex;
  align-items: center;
  padding-left: 6px;
}

.backroom-bot-stack img {
  width: 36px;
  height: 36px;
  margin-left: -7px;
  border: 1px solid rgba(194, 159, 108, 0.34);
  border-radius: 50%;
  object-fit: cover;
  background: #090908;
  filter: sepia(0.14) saturate(0.75) contrast(1.04);
}

.backroom-bot-stack img:first-child {
  margin-left: 0;
}

.backroom-pending__copy {
  display: grid;
  gap: 6px;
}

.backroom-pending__copy strong {
  color: #c8b28f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.backroom-pending__copy p {
  margin: 0;
  color: #756b5d;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.55rem;
  line-height: 1.5;
}

.backroom-chat {
  position: relative;
  z-index: 1;
  padding: 9px 16px 10px;
  display: grid;
  gap: 8px;
}

.backroom-chat__bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.backroom-chat__input {
  min-width: 0;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(194, 159, 108, 0.22);
  background: rgba(3, 3, 3, 0.68);
  color: #8a806f;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.57rem;
}

.backroom-chat__input:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.backroom-chat__send,
.backroom-discord-link {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(194, 159, 108, 0.28);
  background: rgba(14, 12, 10, 0.72);
  color: #a99473;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.backroom-chat__send {
  min-width: 64px;
  opacity: 0.55;
}

.backroom-chat__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.backroom-access-note {
  color: #6d6458;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.51rem;
  line-height: 1.35;
}

.backroom-discord-link {
  min-width: 142px;
  padding: 0 11px;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.backroom-discord-link:hover,
.backroom-discord-link:focus-visible {
  color: #eee5d3;
  border-color: rgba(168, 55, 47, 0.58);
  background: rgba(127, 31, 29, 0.14);
  outline: none;
}

@media (max-width: 1180px) {
  .recent-evidence-grid,
  .sealed-cases-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .home-section-four {
    grid-template-columns: 1fr;
  }

  .recent-evidence-grid {
    grid-template-columns: repeat(4, minmax(145px, 1fr));
    overflow-x: auto;
    padding-bottom: 14px;
  }

  .sealed-cases-grid {
    grid-template-columns: repeat(4, minmax(145px, 1fr));
    overflow-x: auto;
    padding-bottom: 14px;
  }
}

@media (max-width: 720px) {
  .home-section-four {
    width: min(calc(100% - 20px), var(--page-width));
    gap: 10px;
  }

  .home-section-four__header {
    align-items: flex-start;
    padding-inline: 14px;
  }

  .recent-evidence-grid,
  .sealed-cases-grid {
    padding-inline: 14px;
  }

  .recent-evidence-empty-note,
  .sealed-cases-note,
  .backroom-context,
  .backroom-chat {
    padding-inline: 14px;
  }

  .backroom-feed {
    margin-inline: 14px;
  }

  .backroom-pending {
    grid-template-columns: 1fr;
  }

  .backroom-chat__foot {
    align-items: stretch;
    flex-direction: column;
  }

  .backroom-discord-link {
    width: 100%;
  }
}
