/* Override WordPress Theme Widget Container Styles */
.widget_stx_leaderboard_widget {
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

/*--------------------
Leaderboard
--------------------*/
.stx-leaderboard,
.stx-leaderboard *,
.stx-leaderboard *::before,
.stx-leaderboard *::after {
  box-sizing: content-box !important;
}

.stx-leaderboard {
  position: relative;
  width: 100%;
  margin: 0 !important;
  background: linear-gradient(to bottom, #3a404d, #181c26);
  border-radius: 10px;
  box-shadow: 0 7px 30px rgba(62, 9, 11, .3);
  font-family: 'Open Sans', sans-serif;
}

.stx-leaderboard h1 {
  font-size: 18px;
  color: #e1e1e1;
  padding: 8px 13px 12px;
  margin: 0;
  text-transform: none;
}

.stx-leaderboard h1 svg {
  width: 25px;
  height: 26px;
  position: relative;
  top: 3px;
  margin-right: 6px;
  vertical-align: baseline;
}

.stx-leaderboard ol {
  counter-reset: leaderboard;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stx-leaderboard ol li {
  position: relative;
  z-index: 1;
  font-size: 14px;
  counter-increment: leaderboard;
  padding: 12px 10px 12px 50px;
  cursor: pointer;
  backface-visibility: hidden;
  transform: translateZ(0) scale(1.0, 1.0);
  background: none;
  margin-bottom: 0;
}

.stx-leaderboard ol li::before {
  content: counter(leaderboard);
  position: absolute;
  z-index: 2;
  top: 4px;
  left: 15px;
  width: 20px;
  height: 20px;
  line-height: 20px;
  color: #c24448;
  background: #fff;
  border-radius: 20px;
  text-align: center;
}

.stx-leaderboard ol li mark {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 5px 10px 19px 50px;
  margin: 0;
  background: none;
  color: #fff;
}

.stx-leaderboard ol li mark::before, 
.stx-leaderboard ol li mark::after {
  content: '';
  position: absolute;
  z-index: 1;
  bottom: -11px;
  left: -9px;
  border-top: 10px solid #c24448;
  border-left: 10px solid transparent;
  transition: all .1s ease-in-out;
  opacity: 0;
}

.stx-leaderboard ol li mark::after {
  left: auto;
  right: -9px;
  border-left: none;
  border-right: 10px solid transparent;
}

.stx-leaderboard ol li small {
  position: relative;
  z-index: 2;
  display: block;
  text-align: right;
  color: white;
  padding-right: 15px;
}

.stx-leaderboard ol li::after {
  content: '';
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fa6855;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .08);
  transition: all .3s ease-in-out;
  opacity: 0;
}

.stx-leaderboard ol li:nth-child(1) {
  background: #fa6855;
}
.stx-leaderboard ol li:nth-child(1)::after {
  background: #fa6855;
}

.stx-leaderboard ol li:nth-child(2) {
  background: #e0574f;
}
.stx-leaderboard ol li:nth-child(2)::after {
  background: #e0574f;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .08);
}
.stx-leaderboard ol li:nth-child(2) mark::before, 
.stx-leaderboard ol li:nth-child(2) mark::after {
  border-top: 6px solid #ba4741;
  bottom: -7px;
}

.stx-leaderboard ol li:nth-child(3) {
  background: #d7514d;
}
.stx-leaderboard ol li:nth-child(3)::after {
  background: #d7514d;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .11);
}
.stx-leaderboard ol li:nth-child(3) mark::before, 
.stx-leaderboard ol li:nth-child(3) mark::after {
  border-top: 2px solid #b0433f;
  bottom: -3px;
}

.stx-leaderboard ol li:nth-child(4) {
  background: #cd4b4b;
}
.stx-leaderboard ol li:nth-child(4)::after {
  background: #cd4b4b;
  box-shadow: 0 -1px 0 rgba(0, 0, 0, .15);
}
.stx-leaderboard ol li:nth-child(4) mark::before, 
.stx-leaderboard ol li:nth-child(4) mark::after {
  top: -7px;
  bottom: auto;
  border-top: none;
  border-bottom: 6px solid #a63d3d;
}

.stx-leaderboard ol li:nth-child(5) {
  background: #c24448;
  border-radius: 0 0 10px 10px;
}
.stx-leaderboard ol li:nth-child(5)::after {
  background: #c24448;
  box-shadow: 0 -2.5px 0 rgba(0, 0, 0, .12);
  border-radius: 0 0 10px 10px;
}
.stx-leaderboard ol li:nth-child(5) mark::before, 
.stx-leaderboard ol li:nth-child(5) mark::after {
  top: -9px;
  bottom: auto;
  border-top: none;
  border-bottom: 8px solid #993639;
}

.stx-leaderboard ol li:hover {
  z-index: 2;
  overflow: visible;
}
.stx-leaderboard ol li:hover::after {
  opacity: 1;
  transform: scaleX(1.06) scaleY(1.03);
}
.stx-leaderboard ol li:hover mark::before, 
.stx-leaderboard ol li:hover mark::after {
  opacity: 1;
  transition: all .35s ease-in-out;
}

/*--------------------
Modal Styles
--------------------*/
.stx-modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.8);
  z-index: 999999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.stx-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.stx-modal-content {
  position: relative;
  width: 82rem;
  max-width: 95vw;
  background: #181c26;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  color: white;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  box-sizing: border-box !important;
}
.stx-modal-overlay.active .stx-modal-content {
  transform: scale(1);
}

.stx-modal-content.spin-away {
  animation: spinAway 2s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

@keyframes spinAway {
  0% {
    transform: scale(1) translate(0, 0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: scale(0.1) translate(-200vw, -200vh) rotate(-1440deg);
    opacity: 0;
  }
}

.stx-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.stx-modal-close:hover {
  color: #f2606f;
}

#stx-modal-title {
  margin-top: 0;
  color: #38bdf8;
  font-size: 24px;
}

.stx-bar-chart {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.stx-bar-row {
  display: flex;
  align-items: center;
}
.stx-bar-label {
  width: 250px;
  font-size: 14px;
  color: #e1e1e1;
  text-align: right;
  margin-right: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box !important;
}
.stx-bar-track {
  flex: 1;
  background: #3a404d;
  height: 20px;
  border-radius: 10px;
  overflow: hidden;
  box-sizing: border-box !important;
}
.stx-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 10px;
  transition: width 1s ease-out;
  box-sizing: border-box !important;
}
.stx-bar-value {
  width: 50px;
  margin-left: 10px;
  font-weight: bold;
  box-sizing: border-box !important;
}

/* D3 Chart Styles */
.chart-wrapper {
	width: 100%;
	height: 400px;
	background-color: transparent;
	position: relative;
    margin-top: 20px;
}

.chart-wrapper path {
	stroke: #181c26;
	cursor: pointer;
	transition: fill 250ms;
}
.chart-wrapper path:hover {
	fill: #fff !important;
}

.chart-wrapper text {
	font-size: 1em;
	font-weight: bold;
	text-transform: uppercase;
	letter-spacing: .5px;
    fill: #fff !important;
}

.chart-wrapper polyline {
	fill: none;
	stroke: #fff;
	stroke-width: 2px;
	stroke-dasharray: 5px;
}

.stx-replay-btn {
  text-transform: uppercase;
  cursor: pointer;
  padding: 5px 10px;
  outline: none;
  font-size: .8em;
  background-color: transparent;
  color: #fff;
  border: 1px solid #fff;
  letter-spacing: 1px;
  transition: all 250ms;
}
.stx-replay-btn:hover {
  background-color: #fff;
  color: #181c26;
  box-shadow: 0 0 2px #fff;
}
.stx-replay-btn:active {
  opacity: 0.5;
}

.stx-modal-header {
  text-align: center;
  margin-bottom: 20px;
}

#stx-modal-title {
  font-weight: 400;
  font-family: 'Bebas Neue', sans-serif;
  margin: 0;
  font-size: 48px;
  color: #fff;
  line-height: 1;
}

.stx-modal-header p {
  color: #a8dadc;
  margin: 5px 0 0 0;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

:root {
  --duration: 6s;
  --wave-duration: calc(var(--duration) * 0.25);
  --text-in-delay: calc(var(--duration) * 0.275);
  --text-in-duration: calc(var(--duration) * 0.1);
  --easing: cubic-bezier(0.5, 0, 0.5, 1);
  --dot-color: #ffd950;
  --dot-color-dark: #977a12;
}

.container-splitting {
  display: grid;
  align-items: center;
  justify-items: center;
}
.container-splitting > * {
  grid-area: 1 / 1;
}

#stx-modal-title.title .char {
  --distance-percent: 0.5; /* Default fallback if splitting doesn't set it */
  --delay: calc(var(--text-in-delay) + (0.25s * (1 - var(--distance-percent))));
  animation: text-in var(--text-in-duration) var(--easing) var(--delay) backwards;
  transform-origin: center 1em;
}

@keyframes text-in {
  0% {
    opacity: 0;
    transform: translateX(calc(-0.4em * var(--char-offset, 0))) scale(0);
  }
  90% {
    transform: translateX(0em) scale(1.1);
  }
}

#stx-modal-title.title .char[data-char="t"],
#stx-modal-title.title .char[data-char="i"],
#stx-modal-title.title .char[data-char="T"],
#stx-modal-title.title .char[data-char="I"] {
  visibility: hidden;
  --squish-scale: 0.6;
  --squish-y: 10%;
}

