/* School grounds 3D viewer and its static fallback. */
.topbar .join { color: #243a32 !important; }
.grounds-showcase[hidden],
#momentsGrid[hidden] { display: none !important; }
.grounds-stage {
  position: relative;
  height: clamp(330px, 42vw, 470px);
  overflow: hidden;
  border: 1px solid #cfe7f0;
  border-radius: 18px;
  background: radial-gradient(ellipse at 50% 38%, #fbfeff 0%, #e6f5fb 62%, #cfeaf5 100%);
  isolation: isolate;
}
.grounds-stage::after {
  content: "";
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 0;
  left: 0;
  height: 112px;
  background: linear-gradient(0deg, rgba(45, 112, 143, .45), transparent);
  pointer-events: none;
}
#groundsCanvas {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: pan-y pinch-zoom;
}
#groundsCanvas.is-dragging { cursor: grabbing; }
.grounds-caption {
  position: absolute;
  z-index: 2;
  right: 24px;
  bottom: 10px;
  left: 24px;
  color: #fff;
  text-align: center;
  font: 600 16px/1.6 'Noto Serif Bengali', serif;
  pointer-events: none;
}
.grounds-swipe-hint { display: none; }
.grounds-arrow {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.78);
  color: #183b31;
  background: rgba(255,255,255,.94);
  cursor: pointer;
  transition: background-color .18s ease, transform .18s ease;
}
.grounds-arrow:hover { background: #fff; transform: translateY(-1px); }
.grounds-arrow:focus-visible { outline: 3px solid #9a641e; outline-offset: 3px; }
.grounds-arrow {
  top: 50%;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  transform: translateY(-50%);
}
.grounds-arrow svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.grounds-arrow:hover { transform: translateY(calc(-50% - 1px)); }
.grounds-previous { left: 18px; }
.grounds-next { right: 18px; }
#momentsGrid .moment.fixed-ground:focus-visible { outline: 3px solid #9a641e; outline-offset: 3px; }
@media (max-width: 850px) {
  .grounds-stage { height: 370px; }
}
@media (max-width: 580px) {
  .grounds-stage { height: clamp(230px, 66vw, 270px); border-radius: 14px; }
  .grounds-stage::after { height: 88px; }
  .grounds-arrow { width: 42px; height: 42px; }
  .grounds-previous { left: 10px; }
  .grounds-next { right: 10px; }
  .grounds-caption { right: 12px; bottom: 6px; left: 12px; font-size: 14px; }
  .grounds-swipe-hint {
    position: absolute;
    z-index: 3;
    top: 12px;
    left: 50%;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: 999px;
    background: rgba(255, 255, 255, .82);
    color: #315c70;
    box-shadow: 0 4px 14px rgba(35, 75, 94, .16);
    font: 600 12px/1.2 'DM Sans', sans-serif;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%);
  }
  .grounds-swipe-hint.is-active { animation: grounds-swipe-intro 3s ease-out forwards; }
}
@keyframes grounds-swipe-intro {
  0% { opacity: 0; transform: translateX(-50%) scale(.92); }
  10%, 26% { opacity: 1; transform: translateX(-50%) scale(1); }
  38% { opacity: 1; transform: translateX(-50%) scale(1.045); }
  50% { opacity: 1; transform: translateX(-50%) scale(1); }
  62% { opacity: 1; transform: translateX(-50%) scale(1.04); }
  74% { opacity: 1; transform: translateX(-50%) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) scale(.97); }
}
@media (prefers-reduced-motion: reduce) {
  .grounds-arrow { transition: none; }
  .grounds-swipe-hint.is-active { animation-name: grounds-swipe-fade; }
}
@keyframes grounds-swipe-fade {
  0%, 15% { opacity: 0; }
  30%, 75% { opacity: 1; }
  100% { opacity: 0; }
}
