/* ============================================================
   NOVA — Portofolio bertema semesta
   Palet: deep space + nebula ungu/cyan/pink
   ============================================================ */

:root {
  --bg: #050510;
  --bg-soft: #0a0a1e;
  --card: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #e8e8f5;
  --text-muted: #9a9ab8;
  --purple: #8b5cf6;
  --cyan: #22d3ee;
  --pink: #ec4899;
  --gradient: linear-gradient(135deg, var(--purple), var(--cyan));
  --gradient-3: linear-gradient(
    135deg,
    var(--purple),
    var(--pink),
    var(--cyan)
  );
  --font-head: "Space Grotesk", sans-serif;
  --font-body: "Poppins", sans-serif;
  --font-logo: "Orbitron", sans-serif;
  --radius: 16px;
  --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.25);
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
}

::selection {
  background: var(--purple);
  color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--purple), var(--cyan));
  border-radius: 10px;
}

/* ============ Latar semesta ============ */
#starfield {
  position: fixed;
  inset: 0;
  z-index: -2;
  display: block;
}

.nebula {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  z-index: -1;
  pointer-events: none;
  animation: nebula-drift 24s ease-in-out infinite alternate;
}
.nebula-1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(
    circle,
    rgba(139, 92, 246, 0.55),
    transparent 70%
  );
  top: -140px;
  left: -140px;
}
.nebula-2 {
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.4), transparent 70%);
  bottom: -120px;
  right: -120px;
  animation-delay: -8s;
}
.nebula-3 {
  width: 380px;
  height: 380px;
  background: radial-gradient(
    circle,
    rgba(236, 72, 153, 0.35),
    transparent 70%
  );
  top: 45%;
  left: 55%;
  animation-delay: -16s;
}
@keyframes nebula-drift {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(60px, 40px) scale(1.15);
  }
}

/* ============ Utilitas ============ */
.container {
  width: min(1120px, 92%);
  margin-inline: auto;
}

.gradient-text {
  background: var(--gradient-3);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: gradient-shift 6s ease infinite;
}
@keyframes gradient-shift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.section {
  padding: 110px 0;
  position: relative;
}

.section-tag {
  font-family: var(--font-logo);
  font-size: 0.8rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 8px;
}

.section-title {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 48px;
}

.section-desc {
  max-width: 560px;
  color: var(--text-muted);
  margin-top: -32px;
  margin-bottom: 48px;
}

/* Animasi reveal saat scroll */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.delay-1 {
  transition-delay: 0.1s;
}
.delay-2 {
  transition-delay: 0.2s;
}
.delay-3 {
  transition-delay: 0.3s;
}
.delay-4 {
  transition-delay: 0.4s;
}
.delay-5 {
  transition-delay: 0.5s;
}

/* Tombol */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 999px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    background 0.3s ease;
}
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(34, 211, 238, 0.45);
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
}
.btn-outline:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(-3px);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.25);
}
.btn-full {
  width: 100%;
}

/* ============ Navbar ============ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 18px 0;
  transition:
    background 0.4s ease,
    padding 0.4s ease,
    box-shadow 0.4s ease;
}
.navbar.scrolled {
  padding: 10px 0;
  background: rgba(5, 5, 16, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid var(--card-border);
}

.nav-container {
  width: min(1120px, 92%);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-logo);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.nav-logo span {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}
.nav-link {
  padding: 8px 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 400;
  border-radius: 999px;
  transition:
    color 0.3s ease,
    background 0.3s ease;
}
.nav-link:hover {
  color: var(--text);
}
.nav-link.active {
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.08);
}
.nav-cta {
  border: 1.5px solid var(--purple);
  color: var(--text);
  margin-left: 8px;
}
.nav-cta:hover {
  background: var(--purple);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 110;
}
.hamburger span {
  width: 26px;
  height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}
.hamburger.open span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* ============ Hero ============ */
.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 32px;
  width: min(1120px, 92%);
  margin-inline: auto;
  padding-top: 90px;
  position: relative;
}

.hero-greeting {
  font-family: var(--font-logo);
  font-size: 0.85rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-head);
  font-size: clamp(2.6rem, 6.5vw, 4.4rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 12px;
}

