@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700&family=Rajdhani:wght@500;600&display=swap");

:root {
  --neon-bg: #070012;
  --neon-magenta: #ff2bd6;
  --neon-cyan: #00e8ff;
  --neon-violet: #7b2cff;
  --neon-panel: rgba(8, 0, 22, 0.72);
}

body,
html {
  padding: 0;
  margin: 0;
  height: 100%;
  width: 100%;
  background-color: var(--neon-bg);
  font-family: "Rajdhani", sans-serif;
  overflow: hidden;
}
body{
  height: 100dvh;
}
* {
  -webkit-tap-highlight-color: transparent;
}

#container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background: var(--neon-bg);
}

body.game-started #container {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

canvas {
  pointer-events: auto;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  background: var(--neon-bg);
}
.Reset,.ViewPoint {
  display: none;
  place-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 8px;
  position: absolute;
  top: 1.4rem;
  right: 1.4rem;
  z-index: 10;
  font-size: 2rem;
  border: 2px solid var(--neon-cyan);
  color: var(--neon-cyan);
  cursor: pointer;
  background-color: rgba(8, 0, 22, 0.85);
  box-shadow: 0 0 12px rgba(0, 232, 255, 0.35);
  transition: all 0.3s ease-in-out;
}

body.game-started .Reset,
body.game-started .ViewPoint {
  display: grid;
}
.Reset{
  right: 5.5rem;
}

.Unmute:active,.Profile:active {
  transform: scale(0.3);
}
#LoadingBox {
  user-select: none;      
  -webkit-user-drag: none;
  width: 100%;
  height: 100%;
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  box-sizing: border-box;
  gap: 16px;
  flex-direction: column;
  isolation: isolate;
  overflow: hidden;
  background-color: var(--neon-bg);
  transition: background 0.6s ease;
}

/* Neon glass-board splash (matches in-game look). */
#LoadingBox::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url(assets/neon-splash.png?v=2);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 1;
  pointer-events: none;
  transition: opacity 0.9s ease;
}

/* Scanline + vignette overlay for synthwave depth. */
#LoadingBox::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 80% at 50% 40%, transparent 30%, rgba(7, 0, 18, 0.55) 100%),
    linear-gradient(180deg, rgba(7, 0, 18, 0.35) 0%, transparent 35%, transparent 60%, rgba(7, 0, 18, 0.65) 100%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 232, 255, 0.03) 2px,
      rgba(0, 232, 255, 0.03) 4px
    );
  opacity: 1;
  transition: opacity 0.9s ease;
}

#LoadingBox.scene-ready {
  /* Keep menu opaque — board stays hidden until body.game-started */
  background-color: var(--neon-bg);
}

#LoadingBox.scene-ready::before {
  opacity: 1;
}

#LoadingBox.scene-ready::after {
  opacity: 1;
}

.neon-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 1;
  pointer-events: none;
}

.neon-brand img {
  width: min(210px, 55vw);
  height: auto;
  filter:
    drop-shadow(0 0 10px rgba(0, 232, 255, 0.55))
    drop-shadow(0 0 22px rgba(255, 43, 214, 0.4))
    drop-shadow(0 0 18px rgba(255, 140, 0, 0.25));
}

/* In-game 2D brand — top-left overlay (replaces floating 3D logo plane). */
#neonchess-logo-overlay {
  display: none;
  position: fixed;
  top: 1.1rem;
  left: 1.1rem;
  z-index: 12;
  line-height: 0;
  text-decoration: none;
  pointer-events: auto;
  transition: transform 0.25s ease, filter 0.25s ease;
}

body.game-started #neonchess-logo-overlay {
  display: block;
}

#neonchess-logo-overlay img {
  width: clamp(56px, 9vw, 88px);
  height: auto;
  display: block;
  filter:
    drop-shadow(0 0 8px rgba(0, 232, 255, 0.5))
    drop-shadow(0 0 16px rgba(255, 43, 214, 0.35));
}

#neonchess-logo-overlay:hover {
  transform: scale(1.05);
}

#neonchess-logo-overlay:hover img {
  filter:
    drop-shadow(0 0 12px rgba(0, 232, 255, 0.75))
    drop-shadow(0 0 22px rgba(255, 43, 214, 0.5));
}

.neon-brand span {
  font-family: "Orbitron", sans-serif;
  font-size: clamp(0.75rem, 2.5vw, 0.95rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--neon-cyan);
  text-shadow:
    0 0 8px rgba(0, 232, 255, 0.9),
    0 0 20px rgba(255, 43, 214, 0.4);
}

