.game-display {
  display: block;
  margin: 0 auto;
  overflow: hidden;
  position: relative;

  &--bg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    background: url(./background/default.jpg) center no-repeat;
    background-size: cover;
    animation: 1.5s game-display--bg-default;
    animation-fill-mode: both;
  }
  &[data-info-panel-position='top'] &--bg {
    animation-name: game-display--bg-down;
  }

  &--video-bg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: -48px;
    left: 0px;
    z-index: 11;
    opacity: 0;
    transition: 0.5s opacity;
    will-change: opacity;
    &.is-playing {
      opacity: 1;
    }
  }
  &[data-panel-placement='left'] &--video-bg {
    transform: translateX(13.671875%) scale(0.87);
  }
  &[data-panel-placement='right'] &--video-bg {
    transform: translateX(13.671875%) scale(0.87);
  }

  &--bg img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    animation: 1.2s game-display--bg-default;
    animation-fill-mode: both;
  }
  &[data-info-panel-position='top'] &--bg img {
    animation-name: game-display--bg-down;
  }

  > canvas {
    position: relative;
    z-index: 100;
  }

  &--touch-buttons {
    position: fixed;
    transform: translateZ(0);
    top: 0;
    opacity: 0;
    z-index: 110;
  }
  &--touch-buttons.is-visible {
    opacity: 1;
  }
  &--touch-buttons.is-left {
    left: 0;
  }
  &--touch-buttons.is-right {
    right: 0;
  }
  &--touch-escape-button,
  &--touch-replay-button,
  &--touch-fullscreen-button {
    position: absolute;
    top: 12px;
    margin: 0;
    padding: 0;
    border: 0;
    width: 32px;
    height: 32px;
    background: transparent center center no-repeat;
    background-size: 32px 32px;
    cursor: pointer;
  }
  &--touch-escape-button {
    background-image: url(./touch-escape.png);
    left: 12px;
  }
  &--touch-replay-button {
    background-image: url(./touch-replay.png);
    left: 56px;
  }
  &--touch-fullscreen-button {
    background-image: url(./touch-fullscreen.png);
    right: 12px;
    :root:fullscreen & {
      display: none;
    }
  }
  &--escape-hint {
    position: absolute;
    left: 12px;
    top: 56px;
    display: none;
    background: #b61a44;
    padding: 8px 12px;
    color: white;
    white-space: nowrap;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1rem;
    pointer-events: none;
    &.is-shown {
      display: block;
    }
    &::after {
      content: '';
      display: block;
      position: absolute;
      width: 0;
      height: 0;
      top: -8px;
      left: 16px;
      margin-left: -8px;
      border-width: 0 8px 8px 8px;
      border-style: solid;
      border-color: transparent;
      border-bottom-color: #b61a44;
    }
  }
}

@keyframes game-display--bg-default {
  from {
    transform: translate(0, 0);
    opacity: 0;
  }
  to {
    transform: translate(0, -35px);
    opacity: 1;
  }
}

@keyframes game-display--bg-down {
  from {
    transform: translate(0, 0);
    opacity: 0;
  }
  to {
    transform: translate(0, 35px);
    opacity: 1;
  }
}
