@import url('https://cdn.jsdelivr.net/gh/moonspam/NanumSquare@1.0/nanumsquare.css');
@import '@utils/variable';

$guide-cover-url: '@resources/bookcover.jpg';
$guide-page-url: '@resources/page.jpg';
html,
body,
input,
label,
button {
  all: unset;
  overflow: hidden;
  user-select: none;
}

* {
  box-sizing: border-box;
}
button:not(:disabled) {
  cursor: pointer;
}

html {
  font-family: 'NanumSquare', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

video {
  display: none;
  width: 0;
  height: 0;
}

.hide {
  display: none;
}

.movable {
  position: absolute;
}

.helper-text {
  @include absolute-center-x;
  @include helper-text-white-background;
  z-index: $z-index-layouts;
  top: 25%;
  font-size: x-large;
  text-align: center;
  white-space: nowrap;
}

.button-primary {
  @include button;
  background-color: $main-color;
}
.button-primary-clicked {
  @include button;
  background-color: $main-clicked-color;
  font-weight: 600;
}

.button-cancel {
  @include button;
  background-color: $gray-color;
}

.card-wrapper {
  position: absolute;
  width: 240px;
  height: 370px;
  border-radius: $small-radius;
  img {
    border-radius: $small-radius;
  }
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.card-common {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
}

.card-back {
  transform: rotateY(180deg);
}

.card-glow-gold {
  box-shadow: $glow-color-gold;
}

.card-glow-gold-hover {
  @include card-glow-hover;
  &:hover {
    box-shadow: $glow-color-gold;
    cursor: pointer;
  }
}

.guide-wrapper {
  @include flex-column;
  position: absolute;
  z-index: $z-index-layouts;
  top: 10%;
  right: 1rem;
  transform: translateY(-50%);
  > * {
    margin: 0.5em 0;
  }
}

.guide-content-wrapper {
  position: absolute;
  width: 40%;
  min-height: 60%;
  border-radius: 1rem;
  perspective: 2000px;
  transform: translate(-50%, -50%);
}

@mixin guide-page {
  position: absolute;
  width: 90%;
  min-height: 100%;
  max-height: 100%;
  padding: 2rem;
  background: url($guide-page-url);
  background-size: cover;
  border-radius: 5px;
  box-shadow: 5px 5px 15px #333;
  font-size: 1.2rem;
  line-height: 1.5;
  overflow-y: auto;
}

@mixin animation-setting {
  animation-delay: 0.5s;
  animation-duration: 0.5s;
  animation-fill-mode: forwards;
}

.guide-left-page-wrapper {
  @include guide-page;
  @include animation-setting;
  z-index: 10;
  animation-name: flipGuide;
  background: url($guide-cover-url);
  background-size: cover;
}

.guide-right-page-wrapper {
  @include guide-page;
}

@keyframes flipGuide {
  0% {
    background: url($guide-cover-url);
    background-size: cover;
    transform: rotateY(0);
    transform-origin: top left;
  }
  20% {
    background: url($guide-cover-url);
    background-size: cover;
  }
  30% {
    background: url($guide-page-url);
    background-size: cover;
  }
  100% {
    background: url($guide-page-url);
    background-size: cover;
    transform: rotateY(-180deg);
    transform-origin: top left;
  }
}
.guide-left-content {
  @include animation-setting;
  animation-name: flipGuideContent;
  opacity: 0;
  transform: rotateY(-180deg);
}

.guide-right-content {
  @include animation-setting;
  animation-name: flipGuideContent;
  opacity: 0;
}

@keyframes flipGuideContent {
  0% {
    opacity: 0;
  }

  25% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}
.guide-button {
  display: flex;
  width: 3.5rem;
  height: 3.5rem;
  align-items: center;
  justify-content: center;
  background-color: $main-color;
  border-radius: 100%;
  box-shadow: $button-shadow;
  cursor: pointer;
  svg {
    width: 1.7rem;
    height: 1.7rem;
  }

  &.refresh-button-small {
    width: 2rem;
    height: 2rem;
  }
}

.duck-container {
  position: relative;
}
