/*
 * The front page.
 *
 * Laid out the way the old one was, and measured against it: the feed of what
 * has just been won across the top with its own little rail of buttons, two
 * panels under it at two fifths and three fifths, then the games, the newest
 * boxes and the biggest battles.
 *
 * The sections themselves have no frame. They sit on the page and are told
 * apart by their headings, which is what made that page feel open rather than
 * boxed in.
 */

/* --------------------------------------------------------- the drop feed */

.hm-feed {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.hm-feed[hidden] {
  display: none;
}

/* The rail: what the feed is showing, and how it is sorted. */
.hm-feed-rail {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: none;
  width: 48px;
  padding: 6px;
  border-radius: 12px;
  background: #0b1424;
}

.hm-feed-rail button {
  display: grid;
  place-items: center;
  height: 100%;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
}

.hm-feed-rail button svg {
  width: 16px;
  height: 16px;
}

.hm-feed-rail button.is-on {
  background: #17223a;
  color: var(--lime);
}

.hm-drops {
  display: flex;
  gap: 10px;
  flex: 1;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
}

/*
 * A drop card: the rarity in a pill and the price beside it, the item under
 * them, and the rarity again as a glow in the two far corners. The glow is the
 * same colour as the pill, which is how the old feed read from across a room.
 */
.hm-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: none;
  width: 116px;
  height: 88px;
  padding: 8px;
  border-radius: 12px;
  background:
    linear-gradient(
      145deg,
      var(--tier) -60%,
      rgba(0, 0, 0, 0.1) 45%,
      rgba(0, 0, 0, 0.1) 65%,
      var(--tier) 160%
    ),
    rgba(4, 5, 6, 0.5);
  animation: hm-slide 320ms ease;
}

