:root{
  --title-font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  --body-font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  --title-fx: float;
  --nebula-mode: violet;

  --title-c1: rgba(255,255,255,0.95);
  --title-c2: rgba(170,120,255,0.95);
  --title-c3: rgba(120,200,255,0.95);
  --title-size: clamp(28px, 4vw, 48px);
  --intro-size: 16px;

  --bg: #050610;
  --panel: rgba(10, 12, 25, 0.68);
  --panel2: rgba(10, 12, 25, 0.55);
  --border: rgba(255,255,255,0.10);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.65);
  --glow: rgba(142, 208, 255, 0.22);
  --accent: rgba(142, 208, 255, 0.9);
}

*{ box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin:0;
  font-family: var(--body-font);
  color: var(--text);
  background: radial-gradient(1200px 800px at 70% 20%, rgba(145, 80, 255, 0.18), rgba(0,0,0,0) 60%),
              radial-gradient(900px 700px at 20% 80%, rgba(60, 120, 255, 0.14), rgba(0,0,0,0) 55%),
              linear-gradient(180deg, #03010a 0%, #04021a 35%, #02010f 100%);
overflow-x: hidden;
}

#starCanvas{
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
}

.topbar{
  position: relative;
  z-index: 2;
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  padding: 18px 22px;
}

.brand-title{
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-shadow: 0 0 24px var(--glow);
}
.brand-sub{
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.4px;
}

.nav{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-link{
  text-decoration: none;
  color: var(--text);
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.nav-link:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.10);
}
.nav-link.active{
  background: rgba(142, 208, 255, 0.12);
  border-color: rgba(142, 208, 255, 0.25);
  box-shadow: 0 0 30px rgba(142, 208, 255, 0.12);
}

.lang{
  color: var(--muted);
  font-size: 13px;
  padding: 10px 6px;
}
.lang-link{
  color: var(--muted);
  text-decoration: none;
}
.lang-link:hover{ color: var(--text); }

.main{
  position: relative;
  z-index: 2;
  min-height: calc(100vh - 140px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 28px 18px 18px;
}

.panel{
  width: min(980px, 96vw);
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  box-shadow: 0 10px 60px rgba(0,0,0,0.45);
  backdrop-filter: blur(10px);
  padding: 26px 22px;
}

.center{
  text-align:center;
}

.hero-title{
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 900;
  letter-spacing: 0.6px;
  text-shadow: 0 0 30px var(--glow);
}

.constellation{
  margin: 10px auto 8px;
  width: min(740px, 92vw);
  height: 120px;
  border-radius: 18px;
  border: 1px dashed rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.15);
  display:flex;
  align-items:center;
  justify-content:center;
  position: relative;
  overflow:hidden;
}
.constellation canvas{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
}

