/* Jigsaw Puzzle AI CSS Giao diện Cyber Hologram */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #090d16;
  --pk: #f472b6;
  --cy: #38bdf8;
  --ye: #fbbf24;
  --glass: rgba(15, 23, 42, 0.72);
  --border: rgba(56, 189, 248, 0.25);
  --font-hud: 'Share Tech Mono', monospace;
}

body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  font-family: 'Outfit', sans-serif;
  color: #fff;
  user-select: none;
}

/* Digital Grid CRT overlay background */
body::after {
  content: " ";
  display: block;
  position: fixed;
  inset: 0;
  background: 
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
    linear-gradient(90deg, rgba(56, 189, 248, 0.03) 1px, transparent 1px), 
    linear-gradient(rgba(56, 189, 248, 0.03) 1px, transparent 1px);
  background-size: 100% 4px, 30px 30px, 30px 30px;
  z-index: 2;
  pointer-events: none;
}

#vid {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  opacity: 0.4;
  z-index: 0;
  pointer-events: none;
}

#bg-blur {
  position: fixed;
  inset: 0;
  z-index: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(9, 13, 22, 0.55);
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

#bg-blur.show {
  opacity: 1;
}

#cvs {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* Sci-fi Loading Screen */
#ld {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #060911;
  transition: opacity 0.6s cubic-bezier(0.1, 0.8, 0.2, 1);
}

#ld.out {
  opacity: 0;
  pointer-events: none;
}

#ld h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(28px, 6vw, 46px);
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--pk), var(--cy));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 24px;
  text-shadow: 0 0 30px rgba(244, 114, 182, 0.2);
}

.ring {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(56, 189, 248, 0.1);
  border-top-color: var(--cy);
  border-bottom-color: var(--pk);
  border-radius: 50%;
  animation: spinRing 1s linear infinite;
}

@keyframes spinRing {
  to { transform: rotate(360deg); }
}

#ld p {
  margin-top: 18px;
  font-family: var(--font-hud);
  font-size: 11px;
  color: rgba(56, 189, 248, 0.6);
  letter-spacing: 4px;
  text-transform: uppercase;
}

/* Holographic Floating Status Bar */
#st {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 32px;
  background: var(--glass);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 40px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-family: var(--font-hud);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: #fff;
  z-index: 100;
  text-align: center;
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(56, 189, 248, 0.1);
  text-transform: uppercase;
}

#st.warn {
  color: var(--ye);
  border-color: rgba(251, 191, 36, 0.4);
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.15), inset 0 0 8px rgba(251, 191, 36, 0.1);
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

#st.shoot {
  color: var(--cy);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.25), inset 0 0 8px rgba(56, 189, 248, 0.15);
  text-shadow: 0 0 10px var(--cy);
}

#st.on {
  color: var(--pk);
  border-color: rgba(244, 114, 182, 0.5);
  box-shadow: 0 0 25px rgba(244, 114, 182, 0.25), inset 0 0 8px rgba(244, 114, 182, 0.15);
  text-shadow: 0 0 10px var(--pk);
}

/* White Screen Capture Flash */
#flash {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease-out;
}

/* Glassmorphism Cyber Leaderboard */
#leaderboard {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 20px;
  min-width: 220px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), inset 0 0 15px rgba(255, 255, 255, 0.03);
  pointer-events: none;
  font-family: var(--font-hud);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
}

#leaderboard h3 {
  font-size: 11px;
  font-weight: 900;
  color: var(--ye);
  margin-bottom: 12px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
  padding-bottom: 6px;
}

#leaderboard ol {
  padding-left: 20px;
  font-size: 12px;
  font-weight: 700;
  margin: 0;
  line-height: 2.0;
  color: rgba(255, 255, 255, 0.85);
}

#leaderboard li::marker {
  color: rgba(255, 255, 255, 0.4);
  font-weight: 400;
}

#leaderboard span {
  color: var(--cy);
  float: right;
  margin-left: 20px;
  text-shadow: 0 0 6px rgba(56, 189, 248, 0.5);
  font-weight: 900;
}

/* Sci-fi corner decorations inside index.html styling references */
.corner-dec {
  position: absolute;
  width: 8px;
  height: 8px;
  border: 2px solid var(--cy);
  z-index: 10;
}
.c-tl { top: 0; left: 0; border-right: none; border-bottom: none; }
.c-tr { top: 0; right: 0; border-left: none; border-bottom: none; }
.c-bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.c-br { bottom: 0; right: 0; border-left: none; border-top: none; }
