/* V33.1.115 - one calm play hub and a living couple avatar group */

/* The four former scene cards are now available from one hub. */
#twoPersonGarden .tg-gacha-garden-entry,
#twoPersonGarden .community-garden-entry,
#twoPersonGarden .pond-garden-entry,
#twoPersonGarden .petal-garden-entry {
  display: none !important;
}

.tg-play-hub-entry {
  position: absolute;
  z-index: 18;
  top: max(188px, calc(env(safe-area-inset-top) + 182px));
  right: 14px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0 8px;
  width: 148px;
  min-height: 48px;
  padding: 6px 10px 6px 7px !important;
  border: 1px solid rgba(255,255,255,.72) !important;
  border-radius: 18px !important;
  background: linear-gradient(135deg, rgba(76,53,89,.82), rgba(73,79,131,.8)) !important;
  color: #fff !important;
  text-align: left !important;
  text-shadow: 0 1px 4px rgba(27,16,38,.7);
  box-shadow: 0 10px 28px rgba(29,20,52,.27) !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.tg-play-hub-entry > span {
  grid-row: 1 / 3;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff8d8, #ffd0dc);
  color: #7c3e67;
  font-size: 18px;
  text-shadow: none;
  box-shadow: 0 4px 13px rgba(255,211,184,.35);
}

.tg-play-hub-entry b,
.tg-play-hub-entry small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tg-play-hub-entry b { font-size: 12px; }
.tg-play-hub-entry small { margin-top: 1px; color: #fff1f5; font-size: 8px; }
.tg-play-hub-entry:active { transform: scale(.97); }
#twoPersonGarden.tg-welcome-only .tg-play-hub-entry { display: none !important; }

.tg-play-hub[hidden] { display: none !important; }
.tg-play-hub {
  position: absolute;
  z-index: 150;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px 14px max(18px, env(safe-area-inset-bottom));
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

.tg-play-hub.open { opacity: 1; pointer-events: auto; }
.tg-play-hub-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: rgba(22,15,28,.62) !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.tg-play-hub-card {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  max-height: min(82dvh, 720px);
  overflow: auto;
  padding: 10px 16px 19px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 28px;
  background: linear-gradient(155deg, rgba(255,253,249,.98), rgba(250,235,238,.98));
  color: #5f414c;
  box-shadow: 0 28px 80px rgba(22,13,27,.48);
  transform: translateY(24px) scale(.985);
  transition: transform .24s ease;
}

.tg-play-hub.open .tg-play-hub-card { transform: translateY(0) scale(1); }
.tg-play-hub-handle { width: 42px; height: 4px; margin: 0 auto 11px; border-radius: 99px; background: #d7c1c6; }
.tg-play-hub-card header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.tg-play-hub-card header small { color: #d15d79; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.tg-play-hub-card h2 { margin: 5px 0 0; font: 800 25px/1.15 Georgia, "Songti SC", serif; }
.tg-play-hub-close { width: 36px; height: 36px; flex: 0 0 36px; padding: 0 !important; border: 0 !important; border-radius: 50% !important; background: #f2e2e3 !important; color: #7f5c67 !important; font-size: 23px !important; box-shadow: none !important; }
.tg-play-hub-lead { margin: 10px 0 14px; color: #8d6c77; font-size: 11px; line-height: 1.65; }

.tg-play-hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tg-play-hub-grid > button {
  position: relative;
  min-height: 132px;
  overflow: hidden;
  padding: 14px 13px !important;
  border: 1px solid rgba(255,255,255,.72) !important;
  border-radius: 22px !important;
  color: #fff !important;
  text-align: left !important;
  text-shadow: 0 1px 5px rgba(26,17,43,.55);
  box-shadow: 0 10px 25px rgba(82,49,82,.15) !important;
}

.tg-play-hub-grid > button::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -32px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,.13);
}

.tg-play-hub-grid > button.community { background: linear-gradient(145deg, #426888, #7d749f) !important; }
.tg-play-hub-grid > button.gacha { background: linear-gradient(145deg, #30366f, #94618f) !important; }
.tg-play-hub-grid > button.pond { background: linear-gradient(145deg, #32758a, #4e79ae) !important; }
.tg-play-hub-grid > button.petal { background: linear-gradient(145deg, #bc6388, #f09191) !important; }
.tg-play-hub-grid span,
.tg-play-hub-grid b,
.tg-play-hub-grid small { position: relative; z-index: 1; display: block; }
.tg-play-hub-grid span { margin-bottom: 8px; font-size: 29px; }
.tg-play-hub-grid b { font-size: 15px; }
.tg-play-hub-grid small { margin-top: 5px; color: rgba(255,255,255,.84); font-size: 9px; line-height: 1.45; }
.tg-play-hub-grid em { position: absolute; z-index: 1; top: 12px; right: 11px; padding: 4px 7px; border-radius: 999px; background: rgba(255,255,255,.18); color: #fff; font-size: 8px; font-style: normal; }
.tg-play-hub-grid > button:active { transform: scale(.975); }
.tg-play-hub-status { margin-top: 12px; padding: 9px 11px; border-radius: 14px; background: #f2e5e5; color: #997681; font-size: 9px; text-align: center; }

/* The couple now stands together in one quiet right-side lane. */
@media (max-width: 540px) {
  #twoPersonGarden .tg-play-hub-entry {
    top: max(183px, calc(env(safe-area-inset-top) + 177px));
    right: 10px;
    width: 138px;
    min-height: 44px;
    padding: 5px 8px 5px 6px !important;
    border-radius: 16px !important;
  }

  #twoPersonGarden .tg-play-hub-entry > span { width: 30px; height: 30px; font-size: 16px; }
  #twoPersonGarden .tg-play-hub-entry b { font-size: 10px; }
  #twoPersonGarden .tg-play-hub-entry small { font-size: 7px; }

  #twoPersonGarden .tg-avatar-layer {
    z-index: 9;
    inset: auto 0 calc(226px + var(--tg-safe-bottom, 0px));
    height: clamp(150px, 22vh, 188px);
  }

  #twoPersonGarden .tg-avatar-character {
    width: clamp(54px, 15vw, 66px);
    max-height: 188px;
  }

  #twoPersonGarden .tg-avatar-character.slot-0 {
    left: auto;
    right: 76px;
    bottom: 24px;
  }

  #twoPersonGarden .tg-avatar-character.slot-1 {
    left: auto;
    right: 10px;
    bottom: 18px;
  }

  #twoPersonGarden .tg-avatar-name { max-width: 65px; }
}

/* Small, occasional motions keep the people alive without continuous heavy animation. */
.tg-avatar-character.ambient-wave .tg-avatar-body { animation: tg-avatar-ambient-wave 2.3s ease-in-out; transform-origin: 50% 100%; }
.tg-avatar-character.ambient-glance .tg-avatar-body { animation: tg-avatar-ambient-glance 2.7s ease-in-out; transform-origin: 50% 100%; }
.tg-avatar-character.ambient-step .tg-avatar-body { animation: tg-avatar-ambient-step 2.7s ease-in-out; transform-origin: 50% 100%; }
.tg-avatar-character.ambient-pair-left .tg-avatar-body { animation: tg-avatar-ambient-pair-left 3.2s ease-in-out; transform-origin: 50% 100%; }
.tg-avatar-character.ambient-pair-right .tg-avatar-body { animation: tg-avatar-ambient-pair-right 3.2s ease-in-out; transform-origin: 50% 100%; }
.tg-avatar-layer.ambient-pair::after {
  content: "♡";
  position: absolute;
  right: 68px;
  bottom: 78%;
  color: #ffb3c7;
  font-size: 18px;
  opacity: 0;
  filter: drop-shadow(0 2px 5px rgba(255,255,255,.8));
  animation: tg-avatar-ambient-heart 3.2s ease-out;
}

@keyframes tg-avatar-ambient-wave {
  0%,100% { transform: translateY(0) rotate(0); }
  24% { transform: translateY(-3px) rotate(-2deg); }
  45% { transform: translateY(-5px) rotate(2deg); }
  68% { transform: translateY(-3px) rotate(-1deg); }
}
@keyframes tg-avatar-ambient-glance {
  0%,100% { transform: translateX(0) rotate(0); }
  38%,68% { transform: translateX(-3px) rotate(-1.2deg); }
}
@keyframes tg-avatar-ambient-step {
  0%,100% { transform: translate(0,0); }
  35% { transform: translate(-5px,-2px); }
  68% { transform: translate(3px,0); }
}
@keyframes tg-avatar-ambient-pair-left {
  0%,100% { transform: translateX(0) rotate(0); }
  38%,72% { transform: translateX(5px) rotate(1.2deg); }
}
@keyframes tg-avatar-ambient-pair-right {
  0%,100% { transform: translateX(0) rotate(0); }
  38%,72% { transform: translateX(-5px) rotate(-1.2deg); }
}
@keyframes tg-avatar-ambient-heart {
  0%,18% { opacity: 0; transform: translateY(5px) scale(.72); }
  42%,68% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-24px) scale(1.2); }
}

@media (max-width: 360px), (max-height: 720px) and (max-width: 540px) {
  #twoPersonGarden .tg-play-hub-entry {
    top: max(169px, calc(env(safe-area-inset-top) + 163px));
    width: 122px;
    min-height: 40px;
  }
  #twoPersonGarden .tg-play-hub-entry small { display: none; }
  #twoPersonGarden .tg-avatar-layer { bottom: calc(210px + var(--tg-safe-bottom, 0px)); height: 140px; }
  #twoPersonGarden .tg-avatar-character { width: clamp(48px, 14vw, 56px); max-height: 140px; }
  #twoPersonGarden .tg-avatar-character.slot-0 { right: 68px; bottom: 19px; }
  #twoPersonGarden .tg-avatar-character.slot-1 { right: 10px; bottom: 14px; }
  .tg-play-hub { padding-left: 10px; padding-right: 10px; }
  .tg-play-hub-card { padding-left: 12px; padding-right: 12px; border-radius: 24px; }
  .tg-play-hub-grid { gap: 8px; }
  .tg-play-hub-grid > button { min-height: 118px; padding: 12px 11px !important; }
}

html[data-rose-quality="ultra"] .tg-play-hub-entry,
html[data-rose-quality="ultra"] .tg-play-hub-backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; }

@media (prefers-reduced-motion: reduce) {
  .tg-play-hub,
  .tg-play-hub-card,
  .tg-avatar-character .tg-avatar-body,
  .tg-avatar-layer::after { animation: none !important; transition: none !important; }
}
