/* ============================================================
   MUSHVEDA — EXTRA LAYER · Game · Gallery · Admin · Motion FX
   ============================================================ */

/* ---------- Scroll progress (gold) ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, #2e5b23, #d9b86a, #b98f3e);
  z-index: 999;
  box-shadow: 0 0 12px rgba(217, 184, 106, 0.7);
}

/* ---------- Custom cursor glow ---------- */
.cursor-glow {
  position: fixed;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid rgba(185, 143, 62, 0.75);
  background: radial-gradient(circle, rgba(217, 184, 106, 0.22), transparent 70%);
  pointer-events: none;
  z-index: 998;
  transform: translate(-50%, -50%);
  transition: width 0.25s, height 0.25s, opacity 0.3s;
  mix-blend-mode: multiply;
  opacity: 0;
}

.cursor-glow.big { width: 52px; height: 52px; }

@media (hover: none), (max-width: 860px) {
  .cursor-glow { display: none; }
}

/* ---------- Split text letters ---------- */
.split-text .ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.55em) rotate(4deg);
  animation: ch-in 0.62s cubic-bezier(0.22, 1, 0.35, 1) forwards;
  animation-delay: var(--d, 0s);
  will-change: transform;
}

@keyframes ch-in {
  to { opacity: 1; transform: translateY(0) rotate(0); }
}

/* ---------- Magnetic buttons ---------- */
.magnetic {
  transition: transform 0.22s cubic-bezier(0.25, 1.2, 0.35, 1), box-shadow 0.3s;
  will-change: transform;
}

