#bg,
#fond1 {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.4s ease;
}

#bg {
  z-index: -2;
  display: block;
}

#fond1 {
  z-index: -1;
  display: none;
  filter: saturate(1.02) brightness(0.82);
}

#videoLoader {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(8, 10, 16, 0.46), rgba(8, 10, 16, 0.9));
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 0.3s ease;
}

.pl {
  --bg: #080a10;
  --primary1: var(--hot);
  --primary2: var(--accent);
  --fg-t: rgba(94, 234, 212, 0.75);
  --trans-dur: 0.2s;
  width: 14em;
  height: 14em;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--text);
  text-transform: uppercase;
  transform: rotateX(30deg) rotateZ(45deg);
  box-shadow: 2em 0 2em rgba(0, 0, 0, 0.3) inset, -2em 0 2em rgba(94, 234, 212, 0.08) inset;
}

.pl,
.pl__dot {
  border-radius: 50%;
}

.pl__dot {
  top: calc(50% - 0.75em);
  left: calc(50% - 0.75em);
  width: 1.5em;
  height: 1.5em;
  transform: rotate(var(--r)) translateX(5em) rotate(var(--rr));
  z-index: var(--z);
  animation-name: shadow724;
}

.pl__dot,
.pl__dot:before,
.pl__dot:after {
  position: absolute;
  animation-duration: 2s;
  animation-delay: var(--d);
  animation-iteration-count: infinite;
}

.pl__dot:before,
.pl__dot:after {
  content: "";
  display: block;
  left: 0;
  width: inherit;
}

.pl__dot:before {
  height: inherit;
  z-index: 1;
  border-radius: inherit;
  background-color: var(--bg);
  box-shadow: 0.05em 0 0.1em rgba(255, 255, 255, 0.18) inset;
  animation-name: pushInOut1724;
}

.pl__dot:after {
  bottom: 0;
  height: 3em;
  border-radius: 0.75em;
  background-color: var(--primary1);
  clip-path: polygon(0 75%, 100% 75%, 100% 100%, 0 100%);
  transform: rotate(-45deg);
  transform-origin: 50% 2.25em;
  box-shadow: 0.1em 0.3em 0.2em rgba(255, 255, 255, 0.35) inset, 0 -0.4em 0.2em #151820 inset, 0 -1em 0.25em rgba(0, 0, 0, 0.28) inset;
  animation-name: pushInOut2724;
}

.pl__dot:nth-child(1) { --r: 0deg; --rr: 0deg; --d: 0s; --z: 5; }
.pl__dot:nth-child(2) { --r: -30deg; --rr: 30deg; --d: -0.166s; --z: 4; }
.pl__dot:nth-child(3) { --r: -60deg; --rr: 60deg; --d: -0.333s; --z: 3; }
.pl__dot:nth-child(4) { --r: -90deg; --rr: 90deg; --d: -0.5s; --z: 2; }
.pl__dot:nth-child(5) { --r: -120deg; --rr: 120deg; --d: -0.666s; --z: 1; }
.pl__dot:nth-child(6) { --r: -150deg; --rr: 150deg; --d: -0.833s; --z: 1; }
.pl__dot:nth-child(7) { --r: -180deg; --rr: 180deg; --d: -1s; --z: 2; }
.pl__dot:nth-child(8) { --r: -210deg; --rr: 210deg; --d: -1.166s; --z: 3; }
.pl__dot:nth-child(9) { --r: -240deg; --rr: 240deg; --d: -1.333s; --z: 4; }
.pl__dot:nth-child(10) { --r: -270deg; --rr: 270deg; --d: -1.5s; --z: 5; }
.pl__dot:nth-child(11) { --r: -300deg; --rr: 300deg; --d: -1.666s; --z: 6; }
.pl__dot:nth-child(12) { --r: -330deg; --rr: 330deg; --d: -1.833s; --z: 6; }

.pl__text {
  max-width: 6rem;
  position: relative;
  font-size: 0.8em;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 0 0.15em var(--fg-t);
  transform: rotateZ(-45deg);
  letter-spacing: 1px;
}

#player {
  position: relative;
  width: 100vw;
  height: 100vh;
}

/* --------------------------------------------------------------------------
   Topbar Navigation
   -------------------------------------------------------------------------- */

#topbar {
  position: fixed;
  top: 14px;
  left: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 30;
  padding: 8px 14px;
  background: rgba(8, 12, 20, 0.65);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.topbar-left,
.topbar-center,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-left {
  flex-shrink: 0;
}

.topbar-center {
  flex-wrap: wrap;
  justify-content: center;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.topbar-btn {
  height: 42px;
  min-width: 42px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-weight: 600;
}

.topbar-btn.icon-only {
  padding: 0;
  width: 42px;
}

.topbar-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.topbar-btn.active {
  background: rgba(94, 234, 212, 0.2);
  border-color: var(--accent);
  color: var(--accent);
}

.topbar-btn.terminal-accent {
  border-color: rgba(74, 222, 128, 0.4);
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
}

.topbar-btn.terminal-accent:hover {
  background: rgba(74, 222, 128, 0.24);
  border-color: #4ade80;
  box-shadow: 0 0 15px rgba(74, 222, 128, 0.25);
}

#backBtn {
  display: none;
  font-size: 18px;
  width: 42px;
  padding: 0;
}

