html {
  scroll-behavior: smooth;
}

body {
  color: white;
  //Temp
  pre {
    outline: 1px solid #ccc;
    padding: 5px;
    margin: 5px;
  }
  .string {
    color: green;
  }
  .number {
    color: darkorange;
  }
  .boolean {
    color: blue;
  }
  .null {
    color: magenta;
  }
  .key {
    color: red;
  }
}

#sidebar {
  &.gaming {
    min-width: var(--sidebar-mini-width);
    max-width: var(--sidebar-mini-width);
    text-align: center;

    .menuButton {
      font-size: 0.75em;
    }

    .menu-item {
      display: none;
    }
  }
}

#content {
  &.gaming {
    height: 100%;
    width: calc(100% - var(--sidebar-mini-width));
    margin-left: var(--sidebar-mini-width);
  }
}

.loading {
  &.gaming:before {
    left: var(--sidebar-mini-width);
  }
}

#custom-loader {
  &.gaming:before {
    left: var(--sidebar-mini-width);
  }
}

.form-control::placeholder {
  color: #99a3ac;
}

.tempTempWindow {
  width: 100%;
  height: 100%;
}

.tempTempWindow.popup {
  position: fixed;
  top: 0;
  left: var(--sidebar-full-width);
  z-index: 44; //just before close button
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  cursor: pointer;
  width: 100%;

  .art-crop-wrapper {
    justify-content: center;
    display: flex;
    width: 85%;
    height: 100%;
    padding: 5em;

    .img-art-crop {
      object-fit: contain;
      width: 100%;
    }

    .art-crop-artist {
      position: absolute;
      bottom: 1%;
      left: 1%;
      text-align: left;
      color: #243d64;
      background-color: #ffeaced1;
      padding: 0.5em;
      border-radius: 5%;
      font-weight: 200;
    }
  }

  .rules-wrapper {
    height: 85vh;
    display: flex;
    width: 70%;
    margin: 4em auto;
    background-color: #373c42;
    border: 2px solid #8f8f8f;
    border-radius: 5%;
    padding: 2em;
    overflow: scroll;
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: flex-start;
    flex-direction: column;
    overflow-x: hidden;

    .rule-item-wrapper {
      margin-bottom: 1em;
      max-width: 50%;
      text-align: justify;
      background-color: #464d55;
      border-radius: 0 0 0 0;
      padding: 0.7em 3em 0.7em 0.7em;
      margin-right: 1em;
      font-family: "Lato", "Helvetica Neue", Arial, Helvetica, sans-serif,
        "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
      border: dashed;
      border-color: #99917f33;

      .rule-comment {
        color: #ddd;
      }

      .rule-date {
        color: #9fa2aa;
        font-size: 0.8em;
        font-style: italic;
        padding-left: 0.2em;
        text-align: right;
      }
    }

    .no-rules-message {
      color: #9fa2aa;
      font-style: italic;
      text-align: center;
      padding: 2em;
      width: 100%;
      
      p {
        margin: 0;
        font-size: 1.1em;
      }
    }
  }
}

// SET VIEW

.set-view-wrapper {
  margin: 1em;

  .set-view {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    flex-shrink: 0;
    flex-grow: 0;
    justify-content: center;
    cursor: pointer;

    .set-header {
      width: 100%;
      padding: 0.1em;
      display: flex;

      .set-filter {
        width: 27ch;
        margin: auto;
        margin-bottom: 1.1em;
      }

      .set-header-buttons {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        flex-shrink: 0;
        flex-grow: 0;

        .set-button-open-all {
          background: #262b2f;
          cursor: pointer;
          border: 1px solid rgba(0, 0, 0, 0.25);
          border-radius: 2%;
          width: 34px;
          height: 38px;
          margin-left: 5px;
          padding: 5px;
          transition: background 200ms;
          font-size: 1.2em;
          text-align: center;
        }
      }
    }

    .set-in-grid {
      display: flex;
      position: relative;
      align-items: center;
      text-align: center;
      flex-direction: column;
      border-radius: 4%;

      margin: 3px;
      width: var(--sidebar-full-width);
      transform-origin: center;
      transition: transform 200ms;
      height: 180px;
      vertical-align: middle;

      .set-in-grid-img {
        filter: invert(1);
        width: 50px;
        min-height: 120px;
      }

      .set-name-grid {
        color: #dde1ea;
        margin-top: -13px;
        overflow-y: auto;
        overflow: hidden;
      }

      .set-card-count {
        position: absolute;
        color: #858585;
        left: 7px;
        top: 5px;
        text-align: center;
        font-size: 0.8em;
        opacity: 0; //hide on phones
      }

      .set-children-plus {
        position: absolute;
        width: 27px;
        top: 0px;
        right: 0px;
        font-size: 1.3em;
        color: #cacaca;
        background: #4f5255;
        border-radius: 15%;
        padding: 0.2em;

        &.active {
          opacity: 1;
        }
      }

      &.set-child {
        background-color: #4f5255;
      }
    }

    /* Large devices (laptops/desktops, 992px and up) */
    @media only screen and (min-width: 992px) {
      justify-content: left;

      .set-header {
        .set-filter {
          margin: unset;
          margin-left: 0.4em;
          margin-bottom: 0.5em;
        }

        .set-header-buttons {
          .set-button-open-all {
            &:hover {
              background: #33383e;
            }
          }
        }
      }

      .set-in-grid {
        .set-children-plus {
          opacity: 0;
        }
        .set-card-count {
          opacity: 0;
        }

        &:hover {
          transform: scale(1.05);
          border: 1px solid #778899;
          box-shadow: 1px 1px 5px -1px black;

          .set-children-plus {
            opacity: 1;
          }

          .set-card-count {
            opacity: 1;
          }
        }
      }
    }
  }
}