.hero-typing {
  font-family: var(--font-head);
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  font-weight: 500;
  color: var(--text-muted);
  min-height: 2.2em;
  margin-bottom: 16px;
}
.typing-cursor {
  color: var(--cyan);
  animation: blink 0.9s step-end infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero-desc {
  max-width: 480px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}

.hero-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero-socials a {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text-muted);
  transition:
    color 0.3s ease,
    border-color 0.3s ease,
    transform 0.3s ease,
    box-shadow 0.3s ease;
}
.hero-socials svg {
  width: 20px;
  height: 20px;
}
.hero-socials a:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  transform: translateY(-4px);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.3);
}

/* Planet */
.hero-visual {
  display: grid;
  place-items: center;
  transition: transform 0.2s ease-out;
}
.planet-system {
  position: relative;
  width: 340px;
  height: 340px;
  display: grid;
  place-items: center;
}
.planet {
  position: relative;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 32% 30%,
    #c4b5fd 0%,
    #8b5cf6 35%,
    #4c1d95 70%,
    #1e1b4b 100%
  );
  box-shadow:
    inset -18px -14px 40px rgba(0, 0, 0, 0.55),
    0 0 60px rgba(139, 92, 246, 0.45),
    0 0 120px rgba(139, 92, 246, 0.2);
  animation: planet-float 6s ease-in-out infinite;
  z-index: 2;
  overflow: hidden;
}
@keyframes planet-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-16px);
  }
}
.crater {
  position: absolute;
  border-radius: 50%;
  background: rgba(30, 27, 75, 0.5);
  box-shadow: inset 2px 2px 6px rgba(0, 0, 0, 0.5);
}
.crater-1 {
  width: 34px;
  height: 34px;
  top: 26%;
  left: 22%;
}
.crater-2 {
  width: 20px;
  height: 20px;
  top: 58%;
  left: 56%;
}
.crater-3 {
  width: 14px;
  height: 14px;
  top: 40%;
  left: 68%;
}

.planet-ring {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: rgba(34, 211, 238, 0.55);
  border-bottom-color: rgba(236, 72, 153, 0.45);
  transform: rotateX(72deg);
  animation: ring-spin 10s linear infinite;
  z-index: 1;
}
@keyframes ring-spin {
  from {
    transform: rotateX(72deg) rotateZ(0deg);
  }
  to {
    transform: rotateX(72deg) rotateZ(360deg);
  }
}

.orbit {
  position: absolute;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}
.orbit-1 {
  width: 260px;
  height: 260px;
  animation: orbit-spin 14s linear infinite;
}
.orbit-2 {
  width: 340px;
  height: 340px;
  animation: orbit-spin 22s linear infinite reverse;
}
@keyframes orbit-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.moon {
  position: absolute;
  border-radius: 50%;
}
.moon-1 {
  width: 18px;
  height: 18px;
  top: -9px;
  left: 50%;
  background: radial-gradient(circle at 35% 35%, #a5f3fc, #0891b2);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.8);
}
.moon-2 {
  width: 12px;
  height: 12px;
  top: 50%;
  right: -6px;
  background: radial-gradient(circle at 35% 35%, #fbcfe8, #db2777);
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.8);
}

.floating-astronaut {
  position: absolute;
  top: -8%;
  right: -4%;
  font-size: 2.6rem;
  animation: astro-float 7s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.6));
  z-index: 3;
}
@keyframes astro-float {
  0%,
  100% {
    transform: translate(0, 0) rotate(-8deg);
  }
  50% {
    transform: translate(-14px, 20px) rotate(10deg);
  }
}

/* Scroll indicator */
.scroll-down {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-muted);
  opacity: 0.8;
}
.mouse {
  width: 24px;
  height: 38px;
  border: 2px solid var(--text-muted);
  border-radius: 999px;
  display: block;
  position: relative;
}
.wheel {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 4px;
  background: var(--cyan);
  animation: wheel-scroll 1.8s ease infinite;
}
@keyframes wheel-scroll {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(14px);
  }
}
.scroll-text {
  font-size: 0.72rem;
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* ============ Tentang ============ */
.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 56px;
  align-items: center;
}

.avatar-frame {
  position: relative;
  width: 260px;
  height: 260px;
  margin-inline: auto;
  display: grid;
  place-items: center;
}
.avatar-placeholder {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 5.5rem;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(139, 92, 246, 0.35),
    rgba(5, 5, 16, 0.9)
  );
  border: 1.5px solid var(--card-border);
  box-shadow: var(--shadow-glow);
}
.avatar-frame img {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--card-border);
  box-shadow: var(--shadow-glow);
}
.avatar-orbit {
  position: absolute;
  inset: 0;
  border: 1.5px dashed rgba(34, 211, 238, 0.35);
  border-radius: 50%;
  animation: orbit-spin 16s linear infinite;
}
.avatar-orbit span {
  position: absolute;
  top: -6px;
  left: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
}