.intro{
  margin: 18px auto 6px;
  max-width: 780px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  min-height: 64px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  border-radius: 16px;
  padding: 12px 16px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor:pointer;
  text-decoration:none;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover{
  transform: translateY(-1px);
  background: rgba(142, 208, 255, 0.10);
  border-color: rgba(142, 208, 255, 0.25);
  box-shadow: 0 0 30px rgba(142, 208, 255, 0.14);
}

.form{
  display:grid;
  gap: 12px;
  width: min(520px, 92vw);
  margin: 0 auto;
}
.field{
  display:grid;
  gap: 8px;
  text-align:left;
}
label{
  color: var(--muted);
  font-size: 13px;
}
input[type="text"], input[type="password"], input[type="email"]{
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  outline: none;
}
input:focus{
  border-color: rgba(142, 208, 255, 0.35);
  box-shadow: 0 0 0 3px rgba(142, 208, 255, 0.12);
}

.row{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hint{
  color: var(--muted);
  font-size: 13px;
}
.error{
  border: 1px solid rgba(255, 115, 115, 0.35);
  background: rgba(255, 115, 115, 0.08);
  padding: 10px 12px;
  border-radius: 16px;
}
.ok{
  border: 1px solid rgba(142, 255, 182, 0.28);
  background: rgba(142, 255, 182, 0.08);
  padding: 10px 12px;
  border-radius: 16px;
}

.footer{
  position: relative;
  z-index: 2;
  padding: 14px 18px 22px;
  display:flex;
  gap: 10px;
  justify-content:center;
  align-items:center;
  color: var(--muted);
}
.footer-link{
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  padding: 6px 8px;
}
.footer-link:hover{ color: var(--text); }
.dot{ opacity: .6; }

.modal, .admin-panel{
  position: fixed;
  inset: 0;
  display:none;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,0.55);
  z-index: 50;
  padding: 18px;
}
.modal.show, .admin-panel.show{ display:flex; }

.modal-card, .admin-card{
  width: min(920px, 96vw);
  max-height: 80vh;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(10, 12, 25, 0.88);
  box-shadow: 0 12px 90px rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
}
.modal-head{
  position: sticky;
  top: 0;
  z-index: 2;

  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
.modal-title{
  font-weight: 800;
  letter-spacing: .3px;
}
.icon-btn{
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-radius: 12px;
  padding: 6px 10px;
  cursor:pointer;
}
.modal-body{
  margin: 0;
  padding: 14px 16px;
  white-space: pre-wrap;
  color: var(--muted);
  overflow:auto;
  max-height: calc(80vh - 54px);
}
.admin-body{
  padding: 14px 16px 18px;
  color: var(--muted);
  max-height: calc(80vh - 56px);
  overflow-y: auto;
}
.admin-body::-webkit-scrollbar{ width: 10px; }
.admin-body::-webkit-scrollbar-thumb{ background: rgba(255,255,255,0.12); border-radius: 999px; }
.admin-body::-webkit-scrollbar-track{ background: rgba(0,0,0,0.18); }

.admin-body code{ color: var(--text); }

.toast{
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(10, 12, 25, 0.92);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  display:none;
}
.toast.show{ display:block; }


/* Welcome page: remove the central dark window */
.panel--clear{
  border: none;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  padding: 0;
}

/* Gradient title */
/* Subtle text glow */
.hero-title, .brand-title{
  filter: drop-shadow(0 0 18px rgba(160,120,255,0.20)) drop-shadow(0 0 22px rgba(120,200,255,0.12));
}


.hero-title{
  font-size: var(--title-size);
  font-weight: 900;
  letter-spacing: 0.6px;
  text-shadow: 0 0 30px var(--glow);
  background: linear-gradient(90deg, var(--title-c1), var(--title-c2), var(--title-c3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.intro{
  font-size: var(--intro-size);
}


@keyframes amFloat{
  0% { transform: translate3d(0,0,0); }
  50% { transform: translate3d(0,-10px,0); }
  100% { transform: translate3d(0,0,0); }
}
@keyframes amDrift{
  0% { transform: translate3d(0,0,0); }
  50% { transform: translate3d(12px,-8px,0); }
  100% { transform: translate3d(0,0,0); }
}
@keyframes amShimmer{
  0% { filter: drop-shadow(0 0 18px rgba(160,120,255,0.22)) drop-shadow(0 0 22px rgba(120,200,255,0.12)); opacity: .96; }
  50% { filter: drop-shadow(0 0 28px rgba(160,120,255,0.32)) drop-shadow(0 0 34px rgba(120,200,255,0.18)); opacity: 1; }
  100% { filter: drop-shadow(0 0 18px rgba(160,120,255,0.22)) drop-shadow(0 0 22px rgba(120,200,255,0.12)); opacity: .96; }
}

.floaty{ animation: amFloat 6.5s ease-in-out infinite; }
.drifty{ animation: amDrift 9.5s ease-in-out infinite; }
.shimmer{ animation: amShimmer 5.2s ease-in-out infinite; }

/* Title flying effect variants (controlled by --title-fx) */
.hero-title{
  font-family: var(--title-font);
}
body[data-titlefx="float"] .hero-title{ animation: amFloat 6.5s ease-in-out infinite, amShimmer 5.2s ease-in-out infinite; }
body[data-titlefx="drift"] .hero-title{ animation: amDrift 10.0s ease-in-out infinite, amShimmer 5.2s ease-in-out infinite; }
body[data-titlefx="shimmer"] .hero-title{ animation: amShimmer 4.8s ease-in-out infinite; }

/* Make intro/button gently float too */
.intro{ animation: amDrift 12s ease-in-out infinite; }
.btn{ animation: amFloat 8.5s ease-in-out infinite; }

/* Nebula overlay modes (canvas does the heavy lifting, this adds subtle color wash) */
body[data-nebula="violet"] .main::before{
  content:"";
  position:absolute; inset:-40px;
  pointer-events:none;
  background: radial-gradient(900px 600px at 75% 25%, rgba(170,110,255,0.18), rgba(0,0,0,0) 60%),
              radial-gradient(800px 520px at 20% 75%, rgba(70,130,255,0.14), rgba(0,0,0,0) 58%);
  filter: blur(2px);
}
body[data-nebula="teal"] .main::before{
  content:"";
  position:absolute; inset:-40px;
  pointer-events:none;
  background: radial-gradient(860px 560px at 70% 30%, rgba(80,240,220,0.14), rgba(0,0,0,0) 60%),
              radial-gradient(760px 520px at 25% 75%, rgba(90,160,255,0.12), rgba(0,0,0,0) 58%);
  filter: blur(2px);
}
body[data-nebula="ember"] .main::before{
  content:"";
  position:absolute; inset:-40px;
  pointer-events:none;
  background: radial-gradient(860px 560px at 68% 32%, rgba(255,120,90,0.12), rgba(0,0,0,0) 60%),
              radial-gradient(760px 520px at 25% 75%, rgba(170,110,255,0.10), rgba(0,0,0,0) 58%);
  filter: blur(2px);
}
body[data-nebula="none"] .main::before{ content:none; }


.constellation-label{
  position: fixed;
  left: 50%;
  top: 36%;
  transform: translate(-50%, 0);
  z-index: 2;
  pointer-events: none;
  text-align: center;
  opacity: 0;
  transition: opacity 280ms ease;
  font-family: var(--body-font);
}

.constellation-label.show{ opacity: 1; }

.constellation-label .glyph{
  font-family: "Segoe UI Symbol", "Noto Sans Symbols", system-ui, Arial;
  font-size: 34px;
  line-height: 1;
  opacity: 0.85;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 14px rgba(170,120,255,0.25));
}

.constellation-label .name{
  font-weight: 900;
  letter-spacing: 0.22em;
  font-size: 14px;
  opacity: 0.68;
  text-transform: uppercase;
}



/* Hide center content (title/text/buttons) */
body[data-hidecenter="1"] .hero{ display:none !important; }
body[data-hidecenter="1"] .topbar{ opacity:0; pointer-events:none; }
body[data-hidecenter="1"] .footer{ opacity:0; pointer-events:none; }

body[data-page="login"] #constellationLabel{ display:none !important; }


.menu-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  max-width: 900px;
  margin: 18px auto 0;
}
.card{
  display:block;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.92);
  text-decoration:none;
  backdrop-filter: blur(10px);
  transition: transform 220ms ease, background 220ms ease;
}
.card:hover{ transform: translateY(-2px); background: rgba(0,0,0,0.28); }

.lang-box{display:inline-flex;align-items:center;gap:8px;margin-left:10px}
.lang-select{background:rgba(0,0,0,0.25);color:#fff;border:1px solid rgba(255,255,255,0.25);border-radius:10px;padding:8px 10px;outline:none}
.lang-select option{color:#000}


/* Hide UI (stars only) */
body.hide-ui header, body.hide-ui .hero, body.hide-ui footer{ opacity:0; pointer-events:none; }
body.hide-ui .main{ overflow:hidden; }