/////////////////////
.card-list-wrapper {
  padding: 1em;
  padding-right: 0;
  position: relative;

  .card-grid-new,
  .card-grid-search,
  .card-grid-new-reprint,
  .card-grid-already-provided {
    color: white;
  }

  .header-cards-wrapper {
    max-width: calc(100% - var(--sidebar-full-width));

    &.fixed {
      width: -webkit-fill-available;
      top: 0;
      padding-top: 0.6em;
      position: fixed;
      background-color: #111;
      z-index: 44; //card price is 43
      margin-left: -1em;
      padding-left: 1em;
      transition: top 0.3s;
      border-bottom: 1px solid #373737;

      @supports (-moz-appearance: none) {
        width: -moz-available;
      }
    }

    .header-cards {
      display: flex;
      flex-direction: row;
      flex-wrap: nowrap;
      justify-content: space-between;
      min-height: 48px;
      text-align: center;
      padding-right: 2em;

      .header-search-button-wrapper {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;

        .form-control {
          width: 300px;
          margin-bottom: 5px;
        }

        .grid-buttons {
          display: flex;
          margin-left: 10px;
          flex-direction: row;
          color: white;
          flex-wrap: nowrap;
          justify-content: space-between;
          font-size: 1.2em;

          .grid-button {
            background: #262b2f;
            cursor: pointer;
            border: 1px solid rgba(0, 0, 0, 0.25);
            border-radius: 2%;
            width: 34px;
            height: 38px;
            margin-left: 5px;
            padding: 5px;
            transition: background 200ms;

            &:hover,
            &:focus {
              background: #33383e;
            }

            .owned,
            .filtered,
            .last-print,
            .first-print,
            .is-select-mode,
            .all-art {
              color: orange;
            }
          }

          .filter-wrapper {
            background-color: #262b2f;
            min-width: 40em;
            margin-top: -1.7em;
            border-radius: 1%;
            padding: 0 1em 1em;
            position: absolute;
            left: 2em;
            border: 1px solid black;
            z-index: 2;
            box-shadow: 1px 1px 5px -1px black;
            cursor: default;
            top: 80px;

            .filter-row {
              display: flex;
              flex-direction: row;
              flex-wrap: wrap;
              margin-top: 1em;

              .elements {
                display: flex;
                flex-direction: row;
                flex-wrap: wrap;
                font-size: 0.8em;

                .lab {
                  width: 8em;
                  display: flex;
                  flex-direction: column;
                }

                .label,
                .label-input,
                .label-reset,
                .label-list,
                .label-input-raw,
                .label-filter {
                  padding: 0.2em 0.4em;
                  background-color: #111111;
                  line-height: 2em;
                  border: 1px solid #090909;
                  border-radius: 5%;
                  margin-right: 0.5em;
                  cursor: pointer;

                  &.selected {
                    color: orange;
                  }

                  &.only {
                    border: 1px solid #a5a5ab;
                    margin-left: 0.5em;
                  }
                }

                .label-reset,
                .label-filter {
                  border: 2px solid #d2cece;
                  padding: 0.4em 0.6em;
                  border-radius: 14%;
                  margin-top: 1em;
                  margin-left: 2em;
                }

                .element {
                  margin-right: 0.3em;
                  border-radius: 10%;
                  cursor: pointer;
                  line-height: 1.8em;
                  padding: 0.2em 0.4em;
                  font-weight: normal;
                  border: 1px solid #090909;
                  display: flex;
                  height: 2.5em;
                  background-color: #1e1e1e;

                  &.selected {
                    background-color: #1e1e1e;
                    color: orange;
                  }
                }

                .filter-input {
                  width: 15%;
                  background-color: #ffffff;
                  color: #495057;
                  margin-right: 0.5em;
                  margin-left: 0.4em;
                  text-align: right;
                }
              }
            }
          }

          .stats-wrapper {
            background-color: #262b2f;
            min-width: 40em;
            //min-height: 10em;
            margin-top: -1.7em;
            border-radius: 1%;
            padding: 0 1em 1em;
            position: absolute;
            left: 2em;
            border: 1px solid black;
            z-index: 2;
            box-shadow: 1px 1px 5px -1px black;
            cursor: default;
            top: 80px;

            .stat-header {
              display: flex;
              flex-direction: row;
              border-bottom: 2px solid gray;
              margin-bottom: 0.2em;

              .stat-header-item {
                cursor: pointer;
                padding: 0.5em 1em;

                &:focus,
                &:hover {
                  background-color: #3c4146;
                }
                &.selected {
                  background-color: gray;
                }
              }
            }

            .stat-row {
              display: flex;
              flex-direction: row;
              flex-wrap: wrap;

              .stat-item {
                font-size: 0.8em;
                margin: 0.2em;
                border-radius: 5%;
                border: 1px solid #090909;
                display: flex;
                height: 2.5em;
                background-color: #1e1e1e;

                .stat-label {
                  padding: 0.2em 0.4em;
                  background-color: #111111;
                  line-height: 2em;

                  &.common {
                    color: #dedede;
                  }
                  &.uncommon {
                    color: #84aacd;
                  }
                  &.rare {
                    color: #ffd200;
                  }
                  &.mythic {
                    color: #ee8b33;
                  }
                }

                .egg-booster-box-opening,
                .egg-booster-opening {
                  cursor: pointer;
                }

                .stat-value {
                  font-size: 1.1em;
                  line-height: 1.8em;
                  padding: 0.2em 0.4em;
                  font-weight: normal;
                  font-family: -apple-system, BlinkMacSystemFont, Segoe UI,
                    Helvetica, Arial, sans-serif;
                }

                &.selected {
                  color: orange;
                }

                &.stat-stat {
                  cursor: pointer;
                }
              }
            }

            .stat-page {
              &.colors,
              &.cmc,
              &.type {
                height: 250px;

                .chart-colors,
                .chart-cmc,
                .chart-type {
                  height: 95%;
                  max-width: 70%;
                  margin: 0 auto;
                  margin-top: 2em;
                  --labels-size: 3 rem;
                }

                .chart-type {
                  max-width: 90%;
                }

                td {
                  border-radius: 5px 5px 0 0;
                  border: 1px solid #fff;
                }
              }

              &.cmc {
                .chart-cmc {
                  --color: #84b4ff;
                }
              }

              .card-count {
                z-index: 2;
                background-color: #1e1e1e;
                padding: 0.1em 0.2em;
                border-radius: 20%;
                border: 1px solid #131313;
                margin-top: -2em;
              }

              th {
                z-index: 1;
                color: white;
                background-color: #111;
                border: 1px solid #353535;
                border-radius: 6%;
                font-size: 0.6em;
                margin-bottom: -1em;
              }
            }
          }

          .sub-header-close {
            cursor: pointer;
            position: absolute;
            right: 0.5em;
            font-size: 1.4em;
          }
        }
      }

      .grid-title {
        font-size: 1em;
        padding: 0.4em 1em;
        overflow: hidden;
        max-width: 28ch;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .slider {
        cursor: pointer;
        background: #bbbbbb;
        outline: none;
        transition: opacity 0.2s;
        height: 3px;
        border-radius: 20px;
        opacity: 0.8;
        width: 183px;
        margin-top: 15px;

        &:hover,
        &:focus {
          opacity: 1;
        }

        /* for chrome/safari */

        &::-webkit-slider-thumb {
          width: 6px;
          background: #bbbbbb;
          cursor: pointer;
          border: 1px solid #fff;
        }

        /* for firefox */

        &::-moz-range-thumb {
          width: 6px;
          background: #bbbbbb;
          cursor: pointer;
          border: 1px solid #fff;
        }
      }

      .count-card {
        margin-right: 12px;
        margin-top: 5px;
        //width: 355px;
        color: white;
        font-size: 1em;
        text-align: right;
        min-width: 24ch;
      }
    }
  }

  .card-in-grid {
    display: inline-block;
    margin: 3px;
    transform-origin: center;
    transition: all 100ms;
    border-radius: 4%;
    cursor: pointer;
    position: absolute;
    box-shadow: 0 0 0 0 #778899;

    &:before,
    &:after {
      transition: box-shadow 100ms;
      box-shadow: 0 0 0px rgba(0, 0, 0, 0.8);
      top: 0;
      bottom: 0;
      left: 10px;
      right: 10px;
      content: "";
      position: absolute;
      z-index: -1;
    }

    &:not(.selected, .not-selected):hover,
    &:not(.selected, .not-selected):focus {
      transform: scale(1.02);
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(0, 0, 0, 0.1) inset;

      &:before,
      &:after {
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
      }

      &:after {
        right: 10px;
        left: auto;
        transform: skew(8deg) rotate(3deg);
      }
    }

    &.not-selected {
      filter: grayscale(90%);
      &:active {
        transform: scale(0.97);
      }
    }
    &.selected {
      filter: grayscale(0%);
      transform: scale(1);
      border: 1px solid white;

      &:hover {
        transform: none;
      }

      &:active {
        transform: scale(0.97);
      }
    }

    &:not(.selected, .not-selected):active {
      transform: scale(1);
    }

    .card-img-in-grid {
      width: 220px;
      border-radius: 4%;
      background-color: black;
      background-image: url("../Magic_card_back.jpg");
      background-size: contain;
      position: absolute;
      border: 2px #5b5b5b solid;
      border-top: none;
      border-left: none;

      &.alpha {
        border-radius: 6.3%;
      }
      &.owned {
        border: 1px #5ea2f5 solid;
      }
      &.is-fav-artist {
        border-left: 2px #f5c1f8 solid;
      }
      &.owned.is-fav-artist {
        border: 1px #5ea2f5 solid;
        border-left: 1px #f5c1f8 solid;
      }
    }
  }
}

#card-info-page {
  padding-top: 10px;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  padding-left: 10px;
  align-content: flex-start;
  width: calc(100% - 5px);

  .card-card {
    width: calc(100% / 2.8);
    margin-top: 10px;
    height: 100%;

    .card-img-container {
      width: 100%;
      height: calc(100% - 40px);
    }
  }
}