.about-text h3 {
  font-family: var(--font-head);
  font-size: 1.5rem;
  margin-bottom: 16px;
}
.about-text p {
  color: var(--text-muted);
  margin-bottom: 16px;
}
.about-text strong {
  color: var(--text);
  font-weight: 500;
}

.about-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 28px;
}
.stat {
  flex: 1;
  min-width: 130px;
  padding: 20px 16px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  transition:
    transform 0.3s ease,
    border-color 0.3s ease;
}
.stat:hover {
  transform: translateY(-6px);
  border-color: var(--purple);
}
.stat-number,
.stat-plus {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.stat p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============ Keahlian ============ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.skill-card {
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  transition:
    transform 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}
.skill-card:hover {
  transform: translateY(-8px);
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: var(--shadow-glow);
}
.skill-icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
}
.skill-card h3 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  margin-bottom: 16px;
}
.skill-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.skill-progress {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--gradient);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.6);
  transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.skill-percent {
  display: block;
  text-align: right;
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--cyan);
  font-family: var(--font-head);
}

/* ============ Proyek ============ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(8px);
  transition:
    transform 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}
.project-card:hover {
  transform: translateY(-10px);
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.5),
    var(--shadow-glow);
}

.project-thumb {
  height: 180px;
  display: grid;
  place-items: center;
  font-size: 4rem;
  position: relative;
  overflow: hidden;
}
.project-thumb span {
  transition: transform 0.4s ease;
  filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.35));
}
.project-card:hover .project-thumb span {
  transform: scale(1.25) rotate(-8deg);
}
.thumb-1 {
  background: linear-gradient(135deg, #064e3b, #059669, #0e7490);
}
.thumb-2 {
  background: linear-gradient(135deg, #172554, #b45309, #713f12);
}
.thumb-3 {
  background: linear-gradient(135deg, #500724, #db2777, #a855f7);
}
.thumb-4 {
  background: linear-gradient(135deg, #134e4a, #0d9488, #1e40af);
}
.thumb-5 {
  background: linear-gradient(135deg, #2e1065, #7c3aed, #c026d3);
}
.thumb-6 {
  background: linear-gradient(135deg, #1e1b4b, #5b21b6, #0891b2);
}
.thumb-7 {
  background: linear-gradient(135deg, #082f49, #0891b2, #10b981);
}

.projects-cta {
  text-align: center;
  margin-top: 44px;
}

.project-body {
  padding: 24px;
}
.project-body h3 {
  font-family: var(--font-head);
  font-size: 1.25rem;
  margin-bottom: 8px;
}
.project-body p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.project-tags span {
  font-size: 0.72rem;
  font-family: var(--font-head);
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.25);
}

.project-links {
  display: flex;
  gap: 18px;
}
.project-links a {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s ease;
}
.project-links a:hover {
  color: var(--cyan);
}

/* ============ Kontak ============ */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: start;
}

.contact-form {
  padding: 32px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
}

.form-group {
  position: relative;
  margin-bottom: 24px;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 15px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  resize: vertical;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}
.form-group label {
  position: absolute;
  left: 18px;
  top: 15px;
  font-size: 0.9rem;
  color: var(--text-muted);
  pointer-events: none;
  transition:
    transform 0.25s ease,
    font-size 0.25s ease,
    color 0.25s ease,
    top 0.25s ease;
}
.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
  top: -10px;
  left: 14px;
  font-size: 0.72rem;
  color: var(--cyan);
  background: var(--bg-soft);
  padding: 0 8px;
  border-radius: 6px;
}

