/* The gate in front of the valley: the same hide and stone as the other windows, over the park the game already paints. */
#gate {
  position: absolute;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  overflow: auto;
  touch-action: auto;
  background: radial-gradient(ellipse at center, rgba(127, 166, 74, 0.04), rgba(43, 29, 16, 0.42) 72%);
  padding: 16px 12px calc(16px + env(safe-area-inset-bottom, 0px));
}
#gate[hidden] {
  display: none;
}
/* Author `display` rules beat the hidden attribute, so a closed fold would still show. */
#gate [hidden] {
  display: none !important;
}
/* The first lesson covers the whole screen, and its “Now” line sits in the corner of the valley.
   Both wait until the chief has gone through this door. */
body.gateOn #coach,
body.gateOn #nowChip {
  visibility: hidden !important;
}
/* Someone else's park is a picture: the bars that change a park are gone, one return stays. */
body.visiting .hud,
body.visiting .cmdbar,
body.visiting #qsheet,
body.visiting #buildMenu,
body.visiting .dock,
body.visiting #panel,
body.visiting .side,
body.visiting #placeBar,
body.visiting #toolChip,
body.visiting #trackBar,
body.visiting #legacy,
body.visiting #dev,
body.visiting .alerts,
body.visiting .hint,
body.visiting #plotTip {
  display: none !important;
}
#visitBackBar {
  display: none;
}
body.visiting #visitBackBar {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  pointer-events: none;
}
body.visiting #visitBackBar .btn {
  pointer-events: auto;
  min-height: 48px;
  font-size: 18px;
}
body.visiting #visitBack {
  min-width: 220px;
}
body.visiting #visitPrank img {
  width: 46px;
  height: 22px;
  object-fit: contain;
  margin: -4px 6px -4px -2px;
  vertical-align: middle;
}
body.visiting #toast {
  z-index: 360;
}
#toast {
  z-index: 360;
}
.sheetIn {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-weight: 600;
  padding: 8px 10px;
  border: 2px solid #6b4a2a;
  border-radius: 10px;
  background: #fffaf0;
  color: #2b1a0c;
}
.panel h4.sheetH {
  margin: 14px 0 2px;
  font-size: 15px;
  color: #2b1a0c;
}
#panel[data-kind='friends'] .slot .acts .btn,
#panel[data-kind='transfer'] .slot .acts .btn {
  flex: 0 0 auto;
}
#visitGift[hidden],
#visitPrank[hidden],
#palClear[hidden] {
  display: none !important;
}
#palClear {
  position: absolute;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 40;
  max-width: calc(100% - 24px);
}
.gateCard {
  width: min(440px, 100%);
  box-sizing: border-box;
  border: 18px solid transparent;
  border-image: var(--hide-panel);
  padding: 4px 12px 14px;
  text-align: center;
  filter: drop-shadow(0 8px 0 rgba(36, 21, 9, 0.28)) drop-shadow(0 16px 18px rgba(0, 0, 0, 0.28));
}
.gateArt {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 2px 0 6px;
}
.gateArt img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #dfeccf;
  border-radius: 12px;
  border: 2px solid #6b4a2a;
}
.gateCard h1 {
  font-family: var(--display);
  font-size: 28px;
  line-height: 1.1;
  margin: 0;
  color: #2b1a0c;
  text-shadow: 0 1px 0 rgba(255, 250, 235, 0.7);
}
.gateSub,
.gateWho,
.gateNote,
.gateHint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.gateWho {
  color: #2b1a0c;
  font-weight: 700;
}
.gateActs,
.gateForm {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  text-align: left;
}
.gateCard .btn {
  min-height: 42px;
  font-size: 16px;
  width: 100%;
}
.gateCard label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #2b1a0c;
  font-weight: 700;
}
.gateCard input,
.gateCard select {
  font: inherit;
  font-weight: 500;
  width: 100%;
  box-sizing: border-box;
  user-select: text;
  -webkit-user-select: text;
  touch-action: auto;
  padding: 8px 10px;
  border: 2px solid #6b4a2a;
  border-radius: 10px;
  background: #fffaf0;
  color: var(--ink);
}
.gateHint.ok {
  color: var(--leaf);
}
.gateHint.bad {
  color: var(--bad);
}
.gateHits {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gateHits p {
  margin: 0;
  padding: 6px 8px;
  background: #fffaf0;
  border-radius: 10px;
  border: 2px solid #6b4a2a;
}
@media (max-width: 700px) {
  .gateArt img {
    width: 52px;
    height: 52px;
  }
  .gateCard h1 {
    font-size: 24px;
  }
}
body.visiting #visitLike img {
  width: 28px;
  height: 28px;
  margin: -4px 6px -4px -2px;
  vertical-align: middle;
}
body.visiting #visitLike .likeN {
  color: #fff;
  text-shadow: 0 1px 0 rgba(43, 23, 11, 0.8);
}
body.visiting #visitLike.pop img {
  animation: likePop 0.45s cubic-bezier(0.3, 1.8, 0.5, 1);
}
@keyframes likePop {
  40% {
    transform: scale(1.6) rotate(-10deg);
  }
}
