.history-overlay {
  position: fixed;
  inset: 0;
  z-index: 2120;
  display: flex;
  justify-content: center;
  align-items: center;

  pointer-events: auto;
  transition: opacity .16s ease;
}
.history-overlay::before {
  content:"";
  position:absolute;
  inset:0;
  background: rgba(11, 15, 35, 0.80);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
  z-index: 0;
}
.history-dialog {
  position: relative;
  z-index: 1;

  --history-gap: clamp(4px, 2.2vw, 10px);
  --history-pad-x: clamp(6px, 2.6vw, 10px);
  --history-col-date: clamp(60px, 22vw, 80px);
  --history-col-bet: clamp(70px, 22vw, 120px);
  --history-col-win-min: clamp(70px, 22vw, 100px);
  --history-provably-fair: clamp(16px, 22vw, 20px);

  width: min(90vw, 480px);
  height: 570px;
  max-height: 72vh;

  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;

  pointer-events: auto;
  border-radius: 18px;
  background: radial-gradient(100% 100% at 50% 0%, #A5AFDC 0%, #434F87 67.57%, #2E3866 100%);
  box-shadow: 0 0.7px 0 0 rgba(255, 255, 255, 0.55) inset,
  0 -1px 5px 0 rgba(210, 220, 239, 0.17) inset,
  0 2px 2px 0 rgba(1, 19, 42, 0.80);
  backdrop-filter: blur(20px);
  padding: 18px 10px 18px 16px;

  transition: opacity .16s ease, transform .16s ease;
}
.history.title {
  background: linear-gradient(180deg, #1b213d 0%, #2C3560 32%, #2C3560 72%, #1f2646 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  font-family: var(--basic-font);
  font-size: 16px;
  font-style: normal;
  font-weight: 900;
  line-height: normal;
  position: relative;
  display: inline-block;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: visible;
  text-align: center;
}
.title::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 -0.5px 0 rgba(36, 44, 79, 0.55), 0 0.5px 0 rgba(176, 187, 211, 0.85);
  filter: none;
  transform: none;
}
.history-divider {
  width: 100%;
  height: 1px;
  margin: 8px 0;
  background: linear-gradient(90deg,
  rgba(255, 255, 255, 0.00) 4.31%,
  rgba(255, 255, 255, 0.13) 49.04%,
  rgba(255, 255, 255, 0.00) 100%);
  flex: 0 0 auto;
  align-self: stretch;
}
.history-head {
  display: grid;
  grid-template-columns:
    minmax(0, var(--history-col-date))
    minmax(0, var(--history-col-bet))
    minmax(var(--history-col-win-min), 1fr)
    minmax(28px, 30px);
  column-gap: 6px;
  align-items: center;
  padding: 6px var(--history-pad-x) 6px 6px;

  color: #fff;
  font-family: var(--basic-font);
  font-size: clamp(12px, 3.8vw, 14px);
  font-style: normal;
  font-weight: 700;
  line-height: clamp(16px, 4.8vw, 18px);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.50);
}
.history-head > * {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-col--bet,
.history-col--mult,
.history-col--win {
  text-align: center;
}
.history-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: clamp(1px, 6vw, 4px);

  display: flex;
  flex-direction: column;
}
.history-row {
  display: grid;
  grid-template-columns:
    minmax(0, var(--history-col-date))
    minmax(0, var(--history-col-bet))
    minmax(var(--history-col-win-min), 1fr)
    minmax(28px, 30px);
  column-gap: 6px;
  align-items: center;
  padding: 6px var(--history-pad-x) 6px 6px;
}
.history-row > * {
  min-width: 0;
}
.history-row:nth-child(odd) {
  border-radius: clamp(6px, 3.8vw, 8px);
  background: linear-gradient(
          90deg,
          rgba(44, 42, 90, 0.56) 0%,
          rgba(107, 116, 166, 0.56) 48.56%,
          rgba(44, 42, 90, 0.56) 97.93%
  );
  box-shadow:
          0 1px 3px 0 rgba(15, 0, 37, 0.50) inset,
          0 1px 2px 0 rgba(0, 0, 0, 0.25);
}
.history-date {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #D3DBFF;
  font-family: var(--basic-font);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}