.form-status {
  margin-top: 16px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--cyan);
  min-height: 1.4em;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.info-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  transition:
    transform 0.3s ease,
    border-color 0.3s ease;
}
.info-card:hover {
  transform: translateX(8px);
  border-color: var(--cyan);
}
.info-icon {
  font-size: 1.7rem;
}
.info-card h4 {
  font-family: var(--font-head);
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.info-card p,
.info-card a {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-decoration: none;
}
.info-card a:hover {
  color: var(--cyan);
}

/* ============ Footer ============ */
.footer {
  padding: 48px 0 32px;
  text-align: center;
  border-top: 1px solid var(--card-border);
  background: rgba(5, 5, 16, 0.6);
  backdrop-filter: blur(8px);
}
.footer-logo {
  font-family: var(--font-logo);
  font-size: 1.4rem;
  margin-bottom: 8px;
}
.footer p {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-copy {
  margin-top: 12px;
  font-size: 0.78rem !important;
  opacity: 0.7;
}

/* ============ Back to top ============ */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: rgba(10, 10, 30, 0.8);
  backdrop-filter: blur(8px);
  font-size: 1.4rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(20px) rotate(-45deg);
  pointer-events: none;
  transition:
    opacity 0.4s ease,
    transform 0.4s ease,
    box-shadow 0.3s ease;
  z-index: 90;
}
.back-to-top.show {
  opacity: 1;
  transform: translateY(0) rotate(-45deg);
  pointer-events: auto;
}
.back-to-top:hover {
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.5);
  transform: translateY(-4px) rotate(-45deg);
}

/* ============ Responsif ============ */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 120px;
    gap: 48px;
  }
  .hero-desc {
    margin-inline: auto;
  }
  .hero-buttons,
  .hero-socials {
    justify-content: center;
  }
  .hero-visual {
    order: -1;
    margin-top: 20px;
  }
  .planet-system {
    width: 280px;
    height: 280px;
  }
  .planet {
    width: 150px;
    height: 150px;
  }
  .planet-ring {
    width: 240px;
    height: 240px;
  }
  .orbit-1 {
    width: 210px;
    height: 210px;
  }
  .orbit-2 {
    width: 280px;
    height: 280px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  /* backdrop-filter di navbar "mengurung" menu fixed di dalamnya —
     di HP pakai latar solid tanpa blur agar menu benar-benar fullscreen */
  .navbar.scrolled {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(5, 5, 16, 0.94);
  }

  .nav-menu {
    position: fixed;
    inset: 0;
    height: 100dvh;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    background: rgba(5, 5, 16, 0.97);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .nav-menu.open {
    transform: translateX(0);
  }
  .nav-link {
    font-size: 1.15rem;
  }

  .section {
    padding: 80px 0;
  }
  .scroll-down {
    display: none;
  }

  /* --- HP: kartu keahlian berjejer 2, ukuran dipadatkan --- */
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .skill-card {
    padding: 18px 16px;
  }
  .skill-icon {
    font-size: 1.7rem;
    margin-bottom: 8px;
  }
  .skill-card h3 {
    font-size: 0.92rem;
    margin-bottom: 12px;
  }
  .skill-bar {
    height: 6px;
  }
  .skill-percent {
    font-size: 0.75rem;
    margin-top: 6px;
  }

  /* --- HP: kartu proyek berjejer 2, thumb & teks dipadatkan --- */
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .project-thumb {
    height: 110px;
    font-size: 2.4rem;
  }
  .project-body {
    padding: 14px;
  }
  .project-body h3 {
    font-size: 1rem;
    margin-bottom: 6px;
  }
  .project-body p {
    font-size: 0.78rem;
    margin-bottom: 12px;
  }
  .project-tags {
    gap: 6px;
    margin-bottom: 12px;
  }
  .project-tags span {
    font-size: 0.62rem;
    padding: 3px 9px;
  }
  .project-links {
    gap: 12px;
  }
  .project-links a {
    font-size: 0.78rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ============ Mini Game: Astro Dodge ============ */
.game-layout {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 28px;
  align-items: start;
}

.game-wrap {
  max-width: 680px;
  margin-inline: auto;
}

.game-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-family: var(--font-head);
  font-size: 0.95rem;
  color: var(--text-muted);
}
.game-hud strong {
  color: var(--cyan);
  font-size: 1.15rem;
}

.game-help {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.14);
  color: var(--cyan);
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}
.game-help:hover {
  transform: scale(1.12);
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.35);
}

.game-frame {
  position: relative;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: radial-gradient(
    ellipse at 50% 0%,
    rgba(139, 92, 246, 0.12),
    rgba(5, 5, 18, 0.92) 65%
  );
  box-shadow: var(--shadow-glow);
}

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

