@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* ==================== CSS VARIABLES ==================== */
:root {
  --primary-color: #FFC107;
  --primary-dark: #FF8F00;
  --primary-light: #FFF9C4;
  --accent-color: #795548;
  --dark-color: #212121;
  --light-color: #f8f9fa;
  --white: #ffffff;
  --gray: #757575;
  --gradient-1: linear-gradient(135deg, #FFC107 0%, #FF8F00 100%);
  --gradient-2: linear-gradient(135deg, #FF8F00 0%, #FFC107 100%);
  --shadow-light: 0 8px 25px rgba(255, 193, 7, 0.15);
  --shadow-medium: 0 15px 35px rgba(255, 193, 7, 0.2);
  --shadow-heavy: 0 20px 40px rgba(0, 0, 0, 0.1);

  --px-bg: #f5f3f0;
  --px-ink: #222326;
  --px-accent: #ff9500;
  --px-node: #ff3d3d;
  --px-node-ink: #fff;
  --px-muted: #a2a2a2;
  --px-surface: #ffffff;
  --px-shadow: 0 8px 24px rgba(0,0,0,.08);
  --px-font: "Oxanium", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, sans-serif;

  --px-node-size: 82px;
  --px-node-ring: 5px;

  --px-canvas-max: 1200px;
  --px-side-gap: 28px;
}

body {
  font-family: 'Poppins', sans-serif;
  line-height: 1.6;
  color: #333;
  overflow-x: hidden;
  margin: 0;
  background: var(--px-bg);
  padding-top: 90px;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==================== NAVBAR STYLES ==================== */
.navbar {
  background: rgba(255, 255, 255);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-light);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
}

.logo {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary-dark);
  text-decoration: none;
  transition: transform 0.3s ease, color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-image {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  transform: scale(4.18);
  margin-left: 1.5em;
}

.logo:hover {
  transform: scale(0.918);
  color: var(--primary-color);
}

.nav-links {
  display: flex;
  gap: 30px;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--dark-color);
  font-weight: 500;
  position: relative;
  padding: 8px 0;
  transition: all 0.3s ease;
  font-size: 14px;
}

.nav-links a:hover {
  color: var(--primary-dark);
  transform: translateY(-2px);
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 3px;
  background: var(--gradient-1);
  bottom: 0;
  left: 0;
  transition: width 0.3s ease;
  border-radius: 2px;
}

.nav-links a:hover::after {
  width: 100%;
}

.hamburger {
  display: none;
  cursor: pointer;
  padding: 5px;
  z-index: 1002;
}

.hamburger .line {
  width: 25px;
  height: 3px;
  background: var(--gradient-1);
  margin: 5px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

/* ==================== PRACTICE LEVELS PAGE STYLES ==================== */

/* Layout */
#px-app {
  min-height: 100vh;
  width: 100%;
  position: relative;
}

.px-header {
  text-align: center;
  padding: 32px 20px 8px;
}

.px-title {
  margin: 0;
  font-weight: 700;
  letter-spacing: .5px;
  font-size: clamp(28px, 3.6vw, 56px);
  color: var(--px-accent);
  font-family: var(--px-font);
}

.px-title-underline {
  display: inline-block;
  width: clamp(90px, 12vw, 160px);
  height: 5px;
  border-radius: 999px;
  background: var(--px-accent);
  margin-top: 10px;
}

/* Board area */
#px-board {
  max-width: var(--px-canvas-max);
  margin: 0 auto;
  position: relative;
  padding: 10px var(--px-side-gap) 200px;
  overflow-x: hidden;
}

/* Canvas for path + nodes */
#px-canvas {
  position: relative;
  width: 100%;
  min-height: 900px;
}

/* Main curvy path */
#px-trace {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 8px 20px rgba(255,149,0,.18));
}

#px-trace path {
  fill: none;
  stroke: url(#px-stroke);
  stroke-width: 8;
  stroke-linecap: round;
}

/* Level nodes */
#px-nodes {
  position: absolute;
  inset: 0;
}

