/* Tippy CSS */
.tippy-box[data-animation='fade'][data-state='hidden'] {
  opacity: 0;
}
[data-tippy-root] {
  max-width: calc(100vw - 10px);
}
.tippy-box {
  position: relative;
  background-color: #333;
  color: #fff;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.4;
  white-space: normal;
  outline: 0;
  transition-property: transform, visibility, opacity;
}
.tippy-box[data-placement^='top'] > .tippy-arrow {
  bottom: 0;
}
.tippy-box[data-placement^='top'] > .tippy-arrow:before {
  bottom: -7px;
  left: 0;
  border-width: 8px 8px 0;
  border-top-color: initial;
  transform-origin: center top;
}
.tippy-box[data-placement^='bottom'] > .tippy-arrow {
  top: 0;
}
.tippy-box[data-placement^='bottom'] > .tippy-arrow:before {
  top: -7px;
  left: 0;
  border-width: 0 8px 8px;
  border-bottom-color: initial;
  transform-origin: center bottom;
}
.tippy-box[data-placement^='left'] > .tippy-arrow {
  right: 0;
}
.tippy-box[data-placement^='left'] > .tippy-arrow:before {
  border-width: 8px 0 8px 8px;
  border-left-color: initial;
  right: -7px;
  transform-origin: center left;
}
.tippy-box[data-placement^='right'] > .tippy-arrow {
  left: 0;
}
.tippy-box[data-placement^='right'] > .tippy-arrow:before {
  left: -7px;
  border-width: 8px 8px 8px 0;
  border-right-color: initial;
  transform-origin: center right;
}
.tippy-box[data-inertia][data-state='visible'] {
  transition-timing-function: cubic-bezier(0.54, 1.5, 0.38, 1.11);
}
.tippy-arrow {
  width: 16px;
  height: 16px;
  color: #333;
}
.tippy-arrow:before {
  content: '';
  position: absolute;
  border-color: transparent;
  border-style: solid;
}
.tippy-content {
  position: relative;
  padding: 5px 9px;
  z-index: 1;
}

/* Datalol CSS */
.datalol {
  position: relative;
  display: inline-block;
  line-height: normal;

  & img {
    display: inline-block;
    margin: 0 !important;
    padding: 0 !important;
  }
  & .rune-img {
    border-radius: 50%;
    background: #020202;

    &.stone {
      background-size: 200%;
      background-position: 50% 45%;
    }
  }
  & video {
    &.vability {
      display: block;
      margin: auto;
      width: 100%;
    }
  }
  & .icon-name {
    margin-left: 4px;
  }
  & .icon-text {
    position: absolute;
    right: 0;
    bottom: 0;
    border-top-left-radius: 4px;
    background-color: #202d37;
    color: #fff;
    padding: 2px 4px;
    font-family: Beaufort-bold;
    line-height: 20px;
    min-width: 24px;
    height: 24px;
    text-align: center;
  }
}

@media (min-width: 767px) {
  .datalol {
    & video {
      &.vability {
        width: 50%;
      }
    }
  }
}

.tippy-box {
  background: none !important;
}

