:root{
  --primary:#00f3ff;
  --accent:#ff0055;
  --bg:#0a0a0a;
  --card-bg:rgba(20,20,30,.9);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  background:var(--bg);
  font-family:'Orbitron',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:#fff;
  overflow-x:hidden;
}

/* ===== HERO ===== */
.hero-section{
  height:100vh;
  display:flex;
  justify-content:center;
  align-items:center;
  perspective:1500px;
  overflow:hidden;
  background: radial-gradient(circle at center, #1a1a2e 0%, #000 70%, #000 100%);
  position:relative;
}

.content-3d{
  display:flex;
  flex-direction:column;
  align-items:center;
  transform-style:preserve-3d;
  transition:transform .12s ease-out;
  padding: 24px;
}

.spider-title{
  font-family:'Bangers',cursive;
  font-size: clamp(3.4rem, 7vw, 8rem);
  line-height: .85;
  text-align:center;
  color:#fff;
  text-shadow: 4px 4px 0 var(--primary), 8px 8px 0 var(--accent);
  transform: translateZ(100px);
  margin: 0 0 42px 0;
  letter-spacing: 4px;
}

.cards-container{
  display:flex;
  gap: 24px;
  transform-style:preserve-3d;
  flex-wrap:wrap;
  justify-content:center;
}

.comic-card{
  width: min(240px, 80vw);
  height: 320px;
  background: var(--card-bg);
  border: 3px solid #fff;
  position: relative;
  transform-style: preserve-3d;
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
  transition: transform .25s ease, filter .25s ease;
  border-radius: 14px;
  overflow:hidden;
}
.comic-card:hover{ filter: brightness(1.08); transform: translateZ(10px) scale(1.02); }

.comic-card:nth-child(1){ transform: rotateY(12deg) translateZ(0); border-color: var(--primary); }
.comic-card:nth-child(2){ transform: translateZ(50px); border-color: #fff; z-index:10; }
.comic-card:nth-child(3){ transform: rotateY(-12deg) translateZ(0); border-color: var(--accent); }

.card-inner{
  padding: 18px;
  text-align:center;
  height:100%;
  display:flex;
  flex-direction:column;
  justify-content:center;
  background:
    radial-gradient(circle at 20% 20%, rgba(0,243,255,.12), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255,0,85,.12), transparent 45%),
    linear-gradient(135deg, transparent 50%, rgba(255,255,255,.08) 50%);
}

.card-inner h2{
  font-size: 1.55rem;
  margin: 0 0 12px 0;
  text-transform: uppercase;
  color: var(--primary);
}
.comic-card:nth-child(3) h2{ color: var(--accent); }
.card-inner p{ margin:0; line-height:1.45; opacity:.95; }

.scroll-instruction{
  position:absolute;
  bottom: 26px;
  font-size: 1.05rem;
  animation: pulse 1.5s infinite;
  opacity:.95;
  text-align:center;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
}
.scroll-instruction small{
  display:block;
  font-size:.8rem;
  opacity:.8;
  margin-top:4px;
}
.kbd{
  padding: 2px 8px;
  border: 1px solid rgba(255,255,255,.3);
  border-bottom-width: 3px;
  border-radius: 8px;
  margin: 0 6px;
  font-weight: 900;
  background: rgba(255,255,255,.08);
}

/* ===== GAME ===== */
.game-section{
  min-height: 100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  background:#000;
  position:relative;
  border-top: 5px solid var(--accent);
  padding: 24px 14px 42px;
}

.game-ui{
  width: min(920px, 92vw);
  display:flex;
  justify-content:space-between;
  gap: 12px;
  font-size: 1.15rem;
  margin-bottom: 10px;
  text-shadow: 0 0 10px rgba(0,243,255,.35);
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
}
#livesDisplay{ color: var(--accent); letter-spacing: 4px; }

.canvas-wrap{
  width: min(920px, 92vw);
  position:relative;
}

canvas{
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  background:#0d1118;
  border: 4px solid var(--primary);
  box-shadow: 0 0 30px rgba(0,243,255,.20);
  border-radius: 16px;
  display:block;
}

.hud-hint{
  position:absolute;
  left: 14px;
  bottom: 14px;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.14);
  padding: 10px 12px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  gap: 10px;
  font-size: .92rem;
  backdrop-filter: blur(6px);
}
.hud-hint .dot{
  width:10px; height:10px;
  border-radius:999px;
  background: var(--primary);
  box-shadow: 0 0 12px rgba(0,243,255,.8);
}

/* combo */
.combo-badge{
  position:absolute;
  top: 12px;
  right: 12px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.14);
  font-size: .92rem;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 18px rgba(0,243,255,.12);
}
.combo-badge.hot{
  border-color: rgba(255,0,85,.45);
  box-shadow: 0 0 22px rgba(255,0,85,.18);
}

/* ===== MK TOAST (emoji + texto) ===== */
.mk-toast{
  position:absolute;
  left: 16px;
  bottom: 62px;
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(0,0,0,.65);
  border: 1px solid rgba(255,0,85,.35);
  backdrop-filter: blur(6px);
  box-shadow: 0 0 28px rgba(255,0,85,.18);
  transform-origin: 0% 100%;
  animation: mkPop .28s ease-out, mkFloat 1.1s ease-in-out infinite;
  user-select:none;
  pointer-events:none;
}
.mk-emoji{
  font-size: 38px;
  filter: drop-shadow(0 0 12px rgba(255,0,85,.45));
}
.mk-text{
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 1.05rem;
  color: #fff;
  text-shadow: 0 0 12px rgba(0,243,255,.18);
}

@keyframes mkPop{
  0%{ transform: scale(.2) rotate(-6deg); opacity: 0; }
  100%{ transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes mkFloat{
  0%,100%{ transform: translateY(0); }
  50%{ transform: translateY(-4px); }
}

/* overlay */
.overlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,.78);
  z-index: 50;
  padding: 16px;
}
.overlay-card{
  width: min(520px, 94vw);
  background: rgba(0,0,0,.92);
  border: 2px solid var(--accent);
  border-radius: 18px;
  padding: 24px 18px;
  text-align:center;
  box-shadow: 0 25px 70px rgba(0,0,0,.6);
}
.overlay-card h2{ margin: 0 0 8px 0; font-size: 2rem; letter-spacing: 2px; }
.overlay-card p{ margin: 0 0 14px 0; opacity:.95; }

.overlay-actions{
  display:flex;
  justify-content:center;
  gap: 10px;
  flex-wrap:wrap;
  margin-top: 10px;
}

button{
  background: var(--primary);
  border: none;
  padding: 12px 18px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 14px;
  transition: transform .12s ease, filter .12s ease, background .12s ease;
}
button:hover{ filter: brightness(1.08); transform: translateY(-1px); }
button:active{ transform: translateY(0); }

button.ghost{
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  color:#fff;
}
button.ghost:hover{ background: rgba(255,255,255,.12); }

.footer-controls{
  width: min(920px, 92vw);
  display:flex;
  justify-content:flex-end;
  gap: 10px;
  margin-top: 12px;
  opacity: .95;
}

/* FIX overlay visible */
.hidden{ display:none !important; }
.overlay.hidden{ display:none !important; }

@media (prefers-reduced-motion: reduce){
  .content-3d{ transition:none; }
  .scroll-instruction{ animation:none; }
  .mk-toast{ animation:none; }
}

@keyframes pulse{
  0%{ opacity:.65; transform: scale(.98); }
  100%{ opacity:1; transform: scale(1.02); }
}