@keyframes hm-slide {
  from {
    transform: translateX(-16px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.hm-drop-top {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  justify-content: center;
}

.hm-drop-bar {
  width: 20px;
  height: 5px;
  border-radius: 999px;
  background: var(--tier);
}

.hm-drop-value {
  font-size: 10px;
  color: #fff;
}

.hm-drop img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

/* ------------------------------------------------------------ the panels */

.hm-banners {
  display: grid;
  grid-template-columns: 2fr 3fr;
  align-items: start;
  gap: 12px;
  /* The character stands out of the right panel, so the row gives him room. */
  margin: 52px 0 20px;
}

.hm-banner {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 200px;
  padding: 20px;
  border-radius: 12px;
  overflow: hidden;
}

.hm-banner-main {
  background:
    radial-gradient(120% 160% at 80% 20%, #1d2b48, #090f1b 70%);
}

.hm-banner-join {
  align-items: center;
  overflow: visible;
  background:
    radial-gradient(69% 195% at 0 100%, color-mix(in srgb, var(--gold) 42%, transparent), transparent 70%),
    #0b1424;
}

/* The dots, which is what the old panel had behind its text. */
.hm-banner-join::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px);
  background-size: 14px 14px;
  mask: radial-gradient(90% 120% at 100% 50%, #000, transparent 75%);
  pointer-events: none;
}

.hm-banner-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  max-width: 62%;
  z-index: 1;
}

.hm-banner-main .hm-banner-text b {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}

.hm-banner-join .hm-banner-text b {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
}

.hm-banner-text small {
  font-size: 12px;
  color: var(--text-dim);
}

.hm-banner-text .button {
  margin-top: 6px;
  height: 38px;
  border-radius: 10px;
}

/*
 * The artwork is drawn rather than loaded: a wheel of three slices on the left
 * panel and a coin on the right one. Nothing to fetch and nothing to go
 * missing.
 */
.hm-banner-art,
.hm-banner-coin {
  position: absolute;
  right: -20px;
  top: 50%;
  width: 210px;
  height: 210px;
  margin-top: -105px;
  pointer-events: none;
}

.hm-banner-art {
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    color-mix(in srgb, var(--gold) 80%, transparent) 0deg 120deg,
    #2f7fe0 120deg 240deg,
    #d8352a 240deg 360deg
  );
  mask: radial-gradient(circle, transparent 40%, #000 41%);
  opacity: 0.55;
}

.hm-banner-coin {
  right: 26px;
  border-radius: 50%;
  background: radial-gradient(60% 60% at 35% 30%, #ffe7a6, var(--gold) 52%, var(--gold-dark));
  box-shadow: 0 18px 60px rgba(245, 185, 66, 0.35);
  opacity: 0.9;
}

/* ---------------------------------------------------------- the sections */

.hm-section {
  margin-bottom: 22px;
}

.hm-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.hm-head h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 700;
}

.hm-head h2 svg {
  width: 22px;
  height: 22px;
  color: var(--gold);
}

/* The see all link: text with a line under it and an arrow after it. */
.hm-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: none;
  color: var(--text-dim);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.hm-more span {
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 1px;
}

.hm-more:hover {
  color: var(--gold);
}

.hm-more:hover span {
  border-color: var(--gold);
}

.hm-line {
  display: block;
  margin: -6px 0 12px;
  font-size: 12px;
  color: var(--text-faint);
}

/* ------------------------------------------------------------- the games */

.hm-games {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hm-game button {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  height: 200px;
  padding: 18px;
  border: 0;
  border-radius: 14px;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  background:
    radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 62%),
    #0b1424;
  transition: transform 160ms ease;
}

.hm-game button::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 14px 14px;
  mask: radial-gradient(80% 100% at 100% 0%, #000, transparent 70%);
}

.hm-game button:hover {
  transform: translateY(-3px);
}

.hm-game[data-game='wheel'] button {
  --accent: var(--gold);
}
.hm-game[data-game='boxes'] button {
  --accent: #2f7fe0;
}
.hm-game[data-game='battles'] button {
  --accent: #16b5a0;
}
.hm-game[data-game='upgrade'] button {
  --accent: #a855f7;
}
.hm-game[data-game='coinflip'] button {
  --accent: #e0662f;
}

.hm-game-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1;
}

.hm-game-text b {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
}

.hm-game-text small {
  font-size: 11px;
  color: var(--text-faint);
  max-width: 62%;
}

.hm-game-play {
  z-index: 1;
  display: grid;
  place-items: center;
  height: 38px;
  padding: 0 18px;
  border-radius: 10px;
  background: var(--lime);
  color: var(--on-lime);
  font-size: 13px;
  font-weight: 700;
}

/* A shape per game, big in the corner, the way the old panels had artwork. */
.hm-game-art {
  position: absolute;
  right: -24px;
  bottom: -30px;
  width: 168px;
  height: 168px;
  opacity: 0.55;
  pointer-events: none;
}

.hm-game[data-game='wheel'] .hm-game-art {
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--gold) 0deg 120deg, #2f7fe0 120deg 240deg, #d8352a 240deg 360deg);
  mask: radial-gradient(circle, transparent 44%, #000 45%);
}

.hm-game[data-game='boxes'] .hm-game-art {
  border-radius: 20px;
  background: linear-gradient(160deg, #3c8ef0, #0b1424 70%);
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.05);
}

.hm-game[data-game='battles'] .hm-game-art {
  background:
    linear-gradient(45deg, transparent 45%, #16b5a0 45% 55%, transparent 55%),
    linear-gradient(-45deg, transparent 45%, var(--gold) 45% 55%, transparent 55%);
}

.hm-game[data-game='upgrade'] .hm-game-art {
  border-radius: 50%;
  background: conic-gradient(#a855f7 0deg 162deg, #17223a 162deg 360deg);
  mask: radial-gradient(circle, transparent 62%, #000 63%);
}

.hm-game[data-game='coinflip'] .hm-game-art {
  border-radius: 50%;
  background: radial-gradient(60% 60% at 35% 30%, #ffe7a6, var(--gold) 52%, var(--gold-dark));
}

/* ------------------------------------------------------------- the boxes */

.hm-boxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 26px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hm-box button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.hm-box-art {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  transition: transform 180ms ease;
}

.hm-box button:hover .hm-box-art {
  transform: translateY(-4px) scale(1.04);
}

.hm-box-art img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.55));
}

.hm-box-tag {
  position: static;
  align-self: center;
  margin-top: -12px;
}

.hm-box-name {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.hm-box-price {
  display: grid;
  place-items: center;
  width: 100%;
  height: 32px;
  border-radius: 9px;
  background: var(--gold);
  color: var(--on-lime);
  font-size: 13px;
  font-weight: 600;
}

.hm-box-usd {
  font-size: 11px;
  color: var(--text-faint);
}

.hm-battles {
  padding: 0;
}

@media (max-width: 900px) {
  .hm-banners {
    grid-template-columns: 1fr;
  }

  .hm-banner-text {
    max-width: 100%;
  }

  .hm-banner-art,
  .hm-banner-coin {
    opacity: 0.25;
  }

  .hm-feed-rail {
    display: none;
  }
}

/* Real box artwork on the cards that have it. */
.hm-game-img {
  position: absolute;
  z-index: 0;
  bottom: -18px;
  width: 138px;
  height: 138px;
  object-fit: contain;
  filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.55));
  pointer-events: none;
}

.hm-game-img-1 {
  right: -14px;
}

.hm-game-img-2 {
  right: 68px;
  width: 104px;
  height: 104px;
  bottom: -8px;
  opacity: 0.7;
}

.hm-game[data-game='boxes'] .hm-game-art,
.hm-game[data-game='battles'] .hm-game-art {
  display: none;
}

/* ------------------------------------------------------------ the slider */

.hm-slider {
  padding: 0;
  overflow: hidden;
}

.hm-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 22px;
  opacity: 0;
  transform: translateX(14px);
  transition:
    opacity 420ms ease,
    transform 420ms ease;
  pointer-events: none;
}