.user-main {
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
  height: 100%;
  position: absolute;
  display: flex;
  place-content: center;
  transform: scale(0);
  transition: transform .4s ease-in-out;
}
.user-main.open{
  transform: scale(1);
}
.user-details {
  
  max-width: 450px;
  width: 100%;
  height: 100%;
  /* background: linear-gradient(to bottom, #006abc, #00357a); */
  /* overflow: hidden; */
  box-sizing: border-box;
  position: relative;
}
.user-details> button{
  border: none;
  position: absolute;
  top: -10px;
  right: -10px;
  border-radius: 5px;
  background-color: #000000;
  color: white;
  transform: rotate(45deg);
  font-size: 25px;
  width: 40px;
  height: 40px;
  display: grid;
  place-content: center;
  cursor: pointer;
  transition:  transform .3s ease-in-out;
}
.user-details> button:hover{
  transform: scale(1.3);
}
.user-details ion-icon{
  transition:  transform .3s ease-in-out;
  transform: rotate(-45deg);
}
.user-details> button:hover ion-icon{
  transform: rotate(0deg);
}
.user-details> iframe{
  border-radius: 10px;
  border: 3px solid white;
  border-radius: 20px;
  background-color: #c2cede;
}

p {
  font-family: "Rajdhani", sans-serif;
  color: #f0e6ff;
  font-size: 24px;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(255, 43, 214, 0.55), 0 0 16px rgba(0, 232, 255, 0.25);
  padding: 15px;
  text-align: center;
}
.facts{
  margin: 0;
  text-shadow: 0 0 6px rgba(0, 232, 255, 0.45) !important;
  font-size: 16px;
  max-width: 500px;
  animation: opaoff .3s ease-in-out forwards;
  background-color: var(--neon-panel);
  border: 1px solid rgba(0, 232, 255, 0.35);
  border-radius: 10px;
  margin: 10px;
  box-shadow: 0 0 18px rgba(255, 43, 214, 0.2), inset 0 0 20px rgba(123, 44, 255, 0.12);
  color: #d8faff;
}
@keyframes opaoff {
  100%{
    transform: translateY(20px);
    opacity: 0;
  }
}
.facts.active{
  animation: opaOn .3s ease-in-out forwards;
}
.facts.active.none{
  opacity: 0 !important;
}
@keyframes opaOn {
  0%{
    transform: translateY(20px);
    opacity: 0;
  }
  100%{
    transform: translateY(0px);
    opacity: 1;
  }
}
#LoadingBox > div {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
}
.loadButton {
  padding: 12px 40px;
  border: 2px solid var(--neon-cyan);
  font-family: "Orbitron", sans-serif;
  border-radius: 8px;
  background: rgba(8, 0, 22, 0.85);
  box-shadow:
    0 0 12px rgba(0, 232, 255, 0.45),
    0 0 28px rgba(255, 43, 214, 0.25),
    inset 0 0 16px rgba(123, 44, 255, 0.15);
  font-size: 1.35rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 232, 255, 0.7);
  animation: neonPulse 2.2s ease-in-out infinite;
}

@keyframes neonPulse {
  0%, 100% {
    box-shadow:
      0 0 12px rgba(0, 232, 255, 0.4),
      0 0 24px rgba(255, 43, 214, 0.2);
  }
  50% {
    box-shadow:
      0 0 18px rgba(0, 232, 255, 0.7),
      0 0 36px rgba(255, 43, 214, 0.4);
  }
}

.Open {
  animation: openit 2s linear forwards;
  border-radius: 30px;
  pointer-events: none;
}
@keyframes openit {
  0% {
    transform: scale(1) translateY(0px);
  }
  25% {
    transform: scale(0.5);
  }
  30% {
    transform: scale(0.5) translateY(-400px) rotate(5deg);
  }
  50% {
    transform: scale(0.5) translateY(2000px);
  }
  100% {
    transform: scale(0.5) translateY(2000px);
    display: none;
  }
}


