@import './variables';

/* text align */
.text-left-not-xs,
.text-left-not-sm,
.text-left-not-md,
.text-left-not-lg {
  text-align: left;
}

.text-center-not-xs,
.text-center-not-sm,
.text-center-not-md,
.text-center-not-lg {
  text-align: center;
}

.text-right-not-xs,
.text-right-not-sm,
.text-right-not-md,
.text-right-not-lg {
  text-align: right;
}

.text-justify-not-xs,
.text-justify-not-sm,
.text-justify-not-md,
.text-justify-not-lg {
  text-align: justify;
}

@media (max-width: 767px) {
  .text-left-not-xs,
  .text-center-not-xs,
  .text-right-not-xs,
  .text-justify-not-xs {
    text-align: inherit;
  }
  .text-left-xs {
    text-align: left;
  }
  .text-center-xs {
    text-align: center;
  }
  .text-right-xs {
    text-align: right;
  }
  .text-justify-xs {
    text-align: justify;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .text-left-not-sm,
  .text-center-not-sm,
  .text-right-not-sm,
  .text-justify-not-sm {
    text-align: inherit;
  }
  .text-left-sm {
    text-align: left;
  }
  .text-center-sm {
    text-align: center;
  }
  .text-right-sm {
    text-align: right;
  }
  .text-justify-sm {
    text-align: justify;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .text-left-not-md,
  .text-center-not-md,
  .text-right-not-md,
  .text-justify-not-md {
    text-align: inherit;
  }
  .text-left-md {
    text-align: left;
  }
  .text-center-md {
    text-align: center;
  }
  .text-right-md {
    text-align: right;
  }
  .text-justify-md {
    text-align: justify;
  }
}

@media (min-width: 1200px) {
  .text-left-not-lg,
  .text-center-not-lg,
  .text-right-not-lg,
  .text-justify-not-lg {
    text-align: inherit;
  }
  .text-left-lg {
    text-align: left;
  }
  .text-center-lg {
    text-align: center;
  }
  .text-right-lg {
    text-align: right;
  }
  .text-justify-lg {
    text-align: justify;
  }
}

body {
  color: $main-color;
  font-family: 'Caveat', cursive;
  font-size: 1.2rem;
  line-height: 1.2;

  /*&.western-window-open:not(.i-am-moving) {
    .center-container {
      // filter: grayscale(100%); but with z-index due to it;
    }
  }*/

  .hide-if-i-am-moving {
    opacity: 1;
    transform: scale(1) translate(-50%, -50%);
    transition: opacity 0.3s, transform 0.3s;
  }

  &.i-am-moving {
    .hide-if-i-am-moving {
      opacity: 0;
      transform: scale(0) translate(-50%, -50%);
    }
  }
}

.one-opponent {
  display: inline-block;
  padding: 10px;
  text-align: center;
  vertical-align: middle;
  position: relative;
  cursor: pointer;
  border-width: 3px;
  border-style: solid;
  border-left: none;
  border-right: none;
  border-top: none;
  min-height: 140px;
  opacity: 0.9;

  &.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    &:hover {
      opacity: 0.3;
    }
  }

  &:hover {
    opacity: 1;
  }

  .player-full-name {
    font-size: 1rem;
    min-height: 55px;
  }

  .one-opponent-wealth {
    font-size: 1rem;
  }
}

.title {
  font-size: 26px;
  line-height: 1.2;
  text-align: center;
}

.title-small icon {
  vertical-align: middle;
  width: 15px;
  height: 15px;
}

.title-small span {
  vertical-align: middle;
}

.header {
  font-size: 1.6rem;
  padding-left: 30px;
  padding-right: 30px;
  text-align: center;

  .icon-title {
    width: 60px;
    height: 60px;
    margin: 20px auto 10px;
    display: block;
  }
}

.nowrap {
  white-space: nowrap;
}

.title icon {
  width: 40px;
  height: 40px;
  margin: 10px auto 0;
  display: block;
}

.confirmMessage {
  text-align: center;
  margin-bottom: 20px;
  margin-top: 30px;
}

.window-body {
  padding: 20px 50px;
}

.window-footer {
  border-top: 1px solid $lite-gray;
  box-shadow: 0px 0px 9px 2px $gray-transparent-30;
  padding: 15px 50px;
}

label {
  margin-bottom: 0;
}

hr {
  border-top: 1px solid $lightest-gray;
  margin-top: 10px;
  margin-bottom: 10px;
}

.western-alert-danger {
  background: none;
  border: none;
  margin-bottom: 5px;
  padding: 0;
  color: #ffbebe;
}

.badge {
  background: white;
  font-size: 14px;
  line-height: 10px;
  padding: 3px 4px 2px;
  border-radius: 50%;
}

.i-am-border-bottom {
  border-bottom-color: $green-grey;
}

.enemy-border-bottom {
  border-bottom-color: $red-grey;
}

.i-am-border-right {
  border-right-color: $green-grey !important;
}

.enemy-border-right {
  border-right-color: $red-grey !important;
}

.i-am-text {
  color: $green-grey;
}

.enemy-text {
  color: $red-grey;
}

.i-am-background {
  background-color: $light-green-transparent;

  &.active {
    animation-name: blinkGreenBackground;
    animation-duration: 1s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
  }
}

.enemy-background {
  background-color: $light-red-transparent;

  &.active {
    animation-name: blinkRedBackground;
    animation-duration: 1s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
  }
}

.i-am-background-light {
  background-color: $green;
}

.enemy-background-light {
  background-color: $red;
}

@keyframes blinkGreenBackground {
  0% {
    background-color: lighten(rgba($green, 0.9), 50%);
  }
  50% {
    background-color: lighten(rgba($green, 0.9), 30%);
  }
  100% {
    background-color: lighten(rgba($green, 0.9), 50%);
  }
}

@keyframes blinkRedBackground {
  0% {
    background-color: lighten(rgba($red, 0.9), 50%);
  }
  50% {
    background-color: lighten(rgba($red, 0.9), 30%);
  }
  100% {
    background-color: lighten(rgba($red, 0.9), 50%);
  }
}

/* svg */
svg {
  display: block;
}

main-panel svg circle,
main-panel svg line {
  stroke: $main-color;
}

system-message svg circle,
system-message svg line {
  stroke: $main-color;
}

.background-image {
  position: absolute;
  opacity: 0.03;
  width: 300px;
  bottom: 0;
  right: 0;
  z-index: -1;
}

/* scroll for chrome */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: $lightest-gray;
}