.hm-slide.is-on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.hm-slide .hm-banner-text b {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}

.hm-slide-dots {
  position: absolute;
  left: 22px;
  bottom: 14px;
  display: flex;
  gap: 6px;
  z-index: 2;
}

.hm-slide-dots button {
  width: 18px;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: background-color 180ms ease;
}

.hm-slide-dots button.is-on {
  background: var(--lime);
}

.hm-slide-wheel {
  position: absolute;
  right: -26px;
  top: 50%;
  width: 216px;
  height: 216px;
  margin-top: -108px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    color-mix(in srgb, var(--gold) 85%, transparent) 0deg 120deg,
    #2f7fe0 120deg 240deg,
    #d8352a 240deg 360deg
  );
  mask: radial-gradient(circle, transparent 40%, #000 41%);
  opacity: 0.6;
  animation: hm-turn 26s linear infinite;
}

@keyframes hm-turn {
  to {
    transform: rotate(360deg);
  }
}

.hm-slide-img {
  position: absolute;
  right: 6px;
  bottom: -14px;
  width: 190px;
  height: 190px;
  object-fit: contain;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.6));
  animation: hm-float 5s ease-in-out infinite;
}

.hm-slide-img-back {
  right: 128px;
  bottom: 4px;
  width: 140px;
  height: 140px;
  opacity: 0.75;
  animation-delay: 700ms;
}

@keyframes hm-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* -------------------------------------------- the invitation on the right */

.hm-banner-join {
  justify-content: flex-end;
  gap: 18px;
}

.hm-banner-join .hm-banner-text {
  max-width: 58%;
  margin-left: auto;
}

.hm-banner-illustration {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 46%;
  height: 100%;
  pointer-events: none;
}