/* ---------- Hero conic border ---------- */
.gold-frame {
  position: relative;
  border-radius: 26px;
  padding: 4px;
  background: conic-gradient(from var(--ga, 0deg), #d9b86a, #2e5b23, #b98f3e, #4c7a33, #d9b86a);
  animation: spin-grad 8s linear infinite;
}

@keyframes spin-grad {
  to { --ga: 360deg; }
}

@property --ga {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.gold-frame > * {
  border-radius: 22px;
  overflow: hidden;
  display: block;
}

/* ---------- Wave / divider ornaments ---------- */
.wave-divider {
  height: 70px;
  background:
    radial-gradient(60px 30px at 30px 35px, transparent 28px, rgba(185, 143, 62, 0.25) 29px, rgba(185, 143, 62, 0.25) 30px, transparent 31px),
    radial-gradient(60px 30px at 90px 35px, transparent 28px, rgba(46, 91, 35, 0.2) 29px, rgba(46, 91, 35, 0.2) 30px, transparent 31px);
  background-size: 120px 70px;
  opacity: 0.8;
}

/* ---------- Stagger reveals ---------- */
.stagger > *:nth-child(1) { transition-delay: 0.05s; }
.stagger > *:nth-child(2) { transition-delay: 0.13s; }
.stagger > *:nth-child(3) { transition-delay: 0.21s; }
.stagger > *:nth-child(4) { transition-delay: 0.29s; }
.stagger > *:nth-child(5) { transition-delay: 0.37s; }
.stagger > *:nth-child(6) { transition-delay: 0.45s; }

/* ============================================================
   GAME PAGE
   ============================================================ */

.game-wrap {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid rgba(185, 143, 62, 0.4);
  box-shadow: 0 40px 110px rgba(35, 25, 10, 0.35);
  background: linear-gradient(180deg, #14220f, #1c3014 60%, #24401c);
  user-select: none;
}

.game-canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: none;
  touch-action: none;
}

.game-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  pointer-events: none;
  z-index: 3;
}

.hud-chip {
  background: rgba(10, 18, 8, 0.66);
  border: 1px solid rgba(216, 184, 106, 0.4);
  color: #ffe9b8;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  padding: 9px 17px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.hud-chip b { color: #fff; font-size: 1.12rem; }

.game-overlay {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  background: rgba(10, 18, 8, 0.82);
  backdrop-filter: blur(8px);
  z-index: 5;
  padding: 24px;
}

.game-overlay.show { display: flex; animation: fade-up 0.45s ease; }

.game-overlay h2 {
  color: #fffdf7;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
}

.game-overlay p {
  color: rgba(247, 242, 231, 0.86);
  max-width: 460px;
}

.game-overlay .rules {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.game-overlay .rules span {
  background: rgba(247, 242, 231, 0.12);
  border: 1px solid rgba(216, 184, 106, 0.35);
  color: #ffe9b8;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
}

.unlocked-code {
  display: none;
  align-items: center;
  gap: 12px;
  background: rgba(216, 184, 106, 0.15);
  border: 1.5px dashed #d9b86a;
  border-radius: 16px;
  padding: 16px 22px;
  animation: pop-in 0.5s ease;
}

.unlocked-code.show { display: flex; }

.unlocked-code .code {
  font-family: Consolas, Monaco, monospace;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #ffe9b8;
}

.leaderboard {
  background: var(--paper);
  border: 1px solid rgba(185, 143, 62, 0.28);
  border-radius: 22px;
  padding: 30px;
  box-shadow: var(--shadow-soft);
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  color: var(--text-dim);
}

.lb-row:last-child { border-bottom: 0; }

.lb-rank {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--cream-soft);
  border: 1px solid var(--border);
  font-family: var(--font-head);
  color: var(--brown-deep);
}

.lb-row:nth-child(1) .lb-rank { background: linear-gradient(120deg, #d9b86a, #b98f3e); color: #fff; }
.lb-row:nth-child(2) .lb-rank { background: linear-gradient(120deg, #c9c9c9, #9a9a9a); color: #fff; }
.lb-row:nth-child(3) .lb-rank { background: linear-gradient(120deg, #d2a679, #a9713f); color: #fff; }

.lb-score {
  margin-left: auto;
  font-family: var(--font-head);
  font-size: 1.18rem;
  color: var(--forest);
}

/* ============================================================
   GALLERY PAGE
   ============================================================ */

.gal-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 36px;
}

.gal-filters button {
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid rgba(185, 143, 62, 0.35);
  background: var(--paper);
  color: var(--brown);
  font-weight: 750;
  cursor: pointer;
  transition: all 0.25s;
}

.gal-filters button.active,
.gal-filters button:hover {
  background: var(--forest);
  color: var(--cream);
  transform: translateY(-2px);
}

.masonry {
  columns: 3 280px;
  column-gap: 20px;
}

.gal-item {
  break-inside: avoid;
  margin-bottom: 20px;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 1px solid rgba(185, 143, 62, 0.22);
  box-shadow: 0 12px 36px rgba(80, 58, 28, 0.12);
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.25, 1.15), box-shadow 0.4s;
}

.gal-item:hover {
  transform: translateY(-8px) rotate(-0.8deg) scale(1.02);
  box-shadow: 0 34px 80px rgba(80, 58, 28, 0.25);
}

.gal-item img {
  width: 100%;
  display: block;
  transition: transform 0.7s ease;
}

.gal-item:hover img { transform: scale(1.08); }

.gal-cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 40px 18px 15px;
  background: linear-gradient(transparent, rgba(10, 18, 8, 0.82));
  color: #fffdf7;
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  transform: translateY(8px);
  opacity: 0;
  transition: all 0.35s;
}

.gal-item:hover .gal-cap { transform: translateY(0); opacity: 1; }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 8, 0.92);
  backdrop-filter: blur(10px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.lightbox.show { display: flex; animation: fade-up 0.3s ease; }

.lightbox img {
  max-width: min(1000px, 92vw);
  max-height: 82vh;
  border-radius: 18px;
  border: 2px solid rgba(216, 184, 106, 0.5);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(216, 184, 106, 0.5);
  background: rgba(255, 255, 255, 0.1);
  color: #ffe9b8;
  font-size: 1.4rem;
  cursor: pointer;
}

/* ============================================================
   ADMIN — LOGIN + REAL DATA DASHBOARD
   ============================================================ */

.admin-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(700px 400px at 80% -10%, rgba(185, 143, 62, 0.16), transparent 60%),
    linear-gradient(160deg, #14220f, #1c3014 60%, #24401c);
  padding: 24px;
}

.admin-gate .auth-card {
  background: var(--paper);
  width: min(430px, 100%);
}

.admin-gate .lock-orb {
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #d9b86a, #a8802f);
  color: #2b1d0c;
  box-shadow: 0 18px 46px rgba(185, 143, 62, 0.45);
  animation: wobble 5s ease-in-out infinite;
}

.attempts-note {
  font-size: 0.85rem;
  color: var(--text-faint);
  text-align: center;
  margin-top: 12px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-faint);
}

.empty-state .big { font-size: 2.6rem; margin-bottom: 10px; }

.toast-admin {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 600;
  background: var(--forest-deep);
  color: var(--cream);
  padding: 14px 22px;
  border-radius: 13px;
  font-weight: 750;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-12px);
  transition: all 0.3s;
}

.toast-admin.show { opacity: 1; transform: translateY(0); }

@media (max-width: 720px) {
  .masonry { columns: 1; }
  .game-hud { flex-wrap: wrap; padding: 10px; gap: 8px; }
  .hud-chip { font-size: 0.8rem; padding: 7px 12px; }
}
