/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ── Sim Background ────────────────────────────────── */
.sim-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.75;
}

/* ── Scanlines ─────────────────────────────────────── */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.10) 0px,
    rgba(0, 0, 0, 0.10) 1px,
    transparent 1px,
    transparent 3px
  );
}

/* ── Base ──────────────────────────────────────────── */
html {
  background: #05050a;
  color: #aaa;
  font-family: 'Silkscreen', monospace;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Scene (full viewport container) ───────────────── */
.scene {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px;
  position: relative;
  overflow: hidden;
  z-index: 3;
}

/* ── Header / Logo ─────────────────────────────────── */
header {
  text-align: center;
  margin-bottom: 36px;
  position: relative;
  z-index: 1;
}

.pre-logo {
  font-family: 'Silkscreen', monospace;
  font-size: 9px;
  color: #2e2e50;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 14px;
  animation: fadeUp 0.8s 0.2s ease-out both;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  animation: logoIn 1s ease-out both;
}
.logo-svg {
  height: 80px;
  width: auto;
  opacity: 0.9;
  transition: opacity 0.3s;
  animation: logoFlicker 7s 1.4s ease-in-out infinite;
}
.logo:hover .logo-svg {
  opacity: 1;
}

@keyframes logoIn {
  0%   { opacity: 0; transform: translateY(-20px) scale(0.95); filter: blur(8px); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes logoFlicker {
  0%, 93%, 100% { opacity: 1; }
  94%           { opacity: 0.35; }
  95%           { opacity: 1; }
  97%           { opacity: 0.55; }
  98%           { opacity: 1; }
}



@keyframes fadeUp {
  0%   { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ── Browse bar ─────────────────────────────────────── */
.browse-bar {
  width: 100%;
  max-width: 1100px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.8s 0.5s ease-out both;
}
.browse-heading {
  font-family: 'Silkscreen', monospace;
  font-size: 10px;
  color: #4a4a4a;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.browse-count {
  font-family: 'Silkscreen', monospace;
  font-size: 9px;
  color: #2a2a2a;
}
.browse-divider {
  flex: 1;
  height: 1px;
  background: #1a1a1a;
}

/* ── Games section ─────────────────────────────────── */
.games {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.8s 0.6s ease-out both;
}

/* ── 3D Game Box ───────────────────────────────────── */
.game-box-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.game-box-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.game-box-scene {
  width: 100%;
  aspect-ratio: 320 / 275;
  perspective: 600px;
  cursor: pointer;
}

.game-box {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(5deg) rotateY(-15deg);
  transition: transform 0.08s linear;
}

/* Box shadow on the surface below */
.game-box::after {
  content: '';
  position: absolute;
  bottom: -18px;
  left: 10%;
  width: 80%;
  height: 20px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.45) 0%, transparent 70%);
  filter: blur(6px);
  transform: rotateX(90deg);
  pointer-events: none;
}

/* All faces */
.box-face {
  position: absolute;
  backface-visibility: hidden;
}

/* Front face: shows the PNG art */
.box-front {
  width: 100%;
  height: 100%;
  transform: translateZ(10px);
  border-radius: 3px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    inset 0 0 30px rgba(0,0,0,0.15);
}
.box-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}

/* Back face */
.box-back {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #14141e 0%, #0c0c14 50%, #08080c 100%);
  transform: rotateY(180deg) translateZ(10px);
  border-radius: 3px;
  border: 1px solid #1e1e2e;
}

/* Left spine */
.box-left {
  width: 20px;
  height: 100%;
  left: -10px;
  background: linear-gradient(90deg, #1a1a28, #22222e);
  transform: rotateY(-90deg) translateZ(0px);
  border-top: 1px solid rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(0,0,0,0.3);
}

/* Right edge */
.box-right {
  width: 20px;
  height: 100%;
  right: -10px;
  background: linear-gradient(90deg, #22222e, #1a1a28);
  transform: rotateY(90deg) translateZ(calc(100% - 10px));
  border-top: 1px solid rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(0,0,0,0.3);
}

/* Top edge */
.box-top {
  width: 100%;
  height: 20px;
  top: -10px;
  background: linear-gradient(180deg, #2a2a38, #22222e);
  transform: rotateX(90deg) translateZ(0px);
  border-left: 1px solid rgba(255,255,255,0.04);
  border-right: 1px solid rgba(0,0,0,0.2);
}

/* Bottom edge */
.box-bottom {
  width: 100%;
  height: 20px;
  bottom: -10px;
  background: linear-gradient(180deg, #18181e, #10101a);
  transform: rotateX(-90deg) translateZ(calc(100% - 10px));
  border-left: 1px solid rgba(255,255,255,0.02);
  border-right: 1px solid rgba(0,0,0,0.3);
}

/* Gloss / specular overlay on front */
.box-gloss {
  position: absolute;
  width: 100%;
  height: 100%;
  transform: translateZ(10.5px);
  border-radius: 3px;
  pointer-events: none;
  background: radial-gradient(ellipse at 30% 20%,
    rgba(255,255,255,0.12) 0%, transparent 55%);
  mix-blend-mode: screen;
}

/* ── Box label below ───────────────────────────────── */
.box-label {
  text-align: center;
}
.box-label h2 {
  font-family: 'Silkscreen', monospace;
  font-size: 14px;
  color: #ccc;
  margin-bottom: 2px;
  transition: color 0.3s;
}
.game-box-link:hover .box-label h2 {
  color: #ff6;
}
.box-genre {
  font-family: 'Silkscreen', monospace;
  font-size: 8px;
  color: #444;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

/* Play Now CTA button */
.box-play-btn {
  --notch: 4px;
  display: inline-block;
  margin-top: 10px;
  font-family: 'Silkscreen', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #ff6;
  background: rgba(60,50,0,0.7);
  padding: 7px 18px;
  cursor: pointer;
  clip-path: polygon(
    0% var(--notch), var(--notch) var(--notch), var(--notch) 0%,
    calc(100% - var(--notch)) 0%, calc(100% - var(--notch)) var(--notch), 100% var(--notch),
    100% calc(100% - var(--notch)), calc(100% - var(--notch)) calc(100% - var(--notch)), calc(100% - var(--notch)) 100%,
    var(--notch) 100%, var(--notch) calc(100% - var(--notch)), 0% calc(100% - var(--notch))
  );
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.game-box-link:hover .box-play-btn {
  background: rgba(100,80,0,0.9);
  color: #fff;
  transform: scale(1.05);
}

/* Meta pills */
.box-meta {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.pill {
  --notch: 3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'Silkscreen', monospace;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 8px;
  border: none;
  clip-path: polygon(
    0% var(--notch), var(--notch) var(--notch), var(--notch) 0%,
    calc(100% - var(--notch)) 0%, calc(100% - var(--notch)) var(--notch), 100% var(--notch),
    100% calc(100% - var(--notch)), calc(100% - var(--notch)) calc(100% - var(--notch)), calc(100% - var(--notch)) 100%,
    var(--notch) 100%, var(--notch) calc(100% - var(--notch)), 0% calc(100% - var(--notch))
  );
}
.pill.live {
  color: #6f6;
  border-color: #1a3a1a;
  background: #0a160a;
}
.pill.players {
  color: #6ff;
  border-color: #1a2a3a;
  background: #0a1018;
}

/* Live pulse dot */
.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6f6;
  display: inline-block;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(100,255,100,0.5); }
  50%      { opacity: 0.6; box-shadow: 0 0 0 6px rgba(100,255,100,0); }
}



/* ── Footer ────────────────────────────────────────── */
footer {
  margin-top: 56px;
  text-align: center;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.8s 0.8s ease-out both;
}

.footer-sub {
  font-family: 'Silkscreen', monospace;
  font-size: 8px;
  color: #1c1c1c;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ── Responsive ────────────────────────────────────── */

/* Tablet: 2 per row */
@media (max-width: 900px) {
  .games { grid-template-columns: repeat(2, 1fr); gap: 24px; max-width: 560px; }
  .browse-bar { max-width: 560px; }
}

/* Mobile: 1 per row */
@media (max-width: 520px) {
  .logo-svg { height: 56px; }
  header { margin-bottom: 24px; }
  .games { grid-template-columns: 1fr; gap: 32px; max-width: 300px; }
  .browse-bar { max-width: 300px; }
  .box-label h2 { font-size: 13px; }
  .pre-logo { font-size: 8px; letter-spacing: 2px; }
}
