/* ==========================================================================
   Base styles
   ========================================================================== */

html, body {
  height: 100%;
}

* {
  box-sizing: border-box;
}

*:focus {
  outline: none;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #333;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Amatic SC', cursive;
}

h1 {
  font-size: 3.5em;
  font-weight: normal;
  margin-bottom: .2em;
}

footer {
  margin-top: 1em;
}

/* ==========================================================================
   Prmary player and video styles
   ========================================================================== */

.player {
  position: relative;
  width: 640px;
  height: 356px;
  user-select: none;
  -ms-user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
}

.player:-ms-fullscreen  {
  width:100%;
  height: 100%;
}

.player button {
  border: 0;
  padding: 0;
  margin: 0;
  outline: 0;
}

video {
  position: absolute;
  width: 100%;
  height: 100%;

  background-color: #000;
  border-radius: 4px;
  box-shadow: 0 4px 9px rgba(0, 0, 0, .15);
}

video::-webkit-media-controls {
  display: none;
}

video::-webkit-media-controls-enclosure {
  display: none;
}

/* ==========================================================================
   Controls: Play/Pause button
   ========================================================================== */

.controls {
  position: absolute;
  display: flex;
  align-items: flex-end;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px;
  opacity: 0;
  transition: opacity .25s ease-out;
  z-index: 2147483647; /* to show in fullscreen mode */
}

.controls .play {
  position: relative;
  width: 65px;
  height: 40px;
  margin-right: 10px;
  background: rgba(23, 35, 34, .75);
  color: #fff;
  border-radius: 5px;
  transition: opacity .25s ease-out, background-color .05s, color .05s;
}

.controls .play:hover,
.controls .play:focus {
  background-color: #00adef;
}

.controls .play-icon,
.controls .pause-icon,
.controls .replay-icon {
  margin-top: 3px;
  padding-left: 2px;
}

.controls .play.paused .pause-icon,
.controls .play.paused .replay-icon {
  display: none;
}

.controls .play.playing .play-icon,
.controls .play.playing .replay-icon {
  display: none;
}

.controls .play.ended .play-icon,
.controls .play.ended .pause-icon {
  display: none;
}

/* ==========================================================================
   Controls: Progress bar
   ========================================================================== */

.controls .play-bar {
  position: relative;
  display: flex;
  justify-content: flex-end;
  flex: 1;
  height: 32px;
  padding: 10px;
  background-color: rgba(23, 35, 34, .75);
  border-radius: 2px;
}

.controls .progress {
  position: relative;
  flex: 1;
  border: 1px solid #666;
  cursor: pointer;
}

.controls .progress:active {
  cursor: -moz-grabbing;
  cursor: -webkit-grabbing;
  cursor: grabbing;
}

.controls .progress .loaded,
.controls .progress .played {
  position: absolute;
  height: 100%;
  border: 1px solid transparent;
  background-clip: padding-box;
}

.controls .progress .played {
  background-color: #00adef;
}

.controls .progress .loaded {
  background-color: #666;
  transition: width .2s cubic-bezier(.17, 0, .09, 1);
}

.scrubbing {
  cursor: -moz-grabbing !important;
  cursor: -webkit-grabbing !important;
  cursor: grabbing !important;
}

/* ==========================================================================
   Controls: Progress bar → Timestamp tooltips
   ========================================================================== */

.controls .ghost-timecode,
.controls .timecode {
  position: absolute;
  top: 0;
  left: 0;
  margin: -23px 0 0 -12px;
  opacity: 0;
  transition: opacity .25s ease-out;
  pointer-events: none;
}

.controls .ghost-timecode span,
.controls .timecode span {
  position: relative;
  left: -50%;
  padding: 2px 4px;
  font-size: 10px;
  font-family: Verdana, sans-serif;
  border-radius: 2px;
}

.controls .ghost-timecode span::before,
.controls .timecode span::before {
  bottom: -4px;
  margin-left: -20px;
}

.controls .ghost-timecode span::after,
.controls .ghost-timecode span::before,
.controls .timecode span::after,
.controls .timecode span::before {
  position: absolute;
  bottom: -3px;
  left: 50%;
  margin-left: -3px;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 3px solid transparent;
  content: "";
}

.controls .ghost-timecode {
  margin-left: 0;
}

.controls .ghost-timecode span::after {
  border-top-color: rgba(23, 35, 34, .85);
}

.controls .ghost-timecode span {
  background: rgba(23, 35, 34, .85);
  color: #fff;
}

.controls .timecode span {
  background: #fff;
  color: #000;
  margin-left: 23px;
}

.controls .timecode span::after {
  border-top-color: #fff;
}

/* ==========================================================================
   Controls: Volume
   ========================================================================== */

.controls .volume {
  position: relative;
  width: 24px;
  height: 100%;
  margin-left: 12px;
  cursor: pointer;
}

.controls .volume > div {
  position: absolute;
  display: block;
  width: 3px;
  height: 12px;
  bottom: 0;
  left: 0;
  background-color: #00adef;
}

.controls .volume > div.fill-0 {
  background-color: #666;
}

.controls .volume > div.fill-1 {
  box-shadow: inset -2px 0 0 #666;
}

.controls .volume > div.fill-2 {
  box-shadow: inset -1px 0 0 #666;
}

.controls .volume > div:nth-child(2) {
  left: 5px;
}

.controls .volume > div:nth-child(3) {
  left: 10px;
}

.controls .volume > div:nth-child(4) {
  left: 15px;
}

.controls .volume > div:nth-child(5) {
  left: 20px;
}

.controls .volume > div:hover {
  height: 15px;
}

/* ==========================================================================
   Controls: Fullscreen
   ========================================================================== */

.controls .fullscreen {
  position: relative;
  width: 12px;
  height: 100%;
  margin-left: 10px;
  font-size: 10px;
  background: 0 0;
}

.controls .fullscreen.is-fullscreen .enter-fullscreen {
  display: none;
}

.controls .fullscreen:not(.is-fullscreen) .exit-fullscreen {
  display: none;
}

.controls .fill {
  fill: #fff;
  transition: fill .05s;
}

.controls .fullscreen:hover .fill,
.controls .fullscreen:focus .fill {
  fill: #00adef;
}

/* ==========================================================================
   Animations
   ========================================================================== */

.fadeIn {
  animation-duration: 1.2s;
  animation-fill-mode: both;
  animation-name: fadeIn;
}

.zoomInBackwards {
  animation: 0.75s 0.3s zoomIn backwards;
}

@keyframes zoomIn {
  from {
    transform: scale(1.05);
    opacity: 0
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}