.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: rgba(5, 5, 16, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.game-overlay.hidden {
  display: none;
}
.game-overlay h3 {
  font-family: var(--font-head);
  font-size: 1.7rem;
}
.game-overlay p {
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 380px;
}

/* Modal peraturan game */
.game-rules {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(5, 5, 16, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.game-rules.hidden {
  display: none;
}
.game-rules-card {
  position: relative;
  width: min(440px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 26px 28px;
  background: rgba(14, 14, 34, 0.92);
  border: 1px solid rgba(139, 92, 246, 0.45);
  border-radius: var(--radius);
  box-shadow: var(--shadow-glow);
}
.game-rules-card h3 {
  font-family: var(--font-head);
  font-size: 1.25rem;
  margin-bottom: 14px;
  padding-right: 28px;
}
.game-rules-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.game-rules-card li {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.game-rules-card strong {
  color: var(--text);
  font-weight: 600;
}
.game-rules-card .btn {
  display: block;
  margin-inline: auto;
}
.game-rules-card::-webkit-scrollbar {
  width: 5px;
}
.game-rules-card::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.5);
  border-radius: 99px;
}

/* Seksi peraturan yang rapi */
.rules-section {
  margin-bottom: 18px;
}
.rules-section h4 {
  font-family: var(--font-head);
  font-size: 0.8rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--cyan);
  padding-bottom: 6px;
  margin-bottom: 10px;
  border-bottom: 1px dashed rgba(139, 92, 246, 0.3);
}
.rules-section ul {
  margin-bottom: 0;
  gap: 8px;
}
.rules-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.rules-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rules-chips span {
  font-size: 0.78rem;
  padding: 4px 11px;
  border-radius: 999px;
  color: var(--text-muted);
  background: rgba(236, 72, 153, 0.08);
  border: 1px solid rgba(236, 72, 153, 0.3);
  white-space: nowrap;
}
.rules-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.rules-list li > b {
  min-width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.rules-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition:
    color 0.3s ease,
    border-color 0.3s ease,
    transform 0.3s ease;
}
.rules-close:hover {
  color: var(--pink);
  border-color: var(--pink);
  transform: rotate(90deg);
}

/* 📊 Panel hasil game over ala arcade */
.game-overlay {
  animation: overlay-in 0.35s ease;
  overflow-y: auto;
}
/* Saat panel hasil tampil, rata atas agar judul tak terpotong */
.game-overlay:has(.go-result:not(.hidden)) {
  justify-content: flex-start;
  padding-top: 22px;
  gap: 10px;
}
@keyframes overlay-in {
  from {
    opacity: 0;
    transform: scale(1.05);
  }
}
.game-overlay h3 {
  animation: title-in 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes title-in {
  from {
    transform: translateY(-14px) scale(0.92);
    opacity: 0;
  }
}

.go-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.go-result.hidden {
  display: none;
}
.game-overlay .go-score-label {
  font-family: var(--font-logo);
  font-size: 0.62rem;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: -8px;
}
.game-overlay .go-score {
  font-family: var(--font-head);
  font-size: 3.4rem;
  font-weight: 700;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(34, 211, 238, 0.35));
}
.game-overlay .go-result.record .go-score {
  background: linear-gradient(135deg, #fde68a, #f59e0b, #fbbf24);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(250, 204, 21, 0.45));
  animation: record-pulse 1.6s ease-in-out infinite;
}
@keyframes record-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

.go-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.go-stat {
  min-width: 88px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.go-stat span {
  font-size: 1.05rem;
}
.go-stat b {
  font-family: var(--font-head);
  font-size: 1.02rem;
  color: var(--text);
}
.go-stat small {
  font-size: 0.6rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.go-badges {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.go-badges.hidden {
  display: none;
}
.go-badges-label {
  font-family: var(--font-logo);
  font-size: 0.58rem;
  letter-spacing: 3px;
  color: var(--text-muted);
}
.go-badge {
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-family: var(--font-head);
  color: #fde68a;
  background: rgba(250, 204, 21, 0.1);
  border: 1px solid rgba(250, 204, 21, 0.45);
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.2);
  animation: badge-pop 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) backwards;
}
@keyframes badge-pop {
  from {
    transform: scale(0);
    opacity: 0;
  }
}

/* 📤 Tombol tantang teman */
.go-share {
  padding: 10px 24px;
  font-size: 0.85rem;
}

/* 🚀 Pemilih skin roket */
.skin-picker {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.skin-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--card-border);
  background: rgba(255, 255, 255, 0.05);
  font-size: 1.15rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}
.skin-btn:hover {
  transform: translateY(-3px) scale(1.08);
}
.skin-btn.selected {
  border-color: var(--cyan);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.12);
}
.skin-btn.locked {
  opacity: 0.35;
  cursor: not-allowed;
  font-size: 0.9rem;
}

/* 💥 Guncangan saat tabrakan */
.game-frame.shake {
  animation: frame-shake 0.45s ease;
}
@keyframes frame-shake {
  10% {
    transform: translate(-7px, 3px);
  }
  30% {
    transform: translate(6px, -4px);
  }
  50% {
    transform: translate(-5px, 2px);
  }
  70% {
    transform: translate(4px, -2px);
  }
  90% {
    transform: translate(-2px, 1px);
  }
}

@media (max-width: 520px) {
  /* --- HUD ramping: muat satu baris di layar sempit --- */
  .game-hud {
    flex-wrap: wrap;
    row-gap: 6px;
    font-size: 0.76rem;
    margin-bottom: 10px;
  }
  .game-hud strong {
    font-size: 0.92rem;
  }
  .game-help {
    width: 27px;
    height: 27px;
    font-size: 0.85rem;
  }

  /* --- Overlay pembuka dipadatkan agar muat di frame pendek --- */
  .game-overlay {
    gap: 8px;
    padding: 12px;
    overflow-y: auto;
    justify-content: flex-start;
  }
  /* pola safe-center: tetap di tengah saat muat, bisa discroll saat tidak */
  .game-overlay > :first-child {
    margin-top: auto;
  }
  .game-overlay > :last-child {
    margin-bottom: auto;
  }
  .game-overlay h3 {
    font-size: 1.1rem;
  }
  .game-overlay p {
    font-size: 0.72rem;
    line-height: 1.45;
    max-width: 300px;
  }
  .game-name-field input {
    width: min(210px, 88%);
    padding: 8px 14px;
    font-size: 0.82rem;
  }
  .skin-picker {
    gap: 6px;
  }
  .skin-btn {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }
  .skin-btn.locked {
    font-size: 0.72rem;
  }
  #game-start {
    padding: 9px 26px;
    font-size: 0.8rem;
  }

  /* --- Layar hasil (game over): frame melar mengikuti isi.
     Canvas game disembunyikan sementara & overlay masuk aliran normal,
     jadi skor + statistik + lencana + tombol tampil utuh tanpa scroll --- */
  .game-frame:has(.game-overlay:not(.hidden) .go-result:not(.hidden))
    #game-canvas {
    display: none;
  }
  .game-frame:has(.game-overlay:not(.hidden) .go-result:not(.hidden))
    .game-overlay {
    position: static;
    padding: 22px 14px;
  }

  .game-overlay .go-score-label {
    letter-spacing: 2.5px;
  }
  .game-overlay .go-score {
    font-size: 2.5rem;
  }
  .go-stats {
    gap: 8px;
  }
  .go-stat {
    min-width: 68px;
    padding: 7px 8px;
  }
  .go-stat b {
    font-size: 0.9rem;
  }
  .go-stat small {
    font-size: 0.54rem;
    letter-spacing: 1px;
  }
  .go-share {
    padding: 8px 20px;
    font-size: 0.75rem;
  }
  .game-overlay:has(.go-result:not(.hidden)) h3 {
    font-size: 1.25rem;
  }
}