::-webkit-scrollbar-thumb {
  background: $lite-gray;
}

/* styles for system-message-container, player-container,
send-money-container and appeared system messages in player */
.message-wrapper {
  background-color: $white-transparent-95;
  border-radius: 10px;
  padding: 3px;
  border: solid 1px;
  z-index: 999999;
}

.marker {
  position: absolute;
  top: 50%;
  background: $green-grey;
  color: white;
  text-transform: uppercase;
  padding: 2px 10px;
  font-size: 18px;
  line-height: 1.4;
  font-style: italic;
  transform: translate(0, -50%);
  z-index: 99;

  &.marker-left {
    left: 0;
    transform: translate(-100%, -50%);
  }

  &.marker-right {
    right: -50px;
  }

  &:before {
    content: '';
    display: block;
    position: absolute;
    top: 1px;
    width: 0;
    height: 0;
    border-style: solid;
  }

  &.marker-left:before {
    right: -9px;
    border-width: 14px 0 14px 10px;
    border-color: transparent transparent transparent $green-grey;
  }

  &.marker-right:before {
    left: -13px;
    border-width: 14px 14px 14px 0;
    border-color: transparent $green-grey transparent transparent;
  }
}

/* labor cost index */
.stripe {
  padding-top: 1px;
  padding-bottom: 1px;
  font-size: 1rem;

  &.up {
    color: $green-grey;

    icon svg {
      fill: $green-grey;
    }
  }

  &.down {
    color: $red-grey;

    icon svg {
      fill: $red-grey;
    }
  }

  &.stripe-grey {
    background: rgba(0, 0, 0, 0.02);
  }
}

.positive {
  color: $green-grey;

  icon svg {
    fill: $green-grey;
  }
}

.negative {
  color: $red-grey;

  icon svg {
    fill: $red-grey;
  }
}

