/* Mobile Diablo II head slot + peace-with-baal }glitter{} + mage plate tomorrow */

.head-slot-room {
  display: none;
}

.peace-baal {
  display: none;
}

@media (max-width: 860px) {
  body.mobile-slot {
    background: #0a0806;
    min-height: 100dvh;
  }

  body.mobile-slot .topbar {
    background: transparent;
    border-bottom: 0;
    position: static;
  }

  body.mobile-slot .nav,
  body.mobile-slot .hero,
  body.mobile-slot .footer,
  body.mobile-slot #shelf-wrap {
    display: none;
  }

  body.mobile-slot .wrap {
    width: 100%;
    margin: 0;
    padding: 0;
    min-height: calc(100dvh - 3.4rem);
  }

  .head-slot-room {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100dvh - 3.4rem);
    padding: 1rem 1rem 3rem;
    position: relative;
    overflow: hidden;
  }

  .head-slot-room::before {
    content: "";
    position: absolute;
    inset: auto 0 28%;
    height: 42%;
    background: linear-gradient(
      180deg,
      rgba(186, 48, 38, 0.12) 0%,
      rgba(92, 122, 148, 0.05) 28%,
      rgba(176, 196, 212, 0.22) 52%,
      rgba(236, 232, 220, 0.28) 74%,
      rgba(20, 18, 16, 0.15) 100%
    );
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.4s ease;
  }

  body.is-tomorrow .head-slot-room::before {
    opacity: 1;
  }

  body.is-tomorrow {
    background:
      radial-gradient(80% 50% at 50% 18%, rgba(164, 46, 36, 0.22) 0%, transparent 56%),
      linear-gradient(180deg, #14161a 0%, #0c0b09 42%, #161410 100%);
  }

  .head-slot-label {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #8a7350;
    margin: 0.7rem 0 0;
  }

  .head-slot {
    appearance: none;
    width: min(46vw, 168px);
    aspect-ratio: 1;
    padding: 7px;
    border: 0;
    cursor: pointer;
    background:
      linear-gradient(145deg, #8a6a3a 0%, #3a2814 38%, #1c120a 100%);
    box-shadow:
      inset 1px 1px 0 #c4a46a,
      inset -2px -2px 0 #1a1008,
      0 0 0 2px #2a1c10,
      0 10px 24px rgba(0, 0, 0, 0.55);
    position: relative;
    z-index: 2;
  }

  .head-slot:focus-visible {
    outline: 2px solid #d4b06a;
    outline-offset: 4px;
  }

  .head-slot-well {
    display: block;
    width: 100%;
    height: 100%;
    background:
      radial-gradient(120% 90% at 50% 30%, #1a1612 0%, #070604 72%);
    box-shadow:
      inset 2px 2px 4px #000,
      inset -1px -1px 0 #3a2a18;
    position: relative;
    overflow: hidden;
  }

  /* empty helm ghost — D2 empty head slot */
  .head-slot-ghost {
    position: absolute;
    inset: 18% 22% 20%;
    border: 1px solid rgba(122, 98, 62, 0.35);
    border-radius: 40% 40% 32% 32%;
    opacity: 1;
    transition: opacity 0.35s ease;
  }

  .head-slot-ghost::after {
    content: "";
    position: absolute;
    left: 22%;
    right: 22%;
    bottom: -18%;
    height: 28%;
    border: 1px solid rgba(122, 98, 62, 0.28);
    border-top: 0;
  }

  .head-slot.is-filled .head-slot-ghost {
    opacity: 0;
  }

  .head-slot-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
  }

  .head-slot.is-filled .head-slot-item {
    display: block;
  }

  .head-slot-got {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: #d8c48a;
    min-height: 1.1rem;
    margin: 0.85rem 0 0;
    text-align: center;
  }

  .slot-picks {
    display: flex;
    gap: 0.45rem;
    margin-top: 1.2rem;
    z-index: 2;
    position: relative;
  }

  .slot-picks button {
    appearance: none;
    width: 56px;
    height: 56px;
    padding: 3px;
    border: 1px solid #6a5434;
    background: #1a140c;
    cursor: pointer;
  }

  .slot-picks button[aria-current="true"] {
    border-color: #d4b06a;
    box-shadow: 0 0 0 1px #d4b06a;
  }

  .slot-picks img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  /* mage plate tomorrow — steel dawn wash */
  .mage-plate {
    pointer-events: none;
    position: absolute;
    inset: 0;
    opacity: 0;
    background:
      linear-gradient(
        165deg,
        rgba(186, 206, 222, 0.16) 0%,
        rgba(92, 118, 138, 0.08) 36%,
        transparent 58%
      ),
      linear-gradient(
        0deg,
        rgba(18, 16, 14, 0.15) 0%,
        transparent 40%
      );
    mix-blend-mode: screen;
    transition: opacity 1.1s ease;
    z-index: 1;
  }

  body.is-tomorrow .mage-plate {
    opacity: 1;
  }

  /* }glitter{} — peace-with-baal */
  .peace-baal {
    display: block;
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 8;
    overflow: hidden;
  }

  .peace-baal[hidden] {
    display: none;
  }

  .glitter {
    position: absolute;
    font-family: var(--mono);
    font-size: 1.15rem;
    line-height: 1;
    color: #e8d9a0;
    opacity: 1;
    animation: glitter-fall 2.8s ease-out forwards;
    text-shadow: 0 0 10px currentColor, 0 0 18px currentColor;
    will-change: transform, opacity;
  }

  .glitter.is-baal { color: #b43328; }
  .glitter.is-peace { color: #f0e2b0; }
  .glitter.is-plate { color: #c5d4e0; }

  @keyframes glitter-fall {
    0% {
      opacity: 1;
      transform: translate3d(0, 0, 0) scale(0.85);
    }
    40% { opacity: 1; }
    70% { color: #f3e6b8; }
    100% {
      opacity: 0;
      transform: translate3d(var(--dx, 8px), 70vh, 0) scale(1.05);
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .glitter { animation-duration: 0.2s; }
    .head-slot-room::before,
    .mage-plate { transition: none; }
  }
}
