html,
body.drift {
  height: 100%;
  overflow: hidden;
  background: #020405;
  touch-action: none;
}

.drift {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.drift-dust {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.drift-beams {
  position: fixed;
  inset: 0;
  z-index: 6;
  overflow: hidden;
  pointer-events: none;
  mix-blend-mode: screen;
}

.beam {
  position: absolute;
  top: -30%;
  height: 160%;
  background: linear-gradient(
    to bottom,
    rgba(105, 245, 222, 0) 0%,
    rgba(105, 245, 222, 0.16) 32%,
    rgba(105, 245, 222, 0.05) 68%,
    rgba(105, 245, 222, 0) 100%
  );
  filter: blur(18px);
  transform-origin: top center;
  animation: beam-pulse 9s ease-in-out infinite;
}

@keyframes beam-pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .beam {
    animation: none;
    opacity: 0.75;
  }
}

.drift-space {
  position: fixed;
  inset: 0;
  z-index: 10;
  perspective: 1000px;
  perspective-origin: 50%;
}

.drift-field {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
}

.obj {
  position: absolute;
  top: 0;
  left: 0;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, opacity;
}

.card-frame {
  position: relative;
  background: #04080a;
  padding: 4px;
  border-radius: 4px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.28),
    0 0 44px rgba(105, 245, 222, 0.22),
    0 26px 60px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  transition:
    box-shadow 160ms ease,
    transform 160ms ease;
}

.card-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
  filter: saturate(1.05) contrast(1.03) brightness(0.98);
}

.obj.card:hover .card-frame {
  box-shadow:
    0 0 0 1px rgba(105, 245, 222, 0.65),
    0 0 70px rgba(105, 245, 222, 0.34),
    0 26px 60px rgba(0, 0, 0, 0.6);
}

.word {
  color: var(--accent);
  font-family: "Morgan Strike", Impact, Haettenschweiler, "Arial Black", sans-serif;
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: 0.01em;
  text-shadow: 0 0 26px rgba(105, 245, 222, 0.28);
  pointer-events: none;
  user-select: none;
}

.word.small {
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.28em;
  text-shadow: none;
  font-weight: 600;
}

.word.tag {
  background: var(--accent);
  color: #04120f;
  font-family: "Morgan Strike", Impact, Haettenschweiler, "Arial Black", sans-serif;
  letter-spacing: 0.04em;
  padding: 0.12em 0.55em 0.2em;
  border-radius: 4px;
  text-shadow: none;
}

.drift-vig {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.55) 100%);
}

.hud {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  padding: clamp(14px, 3vw, 26px);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--glass);
  backdrop-filter: blur(7px);
  color: var(--ink);
  font-family: "Morgan Strike", Impact, Haettenschweiler, "Arial Black", sans-serif;
  font-size: 16px;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.back:hover {
  border-color: var(--edge-strong);
  background: var(--glass-link-hover);
}

.back-arrow {
  font-size: 18px;
  line-height: 1;
}

.foot {
  position: fixed;
  z-index: 40;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  padding: 0 clamp(14px, 3vw, 26px) clamp(14px, 2.4vh, 22px);
  pointer-events: none;
}

.foot-hint {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.speedbar {
  position: relative;
  width: min(220px, 34vw);
  height: 3px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 2px;
}

.speedbar i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 0;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(105, 245, 222, 0.55);
  border-radius: 2px;
}

.detail {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  place-content: center;
  justify-items: center;
  padding: 20px;
  background: rgba(2, 4, 5, 0.88);
}

.detail.on {
  display: grid;
}

.detail-win {
  position: relative;
  max-width: min(94vw, 880px);
  padding: 4px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--glass);
  backdrop-filter: blur(7px);
  box-shadow: 0 0 80px rgba(105, 245, 222, 0.16);
}

.detail-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(4, 8, 10, 0.7);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.detail-close:hover {
  background: rgba(105, 245, 222, 0.32);
}

.detail-media {
  background: #04080a;
  border-radius: 4px;
  padding: 4px;
  overflow: hidden;
}

.detail-media img {
  display: block;
  max-width: 100%;
  max-height: 74vh;
  margin: 0 auto;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .card-frame {
    transition: none;
  }
}
