/* Lovers gallery + Hay Girl story — phone-safe, no page scroll, no spoiler chrome */
html, body.hg-body {
  margin: 0; padding: 0; height: 100%; width: 100%;
  overflow: hidden; background: #1a1410;
  font-family: Georgia, "Times New Roman", serif;
  color: #f3e6c8;
  -webkit-text-size-adjust: 100%;
}
#hgRoot {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  width: 100%; max-width: 430px; margin: 0 auto;
  height: 100%; height: 100dvh;
  background: #1a1410;
  overflow: hidden;
  box-sizing: border-box;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.hg-menu {
  position: absolute; left: 8px; top: 8px; z-index: 4;
  display: flex; gap: 6px;
}
.hg-menu button, .hg-back {
  appearance: none; border: 1px solid #5a4634;
  background: rgba(20,14,10,0.75); color: #c9a86a;
  border-radius: 8px; padding: 6px 10px; font-size: 0.78rem;
  cursor: pointer; font-family: inherit;
}
.hg-scene {
  flex: 1 1 auto; min-height: 0;
  position: relative; background: #0d0a08;
}
.hg-scene > img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  display: block;
}
.hg-scene .hg-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 42%;
  background: linear-gradient(transparent, rgba(10, 8, 6, 0.92));
  pointer-events: none;
}
.hg-dock {
  flex: 0 0 auto;
  background: #241c16;
  border-top: 1px solid #5a4634;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px;
  max-height: 42%;
  overflow: hidden;
}
.hg-who {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.78rem; letter-spacing: 0.04em;
  text-transform: uppercase; color: #c9a86a;
}
.hg-chip {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid #c9a86a; overflow: hidden;
  background: #3a2e24; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; color: #efd9a8;
}
.hg-chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hg-line {
  font-size: 0.95rem; line-height: 1.35;
  color: #f3e6c8;
}
.hg-line.narration { font-style: italic; color: #d8c9a8; }
.hg-line.hint {
  font-size: 0.88rem; color: #c9a86a; font-style: normal;
  text-align: center; min-height: 0;
}
.hg-choices {
  display: flex; flex-direction: column; gap: 6px;
}
.hg-btn {
  appearance: none; border: 1px solid #7a6248;
  background: #3a2c20; color: #f3e6c8;
  border-radius: 10px; padding: 10px 12px;
  font: inherit; font-size: 0.92rem; text-align: left;
  cursor: pointer;
}
.hg-btn:active { background: #4a3a2a; }
.hg-btn.primary {
  background: #5c3a1e; border-color: #c9a86a; text-align: center;
  font-size: 1rem; padding: 12px 14px;
}
.hg-btn:disabled { opacity: 0.45; cursor: default; }
.hg-banner {
  position: absolute; left: 50%; top: 18%;
  transform: translateX(-50%);
  background: rgba(20, 14, 10, 0.88);
  border: 1px solid #c9a86a; border-radius: 12px;
  padding: 14px 18px; text-align: center;
  font-size: 1.05rem; letter-spacing: 0.06em;
  color: #efd9a8; z-index: 3; max-width: 86%;
}

/* ---- Gallery hub (multi-lover cards, no spoilers) ---- */
.hg-scene.hg-hub-host { display: flex; flex-direction: column; }
.hg-scene.hg-hub-host .hg-hub { flex: 1 1 auto; width: 100%; min-height: 0; }
#hgRoot.hg-hub-mode .hg-dock { display: none !important; }

.hg-hub {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
  padding: 42px 10px 10px;
  gap: 8px;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
}
.hg-hub-bg {
  position: absolute; inset: 0;
  background: #0d0a08 center / cover no-repeat;
  filter: saturate(0.9) brightness(0.58);
  pointer-events: none;
  z-index: 0;
}
.hg-hub-bg::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 28%, rgba(50, 34, 22, 0.12), rgba(8, 6, 4, 0.62) 72%),
    linear-gradient(180deg, rgba(10,8,6,0.22), rgba(10,8,6,0.72));
}
.hg-hub-title {
  position: relative; z-index: 1;
  text-align: center; color: #c9a86a;
  font-size: 0.85rem; letter-spacing: 0.14em;
  text-transform: uppercase; flex: 0 0 auto;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}
.hg-gallery {
  position: relative; z-index: 1;
  flex: 1 1 auto; min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  overflow: hidden;
}
.hg-card {
  position: relative;
  border-radius: 12px;
  border: 1.5px solid #8a6a3e;
  background: #12100e;
  overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 0;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}