/* � VIP Mode — Aurora Voyager (easter egg) */
.game-frame.vip {
  border-color: rgba(52, 211, 153, 0.45);
  background: radial-gradient(
    ellipse at 50% 0%,
    rgba(52, 211, 153, 0.1),
    rgba(6, 13, 31, 0.94) 65%
  );
  box-shadow:
    0 0 42px rgba(52, 211, 153, 0.2),
    0 0 80px rgba(139, 92, 246, 0.14);
}
.game-overlay.vip-holo {
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.035) 0 1px,
      transparent 1px 5px
    ),
    rgba(5, 15, 24, 0.9);
  border: 1px solid rgba(52, 211, 153, 0.45);
  box-shadow: inset 0 0 70px rgba(139, 92, 246, 0.12);
}
.game-overlay.vip-holo h3 {
  font-family: var(--font-logo);
  font-size: 1.15rem;
  letter-spacing: 1.5px;
  color: #a7f3d0;
  text-shadow: 0 0 16px rgba(52, 211, 153, 0.8);
}
.game-overlay.vip-holo p {
  color: #d1fae5;
  text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

/* 💀 Chaos Mode — protokol rival */
.game-frame.chaos {
  border-color: rgba(239, 68, 68, 0.55);
  background: radial-gradient(
    ellipse at 50% 0%,
    rgba(239, 68, 68, 0.12),
    rgba(26, 6, 10, 0.94) 65%
  );
  box-shadow: 0 0 42px rgba(239, 68, 68, 0.28);
}
.game-overlay.chaos-holo {
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.035) 0 1px,
      transparent 1px 5px
    ),
    rgba(26, 6, 10, 0.9);
  border: 1px solid rgba(239, 68, 68, 0.5);
  box-shadow: inset 0 0 70px rgba(239, 68, 68, 0.16);
}
.game-overlay.chaos-holo h3 {
  font-family: var(--font-logo);
  font-size: 1.15rem;
  letter-spacing: 1.5px;
  color: #fca5a5;
  text-shadow: 0 0 16px rgba(239, 68, 68, 0.85);
}
.game-overlay.chaos-holo p {
  color: #fee2e2;
}