.card-infos-wrapper {
  padding: 1em;

  .card-img-infos-wrapper {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;

    .card-card {
      z-index: 1;

      .card-large-img {
        width: 100%;
        border-radius: 4%;
        border: 2px solid #5b5b5b;
        border-top: none;
        border-left: none;

        &:hover,
        &:focus {
          transform: none;
          box-shadow: none;
        }

        &.alpha {
          border-radius: 6.3%;
        }
      }
    }

    .fa-retweet {
      cursor: pointer;
      color: #fff;
      position: absolute;
      font-size: 2em;
      z-index: 99;
    }

    .card-infos-box {
      display: flex;
      flex-direction: column;
      flex-wrap: nowrap;
      margin: 20px 0 -25px -15px;
      font-size: 1em;
      max-width: 500px;
      min-width: 300px;
      height: fit-content;

      .card-infos {
        background-color: #2a2f34;
        border: 1px solid rgba(0, 0, 0, 0.25);
        border-top: 3px solid dimgrey;
        border-bottom: 3px solid dimgrey;
        border-radius: 4px;
        padding: 10px 10px 10px 25px;

        &.border-top-W {
          border-top: 3px solid rgb(248, 246, 216);
        }

        &.border-top-U {
          border-top: 3px solid rgb(193, 215, 233);
        }

        &.border-top-B {
          border-top: 3px solid black;
        }

        &.border-top-R {
          border-top: 3px solid rgb(228, 153, 119);
        }

        &.border-top-G {
          border-top: 3px solid rgb(163, 192, 149);
        }

        &.border-bottom-W {
          border-bottom: 3px solid rgb(248, 246, 216);
        }

        &.border-bottom-U {
          border-bottom: 3px solid rgb(193, 215, 233);
        }

        &.border-bottom-B {
          border-bottom: 3px solid black;
        }

        &.border-bottom-R {
          border-bottom: 3px solid rgb(228, 153, 119);
        }

        &.border-bottom-G {
          border-bottom: 3px solid rgb(163, 192, 149);
        }

        &.border-multicolor {
          border-top: 3px solid goldenrod;
          border-bottom: 3px solid goldenrod;
        }

        .card-word {
          transition: text-decoration 100ms;

          &:hover,
          &:focus {
            text-decoration: underline;
            cursor: pointer;
          }
        }

        .card-info-header {
          border-bottom: 2px solid rgba(0, 0, 0, 0.3);
          display: flex;
          justify-content: space-around;

          .card-title {
            display: inline;
            font-size: 1.2em;
            flex: auto;
          }

          .card-mana-cost {
            font-size: 1.5em;
            .mi {
              margin-right: 4px;
            }
            .mi-split {
              margin-right: 5px;
              .mi {
                margin-right: 0;
                color: black;
              }
            }
          }
        }

        .card-line-wrapper {
          display: flex;
          justify-content: space-around;
          border-bottom: 1px solid rgba(0, 0, 0, 0.3);

          .card-type-line {
            padding: 10px 5px;
            color: #999;
            flex: auto;
          }

          .wrapper-first-rarity {
            .card-reserved {
              padding: 0.4em;
              font-size: 0.6em;
              background-color: #f8b32d;
              color: black;
              font-weight: bold;
              border-radius: 50%;
              display: inline-block;
              border: 1px solid black;
              width: 2em;
              text-align: center;
              cursor: pointer;
            }

            .card-promo {
              padding: 0.4em;
              font-size: 0.6em;
              background-color: #fcf69d;
              color: black;
              font-weight: bold;
              border-radius: 50%;
              display: inline-block;
              border: 2px solid black;
              width: 2em;
              text-align: center;
              cursor: pointer;
            }

            .card-first-time {
              padding: 0.4em;
              margin-right: 0.2em;
              font-size: 0.6em;
              background-color: #abe4ff;
              color: black;
              font-weight: bold;
              border-radius: 50%;
              display: inline;
              border: 1px solid black;
              cursor: pointer;
            }

            .card-rarity {
              display: inline;

              .card-set-img {
                height: 100%;
                width: 22px;
              }

              .set-shadow {
                filter: invert(1);
                width: 23px;
                position: absolute;
              }
            }
          }
        }

        .card-oracle {
          border-bottom: 1px solid rgba(0, 0, 0, 0.3);
          padding-bottom: 10px;
          padding-top: 10px;
          font-size: 1em;
          font-weight: 300;
          line-height: 1.7em;
          color: white;
          width: 100%;
          .mi {
            margin-right: 3px;
            font-size: 1.11em;
          }
          .mi-q {
            color: white;
          }
          .mi-split {
            margin-right: 4px;
            .mi {
              margin-right: 0;
              color: black;
            }
          }
        }

        .card-flavor-text {
          border-bottom: 1px solid rgba(0, 0, 0, 0.3);
          padding-bottom: 10px;
          padding-top: 3px;
          //margin-top: -10px;
          font-size: 0.9em;
          color: #999;
          font-style: italic;
          font-weight: 300;
          line-height: 1.7em;
          width: 100%;
        }

        .card-info-power-toughness {
          float: right;
          margin-top: -11px;
          letter-spacing: 1px;
          color: #999;
          font-size: 1.2em;
          width: 60px;
          padding: 3px 6px;
          border: 1px solid #999;
          text-align: center;
          border-radius: 10%;
          background-color: #2a2f34;

          .card-power {
            color: white;
          }
        }

        .card-info-footer {
          padding-top: 10px;

          .card-set-artist-wrapper {
            display: inline-block;

            .card-set-name {
              padding-right: 15px;
              max-width: 200px;
            }

            .fa-paint-brush {
              color: #999;
            }

            .card-art-crop {
              cursor: pointer;
            }

            .card-artist {
              padding-left: 6px;
              padding-right: 15px;
              color: #999;
            }
          }

          .card-year {
            display: inline-block;
            color: #999;
          }
        }
      }

      .card-infos-prices {
        margin-top: 10px;
        font-size: 1.3em;
        background-color: #2a2f34;
        border: 1px solid rgba(0, 0, 0, 0.25);
        text-align: center;

        .card-infos-price {
          vertical-align: top;
          display: inline-block;
          text-align: right;
          padding: 5px 20px 5px 5px;
          border-right: 2px solid rgba(0, 0, 0, 0.25);

          .lowest {
            font-size: 0.5em;
            color: #999;
            //display: block;
          }
        }
        .card-infos-price-foil {
          vertical-align: top;
          display: inline-block;
          text-align: left;
          padding: 5px 5px 5px 10px;
          color: goldenrod;

          .lowest {
            font-size: 0.5em;
            color: #999;
          }
        }

        .percentage {
          font-size: 0.5em;
          color: #999;
        }

        .fa-arrow-up {
          color: green;
          transform: rotate(45deg);
        }
        .fa-arrow-down {
          color: darkred;
          transform: rotate(-45deg);
        }
      }

      .card-infos-price-reprints {
        margin-top: 5px;
        font-size: 1em;
        color: #999;
        background-color: #2a2f34;
        border: 1px solid rgba(0, 0, 0, 0.25);
        text-align: center;
        padding: 3px 3px 3px 13px;

        .card-infos-price-reprints-low,
        .card-infos-price-reprints-high,
        .card-infos-price-count-reprints {
          display: inline-block;
          color: white;
        }
      }

      .legality {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: 5px;
        background-color: #2a2f34;
        border: 1px solid rgba(0, 0, 0, 0.25);
        text-align: center;
        padding: 5px 5px 5px 15px;
        color: white;
        flex-wrap: wrap;
        flex-grow: 0;
        flex-shrink: 0;

        .legal {
          font-size: 0.7em;
          background-color: #3c4146;
          border-radius: 3%;
          width: 18%;
          border: 1px solid rgba(0, 0, 0, 0.25);
          margin: 1%;
          overflow: hidden;
          cursor: pointer;

          &.very-legal {
            background-color: darkolivegreen;
          }
          // &.not-legal {

          // }
          &.banned {
            background-color: #923333;
          }
          &.restricted {
            background-color: #a97a40;
          }
        }
      }

      .related-cards {
        margin-top: 10px;
        text-align: left;
        color: #c9cdd0;
        font-size: 0.8em;
        display: flex;
        flex-direction: column;
        max-height: 132px;
        flex-wrap: wrap;

        .related-card {
          max-height: 28px;
          background-color: #2a2f34;
          padding-left: 29px;
          line-height: 24px;
          cursor: pointer;

          .fa-solid {
            font-size: 1.2em;

            &.color-W {
              color: rgb(248, 246, 216);
            }

            &.color-U {
              color: rgb(193, 215, 233);
            }

            &.color-B {
              color: black;
            }

            &.color-R {
              color: rgb(228, 153, 119);
            }

            &.color-G {
              color: rgb(163, 192, 149);
            }

            &.color-M {
              color: goldenrod;
            }

            &.color-I {
              color: gray;
            }
          }

          .related-card-text {
            display: inline-block;
            padding-left: 9px;
          }
        }
      }

      .card-infos-links {
        margin-top: 10px;
        text-align: center;
        color: #999;
        font-size: 0.7em;
        display: flex;
        flex-direction: column;
        max-height: 132px;
        flex-wrap: wrap;

        .card-link-wrapper {
          margin-top: 5px;
          background-color: #3c4146;
          border: 1px solid rgba(0, 0, 0, 0.11);
          padding: 3px 3px 3px 25px;
          text-align: left;
          cursor: pointer;
          width: 22em;
          max-height: 28px;

          &:hover {
            background-color: #626970;
          }

          img {
            display: inline-block;
            margin-right: 5px;
          }
        }

        .card-icon {
          height: 20px;
          width: 20px;
        }

        .icon-similar,
        .icon-rules {
          font-size: 1.5em;
          padding: 0.18em;
          color: #f1f3f9;
          margin-right: 0.32em;
        }

        .card-similar,
        .card-rules {
          position: relative;

          .similar-card-text,
          .rules-card-text {
            display: inline-block;
            position: absolute;
            top: 6px;
            left: 53px;
          }
        }
      }
    }
  }

  .reprint {
    font-size: 1.3em;
    color: #fff;
    display: inline;
  }

  #card-reprints {
    vertical-align: top;
    padding-top: 15px;
    padding-bottom: 300px;
    margin-top: 15px;

    .grid-title {
      width: 24ch;
      font-size: 1.1em;

      &.reprint {
        width: 10ch;
      }
    }

    .header-cards-wrapper {
      max-width: none;
    }
  }

  .personal-action-card-wrapper {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    max-width: 100%;
    height: min-content;

    .list-deck-wrapper {
      max-height: 59vh;
      overflow-y: scroll;
      scroll-behavior: smooth;
      border-bottom: 1px solid gray;
      scrollbar-color: #4e5359 #373c42;
      scrollbar-width: thin;
    }

    .personal-action-card {
      display: flex;
      width: 100%;
      max-width: 40ch;
      margin-bottom: 0.3em;

      .card-collection-wrapper,
      .card-deck-wrapper,
      .card-in-deck-named {
        background-color: #262b2f;
        border: 1px solid rgba(0, 0, 0, 0.25);
        border-radius: 4%;
        border-bottom: 3px solid black;
        border-top: 1px solid black;
        padding: 0.5em 0.5em;
        text-align: left;
        color: #999;
        width: 25ch;

        .card-owned,
        .card-deck-count {
          color: white;
          font-weight: bold;
          margin-right: 0.2em;
        }
      }

      .card-in-deck-named {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        background-color: #30373c;
        cursor: pointer;
        color: #999;
        margin-left: 1ch;
        width: 24ch;
        transition: background 200ms;
        border-bottom: 2px solid black;

        &.is-active {
          border-top: solid #997c38 1px;
        }

        .card-in-deck-named-count {
          color: white;
        }

        .deck-name {
          margin-left: 0.4em;
          overflow: hidden;
          max-width: 28ch;
          text-overflow: ellipsis;
          white-space: nowrap;
        }

        &:hover {
          background: white;
          color: #7386d5;

          .card-in-deck-named-count {
            color: #48558d;
          }
        }
      }

      .personal-action-button-wrapper {
        display: flex;
        margin-left: 0.3em;

        .personal-action-button {
          background-color: #262b2f;
          margin-right: 0.2em;
          cursor: pointer;
          border: 1px solid rgba(0, 0, 0, 0.25);
          border-bottom: 3px solid black;
          border-radius: 20%;
          width: 2em;
          line-height: 2em;
          padding: 0.3em;
          transition: background 200ms;
          text-align: center;
          font-weight: bold;

          &:hover {
            background: #33383e;
          }

          // &.add-card-collection {

          // }
          // &.remove-card-collection {

          // }

          &.add-card-deck,
          &.remove-card-deck {
            border-bottom: 2px solid black;

            &:active {
              margin-top: 2px;
              margin-bottom: -2px;
            }
          }
        }
      }

      // .card-reprint-count-owned {

      // }
    }
  }
}

