:root {
  --spellbook-gap: 12px;
  --tooltip-color-secondary: #bbac94;
  --tooltip-padding: 1rem;
  --tooltip-image-size: 3rem;
  --tooltip-image-padding: calc(
    var(--tooltip-image-size) + var(--tooltip-padding) / 2
  );
  --rotation-event-width: 50px;
}

.ffxiv-ui-background {
  --ffxiv-ui-background-dot: radial-gradient(
    rgba(31, 48, 75, 0.5) 1px,
    transparent 0
  );
  --ffxiv-ui-background-dot-spacing: 4px;
  --ffxiv-ui-background-dot-offset: 1rem;
  background: var(--ffxiv-ui-background-dot), var(--ffxiv-ui-background-dot),
    linear-gradient(
      to bottom,
      #3d578f var(--ffxiv-ui-background-dot-offset),
      #3d4b69 calc(var(--ffxiv-ui-background-dot-offset) * 2),
      #3d4b69
    );
  background-position:
    0 0,
    calc(var(--ffxiv-ui-background-dot-spacing) / -2)
      calc(var(--ffxiv-ui-background-dot-spacing) / -2),
    0;
  background-size:
    var(--ffxiv-ui-background-dot-spacing)
      var(--ffxiv-ui-background-dot-spacing),
    var(--ffxiv-ui-background-dot-spacing)
      var(--ffxiv-ui-background-dot-spacing),
    auto;
}

.tooltip {
  white-space: nowrap;
}

.tooltip-link {
  color: var(--MAIN-LINK-color);
  line-height: 1.15rem;
}

.tooltip-image {
  display: inline-block;
  width: 1rem;
  height: 1rem;
}

.tooltip-image img {
  display: inline-block;
  position: relative;
  top: 0.15rem;
  vertical-align: baseline;
  margin: 0;
  width: auto;
  max-height: 100%;
}

.tooltip-popup-wrapper {
  position: fixed;
  z-index: 100;
  box-shadow: 0 0 0.25rem 0.25rem #182326;
}

.tooltip-popup {
  padding: var(--tooltip-padding);
  width: 24rem;
  height: auto;
  color: #ffffff;
  font-weight: normal;
  font-size: 0.8rem;
  text-shadow: 1px 1px rgba(0, 0, 0, 0.75);
}

.tooltip-popup-header {
  display: flex;
  position: relative;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex;
  box-shadow: 0 1px 0 0 rgba(71, 110, 188, 1);
  padding-top: calc(var(--tooltip-padding) / 2);
  padding-left: var(--tooltip-image-padding);
  height: auto;
}

.tooltip-popup-header > * {
  height: calc(var(--tooltip-image-size) / 2);
}

.tooltip-popup-header p {
  margin: 0;
}

.tooltip-popup-number {
  flex-basis: 25%;
  font-size: 1.1rem;
  text-align: right;
}

.tooltip-popup-title {
  flex-basis: 75%;
  font-size: 1.1rem;
  white-space: nowrap;
}

.tooltip-popup-image {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--tooltip-image-size);
  height: var(--tooltip-image-size);
}

.tooltip-popup-image img {
  box-shadow: 0px 1px 1px 0px #182326;
  border: solid 1px #000;
  border-radius: 10%;
  width: auto;
  max-height: 100%;
}

.tooltip-popup-type {
  flex-basis: 35%;
  color: var(--tooltip-color-secondary);
}

.tooltip-popup-range,
.tooltip-popup-range > * {
  display: flex;
  justify-content: flex-end;
  margin: 0;
  line-height: 1rem;
}

.tooltip-popup-range > * + * {
  margin-left: 1em;
}

dt {
  font-style: normal;
}

dd {
  list-style: none;
}

.tooltip-popup-range dt {
  opacity: 0.5;
}

.tooltip-popup-range dt + dd {
  margin-left: 0.25rem;
}

.tooltip-popup-cast {
  display: flex;
  flex: 0 0 calc(100% + var(--tooltip-image-padding));
  align-content: flex-end;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 0;
  margin-left: calc(var(--tooltip-image-padding) * -1);
  height: auto;
  text-align: right;
}

.tooltip-popup-cast > * {
  position: relative;
  width: 30%;
}

.tooltip-popup-cast > *:not(:empty)::before {
  position: absolute;
  bottom: -0.15rem;
  left: 0;
  border-radius: 1em;
  background: rgba(255, 255, 255, 0.1);
  width: 100%;
  height: 0.5rem;
  content: '';
}

.tooltip-popup-cast dd {
  margin-top: 0;
  font-size: 1.1rem;
  line-height: 1.1rem;
}

.tooltip-popup-cast dt {
  color: var(--tooltip-color-secondary);
}

.tooltip-popup-description {
  margin-top: 0.5rem;
}

.tooltip-popup p {
  margin: 0;
  line-height: 1rem;
}

.etro-gearset {
  position: relative;
  margin: auto;
  width: 45em;
  height: 40em;
}

.etro-gearset iframe {
  border: 0;
  width: 100%;
  height: 100%;
}

.fab,
.fas {
  width: 1.1rem;
  text-align: center;
}

.tooltip-popup-additional-info div {
  display: flex;
  justify-content: flex-start;
  margin: 0;
  line-height: 1rem;
}

.tooltip-popup-range > * + * {
  margin-left: 1em;
}

.tooltip-popup-additional-info dt {
  color: rgb(0, 204, 34);
}

.tooltip-popup-additional-info dt + dd {
  margin-left: 0.25rem;
}

.spell-list p {
  margin: 0;
}