#celebrate{
  position: absolute;
  z-index: 10;
  width: 100%;
  bottom: 0;
  left: 0;
  padding: 20px 10px;
  justify-content: center;
  box-sizing: border-box;
  transform: translateY(500px);
  /* display: none; */
}
#celebrate.active{
  transition: all .5s ease-in-out;
  transform: translateY(0px);
  display: flex;
}
#celebrate button{
  font-family: "Orbitron", sans-serif;
  outline: 0;
  border: 2px solid var(--neon-magenta);
  background-color: rgba(8, 0, 22, 0.9);
  border-radius: 8px;
  box-shadow: 0 0 16px rgba(255, 43, 214, 0.45);
  box-sizing: border-box;
  padding: 12px 40px;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  text-shadow: 0 0 10px rgba(255, 43, 214, 0.65);
}
#promosion{
  display: none;
}
.promot{
  user-select: none;      
  -webkit-user-drag: none;
  width: 100%;
  height: 100%;
  position: absolute;
  z-index: 15;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.079);
  backdrop-filter: blur(5px);
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
}
.promot button{
  font-family: "Orbitron", sans-serif;
  outline: 0;
  background-color: rgba(8, 0, 22, 0.92);
  border: 2px solid var(--neon-cyan);
  border-radius: 8px;
  box-shadow: 0 0 14px rgba(0, 232, 255, 0.35);
  box-sizing: border-box;
  padding: 12px 20px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  min-width: 140px;
  text-shadow: 0 0 8px rgba(0, 232, 255, 0.5);
}
.btn {
  pointer-events: all !important;
  font-family: "Orbitron", sans-serif;
  outline: 0;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(8, 0, 22, 0.9);
  min-width: 200px;
  border: 2px solid var(--neon-magenta);
  border-radius: 8px;
  box-shadow:
    0 0 14px rgba(255, 43, 214, 0.45),
    0 0 28px rgba(0, 232, 255, 0.2),
    inset 0 0 18px rgba(123, 44, 255, 0.18);
  box-sizing: border-box;
  padding: 12px 30px;
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  overflow: hidden;
  cursor: pointer;
  text-shadow: 0 0 10px rgba(255, 43, 214, 0.65);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}
.btn.options{
  font-size: 18px;
  border-color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 232, 255, 0.65);
}

.btn:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow:
    0 0 18px rgba(0, 232, 255, 0.55),
    0 0 36px rgba(255, 43, 214, 0.35);
}

.btn .animation {
  border-radius: 100%;
  animation: ripple 0.6s linear infinite;
}

/* Neon honeycomb color picker */
.neon-hex-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 1;
}

.neon-hex-wrap .picker-label {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 232, 255, 0.7);
  font-size: clamp(0.75rem, 2.4vw, 0.95rem);
}

.neon-hex-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px 12px;
}

.hex-row {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.hex-row.offset {
  margin-left: 0;
}

.hex-swatch {
  --hex-c: #00e8ff;
  width: 34px;
  height: 38px;
  border: none;
  padding: 0;
  cursor: pointer;
  background: var(--hex-c);
  opacity: 0.85;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  box-shadow:
    0 0 10px var(--hex-c),
    0 0 22px var(--hex-c);
  outline: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

.hex-swatch:hover,
.hex-swatch:focus-visible {
  transform: scale(1.14);
  opacity: 1;
  filter: brightness(1.2);
  box-shadow:
    0 0 14px var(--hex-c),
    0 0 30px var(--hex-c);
}

.hex-swatch.selected {
  transform: scale(1.18);
  opacity: 1;
  box-shadow:
    0 0 0 2px #fff,
    0 0 16px var(--hex-c),
    0 0 34px var(--hex-c);
}

.hex-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Orbitron", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e8d6ff;
}

.hex-preview .chip {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  box-shadow: 0 0 10px currentColor;
}

.move-first {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-family: "Orbitron", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(0, 232, 255, 0.65);
  cursor: pointer;
  user-select: none;
}

.move-first input {
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 2px solid var(--neon-cyan);
  border-radius: 4px;
  background: rgba(8, 0, 22, 0.85);
  box-shadow: 0 0 10px rgba(0, 232, 255, 0.35);
  cursor: pointer;
  position: relative;
}

.move-first input:checked {
  background: var(--neon-cyan);
  box-shadow:
    0 0 12px rgba(0, 232, 255, 0.7),
    inset 0 0 6px rgba(255, 255, 255, 0.35);
}

.move-first input:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #070012;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

@media (min-width: 480px) {
  .hex-swatch {
    width: 40px;
    height: 44px;
  }
  .hex-row {
    gap: 6px;
  }
}

@keyframes ripple {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 43, 214, 0.15),
      0 0 0 16px rgba(0, 232, 255, 0.12),
      0 0 0 32px rgba(255, 43, 214, 0.08),
      0 0 0 48px rgba(0, 232, 255, 0.05);
  }

  100% {
    box-shadow: 0 0 0 16px rgba(0, 232, 255, 0.12),
      0 0 0 32px rgba(255, 43, 214, 0.08),
      0 0 0 48px rgba(0, 232, 255, 0.05),
      0 0 0 64px rgba(255, 43, 214, 0);
  }
}
@media (max-width:500px) {
  .facts{
    font-size: 14px;
  }
  #fingers{
    font-size: 18px !important;
  }
}