.deck-view-wrapper {
  padding: 1em;

  .deck-view {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    flex-shrink: 0;
    flex-grow: 0;

    .deck-card {
      display: flex;
      position: relative;
      align-items: center;
      text-align: center;
      justify-content: center;
      font-size: 1.2rem;
      width: 15rem;
      height: 9rem;
      padding: 1rem 2rem;
      margin-right: 1rem;
      margin-top: 1rem;
      color: white;
      border-radius: 4%;
      background-color: #3c4146;
      cursor: pointer;

      background-size: 135%;
      background-position: 50% 18%;
      background-blend-mode: overlay;
      box-shadow: 1px 1px 5px -1px black;

      &.add-deck-box {
        font-size: 5rem;
        border: 2px solid rgb(191, 191, 191);
      }

      &.is-active {
        border: solid #997c38 2px;
      }

      .deck-card-text {
        -webkit-text-fill-color: white;
        -webkit-text-stroke-width: 1px;
        -webkit-text-stroke-color: #fff;
      }

      .deck-card-count {
        display: block;
        position: absolute;
        right: 5px;
        bottom: 0;
        font-size: 0.8em;
        color: #cacaca;
      }

      .deck-price {
        display: block;
        position: absolute;
        left: 5px;
        bottom: 0;
        font-size: 0.8em;
        color: #cacaca;
      }

      .deck-mana {
        display: block;
        position: absolute;
        bottom: 5px;
      }

      .deck-buttons {
        display: inline-block;
        position: absolute;
        right: 2%;
        top: 0;
        padding: 0.3em;

        .deck-list-buttons {
          display: none;
          position: absolute;
          background-color: #33383e;
          min-width: 160px;
          box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
          z-index: 1;
          font-size: 0.8em;
          opacity: 0;
          transition: opacity 200ms;
          text-align: left;
          right: 3%;
          top: 70%;
          border: 1px solid white;

          i {
            color: white;
            padding: 6px 16px;
            text-decoration: none;
            display: block;
            font-style: normal;

            &.selected {
              font-weight: bold;
              background-color: #212122;
            }

            &:hover {
              background-color: #262b2f;
              outline: 1px solid rgb(183, 183, 188);
            }
          }
        }
      }

      .input-deck {
        width: 10em;
        color: white;
        background-color: #3c4146;
        border: 1px solid #a8adb3;
        padding: 0.5em;
        resize: none;
        text-align: center;
        overflow: auto;
        outline: none;
        -webkit-box-shadow: none;
        -moz-box-shadow: none;
        box-shadow: none;
      }
    }
  }
}

.rarity-mythic {
  filter: invert(66%) sepia(14%) saturate(2509%) hue-rotate(339deg)
    brightness(87%) contrast(81%);
}

.rarity-rare {
  filter: invert(81%) sepia(25%) saturate(464%) hue-rotate(9deg) brightness(99%)
    contrast(88%);
}

.rarity-uncommon {
  filter: invert(80%) sepia(25%) saturate(160%) hue-rotate(150deg)
    brightness(94%) contrast(91%);
}

// .rarity-common {
//   filter: invert(0%) sepia(88%) saturate(5761%) hue-rotate(57deg) brightness(117%) contrast(87%);
// }

.rarity-common {
  filter: invert(100%);
}

.tooltip-buttons .tooltiptext {
  visibility: hidden;
  width: 140px;
  background-color: black;
  border: 1px solid rgba(255, 255, 255, 0.31);
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px 0;
  position: relative;
  z-index: 1;
  left: 50%;
  margin-left: -70px;
  margin-top: 7px;
  font-size: 0.7em;
  opacity: 0;
  transition: opacity 0.2s;
}

.tooltip-buttons .tooltiptext::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent black transparent;
}

.tooltip-buttons:hover .tooltiptext {
  visibility: visible;
  opacity: 0.9;
}

.stats-button {
  height: inherit;
}