.spell-list-number-cell {
  text-align: center;
}

.spell-list-nowrap-cell {
  white-space: nowrap;
}

.death-vulnerability-table-wrapper-label {
  float: left;
  cursor: pointer;
  margin: 0 5px 0 0;
  border-radius: 5px 5px 0 0;
  background: var(--MENU-SECTIONS-BG-color);
  padding: 12px 15px 10px 15px;
  &.death-vulnerability-table-wrapper-label--active {
    background: var(--MENU-SECTION-ACTIVE-CATEGORY-BG-color);
  }
}

.death-vulnerability-table-data-row {
  display: none;
  &.death-vulnerability-table-data-row--active {
    display: table-row;
  }
}

.death-vulnerability-table th {
  text-align: center;
  white-space: nowrap;
}

.death-vulnerability-table td {
  text-align: center;
}

.death-vulnerability-table-name-cell {
  width: 20%;
  text-align: left;
  white-space: nowrap;
}

.death-vulnerability-table-green-check,
.death-vulnerability-table-red-cross {
  font-weight: bold;
  font-size: 2rem;
  text-shadow:
    -1px -1px 0 #000,
    -1px 1px 0 #000,
    1px -1px 0 #000,
    1px 1px 0 #000;
}

.death-vulnerability-table-green-check {
  color: #00cc22;
}

.death-vulnerability-table-red-cross {
  color: #cc2200;
}

.spellbook-wrapper {
  margin: auto;
  width: calc(48px * 4 + var(--spellbook-gap) * 8);
}

.spellbook-wrapper-page-labels {
  display: flex;
  justify-content: flex-start;
  margin: 0 0 -1px 0;
  font-size: 1.1rem;
}

.spellbook-wrapper-page-label {
  float: left;
  cursor: pointer;
  margin: 0 2px 0 0;
  border: solid 1px #fff;
  border-radius: 5px 5px 0 0;
  background: var(--MENU-SECTIONS-BG-color);
  padding: 0 0.5rem 0 0.5rem;
  &.spellbook-wrapper-page-label--active {
    background: var(--MENU-SECTION-ACTIVE-CATEGORY-BG-color);
  }
}

.spellbook {
  display: grid;
  grid-template-rows: repeat(4, 48px);
  grid-template-columns: repeat(4, 48px);
  column-gap: calc(var(--spellbook-gap) * 2);
  row-gap: calc(var(--spellbook-gap) * 3);
  align-self: center;
  margin: auto;
  border: solid 1px #fff;
  height: calc(48px * 4 + var(--spellbook-gap) * 13);
  font-size: 1.1rem;
  text-align: center;
}

.spell-loadout {
  display: grid;
  grid-template-rows: repeat(2, 48px);
  grid-template-columns: repeat(12, 48px);
  column-gap: calc(var(--spellbook-gap) / 2);
  row-gap: calc(var(--spellbook-gap) * 3);
  align-self: center;
  margin: auto;
  border: solid 1px #fff;
  width: calc(48px * 12 + var(--spellbook-gap) * 7.5);
  height: calc(48px * 2 + var(--spellbook-gap) * 7);
  font-size: 1.1rem;
  text-align: center;
}

.spellbook-spell {
  display: none;
  cursor: pointer;
  &.spellbook-spell--active {
    display: grid;
  }
}

.spellbook-spell,
.spell-loadout-spell {
  margin: var(--spellbook-gap);
  outline: solid 1px #fff;
  background: var(--MENU-SECTION-ACTIVE-CATEGORY-BG-color);
  width: 100%;
  height: 100%;
  z-index: 10;
}

.rotation {
  display: flex;
  gap: 4px;
  width: max-content;
}

.rotation-event {
  display: inline-flex;
  gap: 2px;
  width: max-content;
  height: calc(var(--rotation-event-width) * 3);
}

.rotation-event-gcd-wrapper {
  position: relative;
  width: var(--rotation-event-width);
  height: 150px;
}

.rotation-event-gcd {
  position: absolute;
  bottom: var(--rotation-event-width);
  margin-right: auto;
  margin-left: auto;
}

.rotation-event-gcd > img {
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.75);
  border-radius: 5px;
}

.rotation-event-gcd-counter {
  position: absolute;
  bottom: 0;
  width: 100%;
  font-size: 1.5rem;
  text-align: center;
}

.rotation-event-pull-wrapper {
  position: relative;
  width: calc(var(--rotation-event-width) * 0.6);
  font-size: 1.1rem;
  text-align: center;
}

.rotation-event-pull {
  margin-right: auto;
  margin-left: auto;
  background: #ccc;
  width: 10%;
  height: 80%;
}

.rotation-event-ogcd-wrapper {
  width: 36px;
  height: calc(var(--rotation-event-width) * 2);
}

.rotation-event-ogcd {
  padding-top: 75%;
  height: 70%;
}

.rotation-event-ogcd > img {
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.75);
  border-radius: 5px;
}

.rotation-event-ogcd-timebox-wrapper {
  margin: 25% 0 auto 0;
  border: solid 1px var(--MENU-SECTION-ACTIVE-CATEGORY-BG-color);
  background: var(--MENU-SECTIONS-BG-color);
  height: 30%;
  height: calc(var(--rotation-event-width) / 5);
}

.spell-loadout-builder-link-wrapper {
  font-size: 1.5rem;
  text-align: center;
}

.spell-loadout-builder-macro-wrapper {
  font-size: 1rem;
  margin-top: 2em;
  text-align: center;
}

.spell-loadout-builder-macro {
  margin: auto;
  text-align: left;
  white-space: pre;
  display: inline-block;
}