.history-time {
  font-size: clamp(10px, 3.8vw, 12px);
  font-weight: 600;
  line-height: clamp(14px, 4.4vw, 16px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-day {
  font-size: clamp(10px, 3.5vw, 12px);
  font-weight: 600;
  line-height: clamp(13px, 4.0vw, 15px);
  opacity: 0.95;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-bet,
.history-win {
  text-align: center;
  color: #fff;
  font-family: var(--basic-font);
  font-size: clamp(12px, 2vw, 14px);
  font-style: normal;
  font-weight: 800;
  line-height: 13px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.50);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-mult {
  height: clamp(28px, 9.5vw, 36px);
  border-radius: clamp(9px, 3.8vw, 11px);
  display: flex;
  padding: 0 clamp(6px, 2.2vw, 8px);
  text-align: center;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  background: linear-gradient(0deg, rgba(171, 194, 223, 0.80) -17.31%, rgba(210, 220, 239, 0.80) 115.04%);
  box-shadow:
          0 0 3px 0 rgba(255, 255, 255, 0.25) inset,
          0 1px 1px 0 rgba(255, 255, 255, 0.50) inset,
          0 1px 2px rgba(9, 33, 63, 0.35);
  filter: none;
  overflow: hidden;
  font-family: var(--basic-font);
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #303A69;
  font-style: normal;
  font-weight: 900;
}
.history-provably-fair {
  width: clamp(30px, 2vw, 50px);
  height: auto;
}
.history-dialog .history-mult {
  font-size: clamp(14px, 4vw, 16px);
  line-height: 18px;
}
.history-mult.is-win {
  background: linear-gradient(270deg, #D89702 11.61%, #FEDD09 68.43%, #F9F104 97.09%);
}
.history-mult.is-big-win {
  background: linear-gradient(270deg, #D85402 11.61%, #FE9409 68.43%, #F9A304 97.09%);
}
.history-footer{
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  padding-top: 14px;
  padding-right: 6px;
}
.history-load {
  width: clamp(114px, 40vw, 130px);
  height: clamp(39px, 12vw, 42px);
  border: 0;
  border-radius: clamp(12px, 4.5vw, 14px);
  cursor: pointer;
  display: grid;
  place-items: center;

  background: radial-gradient(100% 100% at 50% 0%,
  #B7C9E9 0%,
  #92A6CA 57.77%,
  #717FA9 100%);
  box-shadow:
          0 0.6px 0 rgba(255, 255, 255, 0.55) inset,
          0 1.7px 1.7px rgba(0, 0, 0, 0.50);
}
.history-load:active{
  transform: translateY(1px) scale(.98);
}
.history-load:focus{
  outline: none;
}
.history-load-txt{
  font-family: var(--basic-font);
  font-size: clamp(14px, 4.2vw, 16px);
  font-style: normal;
  font-weight: 800;
  line-height: clamp(16px, 4.8vw, 18px);
  color: #485074;
  display: inline-block;
  filter: url(#filterTextInnerShadow_0_1_1_50);
}
.history-scroll::-webkit-scrollbar {
  width: 4px;
}
.history-scroll::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(15, 18, 45, 0.18);
}
.history-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, #B2BDD4 0%, #9EB0CC 100%);
}
#history-close-btn {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  /*right: var(--console-pad-x);*/
  right: max(env(safe-area-inset-right), 2%);
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(
          100% 100% at 50% 0%,
          #B7C9E9 0%,
          #92A6CA 57.77%,
          #717FA9 100%
  );
  display: grid;
  place-items: center;
  pointer-events: auto;
}
#history-close-btn .icon {
  width: 26px;
  height: 26px;
  position: absolute;
  z-index: 1;
  top: 53%;
  left: 50%;
  transform: translate(-50%, -50%);
  line-height: 0;
}
#history-close-btn .x {
  position: absolute;
  inset: 0;
  width: 19px;
  height: 19px;
  margin: auto;
  display: block;
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.history-dialog {
  position: relative;
}
.history-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 32px);

  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;

  color: #fff;
  font-family: var(--basic-font);
  font-size: clamp(16px, 5vw, 22px);
  font-weight: 800;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);

  pointer-events: none;
  z-index: 3;
}
.history-empty.hidden {
  display: none;
}
.history-scroll:has(> *) + .history-empty {
  display: none;
}
.history-action {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.history-provably-fair {
  justify-self: end;
}
@media (max-width: 375px) and (orientation: portrait) {
  .history-win, .history-bet {
    font-size: 10px;
  }
}
/* region Loading */
.history-load-wrap {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}
.history-spinner {
  position: relative;
  width: 38px;
  height: 38px;
  animation: history-loading 2s linear infinite;
}
.history-bubble-1,
.history-bubble-2 {
  position: absolute;
  left: 50%;
  width: 18px;
  height: 18px;
  margin-left: -11px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #d3dbff 0%, #b2bdd4 45%, #a5afdc 100%);
  box-shadow: 0 0 10px rgba(28, 35, 67, 0.57), inset 0 1px 1px rgba(255, 255, 255, 0.45);
  animation: history-bounce 2s ease-in-out infinite;
}
.history-bubble-1 {
  top: 0;
}
.history-bubble-2 {
  bottom: 0;
  animation-delay: -1s;
}
@keyframes history-loading {
  100% {
    transform: rotate(360deg);
  }
}
@keyframes history-bounce {
  0%,
  100% {
    transform: scale(0.5);
    opacity: 0.55;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}
/* endregion */