#stx-modal-title.title .char[data-char="t"]:before,
#stx-modal-title.title .char[data-char="i"]:before,
#stx-modal-title.title .char[data-char="T"]:before,
#stx-modal-title.title .char[data-char="I"]:before {
  content: attr(data-char);
  animation: text-squish var(--duration) var(--easing) forwards;
  visibility: visible;
  transform-origin: center 1em;
}

#stx-modal-title.title .char[data-char="i"],
#stx-modal-title.title .char[data-char="I"] {
  --squish-scale: 0.9;
  --squish-y: 5%;
}

@keyframes text-squish {
  47.5%, 52.5% { transform: none; }
  50% { transform: translateY(calc(var(--squish-y) * 1)) scaleY(calc(var(--squish-scale) * 1)); }
}

#stx-modal-title.title .char:last-child {
  animation: text-in var(--text-in-duration) var(--easing) var(--delay) backwards, text-bonk var(--duration) var(--easing) forwards;
}

@keyframes text-bonk {
  80%, 85%, to { transform: none; }
  82% { transform: translateX(-20%); }
}

.dot {
  font-size: 48px;
  width: 1em;
  height: 1em;
  animation: dot var(--duration) var(--easing) both;
}

.dot-inner {
  animation: dot-inner var(--duration) var(--easing) both;
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  align-items: center;
  justify-items: center;
}
.dot-inner > * {
  grid-area: 1 / 1;
}