@font-face {
  font-family: 'Beaufort-bold';
  src: url(https://s.lolstatic.com/awesomefonts/1.0.0/Fonts/BeaufortforLOL-Bold.woff) format('woff');
  font-display: swap;
  font-weight: 700;
  font-style: normal;
}

.tooltip-container {
  --container: 1600px;
  --leftCol: 0.6;
  --centerCol: 2;
  --rightCol: 1;
  --surface1: #000a14;
  --surface2: #000205;
  --modal-overlay: rgba(0, 10, 20, 0.8);
  --text1: #fff;
  --text2: #d0a85d;
  --text3: #5c6066;
  --text4: #999;
  --text5: #cebe94;
  --text6: #fffddd;
  --accent1: hsla(0, 0%, 100%, 0.2);
  --accent2: rgba(92, 96, 102, 0.35);
  --accent3: rgba(92, 96, 102, 0.05);
  --blue: #31d7de;
  --gold: #ffc554;
  --gold-gradient: linear-gradient(90deg, #f3bb50, #ffea6a 50%, #ffc554);
  --orange1: #feb131;
  --orange2: #915917;
  --ap: #7b6dff;
  --ad: #af4f23;
  --as: #f9e18c;
  --health: #21975b;
  --mana: #49c8ff;
  --ms: #f0e5d2;
  --shield: #fff;
  --immolate: #e63710;
  --buff: #74f20e;
  --nerf: #fa134a;
  --change: #18d5ff;
  --new: #ffc333;
  --controls-height: 4rem;
  --transition: 0.2s ease;

  pointer-events: none;
  background: var(--surface1);
  padding: 1rem;
  width: 45ch;
  max-width: 90vw;
  /* border: 1px solid var(--accent1); */
  border: 2px solid #ffc55488;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1), 0 4px 5px rgba(0, 0, 0, 0.1), 0 7px 10px rgba(0, 0, 0, 0.2),
    0 13px 18px rgba(0, 0, 0, 0.2), 0 25px 33px rgba(0, 0, 0, 0.2), 0 60px 80px rgba(0, 0, 0, 0.3), 0 5px 30px #000;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans,
    Helvetica Neue, sans-serif;

  .tooltip-header {
    display: flex;
    align-items: flex-start;
  }

  .tooltip-info {
    padding-left: 1rem;
  }

  .tooltip-name {
    color: var(--text1);
    font-family: Beaufort-bold;
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.25;
    text-transform: uppercase;
  }

  .tooltip-price-container {
    display: flex;
    align-items: center;
    font-family: Beaufort-bold;
    font-size: 1.125rem;
    margin: 0;
    color: var(--text2);

    & svg {
      height: 20px;
      width: 20px;
      margin-right: 4px;
    }
  }

  .tooltip-description {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;

    & .mod-icon {
      background: url('/uploads/atlas_item_stats_d5d2f10f5e.webp');
      background-repeat: no-repeat;
      /* 130x377 => 100x290 => 5x14 */
      --aw: 100px;
      --ah: 290px;
      --sw: calc(var(--aw) / 5);
      --sh: calc((var(--ah) / 14));

      background-size: var(--aw) var(--ah);
      display: inline-block;
      position: absolute;
      left: 0;
      width: var(--sw);
      height: var(--sh);

      &.ad {
        background-position: calc(var(--sw) * -2 + 2px) calc(var(--sh) * 0 + 1px);
      }
      &.crit {
        background-position: calc(var(--sw) * -2 + 2px) calc(var(--sh) * -1 + 2px);
      }
      &.critdmg {
        background-image: url('/uploads/texticons_tft_rotational_shop_992c96a042.png');
        background-position: -19px -199px;
        background-size: 199px 420px;
        width: 19px;
        height: 19px;
      }
      &.go {
        background-image: url('/uploads/texticons_tft_rotational_shop_992c96a042.png');
        background-position: -35px -76px;
        background-size: 199px 420px;
        width: 19px;
        height: 19px;
      }
      &.bhp {
        background-image: url('/uploads/texticons_tft_rotational_shop_992c96a042.png');
        background-position: 0px -79px;
        background-size: 199px 420px;
        width: 19px;
        height: 19px;
      }
      &.bmp5 {
        background-image: url('/uploads/texticons_tft_rotational_shop_992c96a042.png');
        background-position: -18px 0px;
        background-size: 199px 420px;
        width: 19px;
        height: 19px;
      }
      &.tena {
        background-image: url('/uploads/texticons_tft_rotational_shop_992c96a042.png');
        background-position: -36px -19px;
        background-size: 199px 420px;
        width: 19px;
        height: 19px;
      }
      &.as {
        background-position: calc(var(--sw) * -2 + 2px) calc(var(--sh) * -2 + 3px);
      }
      &.oh {
        background-position: calc(var(--sw) * -2 + 2px) calc(var(--sh) * -3);
      }
      &.apen {
        background-position: calc(var(--sw) * -2 + 2px) calc(var(--sh) * -4 + 2.5px);
      }
      &.ap {
        background-position: calc(var(--sw) * -2 + 2px) calc(var(--sh) * -5 + 2px);
      }
      &.mp5 {
        background-position: calc(var(--sw) * -2 + 2px) calc(var(--sh) * -6 - 1px);
      }
      &.mpen {
        background-position: calc(var(--sw) * -2 + 2px) calc(var(--sh) * -7 - 0.5px);
      }
      &.hp {
        background-position: calc(var(--sw) * -2 + 2px) calc(var(--sh) * -8 - 1px);
      }
      &.armor {
        background-position: calc(var(--sw) * -2 + 2px) calc(var(--sh) * -9 - 2px);
      }
      &.mr {
        background-position: calc(var(--sw) * -2 + 2px) calc(var(--sh) * -10 - 2.5px);
      }
      &.cdr {
        background-position: calc(var(--sw) * -2 + 2px) calc(var(--sh) * -11 - 2.5px);
      }
      &.ms {
        background-position: calc(var(--sw) * -2 + 2px) calc(var(--sh) * -12 - 3px);
      }
      &.ov {
        background-position: calc(var(--sw) * -2) calc(var(--sh) * -13 - 4px);
      }
    }
  }

  img {
    max-width: 100%;
    height: auto;
    font-size: 0.625rem;
  }

  svg {
    fill: currentColor;
    width: 1em;
    height: 1em;
  }

  * {
    box-sizing: border-box;
  }

  maintext {
    color: var(--text4);
    font-weight: 500;
  }

  stats {
    position: relative;
    display: block;
    margin-bottom: 0.075rem;
    padding-left: 20px;
  }

  active,
  attention,
  immolate,
  ornnBonus,
  passive {
    font-weight: 700;
    color: var(--text1);
  }

  passive {
    color: var(--text2);
  }

  immolate {
    color: var(--immolate);
  }

  magicDamage,
  scaleMR {
    color: var(--ap);
  }

  physicalDamage,
  scaleArmor {
    color: var(--ad);
  }

  speed {
    color: var(--ms);
  }

  shield,
  truedamage {
    color: var(--shield);
  }

  attackSpeed {
    color: var(--as);
  }

  scaleMana {
    color: var(--mana);
  }

  healing,
  scalehealth {
    color: var(--health);
  }

  rarityMythic {
    color: var(--text2);
    font-weight: 700;
  }

  li {
    list-style: none;
    margin: 0.5rem 0;
  }

  rules {
    color: var(--text3);
  }

  audio {
    display: none;
  }

  .scroll::-webkit-scrollbar-track {
    background: transparent;
  }

  .scroll::-webkit-scrollbar-thumb {
    background: var(--text2);
    border: 2px solid var(--surface1);
    border-radius: 10px;
  }

  .scroll::-webkit-scrollbar {
    width: 10px;
  }

  @media (max-width: 1200px) {
    .tippy-popper {
      display: none !important;
    }
  }

  .item-change-modal {
    width: 93vw;
    max-width: 90ch;
    background: var(--surface1);
    padding: 3em;
    border: 1px solid var(--orange2);
  }

  .change-detail-title img,
  .item-change-modal .reference-link {
    display: block;
    float: left;
    width: 3em;
    margin-right: 1em;
    border: 2px solid var(--surface1);
    box-shadow: 0 0 0 1px var(--orange2);
  }

  .item-change-modal .reference-link img {
    display: block;
  }

  .item-change-modal .change-title {
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 2rem;
    font-size: 1.5em;
  }

  .item-change-modal .change-title + br {
    display: none;
  }

  .item-change-modal .blockquote.context {
    position: relative;
    color: var(--text4);
    border-bottom: 1px solid var(--accent2);
    padding-bottom: 1.5em;
    margin-bottom: 1.5em;
    margin-top: 2em;
  }

  .item-change-modal .blockquote.context:after,
  .item-change-modal .blockquote.context:before {
    position: absolute;
    font-size: 3em;
    opacity: 0.3;
  }

  .item-change-modal .blockquote.context:before {
    content: '\201C';
    transform: translate(-2rem, -1.5rem);
  }

  .item-change-modal .blockquote.context:after {
    content: '\201D';
    transform: translate(1rem, -0.5rem);
  }

  .item-change-modal .attribute-change {
    margin-top: 0.5rem;
    font-size: 1.125em;
  }

  .item-change-modal .attribute-change:not(:last-of-type) {
    margin-bottom: 1.25rem;
  }

  .attribute {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
    font-size: 0.875em;
    color: var(--text4);
  }

  .item-change-modal .change-indicator {
    color: var(--orange2);
    margin: 0 0.25rem;
  }

  .item-change-modal .attribute-after,
  .item-change-modal .attribute-removed {
    color: var(--text5);
  }

  .item-change-modal .change-detail-title {
    display: flex;
    align-items: center;
    text-transform: uppercase;
    margin: 2rem 0 1rem;
    font-size: 1em;
  }

  .item-change-modal .divider {
    border: none;
    border-bottom: 1px solid var(--accent2);
  }

  .attribute > :not(em) {
    --att-color: var(--text4);
    display: inline-block;
    position: relative;
    padding: 2px 6px 3px;
    margin: 0 1ch 0 0;
    font-weight: 700;
    color: var(--att-color);
    text-transform: uppercase;
  }

  .attribute > :not(em):before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: var(--att-color);
    border-radius: 3px;
    opacity: 0.2;
    transition: 0.2s ease-in-out;
  }

  .attribute:hover > :before {
    opacity: 0.3;
  }

  .attribute .updated {
    --att-color: var(--ap);
  }

  .attribute .nerf,
  .attribute .removed {
    --att-color: var(--immolate);
  }

  .attribute .buff {
    --att-color: var(--buff);
  }

  .attribute .change {
    --att-color: var(--ap);
  }

  .attribute .new {
    --att-color: var(--new);
  }

  .attribute em {
    display: block;
    color: var(--text5);
  }

  span.attribute-before {
    color: var(--text3);
  }

  .item-change-modal li {
    margin-block: 1em;
  }

  @container modal-container (max-width: 600px) {
    .item-change-modal {
      padding: 1.25em;
      font-size: 0.875em;
    }

    .item-change-modal .change-title {
      margin-bottom: 0;
    }

    .item-change-modal .blockquote.context {
      display: none;
    }

    .item-change-modal ul {
      padding: 0;
    }
  }

  @container modal-container (max-width: 400px) {
    .item-change-modal {
      font-size: 0.75em;
    }
  }
}
.item-build {
  & .item-build-main {
    --border-item: #5c6066;
    width: 300px;

    & .item-build-main {
      width: inherit;
    }

    & .item-img {
      border: 1px solid var(--border-item);
    }

    & .item-build-header {
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    & .item-build-cols {
      position: relative;
      display: flex;
      justify-content: center;
      padding-top: 1rem;

      &::before {
        content: '';
        position: absolute;
        width: 1px;
        height: 1rem;
        top: 0;
        left: 50%;
        background: var(--border-item);
      }

      & .item-build-col {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        flex: 1 1;
        width: 90px;

        &:before {
          content: '';
          width: 1px;
          height: 1rem;
          background: var(--border-item);
          margin-left: 1px;
        }

        &::after {
          content: '';
          position: absolute;
          top: 0;
          height: 1px;
          background: var(--border-item);
        }

        &:first-child:not(:only-child):after {
          left: 50%;
          width: 50%;
        }
        &:nth-child(2):after,
        &:nth-child(3):after,
        &:nth-child(4):after {
          left: 0;
          width: 100%;
        }

        &:last-child:not(:only-child):after {
          left: 0;
          width: 50%;
        }

        & .item-build-col {
          width: 40px;
        }
      }
    }
  }
}
