/* Подсказка повернуть телефон.
   ————————————————————————————————————————————————————————————————
   Стол вдвое шире своей высоты, и в вертикальной ориентации он занимает
   узкую полосу посреди экрана — сверху и снизу пустота. На Android поворот
   попросит сама полноэкранка (controls.ts, lockLandscape), а на iPhone так
   нельзя: там остаётся только сказать.

   Сказать — один раз и тихо: подсказка всплывает на несколько секунд и
   гаснет сама, клики сквозь неё проходят. Кто играет стоймя нарочно, того
   она не держит. Всплывает заново, когда подсказывать снова есть о чём:
   сел за стол или повернул телефон обратно — правило перестаёт и снова
   начинает совпадать, и анимация идёт с начала. Кода за ней нет вовсе. */

#rotate { display: none; }

@media (pointer: coarse) and (orientation: portrait) and (max-width: 600px) {
  body:not(.lobby):not(.turned) #rotate {
    position: fixed;
    left: 50%;
    bottom: calc(104px + var(--safe-b));
    z-index: 7;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px 9px 12px;
    border-radius: 999px;
    background: rgba(14, 18, 16, 0.9);
    border: 1px solid rgba(201, 162, 39, 0.3);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
    color: var(--chalk);
    font-size: 13px;
    white-space: nowrap;
    pointer-events: none;
    transform: translateX(-50%);
    animation: rotate-hint 7s ease both;
  }
}

#rotate svg {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--brass);
  /* Телефон на значке сам показывает, что сделать: ложится набок и
     возвращается — дважды, пока подсказка на экране. */
  animation: rotate-phone 1.4s ease-in-out 0.7s 2;
}

@keyframes rotate-hint {
  0% { opacity: 0; }
  6% { opacity: 1; }
  86% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes rotate-phone {
  0%, 100% { transform: rotate(0); }
  40%, 60% { transform: rotate(-90deg); }
}

@media (prefers-reduced-motion: reduce) {
  #rotate svg { animation: none; }
}

/* Свайп вверх (#178). Safari на iPhone не даёт странице полноэкранки, и
   боком его панели отъедают у стола больше четверти высоты. Но прокрутку он
   понимает как «убери панели» — затемнение поверх стола и просит смахнуть.
   Само затемнение ничего не делает: свайп по нему прокручивает документ
   (index.html, html.room и html.swiping), панели уходят, окно вырастает, и
   controls.ts снимает класс. Касание без свайпа — «оставь как есть». */
#swipeup { display: none; }
html.swiping #swipeup {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(8, 10, 9, 0.62);
  touch-action: pan-y;
  animation: swipe-in 0.3s ease both;
}
.su-card {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 16px 26px 14px;
  border-radius: 18px;
  background: rgba(14, 18, 16, 0.94);
  border: 1px solid rgba(201, 162, 39, 0.3);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
  color: var(--chalk);
  text-align: center;
  pointer-events: none;
}
.su-card svg {
  width: 30px;
  height: 30px;
  color: var(--brass);
  /* Стрелка показывает жест: уходит вверх и возвращается. */
  animation: swipe-arrow 1.3s ease-in-out infinite;
}
.su-card b { font-size: 16px; font-weight: 600; color: #fff; }
.su-card span { font-size: 13px; }
.su-card small { margin-top: 6px; font-size: 11px; opacity: 0.55; }
@keyframes swipe-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes swipe-arrow {
  0%, 100% { transform: translateY(4px); opacity: 0.6; }
  50% { transform: translateY(-6px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .su-card svg { animation: none; }
}
