.hall-detail-overlay[hidden] { display: none !important; }

body.play-page.is-hall-detail-open .game-topbar,
body.play-page.is-hall-detail-open .game-hud-row {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.scene-progress-card {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  align-content: center;
  gap: clamp(4px, .7vw, 10px);
  box-sizing: border-box;
  border: clamp(2px, .25vw, 4px) solid #fff;
  border-radius: clamp(14px, 1.8vw, 28px);
  padding: clamp(10px, 1.8vw, 25px);
  background: linear-gradient(145deg, #fff, #f7effb);
  box-shadow: 0 8px 0 rgba(54, 27, 87, .28), 0 15px 30px rgba(43, 20, 73, .2);
  color: #38205f;
  text-align: left;
}

.scene-progress-card small,
.scene-progress-card em {
  font-style: normal;
  font-weight: 900;
  line-height: 1.1;
}

.scene-progress-card small { color: #d72e7b; font-size: clamp(.52rem, .85vw, .82rem); text-transform: uppercase; }
.scene-progress-card strong { font-size: clamp(1.55rem, 3.2vw, 3.7rem); line-height: .95; }
.scene-progress-card em { color: #6f6278; font-size: clamp(.48rem, .72vw, .72rem); }
.scene-progress-card i { height: clamp(6px, .75vw, 10px); overflow: hidden; border-radius: 999px; background: #e5dceb; }
.scene-progress-card u { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ef3988, #a44ed3, #3a9be6); }

.mission-chooser .game-mode-card.is-washing {
  text-decoration: none;
}

.hall-detail-overlay {
  position: absolute;
  z-index: 96;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 34px);
  background: rgba(31, 15, 52, .68);
  backdrop-filter: blur(8px);
}

.hall-detail-dialog {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  border: 3px solid #3a205d;
  border-radius: 26px;
  padding: clamp(22px, 3vw, 32px);
  color: #321b51;
  background: linear-gradient(145deg, #fff, #f5f3ff);
  box-shadow: 10px 12px 0 rgba(29, 12, 48, .4), 0 28px 70px rgba(21, 9, 38, .42);
  scrollbar-width: thin;
  scrollbar-color: #a65ac6 #eee8f6;
}

.hall-detail-close {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border: 2px solid #e83884;
  border-radius: 13px;
  color: #cf2774;
  background: #fff;
  font: inherit;
  font-size: 1.45rem;
  font-weight: 1000;
  cursor: pointer;
}

.hall-detail-kicker {
  margin: 0;
  color: #d62c7a;
  font-size: .68rem;
  font-weight: 1000;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.hall-detail-dialog h2 {
  max-width: 18ch;
  margin: 7px 52px 0 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.hall-detail-dialog > p:not(.hall-detail-kicker) {
  max-width: 62ch;
  margin: 11px 0 0;
  color: #6e6179;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.45;
}

.hall-ranking-dialog::before {
  position: absolute;
  top: -3px;
  left: 50%;
  width: 42%;
  height: 20px;
  border: 3px solid #3a205d;
  border-top: 0;
  border-radius: 0 0 16px 16px;
  content: "";
  background: linear-gradient(90deg, #ec3583, #8050c6);
  transform: translateX(-50%);
}

.hall-ranking-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  margin: 0 48px 0 0;
  border: 2px solid #eadcec;
  border-radius: 20px;
  padding: 15px;
  background: #fff7fc;
}

.hall-ranking-summary > img { width: 96px; height: 96px; object-fit: contain; }
.hall-ranking-summary h2 { display: grid; gap: 6px; margin: 0; max-width: none; }
.hall-ranking-summary strong { font-size: clamp(2.8rem, 5vw, 4rem); line-height: 1; }
.hall-ranking-summary small { color: #766783; font-size: .9rem; font-weight: 800; }
.hall-ranking-list { list-style: none; margin: 18px 0 0; padding: 0; }

.hall-ranking-list { display: grid; gap: 8px; }

.hall-ranking-list li {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #dfd5e7;
  border-radius: 14px;
  padding: 10px 12px;
  background: #fff;
}

.hall-ranking-list li > img { width: 56px; height: 56px; object-fit: contain; }

.hall-ranking-list span { display: grid; }
.hall-ranking-list span strong { font-size: .88rem; }
.hall-ranking-list span small { color: #82738f; font-size: .74rem; font-weight: 750; }
.hall-ranking-list em { color: #d52d79; font-size: .8rem; font-style: normal; font-weight: 1000; }
.hall-progress-meter {
  height: 6px;
  overflow: hidden;
  margin-top: 6px;
  border-radius: 999px;
  background: #e8e0f1;
}
.hall-progress-meter u {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ef3988, #a44ed3, #3a9be6);
}

.segurancamente-reference {
  width: 100%;
  display: block;
  margin-top: 18px;
  border: 2px solid #eaddeb;
  border-radius: 18px;
  background: #fff;
}

@media (max-width: 720px) {
  .hall-detail-overlay { padding: 8px; }
  .hall-detail-dialog { max-height: calc(100dvh - 16px); border-radius: 20px; padding: 21px 17px; }
  .hall-ranking-list li { grid-template-columns: 44px minmax(0, 1fr) auto; padding: 8px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .hall-detail-dialog { width: min(880px, 100%); max-height: calc(100dvh - 16px); padding: 18px 22px; }
  .hall-detail-dialog h2 { font-size: 1.65rem; }
  .hall-ranking-summary { margin-top: 12px; padding: 8px 12px; }
  .hall-ranking-summary > img { width: 56px; height: 56px; }
  .hall-ranking-summary strong { font-size: 2.5rem; }
  .hall-ranking-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .segurancamente-reference { width: min(560px, 100%); margin-inline: auto; }
}

@media (min-width: 760px) and (max-height: 520px) and (orientation: landscape) {
  .mission-chooser-card {
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #a65ac6 #eee8f6;
  }

  .mission-chooser .game-mode-dock {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
  }

  .mission-chooser .game-mode-card {
    min-width: 0;
    min-height: 218px;
    padding: 8px;
  }

  .mission-chooser .game-mode-card > strong { font-size: .82rem; }
  .mission-chooser .game-mode-card > small { font-size: .55rem; line-height: 1.15; }
  .mission-chooser .game-mode-card > em { min-height: 25px; padding: 5px 6px; font-size: .53rem; }
}

@media (min-width: 900px) and (min-height: 521px) {
  .mission-chooser-card {
    width: min(1160px, calc(100vw - 48px));
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #a65ac6 #eee8f6;
  }

  .mission-chooser .game-mode-dock {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mission-chooser .game-mode-card {
    min-width: 0;
  }
}

@media (min-width: 900px) and (max-height: 820px) {
  .mission-chooser-card {
    gap: 7px;
    padding: 18px 24px;
  }

  .mission-chooser-card h1 {
    font-size: clamp(1.55rem, 3vw, 2.15rem);
  }

  .mission-chooser-card > span {
    font-size: .75rem;
    line-height: 1.3;
  }

  .mission-chooser .game-mode-dock {
    gap: 11px;
  }

  .mission-chooser .game-mode-card {
    min-height: 164px;
    padding: 12px;
  }
}

/* Keep the highlight on the card's own rounded surface. */
.interactive-scene .scene-faq::after { display: none; }
.interactive-scene .scene-object-column-right .scene-faq { filter: none; }
.scene-faq:hover .scene-progress-card,
.scene-faq:focus-visible .scene-progress-card {
  box-shadow: inset 0 0 0 3px #df3988, 0 8px 0 rgba(54, 27, 87, .28), 0 15px 30px rgba(43, 20, 73, .2);
}
@media (max-width: 720px) {
  .hall-ranking-list li > img { width: 44px; height: 44px; }
  .hall-ranking-summary { padding: 8px; gap: 8px; }
  .hall-ranking-summary > img { width: 64px; height: 64px; }
}