/* Dropdown Content (Hidden by Default) */
.sort-dropdown,
.select-dropdown {
  display: none;
  position: absolute;
  background-color: #33383e;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 3;
  margin-left: -6px;
  margin-top: 3px;
  font-size: 0.8em;
  text-align: left;

  i {
    color: white;
    padding: 6px 16px;
    text-decoration: none;
    display: block;
    font-style: normal;

    &.selected {
      font-weight: bold;
      background-color: #212122;
    }

    &:hover {
      background-color: #262b2f;
      outline: 1px solid rgb(183, 183, 188);
    }
  }
}

/* Change the background color of the dropdown button when the dropdown content is shown */
.grid-sort:hover .dropbtn {
  background-color: #3e8e41;
}

.collection-wrapper,
.deck-wrapper {
  top: 0;
  padding: 10px;
  color: #fff;
  position: absolute;
  z-index: 1000;
  width: 100%;

  .import-deck-name {
    margin-top: 1em;
    margin-bottom: 1em;
  }

  .collection-text-area,
  .deck-text-area {
    margin: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;

    .collection-import-button-wrapper,
    .deck-import-button-wrapper {
      display: flex;
      flex-direction: row;

      .collection-import-button,
      .deck-import-button,
      .deck-import-close,
      .collection-import-close {
        margin-top: 20px;
        margin-right: 20px;
        background-color: #262b2f;
        color: white;
        border: 1px solid rgba(0, 0, 0, 0.25);
        transition: background 200ms;

        &:hover,
        &:focus {
          background: #33383e;
        }
      }
    }
  }
}

.collection_str,
.deck_str {
  font-size: 1.5em;
  text-align: center;
}

#collection_raw,
#deck_raw {
  width: 500px;
}

#Progress_Status {
  background-color: #070707;
  width: 80%;
  position: fixed;
  top: 50%;
  left: 13%;
  text-align: center;
  color: white;
}

#myprogressBar {
  width: 1%;
  height: 35px;
  background-color: #262b2f;
  text-align: center;
  line-height: 2em;
  border: 1px solid white;
  border-radius: 4%;
}

#myprogressBarText {
  width: 80%;
  position: fixed;
  top: 50%;
  left: 13%;
  text-align: center;
  padding-top: 0.5em;
}

.card-price {
  display: inline-block;
  z-index: 43;
  opacity: 1;
  position: relative;
  width: auto;
  background: #000;
  color: white;
  font-size: 12px;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  padding: 2px 5px 0px;
  cursor: pointer;
  //border: 1px solid white;
  //border-bottom: 1px solid black;
  font-weight: normal;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial,
    sans-serif;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0 auto;

  &.is-approx {
    color: #ffe0b3;
  }

  &.owned {
    border: 1px solid #5ea2f5;
    //border-bottom: 1px solid #5ea2f5;
    border-bottom: 1px solid black;
  }

  .price-trend {
    color: #57b557;

    &.decrease {
      color: #c24141;
    }
  }
}

.card-solo-count {
  display: inline-block;
  z-index: 43;
  opacity: 1;
  position: absolute;
  width: auto;
  background: #fff;
  color: #0b1237;
  font-size: 0.9em;
  transform: scale(1);
  border-top-right-radius: 56%;
  border-bottom-left-radius: 50%;
  padding: 2px 8px 0;
  cursor: pointer;
  border: 2px solid #5ea2f5;
  border-left: 1px solid white;
  border-bottom: 1px solid white;
}

.card-solo-count-deck {
  display: inline-block;
  z-index: 43;
  opacity: 1;
  position: absolute;
  width: auto;
  background: #fff;
  color: #0b1237;
  font-size: 0.9em;
  transform: scale(1);
  border-top-left-radius: 56%;
  border-bottom-right-radius: 50%;
  padding: 2px 8px 0;
  cursor: pointer;
  border: 2px solid #ffaf31;
  border-right: 1px solid white;
  border-bottom: 1px solid white;
  right: 0;

  &.is-deck-grid {
    border: 2px solid #378f22;
    border-right: 1px solid white;
    border-bottom: 1px solid white;
  }

  &.is-deck-grid-overused {
    border: 2px solid #c42424;
    border-right: 1px solid white;
    border-bottom: 1px solid white;
  }
}

//This part needs a big ass refactoring

#card-prinder-page {
  .card-img-container-prinder {
    &.guessmc {
      display: flex;
    }
  }

  .card-large-img-prinder {
    &.guessmc {
      mask-image: linear-gradient(to bottom, transparent 10%, black 13%);
      height: auto;
      margin-top: -30px;
      transition: all 500ms;

      &:hover {
        transform: none;
        box-shadow: none;
      }

      &.show-solution {
        mask-image: none;
        -webkit-mask-image: none;
        margin-top: 0;
      }
    }
  }

  .mcwrap {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 49%;
    height: 100%;
    margin-top: -1.5%;

    .mana-cost-guess-wrapper {
      display: flex;
      align-items: normal;
      flex-direction: column;
      width: 100%;
      position: relative;

      .title {
        width: 70%;
        text-align: center;
      }

      .box {
        border: 4px solid #424141;
        border-radius: 5%;
        padding: 4%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 70%;
        cursor: pointer;
        color: white;
        height: 100%;
        min-height: 23em;
        transition: opacity 500ms;
      }

      .solutions {
        background-color: #282828;
      }

      .gg {
        opacity: 0;
        position: absolute;
        top: 0;
        background-color: #50753a;
        color: white;
        line-height: 4em;
      }

      .nop {
        opacity: 0;
        position: absolute;
        top: 0;
        background-color: #bc5a5a;
        color: white;
        line-height: 4em;
      }

      .sol {
        font-size: 2em;
        color: black;
        width: 80%;
        border: 3px solid #b0b0b0;
        padding: 0.4em 0.8em;
        margin-bottom: 4%;
        border-radius: 3.2em 2%;
        background-color: #52545b;
        cursor: pointer;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        box-shadow: 2px 1px 5px -1px black;
        z-index: 1;
        transition: all 0.3s;

        &:hover {
          transform: scale(1.03);
          box-shadow: 1px 1px 5px -1px white;
        }

        &:active {
          margin-top: -4px;
        }

        &.only:hover {
          transform: none;
          box-shadow: 2px 1px 5px -1px black;
        }

        .mi {
          //copy pasted shame
          margin-right: 4px;
        }

        .mi-split {
          margin-right: 5px;

          .mi {
            margin-right: 0;
            color: black;
          }
        }
      }

      .message {
        font-size: 3em;
      }

      .card-info {
        background: #585e73;
        padding: 1em 0.5em;
        line-height: 1em;
        border-radius: 16%;
        border: 1px solid white;

        &:hover {
          box-shadow: 2px 1px 5px -1px white;
        }
      }
    }
  }
}

.select-box-wrapper {
  position: fixed;
  font-size: 1.2em;
  bottom: 0;
  right: 0;
  z-index: 44;
  max-width: 18em;
  border: 2px solid #918f8f;
  border-bottom: none;
  margin-right: 12px;
  color: #dbdbdb;
  cursor: pointer;

  .title-select {
    padding: 0.25em 0.7em;
    text-align: center;
    background-color: #1d2124;

    .fa-clipboard {
      padding-left: 1em;
      &:hover {
        color: orange;
      }
    }
    .fa-clipboard-list {
      padding-left: 1em;
      &:hover {
        color: orange;
      }
    }
  }

  .select-box {
    background-color: #3d444a;
    font-size: 0.8em;
    padding: 0.2em 0.4em;
    text-align: right;

    &.open {
      height: 80vh;
      overflow: scroll;
      cursor: default;
    }
  }
}

