html {
  font-size: clamp(12px, 1.5vw, 18px);
  overscroll-behavior: none;
  position: fixed;
  overflow: hidden;
  min-width: 100vw;
  min-height: 100vh;
}

body {
  height: 100vh;
  margin: 0;
  padding: 0;
  min-width: 100vw;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;

}


/* Mobile Portrait */
@media (orientation: portrait) {
  body {
    background-image: url("../images/bg-portrait.png");
      margin: 0;
      min-height: 100vh;
      background-size: cover;
      background-position: top;
      background-repeat: no-repeat;
  }
}

/* Mobile Portrait */
@media (orientation: landscape) {
  body {
    background-image: url("../images/bg.png");
    margin: 0;
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat; 
  }
  
}


* {
  font-family: var(--font-family);
}

@keyframes card-rotate {
  0% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(-15deg);
  }
  100% {
    opacity: 0;
  }
}

div.popup-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  /* div.popup-card-container {
    transform: scale(0.5);
  } */
}

span.popup-unterzeile {
  display: block;
  margin-top: 0.5rem;
  font-size: 1rem;
  color: #333;
}

#game {
  display: none;
  height: 100vh;
  margin: 0;
  padding: 0;
  min-width: 100vw;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;

  div.multiplayer-deck .card-container {
    position: absolute;
  }

  div.multiplayer-karawane .card-container {
    box-shadow:  -2px 2px 1rem rgba(0,0,0,0.3);
  }

  .card-container[data-multiplier] {
    &::after {
      content: attr(data-multiplier) "x";
      position: absolute;
      top: 0.5rem;
      right: 0.5rem;
      font-size: 1rem;
      color: black;
    }
  }

  .gegner-karawane {
    .card-container[data-multiplier] {
      &::after {
        content: attr(data-multiplier) "x";
        position: absolute;
        top: unset;
        right: unset;
        left: 0.5rem;
        bottom: 0.5rem;
        font-size: 1rem;
        color: black;
      }
    }
  }
  
  div.player-deck::after {
    content: '5';
    position: absolute;
    top: 5%;
    right: 15%;
    color: gold;
    font-size: 2rem;
  }

  div.multiplayer-deck {
    position: relative;
    width: var(--card-width);
    height: var(--card-height);

    &::after {
      content: attr(data-card-count);
      position: absolute;
      top: 5%;
      right: 15%;
      color: gold;
      font-size: 2rem;
    }

    &.player-deck {
      bottom: 5rem;
    }
    &.gegner-deck {
      top: 5rem;
    }
  }
  div#playerArea {
    div#card-abwerfen {
      width: var(--card-width);
      height: var(--card-height);
      position: absolute;
      bottom: 5rem;
      left: 1rem;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(0,0,0,0.3);
      border: 1px solid bisque;
      border-radius: 0.65rem;
      span {
        color: snow;
        text-align: center;
      }
    }
  }

  div#playerArea,
  div#gegnerArea {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 90vw;

    div.player-hand {
      bottom: calc(var(--card-height) * -0.6);
      &.hand-disabled {
        pointer-events: none;
        opacity: 0.7;
      }

    }
    div.gegner-hand {
      top: calc(var(--card-height) * -0.6);
    }
  }

  div.multiplayer-hand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    & > div.card-container:not(:first-child) {
      margin-left: -2rem;
    }
  }



  div.multiplayer-deck {
    div.card-container.drawn-card {
      transform-origin: bottom left;
      animation: card-rotate 1s ease-in-out;
    }
  }
  

  div.back-cards {
    position: relative;
    height: var(--card-height);
    width: var(--card-width);
    &  div.card-container {
      position: absolute;
    }

  }

  div#spielerKarawanen,
  div#gegnerKarawanen {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    width: 90vw;

    div.karawane-wraper {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 0.25rem;

      div.karawane-info {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        background: burlywood;
        border: 3px solid sandybrown;
        border-radius: 3px;
        padding: 0.1rem 0.25rem;
        font-size: 1.2rem;

        span {
          text-shadow: 1px 1px 1px #000;
        }
      }

      div.karawane-drop {
        visibility: hidden;
        position: absolute;
        bottom: 0rem;
        opacity: 0;
        z-index: 10;
        transition: opacity 0.2s ease-in-out;

        &.dropable {
          visibility: visible;
          opacity: 0.9;
          transition: opacity 0.2s ease-in-out;
          transform: rotate(7deg) translate(0.3rem, 0.25rem)
        }
        
        &.ui-droppable-hover {
          opacity: 1;
          & > * {
            background-color:  rgb(218, 255, 201) !important;
          }
        } 
      }

    
    
    }
  }

  div.karawane {

    position: relative !important;
    height: var(--card-height);
    width: var(--card-width);

    pointer-events: none;

    &.player-karawane  {
      div.hitbox {
        top: 0 
      }
    }
    &.gegner-karawane  {
      div.hitbox {
        top: 100%;
        transform: translateY(-100%);
      }
    }

  
  

    div.card-container {
      position: absolute;
      transition: 0.2s ease-in-out;
      
      &.number.card.hover {
        background-color: rgb(218, 255, 201);
      }

      &:last-child div.hitbox {
        height: var(--card-height);
      }

      div.hitbox {
        height: 1.75rem;
        width: var(--card-width);
      }
    
    }
  } 

    div#confirm-karawane-aufloesen {
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100vw;
      height: 100vh;
      overflow: hidden;
      background: rgba(0,0,0,0.3);


      & > div {
        font-size: 1.5rem;
        max-width: 320px;
        padding: 2rem;
        background: sandybrown;
        border: 0.5rem solid burlywood;
        border-radius: 5px;
        box-shadow: var(--box-shadow-big);
        justify-content: space-evenly;
        text-shadow: 1px 1px 1px #000;
        color: saddlebrown;
        font-size: 1.5rem;
        max-width: 320px;

        button {
          box-shadow: var(--box-shadow-small);
          background: sandybrown;
          border: 2px solid beige;
          border-radius: 3px;
          cursor: pointer;
          transform: rotate(-1deg);
          margin-top: 1rem;
          font-size: 1.5rem;
          &:last-of-type {
            margin-left: 1rem;
          }
        }
      }

    }
}

