/* Nereye Saklandı? Screen-fitted play mat with fully contained cup motion. */
.hide-page { background: #faf8f5; }
.hide-page .app-shell {
  height: var(--peri-viewport-height, 100dvh);
  min-height: 0;
  overflow: hidden;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}
.hide-page .topbar { flex: 0 0 46px; }
.hide-page .hide-game {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) 27px;
  justify-items: stretch;
  align-items: stretch;
  gap: clamp(9px, 1.8svh, 19px);
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(5px, 1.5svh, 13px) 0 clamp(4px, 1svh, 10px);
}
.hide-game h1 {
  margin: 0;
  color: #363337;
  font-size: clamp(26px, 4.8vmin, 39px);
  line-height: 1.12;
  letter-spacing: -.055em;
  font-weight: 790;
  text-align: center;
}
.hide-stage {
  /* One uninterrupted table: cups move freely, without separate wells/cards. */
  width: 100%;
  height: 100%;
  max-height: 560px;
  max-width: 740px;
  min-width: 0;
  min-height: 0;
  margin: auto;
  padding: clamp(8px, 2vw, 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(2px, .9vw, 12px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid #eee5de;
  border-radius: clamp(24px, 5vw, 38px);
  background: radial-gradient(ellipse at 50% -10%, #fff 0%, #fffdfa 55%, #f7f2ed 100%);
  box-shadow: 0 17px 45px rgba(80, 58, 46, .055);
}
.hide-box {
  container-type: size;
  position: relative;
  display: block;
  flex: 1 1 0;
  width: 0;
  max-width: 220px;
  height: 78%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  color: #d7a79e;
  background: transparent;
  box-shadow: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.hide-box:focus-visible {
  outline: 3px solid #806a60;
  outline-offset: -3px;
  border-radius: 14px;
}
.hide-box::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 20%;
  width: 70%;
  width: min(70cqw, 185px);
  height: 5px;
  height: max(5px, 2cqh);
  border-radius: 50%;
  background: #80695f;
  opacity: .09;
  transform: translateX(-50%);
  pointer-events: none;
}
.hide-box:disabled { cursor: default; }
.hide-box:not(:disabled):active { filter: brightness(.985); }
.hide-ball {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 26%;
  width: 40px;
  width: min(32cqw, 17cqh, 58px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #ffdce0 0, #ec7b83 37%, #c34a61 94%);
  box-shadow: inset -3px -5px 6px rgba(100,34,45,.1), 0 5px 9px rgba(103,42,52,.11);
  transform: translateX(-50%);
}
.hide-ball::after {
  content: "";
  position: absolute;
  left: 20%;
  top: 18%;
  width: 28%;
  height: 18%;
  border-radius: 50%;
  background: rgba(255,255,255,.63);
  transform: rotate(-35deg);
}
.hide-cup {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 21%;
  display: block;
  width: min(90%, 190px);
  width: min(88cqw, 42cqh, 210px);
  aspect-ratio: 1;
  transform: translateX(-50%);
  transition: transform 420ms cubic-bezier(.22,.7,.25,1);
  pointer-events: none;
}
.hide-cup svg { display: block; width: 100%; height: 100%; }
.hide-stage.is-preview .hide-cup, .hide-box.is-open .hide-cup {
  transform: translate(-50%, -75%);
}
.hide-stage.is-found .hide-box.is-open .hide-cup { filter: saturate(1.15); }
.hide-feedback {
  min-height: 0;
  margin: 0;
  color: #716c70;
  font-size: clamp(15px, 2.9vmin, 18px);
  font-weight: 650;
  line-height: 27px;
  text-align: center;
}
.hide-page .welcome-backdrop { background: rgba(250, 248, 245, .96); }
.hide-page .welcome-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.5svh, 16px);
  width: min(100%, 410px);
  max-height: 100%;
  overflow-y: auto;
  padding: clamp(10px, 2.5svh, 25px) clamp(8px, 3vw, 20px);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.hide-welcome-art { display: grid; place-items: center; height: clamp(82px, 20svh, 146px); }
.hide-welcome-art svg { width: clamp(110px, 28svh, 178px); height: 100%; }
.hide-page .welcome-card h2 { margin: 0; font-size: clamp(28px, 6vw, 36px); }
.hide-page .welcome-card p { max-width: 320px; margin: 0; }
.hide-page .welcome-card .start-button { width: min(100%, 320px); flex: 0 0 auto; }
.hide-page .welcome-card .welcome-footnote { margin: 0; }
@media (max-height: 440px) {
  .hide-page .app-shell { padding-block: max(6px, env(safe-area-inset-top)) max(5px, env(safe-area-inset-bottom)); }
  .hide-page .topbar { flex-basis: 40px; }
  .hide-page .hide-game { gap: 5px; padding: 2px 0; grid-template-rows: auto minmax(0, 1fr) 20px; }
  .hide-game h1 { font-size: 23px; }
  .hide-feedback { font-size: 13px; line-height: 20px; }
  .hide-stage { padding: 7px; border-radius: 20px; }
  .hide-box { height: 90%; }
  .hide-cup { bottom: 11%; }
  .hide-ball { bottom: 18%; }
  .hide-box::after { bottom: 12%; }
  .hide-page .welcome-backdrop { padding: 6px; }
  .hide-page .welcome-card { gap: 7px; padding: 5px; }
  .hide-welcome-art { height: 55px; }
  .hide-page .welcome-card h2 { font-size: 24px; }
  .hide-page .welcome-card p { font-size: 12px; }
  .hide-page .welcome-card .start-button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .hide-cup { transition: none; }
  .hide-box:not(:disabled):active { filter: none; }
}
@media (forced-colors: active) {
  .hide-box { border: 2px solid ButtonText; }
  .hide-cup { color: ButtonText; }
  .hide-ball { border: 3px solid ButtonText; }
}

/* The cards themselves move and retain their physical identity during swaps. */
.hide-stage.is-shuffling .hide-box { pointer-events: none; }
.hide-stage.is-shuffling .hide-box .hide-cup { transition: none; }
.hide-stage.is-ready .hide-box { cursor: pointer; }

/* Cups are the only visible choices; the table itself is the sole play surface. */
.hide-stage.is-shuffling .hide-box { will-change: transform; }
