/* THE ARRIVAL — the first thing a child ever sees is Mo's room, not a blank
   screen with a bear in the corner. See assets/arrival.js. */

/* while Mo is waking up and saying hello, the room's own controls are put
   away: no toy row, no hint, no ways out, no "meet my friend" — the child
   is being introduced, not handed a menu */
body.arriving #scPlay .toys,
body.arriving #scPlay .play-hint,
body.arriving #scPlay #playNext,
body.arriving #scPlay .waysout,
body.arriving #scPlay .visit-back { display: none !important; }
body.arriving #scPlay .room [data-scene] { pointer-events: none; }
/* the sheet takes the toy row's place at the bottom of the room */
body.arriving #scPlay { justify-content: flex-end; }

/* ---- the name sheet: a card that rises out of the floor of the room ---- */
.arr-sheet {
  position: relative; z-index: 8; width: min(94vw, 480px); margin: 0 auto;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,247,232,.96));
  border-radius: 30px 30px 26px 26px; padding: 14px 16px 16px;
  box-shadow: 0 -8px 30px rgba(59,42,30,.14), 0 14px 30px rgba(59,42,30,.12);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  transform: translateY(120%); opacity: 0;
  transition: transform .7s var(--spring), opacity .3s;
}
.arr-sheet::before {           /* the gradient outline every surface gets */
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 3px;
  background: linear-gradient(135deg, var(--sun), var(--sky));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.arr-sheet.on { transform: none; opacity: 1; }
.arr-sheet.hidden { display: none; }
.arr-q { font-size: clamp(22px, 5.8vw, 32px); margin: 0; text-align: center; color: var(--ink); line-height: 1.1; }
.arr-q small { display: block; font-size: clamp(12px, 3.3vw, 15px); color: var(--ink-soft); margin-top: 4px; font-weight: 500; }
#arrName {
  font: inherit; font-size: clamp(28px, 8vw, 46px); text-align: center; width: 100%;
  padding: 10px 16px; border: 0; border-radius: 22px; background: #fff; color: var(--deep);
  box-shadow: inset 0 0 0 4px var(--sky), 0 6px 18px rgba(59,42,30,.10); outline: none;
}
#arrName.shake { animation: arrShake .5s; }
@keyframes arrShake { 0%,100%{transform:none} 20%{transform:translateX(-10px)} 40%{transform:translateX(9px)} 60%{transform:translateX(-6px)} 80%{transform:translateX(4px)} }
#arrGo {
  font: inherit; font-size: clamp(19px, 5vw, 26px); padding: 12px 40px; cursor: pointer;
  --a1: var(--teal); --a2: var(--sky); color: var(--ink);
  box-shadow: 2px 8px 0 rgba(79,199,192,.32), 3px 13px 20px rgba(120,86,50,.16), var(--gloss);
}

/* ---- after the name: the letters hang on the bunting line ---- */
.arr-tiles {
  position: absolute; left: 0; right: 0; top: 1.2%; z-index: 9;
  display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(5px, 1.6vw, 12px); padding: 0 74px 0 12px;
  pointer-events: none;
}
.arr-tile {
  font-size: clamp(30px, 8.4vw, 58px); line-height: 1; color: var(--deep);
  background: linear-gradient(180deg, #fff, #FFF6E9);
  border-radius: 16px; padding: 7px clamp(7px, 2.2vw, 14px);
  box-shadow: var(--lift-2), var(--gloss);
  opacity: 0; transform: translateY(-60px) scale(.5) rotate(-8deg);
  transform-origin: 50% -30px;
}
.arr-tile.in { opacity: 1; transform: none; transition: opacity .3s, transform .65s var(--spring); animation: arrSwing 2.6s ease-in-out .7s infinite; }
.arr-tile.gap { background: transparent; box-shadow: none; }
.arr-tile.first { box-shadow: 0 0 0 5px var(--sun), 0 10px 22px rgba(59,42,30,.18); animation: arrPulse 1.4s ease-in-out infinite; }
@keyframes arrSwing { 0%,100%{transform:rotate(-2deg)} 50%{transform:rotate(2deg)} }
@keyframes arrPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.08)} }
/* the string they hang from */
.arr-tiles::before { content: ''; position: absolute; left: 6%; right: 6%; top: -6px; height: 3px;
  background: linear-gradient(90deg, transparent, #C9A87C 12%, #C9A87C 88%, transparent); border-radius: 2px; }

/* the flags make way for the letters */
body.arr-tiles-on #scPlay .room-bunting { opacity: .22; transition: opacity .6s; }

/* the big tap lives in the sheet once the name has been said */
.arr-lead { margin: 2px 0 0; font-size: clamp(15px, 4.2vw, 19px); font-weight: 800; color: var(--ink-soft); letter-spacing: .2px; text-align: center; }
.arr-ready { display: flex; align-items: center; justify-content: center; gap: clamp(14px, 5vw, 28px); padding: 2px 0 4px; }
.arr-first {
  font-size: clamp(54px, 15vw, 92px); line-height: 1; color: var(--deep); font-weight: 800;
  width: clamp(84px, 24vw, 130px); height: clamp(84px, 24vw, 130px); display: grid; place-items: center;
  border-radius: 26px; background: linear-gradient(180deg, #fff, #FFF6E9);
  box-shadow: 0 0 0 5px var(--sun), 0 12px 24px rgba(59,42,30,.16), var(--gloss);
  animation: arrPulse 1.6s ease-in-out infinite;
}
.arr-sheet .bigtap { width: min(36vw, 150px); height: min(36vw, 150px); margin: 0; }
.arr-sheet.big { padding: 14px 16px 22px; }
.arr-sheet .bt-word { display: none; }
body.arriving .prop-layer.front, body.arriving .prop-layer { z-index: 5; }

/* ---- a soft dawn: the room goes from night to day over two seconds ---- */
body.room-night .room-wall, body.room-night .room-floor, body.room-night .room-shelf,
body.room-night .room-bunting, body.room-night .room [data-scene]:not(.room-lamp) { transition: filter 2.2s ease; }
body.dawning .room-wall, body.dawning .room-floor, body.dawning .room-shelf,
body.dawning .room-bunting, body.dawning .room [data-scene]:not(.room-lamp) { transition: filter 2.2s ease; }