/* moved from player */
player {
  icon {
    &.i-am,
    &.enemy {
      filter: drop-shadow(0px 0px 5px black);
    }
  }

  @for $i from 0 through 7 {
    &.player-#{$i} .player {
      animation-delay: #{$i * 1.5}s;
    }
  }

  &.initial-point {
    .player {
      animation-name: playerJumping;
      animation-duration: 0.4s;
    }
    @for $i from 0 through 7 {
      &.player-#{$i} .player {
        animation-delay: #{$i * 0.15}s;
      }
    }
  }
}

@keyframes playerJumping {
  0% {
    transform: translate(0px, 0px);
  }
  20% {
    transform: translate(0px, -15px);
  }
  40% {
    transform: translate(0px, 0px);
  }
  100% {
    transform: translate(0px, 0px);
  }
}

.active {
  &.i-am .player use {
    animation-name: blinkGreenPlayer;
    animation-duration: 1s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
  }

  &.enemy .player use {
    animation-name: blinkRedPlayer;
    animation-duration: 1s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
  }
}

@keyframes blinkGreenPlayer {
  0% {
    fill: $green;
  }
  50% {
    fill: white;
  }
  100% {
    fill: $green;
  }
}

@keyframes blinkRedPlayer {
  0% {
    fill: $red;
  }
  50% {
    fill: white;
  }
  100% {
    fill: $red;
  }
}

.player-path-dot {
  width: 70px;
  height: 70px;
  margin: -35px;
  position: absolute;
  z-index: 1;
  background-size: 70px;
  background-repeat: no-repeat;
  // https://media.giphy.com/media/SGld0SRSJzZuKAm9c1/giphy.gif
}

/* moved from player end */

western-window > .western-window-container > *:not(.western-window-close) {
  @media (max-width: 1200px) {
    width: 100%;
    min-height: 100%;
  }
}

/* reamaze-widget */
#reamaze-widget {
  background: $hover-color !important;
}

.hard-z-index {
  z-index: $western-window-z-index + 1 !important;
}

.show-if-western-window-open {
  display: none !important;
}

.clickable {
  cursor: pointer;

  &.disabled {
    opacity: 0.3;
    cursor: not-allowed;

    &:hover {
      svg {
        fill: $main-color;
      }
    }
  }

  &:hover {
    color: $hover-color;
    svg {
      fill: $hover-color !important;
    }
  }
}

.triangle-container {
  height: 20px;
  position: relative;
  margin: 0 15px;

  .triangle {
    position: absolute;
    transform: translate(-7.5px, 0);
    width: 0;
    height: 0;
    border-style: solid;

    &.down {
      border-width: 15px 7.5px 0 7.5px;
      border-color: $red-grey transparent transparent transparent;
    }

    &.up {
      border-color: transparent transparent $red-grey transparent;
      border-width: 0 7.5px 15px 7.5px;
    }
  }
}

.money-cash {
  position: absolute;
  padding: 7px 12px;
  color: $green-grey;
  background: lighten($green-grey, 50%);
  border: solid 2px;
  border-radius: 0;
  text-shadow: none;
  z-index: 1;

  .from-player-to-player {
    text-shadow: none;
    white-space: nowrap;
    padding: 5px 7px;
    font-size: 1.4rem;
    font-weight: bold;

    .amount {
      display: inline-block;
    }

    amount-dimension icon svg {
      fill: $green-grey;
    }
  }

  &:before {
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 25px;
    transform: translate(-50%, -50%);
    background: lighten($green-grey, 40%);
    z-index: -1;
    border-radius: 50%;
  }

  .money-cash-background {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;

    .money-cash-coner {
      position: absolute;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      background: $green-grey;

      &.money-cash-1 {
        top: -10px;
        left: -10px;
      }

      &.money-cash-2 {
        bottom: -10px;
        left: -10px;
      }

      &.money-cash-3 {
        top: -10px;
        right: -10px;
      }

      &.money-cash-4 {
        bottom: -10px;
        right: -10px;
      }
    }
  }
}

icon.no_money {
  width: 200px;
  height: 200px;
  margin: 50px auto;
  display: block;

  svg {
    fill: $lightest-gray;
  }
}

icon.western-window-close {
  position: absolute;
  width: 20px;
  height: 20px;
  top: 10px;
  right: 10px;
  z-index: 1;
}

.new-svg-without-mask svg > g {
  mask: none;
}
