/* Layout: the phone-sized app shell, screen stacking and scroll bodies. */

.app {
  transition:
    background-color 0.25s,
    color 0.25s;
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--ground);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 34px 80px -24px rgba(24, 33, 74, 0.55);
}

.screen {
  transition:
    background-color 0.25s,
    color 0.25s;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  padding-top: env(safe-area-inset-top, 0px);
}

.device {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

@media (min-width: 640px) and (min-height: 700px) {
  .device {
    padding: 24px;
  }
}

@media (min-width: 640px) and (min-height: 700px) {
  .app {
    width: 400px;
    height: min(860px, calc(100vh - 48px));
    border-radius: 46px;
    border: 10px solid var(--frame);
    box-shadow: 0 34px 80px -20px rgba(29, 32, 96, 0.45);
  }
}

.screen.enter {
  animation: enter 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px max(18px, env(safe-area-inset-right, 0px)) 20px max(18px, env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: none;
}

.body::-webkit-scrollbar {
  display: none;
}

.body > * {
  flex-shrink: 0;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px 6px;
}

.top h2 {
  font-size: 23px;
}

.screen > .body {
  padding-bottom: 150px; /* room to scroll content above the floating quick-exit button + tab bar */
}

/* chat has no floating quick-exit button (it lives in the header there) */
.screen[data-screen="chat"] > .body {
  padding-bottom: 80px;
}

.welcome > .body,
[data-screen="country"] > .body {
  padding-bottom: 20px;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