div#game-over-wrapper {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  .game-over {
    padding: 2rem;
    background: sandybrown;
    border: 0.5rem solid burlywood;
    border-radius: 5px;
    box-shadow: var(--box-shadow-big);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    text-shadow: 1px 1px 1px #000;
    h1 {
      color: saddlebrown
    }
    h2 {
      text-decoration: underline;
      &.win {
        color: cornflowerblue;
      }
      &.lose {
        color: crimson;
      }
    }
    button#game-over-btn {
      box-shadow: var(--box-shadow-small);
      background: sandybrown;
      border: 2px solid beige;
      border-radius: 3px;
      cursor: pointer;
      transform: rotate(-1deg);
      margin-top: 1rem;
    }
  }
}

div#anleitung-wrapper {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  div.anleitung {
    position: relative;
    padding: 2rem;
    background: sandybrown;
    border: 0.5rem solid burlywood;
    border-radius: 5px;
    box-shadow: var(--box-shadow-big);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    text-shadow: 1px 1px 1px #000;
    color: saddlebrown;
    font-size: 1.5rem;
    overflow: auto;
    margin: 3rem;
    max-height: 80vh;


    button {
      position: fixed;
      left: 1rem;
      top: 1rem;
      box-shadow: var(--box-shadow-small);
      background: sandybrown;
      border: 2px solid beige;
      border-radius: 3px;
      cursor: pointer;
      transform: rotate(-1deg);
      margin-top: 1rem;
      font-size: 1.5rem;
      
    }
  }
}

#anleitung-open {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 1000;

  button {
    box-shadow: var(--box-shadow-small);
    background: sandybrown;
    border: 2px solid beige;
    border-radius: 3px;
    cursor: pointer;
    transform: rotate(-1deg);
    font-size: 1.5rem;
    color: saddlebrown;
  }
}