.clock-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.session-badge {
  padding: 5px 10px 5px 12px;
  border: 1px solid rgba(94, 234, 212, 0.35);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.85);
  color: #5eead4;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.topbar-logout-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--muted);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 11px;
  transition: all 0.15s ease;
}

.topbar-logout-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fca5a5;
}

/* --------------------------------------------------------------------------
   Full-Screen Authentication Gate (Lockscreen)
   -------------------------------------------------------------------------- */

.login-gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  background: radial-gradient(circle at center, rgba(8, 10, 16, 0.5) 0%, rgba(8, 10, 16, 0.88) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: opacity 0.35s ease, visibility 0.35s ease, transform 0.35s ease;
}

.login-gate.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.03);
}

.login-gate-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(8, 14, 26, 0.98));
  border: 1px solid rgba(94, 234, 212, 0.35);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8), 0 0 35px rgba(94, 234, 212, 0.12);
  border-radius: 20px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.login-gate-card::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(94, 234, 212, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.login-gate-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.login-gate-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.gate-logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.login-gate-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.quick-user-select-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.quick-user-label {
  font-size: 12px;
  color: var(--muted);
}

.quick-user-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.18s ease;
}

.quick-user-btn:hover {
  background: rgba(94, 234, 212, 0.2);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.login-gate-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrap i {
  position: absolute;
  left: 14px;
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}

.input-icon-wrap input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #ffffff;
  font-size: 14px;
  transition: all 0.2s ease;
}

.input-icon-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(94, 234, 212, 0.25);
  background: rgba(0, 0, 0, 0.6);
}

.gate-submit-btn {
  width: 100%;
  padding: 14px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #042f2e;
  border: none;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(94, 234, 212, 0.35);
  margin-top: 4px;
  cursor: pointer;
}

.gate-submit-btn:hover {
  background: linear-gradient(135deg, #a7f3d0, var(--accent));
  box-shadow: 0 6px 20px rgba(94, 234, 212, 0.5);
  transform: translateY(-1px);
}

.login-error-msg {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  text-align: center;
}



/* --------------------------------------------------------------------------
   Overlays (Music & Docs)
   -------------------------------------------------------------------------- */

#overlay,
#docsOverlay {
  position: absolute;
  inset: 80px 24px 24px;
  display: none;
  flex-direction: column;
  gap: 12px;
  z-index: 10;
  overflow-y: auto;
}

#overlay {
  inset: 80px 24px 140px;
}

/* Docs Specific Styles */
.docs-menu {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 40px;
}

.docs-search-bar {
  position: relative;
  width: 100%;
}

.docs-search-bar i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  font-size: 15px;
}

.docs-search-bar input {
  padding-left: 42px;
  height: 46px;
  border-radius: 12px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  font-size: 14px;
}

.docs-category-title {
  display: flex;
  align-items: center;
  margin-top: 10px;
}

.docs-category-title h2 {
  font-size: 16px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.doc-button {
  position: relative;
  display: block;
  text-decoration: none;
  color: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 16px;
  transition: all 0.2s ease;
}

.doc-button:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.doc-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 15px;
}

.doc-icon {
  font-size: 18px;
  color: var(--accent);
}

/* Animations */
@keyframes shadow724 {
  0%, 50%, 100% { box-shadow: 0.1em 0.1em 0 0.1em #020307, 0.3em 0 0.3em rgba(0, 0, 0, 0.35); }
  25% { box-shadow: 0.1em 0.1em 0 0.1em #020307, 0.8em 0 0.8em rgba(251, 113, 133, 0.28); }
}

@keyframes pushInOut1724 {
  0%, 50%, 100% { background-color: var(--bg); transform: translate(0, 0); }
  25% { background-color: var(--primary2); transform: translate(-71%, -71%); }
}

@keyframes pushInOut2724 {
  0%, 50%, 100% { background-color: var(--bg); clip-path: polygon(0 75%, 100% 75%, 100% 100%, 0 100%); }
  25% { background-color: var(--primary1); clip-path: polygon(0 25%, 100% 25%, 100% 100%, 0 100%); }
}

/* --------------------------------------------------------------------------
   Responsive Rules
   -------------------------------------------------------------------------- */

@media (max-width: 960px) {
  #topbar {
    flex-wrap: wrap;
    padding: 10px;
  }
  
  .topbar-center {
    order: 3;
    width: 100%;
    justify-content: space-between;
    margin-top: 6px;
  }
  
  .nav-btn .btn-label {
    display: none;
  }

  .nav-btn {
    padding: 0;
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 600px) {
  .brand-name {
    display: none;
  }
  
  .clock-badge {
    display: none;
  }

  #overlay,
  #docsOverlay,
  #servicesOverlay {
    inset: 120px 10px 10px;
  }
}