/* Label troll di papan peringkat */
.lb-troll {
  display: block;
  white-space: normal;
  font-size: 0.62rem;
  line-height: 1.25;
  color: var(--text-muted);
  margin-top: 2px;
}
.game-name-field input {
  width: min(280px, 80%);
  padding: 12px 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  color: var(--text);
  font-family: var(--font-head);
  font-size: 0.95rem;
  outline: none;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}
.game-name-field input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18);
}
.game-name-field input.error {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.22);
  animation: shake 0.35s ease;
}
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-7px);
  }
  75% {
    transform: translateX(7px);
  }
}

/* Papan peringkat */
.leaderboard {
  display: flex;
  flex-direction: column;
  max-height: 500px;
  padding: 22px 22px 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
}
.lb-title {
  font-family: var(--font-head);
  font-size: 1.2rem;
}
.lb-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.lb-top3,
.lb-rest {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lb-top3 {
  flex-shrink: 0;
}
.lb-rest {
  gap: 6px;
  overflow-y: auto;
  min-height: 0;
  padding: 2px 6px 2px 2px;
  margin-right: -8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.5) transparent;
}
.lb-rest::-webkit-scrollbar {
  width: 5px;
}
.lb-rest::-webkit-scrollbar-track {
  background: transparent;
}
.lb-rest::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.5);
  border-radius: 99px;
}

/* Pemisah podium vs penantang */
.lb-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 2px 10px;
  flex-shrink: 0;
}
.lb-divider::before,
.lb-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(139, 92, 246, 0.55),
    transparent
  );
}
.lb-divider span {
  font-family: var(--font-logo);
  font-size: 0.6rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.lb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  font-size: 0.9rem;
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease;
}
.lb-item:hover {
  transform: translateX(5px);
  border-color: rgba(139, 92, 246, 0.45);
}
.lb-rank {
  font-family: var(--font-head);
  min-width: 34px;
  text-align: center;
  color: var(--text-muted);
}
.lb-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-badges {
  flex-shrink: 0;
  font-size: 0.82rem;
  letter-spacing: 1px;
  cursor: help;
}
.lb-score {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--cyan);
}

/* Podium 1–3 */
.lb-top3 .lb-item {
  padding: 13px 14px;
}
.lb-top3 .lb-rank {
  font-size: 1.3rem;
}
.lb-rank-1 {
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    90deg,
    rgba(250, 204, 21, 0.16),
    rgba(255, 255, 255, 0.03)
  );
  border-color: rgba(250, 204, 21, 0.45);
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.15);
}
.lb-rank-1::after {
  content: "";
  position: absolute;
  top: 0;
  left: -70%;
  width: 45%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent,
    rgba(255, 255, 255, 0.16),
    transparent
  );
  animation: lb-shine 3.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes lb-shine {
  0%,
  55% {
    left: -70%;
  }
  100% {
    left: 135%;
  }
}
.lb-rank-1 .lb-name {
  font-weight: 600;
  color: #fde047;
}
.lb-rank-2 {
  background: linear-gradient(
    90deg,
    rgba(203, 213, 225, 0.14),
    rgba(255, 255, 255, 0.03)
  );
  border-color: rgba(203, 213, 225, 0.4);
}
.lb-rank-2 .lb-name {
  color: #e2e8f0;
}
.lb-rank-3 {
  background: linear-gradient(
    90deg,
    rgba(217, 119, 6, 0.16),
    rgba(255, 255, 255, 0.03)
  );
  border-color: rgba(217, 119, 6, 0.45);
}
.lb-rank-3 .lb-name {
  color: #fdba74;
}

/* Baris penantang 4–10 */
.lb-rest .lb-item {
  padding: 7px 12px;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
}
.lb-rest .lb-rank {
  width: 26px;
  height: 26px;
  min-width: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  font-size: 0.7rem;
}
.lb-rest .lb-score {
  font-size: 0.88rem;
}