/*
 * The character, on the floor of the panel.
 *
 * Taller than the panel and anchored to its base, so he is cropped by it the
 * way a figure standing behind a counter is. No pointer, no tab stop: he is
 * scenery.
 */
/*
 * The character, standing out of the panel.
 *
 * The same trick as the challenge vault: he is taller than the card and
 * anchored to its floor, so his head goes past the top edge instead of being
 * cropped by it. No pointer and no tab stop: he is scenery.
 */
.hm-ill-figure {
  position: absolute;
  left: 3%;
  bottom: -4px;
  height: 252px;
  width: auto;
  max-width: 96%;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.55));
  pointer-events: none;
}

@keyframes hm-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* -------------------------------------------- the invitation on the right */

.hm-banner-join {
  justify-content: flex-end;
  gap: 18px;
}

.hm-banner-join .hm-banner-text {
  max-width: 58%;
  margin-left: auto;
}

.hm-banner-illustration {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 46%;
  height: 100%;
  pointer-events: none;
}

.hm-banner-illustration img {
  position: absolute;
  object-fit: contain;
  filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.6));
}

.hm-banner-illustration .hm-ill-0 {
  left: 16%;
  bottom: -10px;
  width: 150px;
  height: 150px;
  z-index: 2;
  animation: hm-float 5.5s ease-in-out infinite;
}

.hm-banner-illustration .hm-ill-1 {
  left: -6%;
  bottom: 14px;
  width: 112px;
  height: 112px;
  opacity: 0.8;
  animation: hm-float 6s ease-in-out infinite 400ms;
}

.hm-banner-illustration .hm-ill-2 {
  left: 46%;
  bottom: 22px;
  width: 104px;
  height: 104px;
  opacity: 0.7;
  animation: hm-float 6.4s ease-in-out infinite 800ms;
}

/* ------------------------------------------------- a little more presence */

.hm-game button {
  height: 210px;
}

.hm-game-img {
  animation: hm-float 6s ease-in-out infinite;
}

.hm-game button:hover .hm-game-img {
  animation-play-state: paused;
  transform: translateY(-6px) scale(1.04);
  transition: transform 220ms ease;
}

@media (max-width: 900px) {
  .hm-banner-join .hm-banner-text {
    max-width: 100%;
  }

  .hm-banner-illustration {
    opacity: 0.18;
  }
}