.hg-card.ready { border-color: #c9a86a; box-shadow: 0 0 0 1px rgba(201,168,106,0.35), 0 6px 18px rgba(0,0,0,0.45); }
.hg-card.unlocked { border-color: #c9a86a; }
.hg-card-art {
  flex: 1 1 auto; min-height: 0;
  position: relative;
  background: #0d0a08 center 18% / cover no-repeat;
}
.hg-card-art.faint {
  filter: grayscale(0.55) brightness(0.55);
  opacity: 0.55;
}
.hg-card-art.faint::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(12, 9, 7, 0.42);
}
.hg-card-art.bw {
  filter: grayscale(1) contrast(1.05);
  opacity: 1;
}
.hg-card-veil {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  z-index: 1;
}
.hg-card-veil .q {
  font-size: 1.45rem; letter-spacing: 0.12em;
  color: rgba(239, 217, 168, 0.78);
  text-shadow: 0 2px 10px rgba(0,0,0,0.9);
  font-weight: 600;
}
.hg-card-body {
  flex: 0 0 auto;
  position: relative; z-index: 2;
  padding: 6px 7px 7px;
  background: linear-gradient(180deg, rgba(18,14,10,0.72), rgba(14,10,8,0.94));
  border-top: 1px solid rgba(90, 70, 52, 0.55);
  display: flex; flex-direction: column; gap: 3px;
}
.hg-card-name {
  font-size: 0.82rem; color: #efd9a8;
  letter-spacing: 0.04em; text-align: center;
  line-height: 1.15;
}
.hg-card-name.locked { color: #9a8768; letter-spacing: 0.1em; }
.hg-reqs {
  display: flex; flex-direction: column; gap: 3px;
  margin-top: 2px;
}
.hg-req {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 5px;
  align-items: start;
  font-size: 0.62rem;
  line-height: 1.2;
  color: #d8c9a8;
}
.hg-req.done { color: #9fc978; }
.hg-req .mk {
  width: 12px; height: 12px; border-radius: 3px;
  border: 1px solid #6a5a48;
  background: #1a1510;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.55rem; line-height: 1;
  color: transparent;
  margin-top: 1px;
}
.hg-req.done .mk {
  border-color: #7aa84e;
  background: #2a3a1c;
  color: #b6e08a;
}
.hg-req .lab { min-width: 0; }
.hg-bar {
  margin-top: 2px; height: 3px;
  background: #2a221c; border-radius: 2px; overflow: hidden;
  grid-column: 2;
}
.hg-bar > i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, #8a6a3e, #c9a86a);
  border-radius: 2px;
}
.hg-req.done .hg-bar > i { background: linear-gradient(90deg, #5a8a3a, #9fc978); }
.hg-card-min {
  font-size: 0.62rem; color: #a89472;
  text-align: center; line-height: 1.25;
  margin-top: 1px;
}
.hg-card-go {
  margin-top: 4px;
}
.hg-card-go .hg-btn.primary {
  width: 100%;
  padding: 7px 8px;
  font-size: 0.78rem;
  border-radius: 8px;
}
.hg-hub-foot {
  position: relative; z-index: 1;
  flex: 0 0 auto;
  max-width: 320px; width: 100%;
  margin: 0 auto;
  min-height: 0;
}

@media (max-height: 760px) {
  .hg-hub { padding-top: 38px; gap: 6px; }
  .hg-hub-title { font-size: 0.76rem; }
  .hg-gallery { gap: 6px; }
  .hg-card-body { padding: 5px 6px 6px; }
  .hg-card-name { font-size: 0.76rem; }
  .hg-req { font-size: 0.58rem; }
  .hg-card-min { font-size: 0.58rem; }
  .hg-card-go .hg-btn.primary { padding: 6px 7px; font-size: 0.72rem; }
  .hg-dock { max-height: 40%; padding-top: 8px; padding-bottom: 10px; }
  .hg-line { font-size: 0.9rem; }
}
@media (max-height: 700px) {
  .hg-hub { padding: 36px 8px 8px; gap: 5px; }
  .hg-gallery { gap: 5px; }
  .hg-card { border-radius: 10px; }
  .hg-req { font-size: 0.55rem; gap: 4px; }
  .hg-card-veil .q { font-size: 1.2rem; }
  .hg-bar { height: 2px; }
}


/* lock2: locked portraits under ??? are a silhouette, never a readable face.
   Does not touch assets/characters/lovers/*/brandon_masters/. */
.hg-card-veil {
  background: rgba(6, 4, 3, .66);
  -webkit-backdrop-filter: blur(16px) brightness(0.3) saturate(0);
  backdrop-filter: blur(16px) brightness(0.3) saturate(0);
}
.hg-card:has(.hg-card-veil) .hg-card-art,
.hg-card:has(.hg-card-veil) .hg-card-art.faint {
  filter: brightness(0) saturate(0) contrast(1.2) !important;
  opacity: .85 !important;
}
.hg-card:has(.hg-card-veil) .hg-card-art::after,
.hg-card:has(.hg-card-veil) .hg-card-art.faint::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(8, 5, 4, .45);
}