/* Baris milik pemain saat ini */
.lb-item.me {
  border-color: var(--cyan);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.25);
}

.lb-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 14px 0 6px;
}

/* ============ NOVA AI assistant ============ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.ai-widget { position: fixed !important; z-index: 9999 !important; right: 24px; bottom: 24px; display: block !important; visibility: visible !important; font-family: var(--font-body); }
.ai-launcher { display: flex; align-items: center; gap: 10px; padding: 7px 15px 7px 7px; color: #fff; border: 1px solid rgba(34, 211, 238, .52); border-radius: 999px; background: rgba(10, 10, 30, .9); box-shadow: 0 0 26px rgba(34, 211, 238, .27); font: 600 .82rem var(--font-body); cursor: pointer; transition: transform .2s, box-shadow .2s; }
.ai-launcher:hover { transform: translateY(-3px); box-shadow: 0 0 34px rgba(139, 92, 246, .45); }
.ai-launcher img, .ai-panel-head > img { width: 42px; height: 42px; object-fit: cover; object-position: center; border-radius: 50%; border: 1px solid rgba(255,255,255,.45); background: #0b1530; }
.ai-panel { position: absolute; right: 0; bottom: 64px; width: min(370px, calc(100vw - 32px)); max-height: calc(100vh - 92px); padding: 14px; display: flex; flex-direction: column; border: 1px solid rgba(139, 92, 246, .42); border-radius: 20px; background: rgba(7, 9, 29, .96); box-shadow: 0 18px 55px rgba(0,0,0,.45), 0 0 35px rgba(139, 92, 246, .18); backdrop-filter: blur(18px); opacity: 0; transform: translateY(12px) scale(.97); pointer-events: none; transition: .2s ease; }
.ai-panel.open { opacity: 1; transform: none; pointer-events: auto; }
.ai-panel-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--card-border); }
.ai-panel-head > div { flex: 1; line-height: 1.25; }.ai-panel-head p { font: 700 .9rem var(--font-head); }.ai-panel-head small, .ai-note { color: var(--text-muted); font-size: .68rem; }.ai-online { color: #5eead4; font: 500 .65rem var(--font-body); }.ai-online::before { content: "• "; }
.ai-close { color: var(--text-muted); background: transparent; border: 0; font-size: 1.6rem; cursor: pointer; }.ai-close:hover { color: #fff; }
.ai-messages { min-height: 0; flex: 1; max-height: 330px; padding: 14px 2px 8px; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 9px; }
.ai-message { max-width: 88%; padding: 9px 11px; overflow-wrap: anywhere; white-space: pre-wrap; border-radius: 13px; font-size: .76rem; line-height: 1.55; }.ai-bot { align-self: flex-start; background: rgba(139,92,246,.16); border: 1px solid rgba(139,92,246,.2); }.ai-user { align-self: flex-end; background: rgba(34,211,238,.15); border: 1px solid rgba(34,211,238,.2); }
.ai-typing::after { content: "..."; display: inline-block; width: 15px; overflow: hidden; vertical-align: bottom; animation: ai-dots 1s steps(4, end) infinite; } @keyframes ai-dots { to { width: 0; } }
.ai-suggestions { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; }.ai-suggestions button { white-space: nowrap; padding: 5px 8px; color: #c4b5fd; border: 1px solid rgba(139,92,246,.35); border-radius: 999px; background: rgba(139,92,246,.1); font: 500 .65rem var(--font-body); cursor: pointer; }.ai-suggestions button:hover { border-color: var(--cyan); color: var(--cyan); }
.ai-form { display: flex; gap: 7px; }.ai-form input { min-width: 0; flex: 1; padding: 10px 12px; color: var(--text); outline: none; border: 1px solid var(--card-border); border-radius: 11px; background: rgba(255,255,255,.05); font: .75rem var(--font-body); }.ai-form input:focus { border-color: var(--cyan); }.ai-form button { width: 42px; border: 0; border-radius: 11px; color: #061018; background: var(--cyan); cursor: pointer; font-size: 1rem; }.ai-note { padding: 8px 2px 0; line-height: 1.35; }
@media (max-width: 520px) { .ai-widget { right: 16px; bottom: 16px; }.ai-launcher span { display: none; }.ai-launcher { padding: 6px; }.ai-panel { bottom: 58px; }.ai-messages { max-height: 45vh; } }

@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: 1fr;
  }
  .leaderboard {
    max-height: 460px;
  }
}