.similar-card-wrapper {
  display: flex;
  border: solid 0px pink;
  height: 100vh;
  justify-content: space-around;

  .similar-card-title {
    display: none; // only show this on small screens
  }

  .similar-card-container {
    //width: 20%;
    border: solid 0px pink;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5em;
    padding: 1em;
    min-width: 200px;

    .card-similar-left {
      border: solid 0px pink;
      height: 100%;
      .card-similar-img-container {
        border: solid 0px pink;
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100%;
        .card-large-similar-img {
          border-radius: 4%;
          display: block;
          object-fit: contain;
          max-width: 100%;
          max-height: 80%;
        }
      }
    }
  }

  .similar-card-filter-wrapper {
    border: solid 0px pink;
    //width: 15%;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    text-align: center;
    justify-content: center;

    .similar-card-filter,
    .similar-card-reset,
    .similar-card-grid-view {
      padding: 1em;
      margin: 0.2em;
      border-radius: 3%;
      background-color: #52545b;
      border: solid 1px #aaa;
      cursor: pointer;
      min-width: 9em;
      position: relative;

      &.disabled {
        background-color: #36373b;
      }

      &:hover:not(.disabled) {
        background-color: #999898;
        border: solid 1px white;
      }

      .score {
        position: absolute;
        left: -2.5em;
      }

      .ignore {
        position: absolute;
        left: 7.3em;
        top: -0.05em;
        border-radius: 5%;
        opacity: 0;
        padding: 1.05em 0.5em 0.95em;

        &:hover {
          opacity: 1;
          background-color: #646569;
          border: 1px solid #424243;
        }
      }
    }

    .similar-card-reset,
    .similar-card-grid-view {
      background-color: #494a4f;
      margin-top: 0.7em;
      padding: 0.5em;
    }
  }

  .similar-card-choice-wrapper {
    border: solid 0px pink;
    //width: 65%;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;

    .similar-card-view-one {
      border: solid 0px pink;
      display: flex;
      align-items: center;
      justify-content: center;
      max-height: 100%;
      position: relative;

      .view-one-left {
        font-size: 4em;
        cursor: pointer;
        user-select: none;
        position: absolute;
        right: 90%;
      }

      .card-similar-right {
        height: 100%;
        //width: 60%;

        .card-similar-img-container-pick {
          border: solid 0px pink;
          padding: 1em;
          height: 100%;
          justify-content: center;
          align-items: center;
          display: flex;
          flex-direction: column;
          min-width: 200px;

          .card-large-similar-img-pick {
            border-radius: 4%; //dude css class exists for a reason you dumdum
            display: block;
            object-fit: contain;
            //max-width: 100%;
            //max-height: 100%;

            max-width: 100%;
            max-height: 80%;
          }

          .card-score {
            position: relative;
            margin-top: 0.5em;
            top: 0;
          }
        }
      }

      .view-one-right {
        font-size: 4em;
        cursor: pointer;
        user-select: none;
        position: absolute;
        left: 90%;
      }
    }

    .similar-card-choice-buttons-wrapper {
      border: solid 0px pink;
      display: flex;
      flex-direction: row;
      flex-wrap: nowrap;
      justify-content: center;
      margin-top: 1em;
      height: 4em;

      .similar-card-button {
        padding: 1em;
        margin: 0.2em;
        border-radius: 3%;
        background-color: #52545b;
        border: solid 1px #aaa;
        cursor: pointer;

        &:hover {
          background-color: #999898;
          border: solid 1px white;
        }
      }
    }

    .similar-card-choice-selected {
      display: flex;
      flex-direction: row;
      flex-wrap: nowrap;
      flex: 1;

      .similar-card-choice-selected-card {
        border-radius: 4%; //dude css class exists for a reason you dumdum
        width: 115px; //mouais
        display: block;
        margin: 0.2em;
        object-fit: contain;
      }
    }
  }

  .card-large-link {
    top: 86%;
    left: auto;
  }

  .card-large-similar-img:hover ~ .card-large-link {
    opacity: 0.75;
  }

  .card-large-similar-img-pick:hover ~ .card-large-link {
    opacity: 0.75;
  }
}
//
//div:active:after {
//  content: attr(title);
//  padding: 2px;
//  border: 1px solid #ccc;
//  color: black;
//  background: #f6f6f6;
//  position: absolute;
//  width: 100px;
//}

//a:active { //make it a class
//  margin-top: 2px;
//  margin-bottom: -2px;
//}

.bouncy {
  &:active {
    margin-top: 2px;
    margin-bottom: -2px;
  }
}

.selection {
  text-align: left;
}

.select2-search {
  width: 14.4em;
  height: 2em;
  font-size: 1.1em;
}

.select2-container--default.select2-container--focus
  .select2-selection--multiple {
  //border: solid #ced4da 1px;
  border: unset;
}

.select2-container--default .select2-selection--multiple {
  background-color: #3c4146;
}
.select2-container--default
  .select2-selection--multiple
  .select2-selection__choice {
  background-color: #000;
}
.select2-container--default .select2-search--inline .select2-search__field {
  background-color: white;
  color: #495057;
  border: unset;
}
.select2-results__option {
  background-color: black;
  width: 15.6em;
}
.select2-results {
  background-color: black;
  width: 15.6em;
}
.select2-container--default .select2-results__option--selected {
  background-color: #423f3f;
}
.select2-container--default
  .select2-results__option--highlighted.select2-results__option--selectable {
  background-color: #81868c;
}
.select2-container--default .select2-selection--multiple {
  //border: solid #ced4da 1px;
  border: unset;
  background-color: unset;
}
.hideSearch {
  display: none;
}

.select2-container .select2-search--inline .select2-search__field {
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  padding-left: 0.5em;
  line-height: 2;
  height: 1.8em;
}

.booster-game-wrapper,
.booster-game-wrapper-anyway {
  position: fixed;
  top: 0;
  left: 20px;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  flex-direction: column;

  .booster-game-wrapper-inner {
    background-color: #00020f;
    border-radius: 4%;
    padding: 1.1em;
  }

  .booster-game-set-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    min-height: 40px;

    .booster-game-set-img {
      filter: invert(1);
      width: 100px;
    }

    .booster-game-set-release {
      font-size: 0.6em;
      color: rgb(160, 160, 160);
    }
  }

  .booster-game-div {
    min-width: 290px;
    max-width: 440px;
    padding: 20px;
    color: white;
    border-radius: 2%;
    background-color: #21252f;
    margin: 0.6em;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;

    .booster-game-remaining {
      font-size: 0.6em;
      color: rgb(160, 160, 160);
    }

    .open {
      &.deactivated {
        background-color: #6b6b6b;
        cursor: unset;
      }
    }

    &:not(.deactivated):hover {
      background-color: #2f3441;
    }
  }
}

.booster-opening-wrapper {
  width: 100%;
  height: 100%;
  cursor: pointer;
  display: flex;
  position: relative;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  flex-grow: 1;
  overflow: hidden;

  canvas {
    // border: 1px solid black;
  }

  .booster {
    height: 100%;
    width: 100%;
    flex-shrink: 0;
    flex-grow: 0;
    transform: translateY(100vh);
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: absolute;
    cursor: pointer;

    filter: drop-shadow(0px 0px 35px white);

    animation: scrollItemInFromTop 0.5s ease-out forwards;

    &.floating {
      animation: float 6s ease-in-out infinite, zooming 6s ease-in-out infinite,
        rotatingHeavy 12s ease-in-out infinite;
    }

    &.leaving {
      animation: scrollItemOutBottom 2s ease-in forwards;
    }

    &.fadeout {
      animation: fadeOut 1.5s ease-in forwards;
    }

    &:not(.leaving):hover {
      animation: shake 1s infinite;
    }
  }

  .booster-opening {
    height: 100%;
    max-height: 100vh;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    width: 100%;
    flex-shrink: 0;
    flex-grow: 0;
    transform: translateY(100vh);
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: absolute;

    animation-name: scrollItemIn;
    animation-duration: 0.5s;
    animation-timing-function: ease-out;
    animation-fill-mode: forwards;

    .card {
      position: absolute;
      background-size: cover;
      background-position: center;
      background-color: #444;
      background-image: url("../Magic_card_back.jpg");
      border: 1px solid #ccc;
      cursor: pointer;
      border-radius: 4%;
      user-select: none;
      -webkit-user-select: none;

      &.floating {
        transform: translatey(0px);
        animation: float 6s ease-in-out infinite,
          zooming 6s ease-in-out infinite, rotating 12s ease-in-out infinite;
      }

      &.in-front {
        &.common {
          box-shadow: 0px 0px 10px 0px #ffffff;
        }

        &.uncommon {
          box-shadow: 0px 0px 10px 5px rgb(142, 142, 253);
        }

        &.rare {
          box-shadow: 0px 0px 10px 15px rgb(255, 249, 158);
        }

        &.mythic {
          box-shadow: 0px 0px 10px 20px rgb(255, 154, 92);
        }
      }

      &.leaving {
        animation: scrollItemOut 0.4s ease-in forwards;
      }
    }

    .new-card {
      position: absolute;
      display: flex;
      width: 100%;
      height: 100%;
      font-size: 3em;
      justify-content: center;
      align-items: start;
      margin: auto;
      text-align: center;
      font-style: italic;
      animation: glow 2s ease-in-out infinite alternate;
    }

    .prices {
      position: absolute;
      display: flex;
      width: 100%;
      height: 94%;
      justify-content: center;
      align-items: end;
      margin: auto;
      text-align: center;

      .price {
        animation: fadeIn 1s;
        font-size: 1.5em;
        -webkit-text-stroke-width: 1px;
        -webkit-text-stroke-color: black;

        &.common {
          color: white;
          font-size: 1.4em;
          font-weight: 400;
        }

        &.uncommon {
          color: rgb(142, 142, 253);
          font-size: 1.7em;
          font-weight: 500;
        }

        &.rare {
          color: rgb(255, 249, 158);
          font-size: 1.9em;
          animation: glow 2s ease-in-out infinite alternate;
          font-weight: 600;
        }

        &.mythic {
          color: rgb(255, 154, 92);
          font-size: 2.1em;
          animation: glow 2s ease-in-out infinite alternate;
          font-weight: 700;
        }

        &.leaving {
          animation-name: scrollItemOut;
          animation-duration: 0.4s;
          animation-timing-function: ease-in;
          animation-fill-mode: forwards;
          transform: translateX(0%);
        }
      }
    }
  }
}