/* A game card with a clip of its own, filling the card behind the words. */
.hm-game-clip {
  /* The old site's violet, turned into this site's lime. */
  filter: url(#tw-lime);
  position: absolute;
  right: 0;
  bottom: 0;
  width: 72%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
  border-radius: 0 12px 12px 0;
  mask-image: linear-gradient(90deg, transparent, #000 26%);
  pointer-events: none;
}

/* ------------------------------------------------- the drawn card art */

/*
 * The games with no clip of their own. Same place on the card as a clip,
 * same fade off the left edge, so a row of cards reads as one row whether
 * the art was filmed or drawn.
 */
.hm-art {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 62%;
  height: 100%;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%);
  mask-image: linear-gradient(90deg, transparent, #000 30%);
}

.hm-art svg {
  width: 82%;
  height: 82%;
  overflow: visible;
}

/* ---- the wheel: three sides turning, with the mark above them */

.hm-art-spin {
  transform-origin: 100px 100px;
  animation: hm-turn 26s linear infinite;
}

.hm-ring {
  fill: none;
  stroke-width: 26;
  stroke-dasharray: 155 310;
}

.hm-ring-a {
  stroke: var(--lime);
}

.hm-ring-b {
  stroke: #2f7fe0;
  stroke-dashoffset: -155;
}

.hm-ring-c {
  stroke: #d8352a;
  stroke-dashoffset: -310;
}

.hm-ring-inner {
  fill: #0a0f16;
}

.hm-art-mark {
  fill: #fff;
}

@keyframes hm-turn {
  to {
    transform: rotate(360deg);
  }
}

/* ---- the coin: one side lime, one side dark, turning over */

.hm-coin {
  position: relative;
  width: 104px;
  height: 104px;
  transform-style: preserve-3d;
  animation: hm-flip 4.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.hm-coin-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
}

.hm-coin-head {
  background: radial-gradient(60% 60% at 35% 30%, var(--lime-soft), var(--lime) 52%, var(--lime-dark));
  box-shadow: 0 10px 30px rgba(204, 255, 0, 0.25);
}

.hm-coin-tail {
  transform: rotateY(180deg);
  background: radial-gradient(60% 60% at 35% 30%, #22303f, #0d141c 60%, #070b10);
  box-shadow: inset 0 0 0 6px rgba(204, 255, 0, 0.18);
}

@keyframes hm-flip {
  0%,
  12% {
    transform: rotateY(0deg);
  }

  50%,
  62% {
    transform: rotateY(540deg);
  }

  100% {
    transform: rotateY(1080deg);
  }
}

/* ---- the crash: a line that climbs and starts again */

.hm-art-crash svg {
  width: 90%;
  height: 76%;
}

.hm-curve {
  fill: none;
  stroke: var(--lime);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  filter: drop-shadow(0 0 8px rgba(204, 255, 0, 0.45));
  animation: hm-climb 5s cubic-bezier(0.55, 0, 0.9, 0.6) infinite;
}

.hm-curve-head {
  position: absolute;
  right: 7%;
  top: 12%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(204, 255, 0, 0.18);
  opacity: 0;
  animation: hm-head 5s ease infinite;
}

@keyframes hm-climb {
  0% {
    stroke-dashoffset: 260;
    stroke: var(--lime);
  }

  70% {
    stroke-dashoffset: 0;
    stroke: var(--lime);
  }

  80%,
  100% {
    stroke-dashoffset: 0;
    stroke: var(--down);
  }
}

@keyframes hm-head {
  0%,
  60% {
    opacity: 0;
  }

  70% {
    opacity: 1;
  }

  80%,
  100% {
    opacity: 0;
  }
}

/* ---- the blackjack: two cards off the shoe */

.hm-play-card {
  position: absolute;
  display: grid;
  place-items: center;
  width: 74px;
  height: 106px;
  border-radius: 10px;
  background: linear-gradient(180deg, #fdfdfb, #e6e9e4);
  color: #16202c;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.45);
}

.hm-play-card-back {
  background: linear-gradient(160deg, #12202c, #0a121a);
  box-shadow: inset 0 0 0 1px rgba(204, 255, 0, 0.18), 0 14px 24px rgba(0, 0, 0, 0.45);
  transform: translate(46px, -6px) rotate(9deg);
}

.hm-play-card-back::after {
  content: '';
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(140deg, var(--lime), var(--lime-dark));
}

.hm-play-card-1 {
  animation: hm-card-1 6s ease-in-out infinite;
}

.hm-play-card-2 {
  color: #c62828;
  animation: hm-card-2 6s ease-in-out infinite;
}

@keyframes hm-card-1 {
  0%,
  8% {
    transform: translate(46px, -6px) rotate(9deg);
    opacity: 0;
  }

  22%,
  92% {
    transform: translate(-34px, 4px) rotate(-8deg);
    opacity: 1;
  }

  100% {
    transform: translate(-34px, 4px) rotate(-8deg);
    opacity: 0;
  }
}

@keyframes hm-card-2 {
  0%,
  26% {
    transform: translate(46px, -6px) rotate(9deg);
    opacity: 0;
  }

  40%,
  92% {
    transform: translate(6px, 10px) rotate(6deg);
    opacity: 1;
  }

  100% {
    transform: translate(6px, 10px) rotate(6deg);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hm-art-spin,
  .hm-coin,
  .hm-curve,
  .hm-curve-head,
  .hm-play-card-1,
  .hm-play-card-2 {
    animation: none;
  }
}