.px-node {
  --_size: var(--px-node-size);
  position: absolute;
  width: var(--_size);
  height: var(--_size);
  margin-left: calc(-1 * var(--_size) / 2);
  margin-top: calc(-1 * var(--_size) / 2);
  border-radius: 50%;
  background: radial-gradient(120% 120% at 30% 30%, #ff6a6a, var(--px-node));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--px-node-ink);
  font-weight: 700;
  letter-spacing: .3px;
  border: var(--px-node-ring) solid rgba(255,255,255,.8);
  box-shadow: 0 10px 20px rgba(0,0,0,.12), inset 0 6px 12px rgba(255,255,255,.25);
  transform: translateZ(0);
  transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s;
  will-change: transform;
  font-family: var(--px-font);
}

.px-node:focus-visible {
  outline: none;
  box-shadow: 0 0 0 6px rgba(0,122,255,.35),
              0 10px 22px rgba(0,0,0,.16),
              inset 0 6px 12px rgba(255,255,255,.3);
}

.px-node:hover {
  transform: translateZ(0) scale(1.09);
  box-shadow: 0 16px 36px rgba(255,149,0,.35),
              0 10px 22px rgba(0,0,0,.18),
              inset 0 10px 16px rgba(255,255,255,.35);
}

.px-node > span {
  font-size: 18px;
  user-select: none;
}

/* Mini-map */
#px-minimap {
  position: fixed;
  right: 18px;
  top: 90px;
  width: 210px;
  z-index: 50;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(6px);
  border: 2px solid rgba(0,0,0,.08);
  border-radius: 14px;
  box-shadow: var(--px-shadow);
  padding: 12px 12px 8px;
}

.px-minimap-head {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .4px;
  color: var(--px-ink);
  margin-bottom: 8px;
  font-family: var(--px-font);
}

#px-mini-svg {
  width: 100%;
  height: 220px;
  display: block;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.6));
  margin-bottom: 10px;
  border: 1px dashed rgba(0,0,0,.08);
}

#px-mini-svg path {
  fill: none;
  stroke: var(--px-accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: .95;
}

#px-mini-svg circle {
  fill: var(--px-node);
  stroke: #fff;
  stroke-width: 1.5;
  opacity: .95;
  cursor: pointer;
  transition: transform 0.2s ease;
}

#px-mini-svg circle:hover {
  transform: scale(1.2);
}

.px-mini-jumps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.px-mini-jumps a {
  display: block;
  background: #fff;
  border-radius: 8px;
  padding: 6px 0;
  font-family: var(--px-font);
  font-weight: 700;
  font-size: 12px;
  color: var(--px-ink);
  text-decoration: none;
  text-align: center;
  box-shadow: 0 3px 10px rgba(0,0,0,.07);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.px-mini-jumps a:hover {
  transform: translateY(-1px);
  background: #fef7ec;
  box-shadow: 0 6px 14px rgba(0,0,0,.12);
  text-decoration: none;
}

/* Mobile guard */
#px-mobile-guard {
  display: none;
  place-items: center;
  min-height: 60vh;
  padding: 48px 20px;
}

.px-mobile-card {
  background: var(--px-surface);
  border: 2px dashed rgba(0,0,0,.08);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
  box-shadow: var(--px-shadow);
  color: var(--px-ink);
  font-size: clamp(16px, 2.8vw, 20px);
  font-family: var(--px-font);
}

/* ==================== RESPONSIVE DESIGN ==================== */

@media (max-width: 1024px) {
  .container {
    width: 95%;
    padding: 0 15px;
  }
}

/* Mobile navbar and practice levels */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 90px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 90px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 50px;
    transition: all 0.5s ease;
    z-index: 999;
    gap: 0;
  }

  .nav-links.active {
    left: 0;
  }

  .nav-links a {
    font-size: 18px;
    margin: 15px 0;
    padding: 15px 20px;
    width: 90%;
    text-align: center;
    border-radius: 10px;
    transition: all 0.3s ease;
  }

  .nav-links a:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
    transform: translateY(0);
  }

  .hamburger {
    display: block;
  }

  .hamburger.active .line:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
  }

  .hamburger.active .line:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active .line:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
  }

  /* Hide practice levels board on mobile */
  #px-board, #px-minimap {
    display: none;
  }

  #px-mobile-guard {
    display: grid;
  }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
  :root {
    --px-node-size: 74px;
  }

  #px-minimap {
    right: 12px;
    width: 190px;
    top: 84px;
  }
}

/* Large screens */
@media (min-width: 1400px) {
  :root {
    --px-node-size: 90px;
  }

  #px-minimap {
    width: 230px;
  }
}

/* Small mobile navbar adjustments */
@media (max-width: 480px) {
  .navbar .container {
    padding: 15px 15px;
  }

  .logo {
    font-size: 24px;
  }

  .logo-icon {
    font-size: 28px;
  }
}

/* Utility */
.navhelp {
  cursor: help;
}