* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: Arial, Helvetica, sans-serif;
}
a {
  text-decoration: none;
}
.wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
  }
  
  .device {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    width: 376px;
    height: 812px;
    border-radius: 39px;
    box-sizing: border-box;
    transform: rotate(6deg) scale(.85) translateY(110vh);
    box-shadow: 25px 60px 125px -25px rgba(13, 13, 13, 0.5), 20px 40px 75px -35px rgba(13, 13, 13, 0.6), 0 0 0 20px #0d0d0d, 0 0 0 22px #1a1a1a;
  
    position: absolute;
    z-index: 100;
    top: -300vh;
    left: 40%;

    opacity: 1;

    transition: all ease-in-out .3s;
}

.imessage img {
    max-width: 100%;
}

.imessage figcaption,
.imessage a figcaption,
.imessage a:visited figcaption {
  font-size: .8rem;
  color: #000;
}
  
  .ringer-switch {
    position: absolute;
    top: 110px;
    left: -25px;
    height: 30px;
    width: 3px;
    background: #0d0d0d;
    border-radius: 3px 0 0 3px;
  }
  
  .volume {
    position: absolute;
    left: -25px;
    height: 65px;
    width: 3px;
    background: #0d0d0d;
    border-radius: 3px 0 0 3px;
  }
  .volume.plus {
    top: 170px;
  }
  .volume.minus {
    top: 250px;
  }
  
  .side-button {
    position: absolute;
    top: 180px;
    right: -25px;
    height: 95px;
    width: 3px;
    background: #0d0d0d;
    border-radius: 0 3px 3px 0;
  }
  
  .display {
    position: relative;
    width: 100%;
    height: 100%;
    background: white;
    overflow: hidden;
    /*border-radius: 39px;*/
    border-radius: 35px;
    overflow-y: scroll;
  }

  .container {
    width: 100%;
    height: 100%;
  }
  
  .imessage::after {
      background: rgb(0,0,0);
      background: linear-gradient(0deg, rgba(255,255,255,1) 26%, rgba(255,255,255,0) 100%);
      content: " ";
      height: 100px;
      width: 86%;
      position: fixed;
      bottom: 1px;
      left: 27px;
  }
  
  .notch {
    position: absolute;
    z-index: 10;
    top: -3px;
    left: 0;
    right: 0;
    width: 206px;
    height: 30px;
    margin: 0 auto;
    background: #0d0d0d;
    border-radius: 0 0 20px 20px;
  }
  .notch span {
    position: absolute;
    width: 6px;
    height: 6px;
    display: block;
    overflow: hidden;
  }
  .notch span:nth-child(1) {
    left: -6px;
    background: radial-gradient(circle at bottom left, transparent 6px, #0d0d0d 3px);
  }
  .notch span:nth-child(2) {
    right: -6px;
    background: radial-gradient(circle at bottom right, transparent 6px, #0d0d0d 3px);
  }
  
  .speaker,
  .camera {
    position: absolute;
    top: 7px;
    height: 8px;
    z-index: 20;
  }
  
  .speaker {
    display: block;
    left: 0;
    right: 0;
    width: 45px;
    margin: 0 auto;
    border-radius: 4px;
    box-shadow: inset 0 0 1px 2px rgba(0, 0, 0, 0.3);
    background: #262626;
  }
  
  .camera {
    right: 140px;
    width: 8px;
    border: 2px solid #171717;
    border-radius: 50%;
    box-sizing: border-box;
    background: MidnightBlue;
  }
  
  .icons-top {
    position: absolute;
    top: 18px;
    left: 292px;
    width: 70px;
    height: 12px;
    z-index: 1;
  }
  .icons-top::after {
    content: "";
    display: block;
    position: absolute;
    top: 22px;
    left: 0;
    right: 0;
    width: 50px;
    height: 2px;
    margin: 0 auto;
    border-radius: 1px;
    background: rgba(255, 255, 255, 0.4);
  }
  .icons-top .cell {
    display: flex;
    height: 100%;
  }
  .icons-top .cell span {
    display: block;
    align-self: flex-end;
    width: 3px;
    background: white;
    border-radius: 1px;
  }
  .icons-top .cell span:not(:last-child) {
    margin-right: 2px;
  }
  .icons-top .cell span:nth-child(1) {
    height: 4px;
  }
  .icons-top .cell span:nth-child(2) {
    height: 6px;
  }
  .icons-top .cell span:nth-child(3) {
    height: 8px;
  }
  .icons-top .cell span:nth-child(4) {
    height: 10px;
    opacity: 0.5;
  }
  .icons-top .wifi {
    position: relative;
    transform: rotate(-45deg);
    position: absolute;
    left: 31px;
  }
  .icons-top .wifi span {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    border-color: white;
    border-style: solid;
    border-width: 2px 2px 0 0;
    border-radius: 0 100% 0 0;
  }
  .icons-top .wifi span:nth-child(1) {
    width: 9px;
    height: 9px;
  }
  .icons-top .wifi span:nth-child(2) {
    width: 5px;
    height: 5px;
  }
  .icons-top .wifi span:nth-child(3) {
    width: 1px;
    height: 1px;
    background: white;
  }
  .icons-top .battery {
    position: absolute;
    left: 44px;
    top: 0;
    width: 22px;
    height: 10px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 3px;
  }
  .icons-top .battery::after {
    content: "";
    position: absolute;
    top: 3px;
    right: -5px;
    width: 2px;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border-bottom-right-radius: 50%;
    border-top-right-radius: 50%;
  }
  .icons-top .battery span {
    position: absolute;
    left: 2px;
    top: 2px;
    height: 6px;
    width: 10px;
    background: white;
    border-radius: 1px;
  }
  
  .icon-lock {
    position: absolute;
    top: 4.5rem;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 24px;
    height: 22px;
    background: white;
    border-radius: 2px;
  }
  .icon-lock::before {
    content: "";
    display: block;
    position: absolute;
    top: -15px;
    left: 0;
    right: 0;
    width: 12px;
    height: 12px;
    margin: 0 auto;
    border: 3px solid white;
    border-top-right-radius: 50%;
    border-top-left-radius: 50%;
  }
  
  .date-time {
    position: absolute;
    top: 6.5rem;
    left: 0;
    right: 0;
    margin: 0 auto;
    text-align: center;
    font-size: 22px;
  }
  .date-time #time {
    font-size: 75px;
    font-weight: 100;
  }
  
  .button {
    position: absolute;
    width: 54px;
    height: 54px;
    bottom: 3rem;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
  }
  .button--left, .button--right {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .button--left {
    left: 3rem;
  }
  .button--right {
    right: 3rem;
  }
  
  .swipe {
    position: absolute;
    bottom: 1rem;
    width: 100%;
    font-size: 17px;
    text-align: center;
    opacity: 0;
    animation-name: swipe-p;
    animation-duration: 4s;
    animation-iteration-count: 2;
    animation-delay: 0.5s;
    animation-timing-function: ease-in-out;
  }
  
  .home-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8px;
    width: 130px;
    height: 5px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.8);
    opacity: 0.75;
    border-radius: 5px;
    animation-name: swipe-bar;
    animation-duration: 4s;
    animation-iteration-count: 2;
    animation-delay: 0.5s;
    animation-timing-function: ease-in-out;
  }
  
  video {
    width: auto;
    height: 100%;
  }
  
  @keyframes swipe-p {
    0% {
      opacity: 0;
      transform: translateY(1rem);
    }
    25% {
      opacity: 0;
      transform: translateY(1rem);
    }
    50% {
      opacity: 1;
      transform: translateY(0);
    }
    75% {
      opacity: 1;
    }
    100% {
      opacity: 0;
    }
  }
  @keyframes swipe-bar {
    0% {
      transform: translateY(0);
    }
    25% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-0.5rem);
    }
    75% {
      transform: translateY(0);
    }
    100% {
      transform: translateY(0);
    }
  }

  .imessage {
    background-color: white;
    border-radius: 0.25rem;
    display: flex;
    flex-direction: column;
    font-size: 1.25rem;
    margin: 0 auto 1rem;
    max-width: 600px;
    padding: 2rem 2rem 4rem;
  }

  .imessage img {
    border-radius: 10px;
  }
  
  .imessage p {
    border-radius: 1.15rem;
    line-height: 1.25;
    max-width: 90%;
    padding: 0.5rem .875rem;
    position: relative;
    word-wrap: break-word;
  }
  
  .imessage p::before,
  .imessage p::after {
    bottom: -0.1rem;
    content: "";
    height: 1rem;
    position: absolute;
  }
  
  p.from-me {
    align-self: flex-end;
    /*background-color: #43CC47;*/
    background-color: #007aff;
    color: #fff; 
  }
  
  p.from-me::before {
    border-bottom-left-radius: 0.8rem 0.7rem;
    /*border-right: 1rem solid #43CC47;*/
    border-right: #007aff;
    right: -0.35rem;
    transform: translate(0, -0.1rem);
  }
  
  p.from-me::after {
    background-color: #fff;
    border-bottom-left-radius: 0.5rem;
    right: -40px;
    transform:translate(-30px, -2px);
    width: 10px;
  }
  
  p[class^="from-"] {
    margin: 0.5rem 0;
    width: fit-content;
  }
  
  p.from-me ~ p.from-me {
    margin: 0.25rem 0 0;
  }
  
  p.from-me ~ p.from-me:not(:last-child) {
    margin: 0.25rem 0 0;
  }
  
  p.from-me ~ p.from-me:last-child {
    margin-bottom: 0.5rem;
  }
  
  p.from-them {
    align-items: flex-start;
    background-color: #e5e5ea;
    color: #000;
  }
  
  p.from-them:before {
    border-bottom-right-radius: 0.8rem 0.7rem;
    border-left: 1rem solid #e5e5ea;
    left: -0.35rem;
    transform: translate(0, -0.1rem);
  }
  
  p.from-them::after {
    background-color: #fff;
    border-bottom-right-radius: 0.5rem;
    left: 20px;
    transform: translate(-30px, -2px);
    width: 10px;
  }
  
  p[class^="from-"].emoji {
    background: none;
    font-size: 2.5rem;
  }

  p[class^="from-"].image {
    background: none;
    padding: 0;
  }

  p[class^="from-"].image a {
    color: #000;
  }
  
  p[class^="from-"].emoji::before {
    content: none;
  }
  
  .no-tail::before {
    display: none;
  }
  
  .margin-b_none {
    margin-bottom: 0 !important;
  }
  
  .margin-b_one {
    margin-bottom: 1rem !important;
  }
  
  .margin-t_one {
    margin-top: 1rem !important;
  }