@keyframes scrollItemInFromTop {
  0% {
    transform: translateY(-100vh);
  }
  100% {
    transform: translateY(0%);
  }
}

@keyframes scrollItemIn {
  0% {
    transform: translateY(100vh);
  }
  100% {
    transform: translateY(0%);
  }
}

@keyframes scrollItemOutBottom {
  0% {
    transform: translateY(0%);
  }
  100% {
    transform: translateY(100%);
    scale: 117%;
  }
}

@keyframes scrollItemOut {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(120vh);
  }
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
  100% {
    transform: translateY(0px);
  }
}

@keyframes zooming {
  0% {
    scale: 100%;
  }
  50% {
    scale: 102%;
  }
  100% {
    scale: 100%;
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes fadeout {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes glow {
  from {
    text-shadow: 0 0 20px #f9983d;
  }
  to {
    text-shadow: 0 0 30px #f9cb62, 0 0 10px #dab348;
  }
}

@keyframes rotating {
  0% {
    transform: rotateX(0deg) rotateY(0deg);
  }
  25% {
    transform: rotateX(-5deg) rotateY(-5deg);
  }
  50% {
    transform: rotateX(0deg) rotateY(0deg);
  }
  75% {
    transform: rotateX(5deg) rotateY(5deg);
  }
  100% {
    transform: rotateX(0deg) rotateY(0deg);
  }
}

@keyframes rotatingHeavy {
  0% {
    transform: rotateX(0deg) rotateY(0deg);
  }
  25% {
    transform: rotateX(-10deg) rotateY(-10deg);
  }
  50% {
    transform: rotateX(0deg) rotateY(0deg);
  }
  75% {
    transform: rotateX(10deg) rotateY(10deg);
  }
  100% {
    transform: rotateX(0deg) rotateY(0deg);
  }
}

@keyframes shake {
  0% {
    transform: translate(1px, 1px) rotate(0deg);
  }
  10% {
    transform: translate(-1px, -2px) rotate(-1deg);
  }
  20% {
    transform: translate(-3px, 0px) rotate(1deg);
  }
  30% {
    transform: translate(3px, 2px) rotate(0deg);
  }
  40% {
    transform: translate(1px, -1px) rotate(1deg);
  }
  50% {
    transform: translate(-1px, 2px) rotate(-1deg);
  }
  60% {
    transform: translate(-3px, 1px) rotate(0deg);
  }
  70% {
    transform: translate(3px, 1px) rotate(-1deg);
  }
  80% {
    transform: translate(-1px, -1px) rotate(1deg);
  }
  90% {
    transform: translate(1px, 2px) rotate(0deg);
  }
  100% {
    transform: translate(1px, -2px) rotate(-1deg);
  }
}

// BOOSTER SUMMARY
.booster-summary-wrapper {
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, #0c0920 0%, #1a1634 50%, #2d2448 100%);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;

  .booster-summary-close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;

    i {
      color: white;
      font-size: 1.2em;
    }

    &:hover {
      background: rgba(255, 255, 255, 0.2);
      transform: scale(1.05);
    }
  }

  .booster-summary-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    gap: 30px;
    min-height: 0; // Allow flex shrinking

    .booster-summary-cards {
      display: flex;
      justify-content: center;
      align-items: center;
      flex-wrap: wrap;
      gap: 15px;
      width: 100%;
      max-width: 1200px;
      flex: 1;
      min-height: 0; // Allow flex shrinking

      .booster-summary-card {
        width: 200px;
        height: 279px; // Magic card ratio: 200px * 1.3875 ≈ 279px
        flex-shrink: 0;
        background-size: cover;
        background-position: center;
        border-radius: 12px;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        position: relative;
        overflow: hidden;
        border: 3px solid transparent;
        margin-bottom: 30px; // Space for price text below

        &::before {
          content: '';
          position: absolute;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
          background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
          opacity: 0;
          transition: opacity 0.3s ease;
        }

        &:hover {
          transform: translateY(-8px) scale(1.08);
          box-shadow: 0 16px 50px rgba(0, 0, 0, 0.6);
          z-index: 10;
        }

        .card-price {
          position: absolute;
          bottom: -25px;
          left: 50%;
          transform: translateX(-50%);
          background: rgba(0, 0, 0, 0.8);
          color: white;
          padding: 4px 8px;
          border-radius: 4px;
          font-size: 0.9em;
          font-weight: bold;
          white-space: nowrap;
          border: 1px solid rgba(255, 255, 255, 0.2);
        }

        &.common {
          border-color: #8a8a8a;
          box-shadow: 0 4px 20px rgba(138, 138, 138, 0.3);
          
          &:hover {
            border-color: #b0b0b0;
            box-shadow: 0 16px 50px rgba(138, 138, 138, 0.7);
          }
        }

        &.uncommon {
          border-color: #c6e7ff;
          box-shadow: 0 4px 20px rgba(198, 231, 255, 0.4);
          
          &:hover {
            border-color: #a0d4ff;
            box-shadow: 0 16px 50px rgba(198, 231, 255, 0.8);
          }
        }

        &.rare {
          border-color: #ffd700;
          box-shadow: 0 4px 20px rgba(255, 215, 0, 0.5);
          
          &:hover {
            border-color: #ffed4e;
            box-shadow: 0 16px 50px rgba(255, 215, 0, 0.9);
          }
        }

        &.mythic {
          border-color: #ff6b35;
          box-shadow: 0 4px 20px rgba(255, 107, 53, 0.6);
          
          &:hover {
            border-color: #ff8f69;
            box-shadow: 0 16px 50px rgba(255, 107, 53, 1.0);
          }
        }
      }
    }

    .booster-summary-actions {
      .open-new-booster-btn {
        background: #262b2f;
        border: 1px solid rgba(0, 0, 0, 0.25);
        border-bottom: 3px solid #1a1e22;
        border-radius: 4px;
        color: white;
        padding: 14px 28px;
        font-size: 1.1em;
        font-weight: bold;
        cursor: pointer;
        transition: background 200ms, transform 150ms;
        display: flex;
        align-items: center;
        gap: 10px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);

        i {
          font-size: 1.2em;
        }

        &:hover, &:focus {
          background: #33383e;
          transform: translateY(-1px);
          box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        }

        &:active {
          transform: translateY(1px);
          border-bottom-width: 1px;
        }
      }
    }
  }

  // Entrance animations
  &.animate-entrance {
    animation: fadeInUp 0.6s ease-out;
  }

  .booster-summary-card {
    opacity: 0;
    transform: translateY(30px) scale(0.9);

    &.animate-card-entrance {
      animation: cardEntrance 0.5s ease-out forwards;
    }
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardEntrance {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

// Responsive design for booster summary
@media (max-width: 1200px) {
  .booster-summary-wrapper .booster-summary-content .booster-summary-cards {
    .booster-summary-card {
      width: 170px;
      height: 236px;
    }
  }
}

@media (max-width: 1024px) {
  .booster-summary-wrapper .booster-summary-content .booster-summary-cards {
    .booster-summary-card {
      width: 150px;
      height: 208px;
    }
  }
}

@media (max-width: 768px) {
  .booster-summary-wrapper {
    .booster-summary-content {
      padding: 15px 10px;
      gap: 20px;

      .booster-summary-cards {
        gap: 10px;

        .booster-summary-card {
          width: 130px;
          height: 180px;
        }
      }

      .booster-summary-actions .open-new-booster-btn {
        padding: 12px 24px;
        font-size: 1em;
      }
    }
  }
}

@media (max-width: 480px) {
  .booster-summary-wrapper .booster-summary-content {
    padding: 10px 5px;
    gap: 15px;

    .booster-summary-cards {
      gap: 8px;

      .booster-summary-card {
        width: 110px;
        height: 153px;
        border-width: 2px;
        margin-bottom: 25px;

        .card-price {
          font-size: 0.8em;
          bottom: -20px;
        }
      }
    }

    .booster-summary-actions .open-new-booster-btn {
      padding: 10px 20px;
      font-size: 0.9em;
    }
  }
}

///////////////////// MEDIA /////////////////////////
///// Phone, tablet, etc....
// i.e small screens only
@media (max-width: 768px) {
  .tempTempWindow.popup {
    left: 0;

    .art-crop-wrapper {
      height: unset;
      margin: auto;

      .img-art-crop {
        width: 360px;
      }
    }
    .rules-wrapper {
      flex-direction: column;
      flex-wrap: nowrap;
      height: auto;
      max-height: 90vh;
      width: 95%;
      padding: 1.5em;
      border-radius: unset;
      margin: 3em auto 1em;
      text-align: justify;
      font-size: 0.9em;

      .rule-item-wrapper {
        margin-bottom: 0.5em;
        max-width: unset;
        padding: 0.8em;
      }
    }
  }

  .card-infos-wrapper
    .card-img-infos-wrapper
    .card-infos-box
    .card-infos-links {
    max-height: unset;
    flex-wrap: nowrap;

    .card-link-wrapper {
      width: auto;
    }
  }

  .card-list-wrapper .header-cards-wrapper {
    max-width: calc(100% - var(--sidebar-mini-width));
    flex-wrap: wrap;

    .form-control {
      font-size: 1em;
    }

    .header-cards {
      flex-wrap: wrap;

      .header-search-button-wrapper {
        flex-wrap: wrap;

        .search-input {
          margin: auto;
        }

        .grid-buttons {
          flex-wrap: wrap;
          margin: 0.2em auto auto;

          .filter-wrapper {
            min-width: unset;
            left: -2em;
            font-size: 0.8em;
            margin-right: 0.2em;

            .filter-row {
              margin-top: 0.2em;
            }

            .only {
              font-size: 0.7em;
            }
          }

          .sort-dropdown {
            margin-left: -145px;
          }

          .stats-wrapper {
            font-size: 0.7em;
            min-width: unset;
            left: -2.3em;
            margin-right: 0.2em;

            .stat-page {
              .chart-colors,
              .chart-cmc,
              .chart-type {
                max-width: unset !important;
              }
            }
          }

          .select-dropdown {
            margin-left: -215px;
          }
        }
      }

      .grid-title {
        margin: auto;
      }

      .slider {
        margin: 1em auto auto;
      }

      .count-card {
        margin: 0.8em auto auto;
        padding-bottom: 0.5em;
      }
    }
  }

  .deck-view-wrapper {
    .deck-view {
      justify-content: center;
    }
  }

  .deck-wrapper,
  .collection-wrapper {
    margin-left: -1.6em;

    .deck-text-area,
    .collection-text-area {
      display: unset;

      .deck_str {
        width: unset;
        font-size: 1.3em;
      }

      .collection_str {
        width: unset;
        font-size: 1.2em;
      }

      #deck_name,
      #deck_set {
        width: unset;
      }

      #deck_raw,
      #collection_raw {
        width: unset;
      }
    }

    .close-button {
      margin-right: unset;
    }
  }

  #card-prinder-page {
    .mcwrap {
      width: 100%;
      float: none;
      margin-top: 1em;
      font-size: 0.65em;
      margin-left: auto;
      margin-right: auto;
      align-items: baseline;

      .mana-cost-guess-wrapper {
        display: flex;
        justify-content: center;
        align-items: center;

        .box {
          width: 80%;
        }
      }

      .title {
        display: none;
      }

      .sol {
        font-size: 1.3em;
      }
    }

    .card-large-img-prinder.guessmc {
      overflow: hidden;
      margin-top: -50px;
    }
  }

  .login-container,
  .register-container,
  .confirmation-container,
  .register-final-container,
  #please-login-container {
    width: 88%;
  }

  .card-large-link {
    opacity: 0.75;
  }

  .similar-card-wrapper {
    font-size: 0.9em;
    display: unset;
    justify-content: unset;

    .similar-card-title {
      display: block;
      margin-top: 1em;
      margin-left: 2em;
      margin-bottom: 1em;
    }

    .similar-card-container {
      display: none;
    }

    .similar-card-filter-wrapper {
      width: 12em;
      max-height: 15em;
      flex-wrap: wrap;
      margin-left: 2em;
      justify-content: unset;

      .similar-card-filter {
        padding: 0.2em;
        min-width: 7em;
        margin-left: 1em;

        .score {
          display: none;
        }
      }

      .similar-card-reset {
        margin-top: 2em;
      }

      .similar-card-reset,
      .similar-card-grid-view {
        border: solid 2px #d7d2d2;
        margin-left: 1em;
      }
    }

    .card-large-link {
      top: 90%;
      left: 50%;
    }
  }

  .close-button {
    margin-right: 0;
    border-radius: 50%;
    background-color: #383e44;
    padding: 2px;
    width: 40px;
    height: 40px;
    text-align: center;
    line-height: 1.2em;
  }
}