.dot-wave {
  width: 200%;
  height: 200%;
  fill: var(--dot-color);
  animation: wave-in var(--wave-duration) var(--easing);
  --offset-x: -110%;
}

@keyframes wave-in {
  0% { transform: translateY(100%) translateX(var(--offset-x)); }
  70% { transform: translateY(30%) translateX(0%); }
}

.dot-wave.background {
  fill: var(--dot-color-dark);
  animation-duration: calc(0.95 * var(--wave-duration));
  --offset-x: 110%;
}

@keyframes dot {
  from { opacity: 0; transform: scale(3); }
  10% { opacity: 1; transform: scale(3); }
  15% { transform: scale(3) translateY(0.5em) scaleY(1.5); }
  20% { transform: scale(1) translateY(-300%); }
  30% { transform: translateY(1em) scaleY(0.5); }
  40% { transform: translateY(-400%); }
  50% { transform: translateY(-1em); }
  53% { transform: translateY(-300%); }
  56% { transform: translateY(-1em); }
  59% { transform: translateY(-200%); }
  62% { transform: translateY(1em); }
  80%, 90%, to { transform: translateY(1em); }
}

@keyframes dot-inner {
  from, 45% { transform: none; }
  70% { transform: translateX(6em); animation-timing-function: cubic-bezier(0.5, 0, 1, 0); }
  80% { transform: translateX(4.3em); animation-timing-function: var(--easing); }
  83%, to { transform: translateX(4.4em); }
}