.notification {
  position: fixed;
  bottom: 1em;
  left: 50%; /* Position the left side at 50% of the viewport */
  transform: translateX(
    -50%
  ); /* Shift it back by 50% of its own width to center it */
  width: 80%;
  max-width: 800px;
  background-color: rgb(255, 243, 219);
  color: rgb(50, 50, 50);
  padding: 15px;
  padding-top: 25px;
  font-size: 14px;
  text-align: left;
  box-shadow: 10px 4px 10px rgb(0 0 0);
  max-height: 50vh; /* Limit height to half of the screen */
  overflow-y: auto;
}
.notification .notification-content {
  max-height: calc(50vh - 30px); /* Ensure the close button is not hidden */
  overflow-y: auto;
}
.notification .close-btn {
  position: absolute;
  right: 5px;
  top: -5px;
  font-weight: bold;
  cursor: pointer;
  font-size: 2em;
}
.ok-notification {
  background-color: rgb(145, 194, 155);
  color: rgb(50, 50, 50);
}
.error-notification {
  background-color: rgb(255, 243, 219);
  color: rgb(50, 50, 50);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent background */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99;
}
.modal-box {
  background-color: #6a6a6a;
  padding: 20px;
  width: 90%;
  max-width: 400px; /* Adjust to control modal size on larger screens */
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 4px 9.1px rgb(71 71 71);
}
.modal-message {
  margin-bottom: 20px;
  font-size: 16px;
  color: #ffffff;
}
.modal-buttons {
  display: flex;
  justify-content: space-between;
}
.modal-buttons button {
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  border-radius: 4px;
}
.confirm-btn {
  background-color: #0d962d;
  color: white;
}
.cancel-btn {
  background-color: #404040;
  color: white;
}
