html {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: "Inter", sans-serif;
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Disable smooth scroll on mobile for better performance */
@media (max-width: 768px) {
  html, body {
    scroll-behavior: auto;
  }

  /* Fix mobile navigation positioning */
  header nav {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    gap: 0.5rem !important;
  }

  .brand-logo {
    font-size: 0.75rem !important;
    flex-shrink: 1;
    min-width: 0;
  }

  .brand-logo img {
    height: 2rem !important;
    margin-right: 0.25rem !important;
    flex-shrink: 0;
  }

  .brand-logo span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Mobile menu controls container */
  .flex.md\\:hidden {
    gap: 0.25rem !important;
    flex-shrink: 0;
  }

  /* Better mobile menu button spacing */
  #mobile-menu-button {
    padding: 0.25rem !important;
    flex-shrink: 0;
  }

  /* Theme switcher mobile adjustments */
  .theme-switcher {
    flex-shrink: 0;
  }

  .theme-button {
    padding: 0.4rem 0.6rem !important;
    font-size: 0.75rem !important;
    white-space: nowrap;
  }
}

/* Text Selection Styling */
::selection {
  background: var(--theme-primary-30);
  color: #ffffff;
}

::-moz-selection {
  background: var(--theme-primary-30);
  color: #ffffff;
}

.hero-bg {
  background-image: linear-gradient(
      rgba(26, 26, 46, 0.75),
      rgba(26, 26, 46, 0.85)
    ),
    url("../Images/MountainViewBackground.png");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  position: relative;
}

@media (max-width: 768px) {
  .hero-bg {
    background-attachment: scroll;
  }

  .slider-arrow {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  #prev-slide {
    left: 5px;
  }

  #next-slide {
    right: 5px;
  }

  .about-slide {
    min-height: 550px;
  }

  .about-slide img {
    max-height: 250px;
  }
}

#home > .text-center {
  position: relative;
  z-index: 1;
}

#home h1 {
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
}

#home p.text-lg {
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
}

.section-title {
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
}

.card {
  background-color: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary {
  background-color: var(--theme-primary);
  color: white;
  transition: background-color 0.3s ease;
}

.btn-primary:hover {
  background-color: var(--theme-primary);
}

.achievement-card img,
.latest-video-card img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

nav a:not(.brand-logo) {
  transition: all 0.3s ease;
}

nav a:not(.brand-logo):hover {
  color: var(--theme-primary);
}

/* Enhanced nav links with underline effect */
.nav-link {
  position: relative;
  padding-bottom: 4px;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-secondary));
  transition: width 0.3s ease;
}

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

.nav-link:hover {
  color: var(--theme-primary);
}

.youtube-color {
  color: #ff0000;
}

.x-color {
  color: #ffffff;
}

.instagram-color {
  color: #e1306c;
}

.linkedin-color {
  color: #0077b5;
}

.tiktok-color {
  color: #ffffff;
}

.social-icon {
  transition: transform 0.3s ease, color 0.3s ease;
  display: inline-block;
}

.social-icon:hover {
  transform: scale(1.2);
}

#mobile-menu a {
  transition: background-color 0.2s ease, color 0.2s ease;
  color: #d1d5db;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#mobile-menu a:last-child {
  border-bottom: none;
}

#mobile-menu a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--theme-primary);
}

#music-player {
  font-family: "Inter", sans-serif;
  transition: width 0.3s ease, height 0.3s ease, padding 0.3s ease;
}

#playlist-list {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

#playlist-list::-webkit-scrollbar {
  display: none;
}

#playlist-list li {
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

#playlist-list li:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

#playlist-list li.active-song {
  background-color: var(--theme-primary);
  color: white;
  font-weight: 600;
}

#music-player.player-minimized {
  width: auto;
  min-width: 180px;
}

@media (min-width: 640px) {
  #music-player.player-minimized {
    min-width: 200px;
  }
}


#music-player.player-minimized #player-main-controls,
#music-player.player-minimized #playlist-container {
  display: none;
}

#music-player.player-minimized .flex.items-center.mb-3 {
  margin-bottom: 0;
}

#animated-name-placeholder {
  display: inline-block;
  position: relative;
  min-height: 1.2em;
}

.jlzn-font-style {
  font-family: "Audiowide", sans-serif;
  color: var(--theme-primary);
}

#animated-name-placeholder::after {
  content: "|";
  display: inline-block;
  margin-left: 3px;
  animation: blink-caret 0.75s step-end infinite;
  color: var(--cursor-color, white);
}

@keyframes blink-caret {
  from,
  to {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.about-slide {
  min-height: 450px;
  display: flex;
  align-items: center;
}

.about-slide img {
  display: block;
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: 0.5rem;
  margin: 0 auto;
}

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.4);
  color: white;
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.3s ease, transform 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.slider-arrow:hover {
  background-color: var(--theme-primary-70);
  transform: translateY(-50%) scale(1.1);
}

#prev-slide {
  left: 15px;
}

#next-slide {
  right: 15px;
}

.slider-dots {
  text-align: center;
  margin-top: 20px;
  position: relative;
  z-index: 10;
}

.dot {
  height: 12px;
  width: 12px;
  margin: 0 5px;
  background-color: #6b7280;
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.3s ease, transform 0.3s ease;
  cursor: pointer;
}

.dot:hover {
  background-color: #9ca3af;
  transform: scale(1.1);
}

.dot.active {
  background-color: var(--theme-primary);
  transform: scale(1.2);
}

.about-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 550px;
  position: relative;
  z-index: 1;
  padding: 2rem 1.5rem;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  border: none;
}

.about-slide::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(5px);
  z-index: -1;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.about-slide-text {
  text-align: center;
  color: #e5e7eb;
  position: relative;
  z-index: 10;
  max-width: 90%;
}

.about-slide-text h3 {
  text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.about-slide-text p {
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.about-slide-img {
  display: none;
}

@media (min-width: 768px) {
  .about-slide {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 2rem;
    min-height: 450px;
    background-image: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .about-slide::before {
    content: none;
  }

  .about-slide-img {
    display: block;
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 0.5rem;
    margin: 0 auto;
  }
  
  .about-slide-text {
    text-align: left;
    max-width: 100%;
    text-shadow: none;
  }
}

.contact-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #d1d5db;
  text-align: left;
}

.contact-input {
  width: 100%;
  background-color: rgba(31, 41, 55, 0.7);
  border: 1px solid #4b5563;
  color: #f3f4f6;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  font-size: 1rem;
}

.contact-input:focus {
  outline: none;
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 3px var(--theme-primary-40);
}

#form-result.success {
  color: #34d399;
}

#form-result.error {
  color: #f87171;
}



/* Enhanced Galaxy Section - Better Mobile UX & Visuals */

#motto-galaxy {
    width: 100%;
    height: 550px;
    position: relative;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1d3a 30%, #000000 100%);
    overflow: hidden;
    margin: 0;
    padding: 0;
    /* Enable smooth scrolling through section */
    touch-action: pan-y pinch-zoom; /* Allow vertical scroll, enable horizontal swipe */
}

/* Enhanced edge fade with more dramatic vignette */
#motto-galaxy::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        ellipse at center,
        transparent 30%,
        rgba(10, 14, 39, 0.6) 70%,
        rgba(0, 0, 0, 0.9) 100%
    );
    pointer-events: none;
    z-index: 5;
}

/* Subtle animated background glow */
#motto-galaxy::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    transform: translate(-50%, -50%);
    background: radial-gradient(
        circle,
        rgba(100, 200, 255, 0.05) 0%,
        transparent 50%
    );
    animation: pulse-glow 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Canvas styling */
#motto-galaxy canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    cursor: grab;
}

#motto-galaxy canvas:active {
    cursor: grabbing;
}

/* Enhanced motto text with better animation */
.motto-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', monospace;
    font-size: clamp(1.3rem, 4.5vw, 2.8rem);
    font-weight: 700;
    text-align: center;
    color: #ffffff;
    text-shadow: 
        0 0 15px rgba(255, 255, 255, 0.9),
        0 0 30px rgba(100, 200, 255, 0.7),
        0 0 45px rgba(100, 200, 255, 0.5),
        0 0 60px rgba(255, 105, 180, 0.3);
    opacity: 0;
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 10;
    letter-spacing: 3px;
    line-height: 1.3;
    max-width: 90%;
    filter: blur(8px);
}

.motto-text.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    filter: blur(0px);
    animation: glow-pulse 3s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        text-shadow: 
            0 0 15px rgba(255, 255, 255, 0.9),
            0 0 30px rgba(100, 200, 255, 0.7),
            0 0 45px rgba(100, 200, 255, 0.5),
            0 0 60px rgba(255, 105, 180, 0.3);
    }
    50% {
        text-shadow: 
            0 0 20px rgba(255, 255, 255, 1),
            0 0 40px rgba(100, 200, 255, 0.9),
            0 0 60px rgba(100, 200, 255, 0.7),
            0 0 80px rgba(255, 105, 180, 0.5);
    }
}

/* Enhanced navigation hints - now indicates both scroll and swipe */
.nav-hint {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Exo 2', sans-serif;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    z-index: 10;
    animation: hint-pulse 3s infinite;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-hint::before {
    content: '← Swipe horizontally to explore →';
    display: block;
}

.nav-hint::after {
    content: '↕ Scroll to continue ↕';
    display: block;
    font-size: 0.85rem;
    opacity: 0.6;
}

@keyframes hint-pulse {
    0%, 100% {
        opacity: 0.5;
        transform: translateX(-50%) translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Responsive adjustments - Hide galaxy on mobile for performance */
@media (max-width: 768px) {
    section[aria-label="Interactive motto galaxy"],
    #motto-galaxy {
        display: none !important;
    }
}

@media (max-width: 480px) {
    section[aria-label="Interactive motto galaxy"],
    #motto-galaxy {
        display: none !important;
    }
}

/* Loading indicator with enhanced animation */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Exo 2', sans-serif;
    font-size: 1.1rem;
    z-index: 5;
    animation: loading-pulse 1.5s ease-in-out infinite;
}

@keyframes loading-pulse {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 1;
    }
}

/* Smooth section integration */
section:has(#motto-galaxy) {
    background: transparent;
    padding: 0;
    margin: 0;
}

/* Accessibility - Focus states for keyboard navigation */
#motto-galaxy:focus-visible {
    outline: 2px solid rgba(100, 200, 255, 0.5);
    outline-offset: -2px;
}

/* --- Interactive Career Timeline Styles --- */

.career-section {
  position: relative;
  background: linear-gradient(135deg, #0a0e27 0%, #1a1d3a 25%, #111827 50%, #1a1d3a 75%, #0a0e27 100%);
  background-size: 400% 400%;
  animation: career-gradient 15s ease infinite;
  padding-bottom: 5rem;
  overflow: hidden;
}

/* Animated gradient background */
@keyframes career-gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Add subtle overlay pattern */
.career-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 30%, var(--theme-primary-03) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, var(--theme-primary-05) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(100, 200, 255, 0.02) 0%, transparent 60%);
  pointer-events: none;
  z-index: 1;
}

/* Add animated particles effect */
.career-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, var(--theme-primary-20), transparent),
    radial-gradient(2px 2px at 60% 70%, var(--theme-primary-15), transparent),
    radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.1), transparent),
    radial-gradient(1px 1px at 80% 10%, rgba(255, 255, 255, 0.1), transparent),
    radial-gradient(2px 2px at 90% 60%, rgba(100, 200, 255, 0.1), transparent),
    radial-gradient(1px 1px at 33% 80%, rgba(255, 255, 255, 0.1), transparent);
  background-size: 200% 200%;
  background-position: 0% 0%;
  animation: particles-drift 20s linear infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes particles-drift {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 100% 100%;
  }
}

/* Ensure content stays above background effects */
.career-section > * {
  position: relative;
  z-index: 2;
}

/* Timeline Wrapper - creates scroll space */
.timeline-wrapper {
  position: relative;
  display: flex;
  padding: 2rem 0;
  align-items: center;
}

/* Year Navigation Sidebar - sticky within wrapper */
.year-navigation {
  position: relative;
  left: 4rem;
  height: fit-content;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 40;
  flex-shrink: 0;
}

.year-nav-btn {
  padding: 0.6rem 1.8rem;
  border-radius: 2rem;
  font-weight: bold;
  font-size: 0.95rem;
  border: 2px solid rgba(156, 163, 175, 0.3);
  background: rgba(156, 163, 175, 0.2);
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  min-width: 160px;
  text-align: center;
}

.year-nav-btn:hover {
  background: rgba(156, 163, 175, 0.3);
  border-color: rgba(156, 163, 175, 0.5);
  transform: translateX(5px);
}

.year-nav-btn.active {
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
  border-color: var(--theme-primary);
  color: white;
  box-shadow: 0 5px 20px var(--theme-primary-50);
  transform: translateX(10px) scale(1.05);
}

.timeline-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0rem 1rem;
  margin: 0;
  perspective: 1500px;
  flex: 1;
}

.timeline-card {
  position: absolute;
  width: 90%;
  max-width: 600px;
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-style: preserve-3d;
  pointer-events: none;
}

.timeline-card.active {
  pointer-events: all;
  z-index: 20;
}

.timeline-card-content {
  background-color: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  position: relative;
}

.timeline-card.active .timeline-card-content {
  border-color: var(--theme-primary-50);
  box-shadow: 0 20px 60px var(--theme-primary-20);
  transform: scale(1);
}

.timeline-card.adjacent .timeline-card-content {
  transform: scale(0.95);
}

.timeline-card.distant .timeline-card-content {
  transform: scale(0.85);
}

/* Hide old year badges on cards */
.timeline-year-badge {
  display: none;
}

.timeline-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.75rem;
  margin-top: 0.5rem;
}

.timeline-location {
  color: var(--theme-primary);
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.location-item {
  display: inline-flex;
  align-items: center;
}

.location-divider {
  color: rgba(255, 255, 255, 0.3);
}

.timeline-description {
  color: #d1d5db;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.timeline-details {
  list-style: none;
  padding: 0;
  margin: 0;
  color: #9ca3af;
  font-size: 0.9rem;
}

.timeline-details li {
  padding: 0.25rem 0;
}

.timeline-card-current .timeline-card-content {
  border-color: var(--theme-primary-30);
}

/* Internship Subsections */
.internship-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.internship-section-title {
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

.internship-card {
  background: var(--theme-primary-05);
  border: 1px solid var(--theme-primary-20);
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: all 0.3s ease;
}

.internship-card:hover {
  background: var(--theme-primary-10);
  border-color: var(--theme-primary-40);
}

.internship-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  cursor: pointer;
  user-select: none;
}

.internship-name {
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
}

.internship-toggle {
  color: var(--theme-primary);
  transition: transform 0.3s ease;
  font-size: 0.875rem;
}

.internship-card[data-expanded="true"] .internship-toggle {
  transform: rotate(180deg);
}

.internship-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
  padding: 0 1rem;
}

.internship-card[data-expanded="true"] .internship-details {
  max-height: 500px;
  padding: 0 1rem 1rem 1rem;
}

.internship-period {
  color: var(--theme-primary);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.internship-desc {
  color: #d1d5db;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.internship-tasks {
  list-style: none;
  padding: 0;
  margin: 0;
  color: #9ca3af;
  font-size: 0.8rem;
}

.internship-tasks li {
  padding: 0.2rem 0;
}

/* Card flip animation - faster transitions */
.timeline-card {
  opacity: 0;
  transform: rotateY(-90deg) scale(0.8);
  pointer-events: none;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Active card - fully visible with flip-in animation */
.timeline-card.active {
  opacity: 1;
  transform: rotateY(0deg) scale(1);
  pointer-events: all;
  z-index: 20;
}

/* Previous cards - hidden (already flipped) */
.timeline-card.prev {
  opacity: 0;
  transform: rotateY(90deg) scale(0.8);
  pointer-events: none;
  z-index: 5;
}

/* Next cards - waiting to flip in */
.timeline-card.next {
  opacity: 0;
  transform: rotateY(-90deg) scale(0.8);
  pointer-events: none;
  z-index: 5;
}

/* Hide content on non-active cards */
.timeline-card:not(.active) .timeline-card-content {
  opacity: 0;
  pointer-events: none;
}

.timeline-card.active .timeline-card-content {
  opacity: 1;
  pointer-events: all;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .timeline-wrapper {
    flex-direction: column;
    padding: 1rem 0;
    align-items: stretch;
  }

  .year-navigation {
    position: relative;
    left: 0;
    top: 0;
    flex-direction: row;
    overflow-x: auto;
    padding: 0 1rem 1.5rem 1rem;
    gap: 0.5rem;
    width: 100%;
    justify-content: flex-start;
  }

  .year-nav-btn {
    font-size: 0.85rem;
    padding: 0.5rem 1.2rem;
    min-width: 120px;
    flex-shrink: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .year-nav-btn.active {
    transform: scale(1.05);
  }

  .timeline-track {
    padding: 0 1rem 2rem 1rem;
    display: block;
  }

  .timeline-card {
    width: 100%;
    max-width: 100%;
    position: static;
    display: none;
  }

  .timeline-card.active {
    display: block;
  }

  .timeline-card-content {
    padding: 1.5rem;
    font-size: 1rem;
  }

  .timeline-title {
    font-size: 1.4rem;
  }

  .timeline-description {
    font-size: 1rem;
  }

  .timeline-details {
    font-size: 0.95rem;
  }

  .timeline-location {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .location-divider {
    display: none;
  }

  .internship-section-title {
    font-size: 1rem;
  }

  .internship-name {
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  .year-nav-btn {
    font-size: 0.8rem;
    padding: 0.45rem 1rem;
    min-width: 110px;
  }

  .timeline-card-content {
    padding: 1.25rem;
  }

  .timeline-title {
    font-size: 1.1rem;
  }
}

/* ========================================
   ASTEROID GAME STYLES - Ultra Polished
   ======================================== */

.asteroid-game-section {
  position: relative;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  padding: 3rem 0 4rem 0;
  overflow: hidden;
}

/* Animated space background */
.asteroid-game-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(2px 2px at 40% 70%, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 80% 10%, rgba(255, 255, 255, 0.25), transparent),
    radial-gradient(2px 2px at 90% 60%, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(1px 1px at 33% 80%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 15% 15%, var(--theme-primary-20), transparent),
    radial-gradient(1px 1px at 85% 85%, var(--theme-primary-15), transparent);
  background-size: 200% 200%;
  animation: stars-twinkle 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes stars-twinkle {
  0%, 100% {
    opacity: 0.8;
    background-position: 0% 0%;
  }
  50% {
    opacity: 1;
    background-position: 100% 100%;
  }
}

/* Ensure content stays above background */
.asteroid-game-section > * {
  position: relative;
  z-index: 2;
}

/* Game Wrapper */
.game-wrapper {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow:
    0 0 40px var(--theme-primary-20),
    0 20px 60px rgba(0, 0, 0, 0.5);
  border: 2px solid var(--theme-primary-30);
  background: rgba(17, 24, 39, 0.8);
  backdrop-filter: blur(10px);
}

/* Canvas */
#asteroidCanvas {
  display: block;
  width: 100%;
  height: 600px;
  background: linear-gradient(180deg, #0a0e1a 0%, #111827 100%);
  touch-action: none; /* Prevent zoom and scroll on touch */
  -webkit-user-select: none;
  user-select: none;
}

@media (max-width: 768px) {
  #asteroidCanvas {
    height: 500px;
  }

  .game-wrapper {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
  }
}

@media (max-width: 480px) {
  #asteroidCanvas {
    height: 450px;
  }

  .score-container {
    padding: 0.4rem 0.75rem;
  }

  .score-value {
    font-size: 1.1rem;
  }

  .score-label {
    font-size: 0.65rem;
  }

  .lives-container {
    gap: 0.35rem;
  }

  .heart-icon {
    font-size: 1.3rem;
  }
}

/* Game Overlays */
.game-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(10px);
  z-index: 10;
  transition: opacity 0.3s ease;
}

.game-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.start-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Start Attack Button - Ultra Flashy */
.start-attack-btn {
  position: relative;
  padding: 1.5rem 3rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow:
    0 0 30px var(--theme-primary-50),
    0 10px 40px var(--theme-primary-40),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: button-pulse 2s ease-in-out infinite;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.start-attack-btn:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow:
    0 0 50px var(--theme-primary-70),
    0 15px 50px var(--theme-primary-50),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.start-attack-btn:active {
  transform: scale(0.98);
}

@keyframes button-pulse {
  0%, 100% {
    box-shadow:
      0 0 30px var(--theme-primary-50),
      0 10px 40px var(--theme-primary-40);
  }
  50% {
    box-shadow:
      0 0 50px var(--theme-primary-70),
      0 10px 50px var(--theme-primary-50);
  }
}

.btn-text {
  position: relative;
  z-index: 2;
}

.btn-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  transform: translate(-50%, -50%) scale(0);
  border-radius: 50%;
  transition: transform 0.5s ease;
}

.start-attack-btn:hover .btn-glow {
  transform: translate(-50%, -50%) scale(2);
}

/* Control hints - responsive text */
.control-hint {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  margin-top: 1.5rem;
  text-align: center;
  line-height: 1.5;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.mobile-controls {
  display: none;
}

.desktop-controls {
  display: inline;
}

@media (max-width: 768px) {
  .mobile-controls {
    display: inline;
  }

  .desktop-controls {
    display: none;
  }

  .control-hint {
    font-size: 0.9rem;
    margin-top: 1.25rem;
  }
}

@media (max-width: 480px) {
  .control-hint {
    font-size: 0.85rem;
    margin-top: 1rem;
  }
}

/* Game Over Content */
.game-over-content {
  text-align: center;
  animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.game-over-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--theme-primary);
  text-shadow:
    0 0 20px var(--theme-primary-70),
    0 0 40px var(--theme-primary-40);
  margin-bottom: 0.75rem;
  letter-spacing: 1px;
}

.game-over-stats {
  margin-bottom: 0.75rem;
}

.final-score-text,
.high-score-text {
  font-size: 0.95rem;
  color: white;
  margin: 0.25rem 0;
}

.final-score-text span,
.high-score-text span {
  color: var(--theme-primary);
  font-weight: 800;
  text-shadow: 0 0 10px var(--theme-primary-50);
}

/* Game UI */
.game-ui {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  gap: 1rem;
  align-items: flex-start;
  z-index: 5;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.game-ui.hidden {
  opacity: 0;
}

/* Pause Button */
.pause-btn {
  background: var(--theme-primary-20);
  border: 2px solid var(--theme-primary-50);
  color: var(--theme-primary);
  width: 3rem;
  height: 3rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  pointer-events: all;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.pause-btn:hover {
  background: var(--theme-primary-30);
  border-color: var(--theme-primary);
  transform: scale(1.05);
  box-shadow: 0 0 20px var(--theme-primary-40);
}

.pause-btn:active {
  transform: scale(0.95);
}

/* Mute Button */
.mute-btn {
  background: rgba(102, 126, 234, 0.2);
  border: 2px solid rgba(102, 126, 234, 0.5);
  color: var(--theme-primary);
  width: 3rem;
  height: 3rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  pointer-events: all;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mute-btn:hover {
  background: rgba(102, 126, 234, 0.3);
  border-color: var(--theme-primary);
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
}

.mute-btn:active {
  transform: scale(0.95);
}

.mute-btn.muted {
  background: var(--theme-primary-20);
  border-color: var(--theme-primary-50);
  color: var(--theme-primary);
}

.mute-btn.muted:hover {
  background: var(--theme-primary-30);
  border-color: var(--theme-primary);
  box-shadow: 0 0 20px var(--theme-primary-40);
}

/* Lives Container */
.lives-container {
  display: flex;
  gap: 0.5rem;
}

.heart-icon {
  font-size: 2rem;
  color: var(--theme-primary);
  filter: drop-shadow(0 0 8px var(--theme-primary-50));
  transition: all 0.3s ease;
}

.heart-icon.filled {
  animation: heartbeat 1.5s ease-in-out infinite;
}

.heart-icon.empty {
  color: var(--theme-primary-20);
  filter: none;
}

.heart-icon.hit {
  animation: heart-shake 0.5s ease;
}

@keyframes heartbeat {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes heart-shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px) rotate(-5deg);
  }
  75% {
    transform: translateX(5px) rotate(5deg);
  }
}

/* Power-ups Container (Top Center) */
.powerups-container {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.75rem;
  pointer-events: none;
  z-index: 10;
}

.powerup-display {
  background: rgba(17, 24, 39, 0.9);
  border: 2px solid var(--theme-primary-50);
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  animation: powerup-appear 0.3s ease-out;
}

.powerup-display.hidden {
  display: none;
}

@keyframes powerup-appear {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.powerup-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.powerup-timer,
.powerup-count {
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--theme-primary);
  font-family: 'Orbitron', monospace;
}

.powerup-count {
  color: #ffd700;
}

/* Score Container */
.score-container {
  text-align: right;
  background: rgba(17, 24, 39, 0.8);
  padding: 0.5rem 0.85rem;
  border-radius: 0.5rem;
  border: 2px solid var(--theme-primary-30);
  backdrop-filter: blur(10px);
}

.current-score,
.high-score {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.15rem 0;
}

.score-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #9ca3af;
  letter-spacing: 0.5px;
}

.score-value {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--theme-primary);
  text-shadow: 0 0 10px var(--theme-primary-50);
  min-width: 50px;
  font-family: 'Orbitron', monospace;
}

.score-value.pulse {
  animation: score-pulse 0.3s ease;
}

@keyframes score-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
    color: var(--theme-secondary);
  }
}

/* Controls Info */
.controls-info {
  margin-top: 1rem;
}

.controls-info p {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Leaderboard Styles */
.leaderboard-display {
  margin: 1rem 0;
  padding: 1rem;
  background: rgba(30, 30, 50, 0.6);
  border-radius: 10px;
  border: 2px solid var(--theme-primary);
}

.leaderboard-title {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--theme-primary);
  text-align: center;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.leaderboard-list.standalone {
  /* No scrollbar needed - only showing top 3 */
  overflow: visible;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  background: rgba(20, 20, 40, 0.8);
  border-radius: 6px;
  border-left: 3px solid var(--theme-primary);
  transition: transform 0.2s;
}

.leaderboard-item:hover {
  transform: translateX(5px);
  background: rgba(30, 30, 50, 0.9);
}

.leaderboard-rank {
  font-size: 0.9rem;
  font-weight: bold;
  color: #ffd700;
  min-width: 28px;
  text-align: center;
}

.leaderboard-rank.rank-1 { color: #ffd700; }
.leaderboard-rank.rank-2 { color: #c0c0c0; }
.leaderboard-rank.rank-3 { color: #cd7f32; }

.leaderboard-icon {
  font-size: 1.1rem;
  min-width: 28px;
  text-align: center;
}

.leaderboard-info {
  flex: 1;
}

.leaderboard-name {
  font-size: 0.8rem;
  font-weight: bold;
  color: white;
  margin-bottom: 0.1rem;
}

.leaderboard-score {
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--theme-primary);
}

.leaderboard-loading {
  text-align: center;
  color: #888;
  padding: 2rem;
  font-size: 1rem;
}

.leaderboard-error {
  text-align: center;
  color: #ff6b6b;
  padding: 1rem;
}

/* View Leaderboard Button */
.leaderboard-view-btn {
  background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
  color: white;
  padding: 1rem 2rem;
  border-radius: 50px;
  border: none;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.leaderboard-view-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* Leaderboard Modal */
.leaderboard-modal-content {
  background: linear-gradient(135deg, #1e1e3f 0%, #2d2d5f 100%);
  padding: 1.25rem;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
  position: relative;
  box-shadow: 0 0 50px var(--theme-primary-30);
}

.close-modal-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.close-modal-btn:hover {
  background: var(--theme-primary-50);
  transform: rotate(90deg);
}

/* High Score Submission Modal */
.high-score-modal-content {
  background: linear-gradient(135deg, #1e1e3f 0%, #2d2d5f 100%);
  padding: 1.5rem;
  border-radius: 16px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 0 50px var(--theme-primary-50);
  animation: modalSlideIn 0.5s ease-out;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.achievement-title {
  color: #ffd700;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.achievement-subtitle {
  color: var(--theme-primary);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  text-align: center;
}

/* Name Input */
.name-input-container {
  margin: 1rem 0;
  position: relative;
}

.input-label {
  display: block;
  color: white;
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.name-input {
  width: 100%;
  padding: 0.6rem 0.9rem;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid var(--theme-primary);
  border-radius: 8px;
  color: white;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s;
}

.name-input:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: #ffd700;
  box-shadow: 0 0 10px var(--theme-primary-50);
}

.name-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.char-counter {
  position: absolute;
  right: 1rem;
  bottom: -1.5rem;
  font-size: 0.8rem;
  color: #888;
}

/* Icon Picker */
.icon-picker-container {
  margin: 1.25rem 0 1rem;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid transparent;
  border-radius: 6px;
  padding: 0.5rem;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.icon-btn.active {
  border-color: var(--theme-primary);
  background: var(--theme-primary-30);
  box-shadow: 0 0 10px var(--theme-primary-50);
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .start-attack-btn {
    padding: 1.25rem 2.5rem;
    font-size: 1.25rem;
  }

  .game-over-title {
    font-size: 1.5rem;
  }

  .final-score-text,
  .high-score-text {
    font-size: 1rem;
  }

  .heart-icon {
    font-size: 1.5rem;
  }

  .score-container {
    padding: 0.5rem 1rem;
  }

  .score-value {
    font-size: 1.25rem;
    min-width: 50px;
  }

  .score-label {
    font-size: 0.75rem;
  }

  .pause-btn {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }

  .high-score-modal-content,
  .leaderboard-modal-content {
    padding: 1rem;
    max-width: 95%;
  }

  .icon-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .powerups-container {
    top: 4.5rem;
    left: 0.5rem;
    transform: none;
    flex-direction: column;
    gap: 0.4rem;
  }

  .powerup-display {
    padding: 0.3rem 0.4rem;
    font-size: 0.75rem;
    border-radius: 0.5rem;
    border-width: 1.5px;
    min-width: auto;
  }

  .powerup-icon {
    font-size: 1rem;
  }

  .powerup-timer,
  .powerup-count {
    font-size: 0.7rem;
  }

  /* Leaderboard mobile optimizations */
  .leaderboard-display {
    padding: 0.6rem;
    margin-top: 0.75rem;
  }

  .leaderboard-title {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    letter-spacing: 0.5px;
  }

  .leaderboard-item {
    gap: 0.35rem;
    padding: 0.35rem 0.45rem;
  }

  .leaderboard-rank {
    font-size: 0.8rem;
    min-width: 26px;
  }

  .leaderboard-icon {
    font-size: 1rem;
    min-width: 26px;
  }

  .leaderboard-name {
    font-size: 0.7rem;
    margin-bottom: 0.08rem;
  }

  .leaderboard-score {
    font-size: 0.8rem;
  }

  .leaderboard-list {
    gap: 0.3rem;
  }

  /* Game Over content mobile */
  .game-over-content {
    padding: 0.75rem;
  }

  .game-over-stats {
    margin-bottom: 0.75rem;
  }

  /* Buttons mobile */
  .game-restart-btn,
  .leaderboard-view-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .leaderboard-display {
    padding: 0.5rem;
    margin-top: 0.6rem;
  }

  .leaderboard-title {
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
  }

  .leaderboard-item {
    padding: 0.3rem 0.35rem;
    gap: 0.25rem;
  }

  .leaderboard-rank {
    font-size: 0.7rem;
    min-width: 22px;
  }

  .leaderboard-icon {
    font-size: 0.9rem;
    min-width: 22px;
  }

  .leaderboard-name {
    font-size: 0.65rem;
  }

  .leaderboard-score {
    font-size: 0.7rem;
  }

  .leaderboard-list {
    gap: 0.25rem;
  }

  .game-over-content {
    padding: 0.6rem;
  }

  .game-over-stats {
    margin-bottom: 0.6rem;
  }

  .high-score-modal-content,
  .leaderboard-modal-content {
    padding: 0.75rem;
    border-radius: 8px;
  }

  .achievement-title {
    font-size: 1.25rem !important;
  }

  .achievement-subtitle {
    font-size: 0.8rem;
  }

  .name-input-container {
    margin: 0.75rem 0;
  }

  .input-label {
    font-size: 0.7rem;
  }

  .name-input {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }

  .icon-picker-container {
    margin: 1rem 0 0.75rem;
  }

  .icon-btn {
    padding: 0.4rem;
    font-size: 1.1rem;
  }

  .submit-score-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }

  .powerups-container {
    left: 0.4rem;
    top: 4.25rem;
  }

  .powerup-display {
    padding: 0.28rem 0.38rem;
  }

  .powerup-icon {
    font-size: 0.95rem;
  }

  .powerup-timer,
  .powerup-count {
    font-size: 0.65rem;
  }
}

/* Extra small devices */
@media (max-width: 360px) {
  #asteroidCanvas {
    height: 380px;
  }

  .start-attack-btn {
    padding: 1rem 2rem;
    font-size: 1rem;
  }

  .mobile-hint {
    font-size: 0.85rem;
    margin-top: 1rem;
  }

  .game-over-title {
    font-size: 1.3rem !important;
  }

  .final-score-text,
  .high-score-text {
    font-size: 0.9rem;
  }

  .leaderboard-display {
    padding: 0.4rem;
    margin-top: 0.5rem;
  }

  .leaderboard-title {
    font-size: 0.75rem;
    margin-bottom: 0.3rem;
  }

  .leaderboard-item {
    padding: 0.25rem 0.3rem;
    gap: 0.2rem;
  }

  .leaderboard-rank {
    font-size: 0.65rem;
    min-width: 20px;
  }

  .leaderboard-icon {
    font-size: 0.85rem;
    min-width: 20px;
  }

  .leaderboard-name {
    font-size: 0.6rem;
  }

  .leaderboard-score {
    font-size: 0.65rem;
  }

  .leaderboard-list {
    gap: 0.2rem;
  }

  .game-over-content {
    padding: 0.5rem;
  }

  .game-over-stats {
    margin-bottom: 0.5rem;
  }

  .game-restart-btn,
  .leaderboard-view-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
  }

  .high-score-modal-content,
  .leaderboard-modal-content {
    padding: 0.6rem;
    max-width: 98%;
  }

  .achievement-title {
    font-size: 1.1rem !important;
  }

  .powerups-container {
    left: 0.35rem;
    top: 4rem;
    gap: 0.3rem;
  }

  .powerup-display {
    padding: 0.25rem 0.35rem;
    font-size: 0.65rem;
    border-radius: 0.4rem;
  }

  .powerup-icon {
    font-size: 0.9rem;
  }

  .powerup-timer,
  .powerup-count {
    font-size: 0.6rem;
  }
}

/* Goal Statement Card */
.goal-statement-wrapper {
  margin-bottom: 2.5rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.goal-statement-card {
  position: relative;
  padding: 2rem 2.5rem;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border: 1px solid var(--theme-primary-20);
  border-radius: 16px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: visible;
}

.goal-statement-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-secondary), var(--theme-primary));
  background-size: 200% 100%;
  animation: gradient-flow 3s ease infinite;
}

@keyframes gradient-flow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.goal-statement-card:hover {
  transform: translateY(-4px);
  border-color: var(--theme-primary-40);
  box-shadow:
    0 12px 48px var(--theme-primary-15),
    0 0 80px var(--theme-primary-10),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.goal-text {
  font-size: 1.25rem;
  line-height: 2.2;
  color: #e5e7eb;
  margin: 0;
  text-align: center;
  position: relative;
}

.highlight-word {
  position: relative;
  color: var(--theme-primary);
  font-weight: 700;
  display: inline-block;
  background: linear-gradient(135deg, var(--theme-primary-15), var(--theme-secondary-10));
  padding: 1px 5px;
  margin: 0 3px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center;
  animation: word-glow 3s ease-in-out infinite;
  will-change: transform;
}

@keyframes word-glow {
  0%, 100% {
    box-shadow: 0 0 4px var(--theme-primary-30);
  }
  50% {
    box-shadow: 0 0 12px var(--theme-primary-50);
  }
}

.highlight-word:nth-child(1) { animation-delay: 0s; }
.highlight-word:nth-child(2) { animation-delay: 0.3s; }
.highlight-word:nth-child(3) { animation-delay: 0.6s; }
.highlight-word:nth-child(4) { animation-delay: 0.9s; }
.highlight-word:nth-child(5) { animation-delay: 1.2s; }

.highlight-word:hover {
  color: #fff;
  transform: scale(1.3);
  background: linear-gradient(135deg, var(--theme-primary-30), var(--theme-secondary-30));
  box-shadow: 0 0 20px var(--theme-primary-70);
  z-index: 10;
  margin: 0 15px;
}

.highlight-word.dragging {
  cursor: grabbing;
  z-index: 100;
}

/* Tablet responsiveness */
@media (max-width: 768px) {
  .goal-statement-card {
    padding: 1.75rem 2rem;
    border-radius: 12px;
  }

  .goal-text {
    font-size: 1.1rem;
    line-height: 2.0;
  }

  .highlight-word {
    padding: 1px 4px;
    margin: 0 2.5px;
  }

  .highlight-word:hover {
    transform: scale(1.25);
    margin: 0 12px;
  }
}

/* Mobile responsiveness */
@media (max-width: 480px) {
  .goal-statement-wrapper {
    margin-bottom: 2rem;
  }

  .goal-statement-card {
    padding: 1.5rem 1.5rem;
    border-radius: 10px;
  }

  .goal-statement-card::before {
    height: 2px;
  }

  .goal-text {
    font-size: 1rem;
    line-height: 1.9;
    text-align: center;
  }

  .highlight-word {
    padding: 1px 4px;
    margin: 0 2px;
    border-radius: 3px;
  }

  .highlight-word:hover {
    transform: scale(1.2);
    margin: 0 10px;
  }
}

/* Extra small mobile */
@media (max-width: 360px) {
  .goal-statement-card {
    padding: 1.25rem 1.25rem;
  }

  .goal-text {
    font-size: 0.95rem;
    line-height: 1.8;
  }

  .highlight-word {
    padding: 0.5px 3px;
    margin: 0 1.5px;
  }

  .highlight-word:hover {
    transform: scale(1.15);
    margin: 0 8px;
  }
}

/* Welcome Text Wave Animation */
.welcome-text {
  cursor: pointer;
  user-select: none;
}

.wave-emoji {
  display: inline-block;
  font-size: 1.2em;
  transition: all 0.3s ease;
  transform-origin: 70% 70%;
}

/* Wave animation keyframes */
@keyframes wave {
  0% { transform: rotate(0deg) scale(1); }
  10% { transform: rotate(14deg) scale(1.1); }
  20% { transform: rotate(-8deg) scale(1.15); }
  30% { transform: rotate(14deg) scale(1.2); }
  40% { transform: rotate(-4deg) scale(1.2); }
  50% { transform: rotate(10deg) scale(1.15); }
  60% { transform: rotate(0deg) scale(1.1); }
  100% { transform: rotate(0deg) scale(1); }
}

/* Mobile wave animation - maintains vertical centering */
@keyframes waveMobile {
  0% { transform: translateY(-50%) rotate(0deg) scale(1); }
  10% { transform: translateY(-50%) rotate(14deg) scale(1.1); }
  20% { transform: translateY(-50%) rotate(-8deg) scale(1.15); }
  30% { transform: translateY(-50%) rotate(14deg) scale(1.2); }
  40% { transform: translateY(-50%) rotate(-4deg) scale(1.2); }
  50% { transform: translateY(-50%) rotate(10deg) scale(1.15); }
  60% { transform: translateY(-50%) rotate(0deg) scale(1.1); }
  100% { transform: translateY(-50%) rotate(0deg) scale(1); }
}

/* Trigger wave on waving class (both desktop and mobile) */
.welcome-text.waving .wave-emoji {
  animation: wave 1s ease-in-out;
}

/* Mobile-specific: larger emoji positioned left/right */
@media (max-width: 768px) {
  .welcome-text {
    position: relative;
    display: inline-block;
    padding: 0 3rem;
  }

  .wave-emoji {
    position: absolute;
    font-size: 2em;
    top: 50%;
    transform: translateY(-50%);
  }

  .wave-emoji:first-child {
    left: 0;
  }

  .wave-emoji:last-child {
    right: 0;
  }

  /* Disable hover on mobile, only click/tap */
  .welcome-text:hover .wave-emoji {
    animation: none;
  }

  /* Wave animation on tap/click - uses mobile animation */
  .welcome-text.waving .wave-emoji {
    animation: waveMobile 1s ease-in-out;
  }
}

@media (max-width: 480px) {
  .welcome-text {
    padding: 0 2.5rem;
  }

  .wave-emoji {
    font-size: 1.8em;
  }
}

/* YouTube Video Thumbnail Play Button Overlay */
.video-thumbnail-wrapper {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
}

.video-thumbnail-wrapper img {
  display: block;
  width: 100%;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.play-button-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 70px;
  height: 70px;
  background: var(--theme-primary-70);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.play-button-overlay i {
  color: white;
  font-size: 28px;
  margin-left: 4px;
  transition: transform 0.3s ease;
}

.video-thumbnail-wrapper:hover .play-button-overlay {
  transform: translate(-50%, -50%) scale(1.1);
  opacity: 1;
  background: var(--theme-primary);
  box-shadow: 0 8px 25px var(--theme-primary-50);
}

.video-thumbnail-wrapper:hover img {
  transform: scale(1.05);
  filter: brightness(0.8);
}

.video-thumbnail-wrapper:active .play-button-overlay {
  transform: translate(-50%, -50%) scale(1);
}

/* Mobile adjustments for play button */
@media (max-width: 768px) {
  .play-button-overlay {
    width: 60px;
    height: 60px;
    opacity: 0.9;
  }

  .play-button-overlay i {
    font-size: 24px;
  }
}

/* Personal Best Score Display */
.personal-best-display {
  margin-top: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: linear-gradient(135deg, var(--theme-primary-10), var(--theme-secondary-10));
  border: 2px solid var(--theme-primary-30);
  border-radius: 10px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.personal-best-display::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.personal-best-label {
  font-size: 0.7rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.personal-best-score {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--theme-primary);
  text-shadow: 0 0 10px var(--theme-primary-50);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    text-shadow: 0 0 10px var(--theme-primary-50);
  }
  50% {
    text-shadow: 0 0 20px var(--theme-primary-70);
  }
}

@media (max-width: 768px) {
  .personal-best-display {
    padding: 0.6rem 0.85rem;
    margin-top: 0.75rem;
  }

  .personal-best-label {
    font-size: 0.65rem;
  }

  .personal-best-score {
    font-size: 1.1rem;
  }
}

/* Scroll-in Animations */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-animate.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animation for cards within sections */
.achievement-card.scroll-animate,
.latest-video-card.scroll-animate,
.value-card.scroll-animate {
  transition-delay: 0.1s;
}

.achievement-card.scroll-animate:nth-child(2),
.latest-video-card.scroll-animate:nth-child(2),
.value-card.scroll-animate:nth-child(2) {
  transition-delay: 0.2s;
}

.achievement-card.scroll-animate:nth-child(3),
.latest-video-card.scroll-animate:nth-child(3),
.value-card.scroll-animate:nth-child(3) {
  transition-delay: 0.3s;
}

.achievement-card.scroll-animate:nth-child(4),
.latest-video-card.scroll-animate:nth-child(4),
.value-card.scroll-animate:nth-child(4) {
  transition-delay: 0.4s;
}

/* Special animation for goal statement card */
.goal-statement-card.scroll-animate {
  transform: scale(0.95) translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.goal-statement-card.scroll-animate.animate-in {
  transform: scale(1) translateY(0);
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .scroll-animate {
    transition: none;
    opacity: 1;
    transform: none;
  }
}

/* ========================================
   MINI YOYO ON MAIN PAGE - Ultra Cool
   ======================================== */

.profile-with-yoyo {
  position: relative;
  display: inline-block;
}

.mini-yoyo-wrapper {
  position: absolute;
  right: 5%;
  top: 22%;
  width: 160px;
  height: 80px;
  cursor: pointer;
  transition: transform 0.3s ease;
  z-index: 10;
  pointer-events: all;
  transform: rotate(220deg);
  transform-origin: center center;
}

.mini-yoyo-wrapper:hover {
  transform: rotate(220deg) scale(1.1);
}

/* Mini Yoyo String */
.mini-yoyo-string {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 40px;
  background: linear-gradient(180deg,
    var(--theme-primary-70) 0%,
    var(--theme-primary-50) 50%,
    var(--theme-primary-30) 100%
  );
  box-shadow: 0 0 8px var(--theme-primary-50);
  transform-origin: top center;
  transition: height 0.1s ease;
}

/* Mini Yoyo Body */
.mini-yoyo {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
  transform-style: preserve-3d;
  transition: all 0.3s ease;
}

/* Mini Yoyo Disc Styling */
.mini-yoyo .yoyo-disc {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 50%, var(--theme-primary) 100%);
  box-shadow:
    0 8px 25px var(--theme-primary-50),
    inset 0 1px 5px rgba(255, 255, 255, 0.3),
    inset 0 -1px 5px rgba(0, 0, 0, 0.3);
}

.mini-yoyo .yoyo-disc-front {
  transform: translateZ(6px);
  z-index: 2;
}

.mini-yoyo .yoyo-disc-back {
  transform: translateZ(-6px) rotateY(180deg);
  z-index: 1;
}

/* Mini Decorative Rings */
.mini-yoyo .yoyo-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.mini-yoyo .ring-1 {
  width: 48px;
  height: 48px;
}

.mini-yoyo .ring-2 {
  width: 34px;
  height: 34px;
  border-color: rgba(255, 255, 255, 0.5);
}

.mini-yoyo .ring-3 {
  width: 22px;
  height: 22px;
  border-color: rgba(255, 255, 255, 0.6);
}

/* Mini Center Hub */
.mini-yoyo .yoyo-center {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #ffd700 100%);
  box-shadow:
    0 0 10px rgba(255, 215, 0, 0.8),
    inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Mini Middle Band (Axle) */
.mini-yoyo .yoyo-band {
  position: absolute;
  width: 14px;
  height: 12px;
  background: linear-gradient(90deg, #555 0%, #888 50%, #555 100%);
  border-radius: 1px;
  z-index: 1;
  box-shadow:
    0 1px 5px rgba(0, 0, 0, 0.5),
    inset 0 0.5px 1px rgba(255, 255, 255, 0.2);
}

/* Mini Yoyo Trick Animation */
.mini-yoyo-wrapper.playing .mini-yoyo-string {
  animation: mini-string-extend 2s ease-in-out;
}

.mini-yoyo-wrapper.playing .mini-yoyo {
  animation: mini-yoyo-trick 2s ease-in-out;
}

.mini-yoyo-wrapper.playing .yoyo-disc-front,
.mini-yoyo-wrapper.playing .yoyo-disc-back {
  animation: yoyo-spin 2s linear;
}

/* Mini String Extension Animation */
@keyframes mini-string-extend {
  0% {
    height: 40px;
  }
  40% {
    height: 110px;
  }
  60% {
    height: 110px;
  }
  100% {
    height: 40px;
  }
}

/* Mini Yoyo Up-Down Movement */
@keyframes mini-yoyo-trick {
  0% {
    top: 40px;
    transform: translateX(-50%) rotateZ(0deg);
  }
  40% {
    top: 110px;
    transform: translateX(-50%) rotateZ(1440deg);
  }
  60% {
    top: 110px;
    transform: translateX(-50%) rotateZ(2160deg);
  }
  100% {
    top: 40px;
    transform: translateX(-50%) rotateZ(3600deg);
  }
}

/* Yoyo Spinning Effect */
@keyframes yoyo-spin {
  0% {
    filter: hue-rotate(0deg) brightness(1);
  }
  50% {
    filter: hue-rotate(180deg) brightness(1.3);
  }
  100% {
    filter: hue-rotate(360deg) brightness(1);
  }
}

/* Mini Yoyo Mobile Responsive */
@media (max-width: 768px) {
  .mini-yoyo-wrapper {
    right: 8%;
    top: 25%;
    width: 120px;
    height: 60px;
  }

  .mini-yoyo-string {
    width: 1.5px;
    height: 30px;
  }

  .mini-yoyo {
    top: 30px;
    width: 45px;
    height: 45px;
  }

  .mini-yoyo .yoyo-disc {
    width: 45px;
    height: 45px;
  }

  .mini-yoyo .ring-1 {
    width: 36px;
    height: 36px;
  }

  .mini-yoyo .ring-2 {
    width: 26px;
    height: 26px;
  }

  .mini-yoyo .ring-3 {
    width: 17px;
    height: 17px;
  }

  .mini-yoyo .yoyo-center {
    width: 11px;
    height: 11px;
  }

  .mini-yoyo .yoyo-band {
    width: 11px;
    height: 9px;
  }

  @keyframes mini-string-extend {
    0% {
      height: 30px;
    }
    40% {
      height: 80px;
    }
    60% {
      height: 80px;
    }
    100% {
      height: 30px;
    }
  }

  @keyframes mini-yoyo-trick {
    0% {
      top: 30px;
      transform: translateX(-50%) rotateZ(0deg);
    }
    40% {
      top: 80px;
      transform: translateX(-50%) rotateZ(1440deg);
    }
    60% {
      top: 80px;
      transform: translateX(-50%) rotateZ(2160deg);
    }
    100% {
      top: 30px;
      transform: translateX(-50%) rotateZ(3600deg);
    }
  }
}

@media (max-width: 480px) {
  .mini-yoyo-wrapper {
    right: 10%;
    top: 28%;
    width: 100px;
    height: 50px;
  }

  .mini-yoyo-string {
    width: 1px;
    height: 25px;
  }

  .mini-yoyo {
    top: 25px;
    width: 38px;
    height: 38px;
  }

  .mini-yoyo .yoyo-disc {
    width: 38px;
    height: 38px;
  }

  .mini-yoyo .ring-1 {
    width: 30px;
    height: 30px;
  }

  .mini-yoyo .ring-2 {
    width: 22px;
    height: 22px;
  }

  .mini-yoyo .ring-3 {
    width: 14px;
    height: 14px;
  }

  .mini-yoyo .yoyo-center {
    width: 9px;
    height: 9px;
  }

  .mini-yoyo .yoyo-band {
    width: 9px;
    height: 7px;
  }

  @keyframes mini-string-extend {
    0% {
      height: 25px;
    }
    40% {
      height: 65px;
    }
    60% {
      height: 65px;
    }
    100% {
      height: 25px;
    }
  }

  @keyframes mini-yoyo-trick {
    0% {
      top: 25px;
      transform: translateX(-50%) rotateZ(0deg);
    }
    40% {
      top: 65px;
      transform: translateX(-50%) rotateZ(1440deg);
    }
    60% {
      top: 65px;
      transform: translateX(-50%) rotateZ(2160deg);
    }
    100% {
      top: 25px;
      transform: translateX(-50%) rotateZ(3600deg);
    }
  }
}

/* ===================================
   RUNNING PERSONAL RECORDS SECTION
   =================================== */

#running-prs {
  position: relative;
  touch-action: auto; /* Allow normal touch scrolling on mobile */
}

/* PR Cards */
.pr-card {
  background: linear-gradient(135deg, rgba(30, 30, 50, 0.8), rgba(20, 20, 35, 0.9));
  border: 1px solid var(--theme-primary-30);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.pr-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    var(--theme-primary-10),
    transparent
  );
  transition: left 0.5s ease;
}

.pr-card:hover::before {
  left: 100%;
}

.pr-card:hover {
  border-color: var(--theme-primary-50);
  box-shadow: 0 0 30px var(--theme-primary-30);
  transform: translateY(-5px) scale(1.02);
}

/* PR Icons */
.pr-icon-wrapper {
  text-align: center;
  color: var(--theme-primary);
  text-shadow: 0 0 15px var(--theme-primary-50);
}

.pr-icon-wrapper i {
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    opacity: 1;
    filter: drop-shadow(0 0 5px var(--theme-primary-50));
  }
  50% {
    opacity: 0.8;
    filter: drop-shadow(0 0 15px var(--theme-primary-70));
  }
}

/* PR Title */
.pr-title {
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-secondary), var(--theme-primary));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
}

/* Distance Badge */
.pr-distance-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
  color: white;
  font-weight: bold;
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 20px;
  box-shadow: 0 2px 10px var(--theme-primary-40);
  z-index: 10;
}

/* PR Content */
.pr-content {
  color: #d1d5db;
  font-size: 0.95rem;
  line-height: 1.8;
}

.pr-stat-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--theme-primary-15);
}

.pr-stat-row:last-child {
  border-bottom: none;
}

.pr-stat-label {
  color: #9ca3af;
  font-size: 0.85rem;
}

.pr-stat-value {
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
}

.pr-activity-name {
  color: var(--theme-primary);
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 1rem;
  display: block;
}

/* Loading Spinner */
.loading-spinner {
  text-align: center;
  color: #9ca3af;
  padding: 20px;
  font-size: 0.9rem;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Not Achieved State */
.pr-not-achieved {
  text-align: center;
  color: #6b7280;
  font-style: italic;
  padding: 20px;
  font-size: 0.9rem;
}

/* Error State */
.pr-error {
  text-align: center;
  color: #ef4444;
  padding: 20px;
  font-size: 0.9rem;
}

/* Responsive Design - Cover Flow Carousel */
@media (max-width: 768px) {
  /* Container wrapper for carousel with perspective */
  #running-prs .grid {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 550px;
    margin-top: 1rem; /* Add space from title */
    padding: 4rem 0;
    overflow: visible; /* Allow cards to show fully */
    perspective: 1200px;
    touch-action: pan-y; /* Allow vertical scrolling */
  }

  .pr-card {
    position: absolute;
    width: 75%;
    max-width: 320px;
    padding: 1.5rem;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    opacity: 0;
    pointer-events: none;
    touch-action: pan-y; /* Allow vertical scrolling */
    will-change: transform, opacity;
  }

  /* Center active card */
  .pr-card.active {
    opacity: 1;
    transform: translateX(0) translateZ(0) scale(1) rotateY(0deg) !important;
    z-index: 10;
    pointer-events: auto;
  }

  /* Previous card (left side) */
  .pr-card.prev {
    opacity: 0.6;
    transform: translateX(-90%) translateZ(-150px) scale(0.8) rotateY(35deg) !important;
    z-index: 5;
    pointer-events: none;
    filter: brightness(0.6);
  }

  /* Next card (right side) */
  .pr-card.next {
    opacity: 0.6;
    transform: translateX(90%) translateZ(-150px) scale(0.8) rotateY(-35deg) !important;
    z-index: 5;
    pointer-events: none;
    filter: brightness(0.6);
  }

  /* Remove hover effect on mobile */
  .pr-card:hover {
    transform: none;
    box-shadow: none;
  }

  /* Cards further away - hidden */
  .pr-card.far-prev,
  .pr-card.far-next,
  .pr-card.hidden {
    opacity: 0;
    transform: translateX(0) translateZ(-300px) scale(0.5) !important;
    z-index: 1;
    pointer-events: none;
  }

  /* Hide scroll indicators */
  .pr-scroll-indicators {
    display: none !important;
  }

  .pr-icon-wrapper i {
    font-size: 2rem;
  }

  .pr-title {
    font-size: 1rem;
  }

  .pr-distance-badge {
    font-size: 0.7rem;
    padding: 3px 10px;
  }

  .pr-stat-row {
    flex-direction: column;
    gap: 4px;
  }

  .pr-stat-label,
  .pr-stat-value {
    font-size: 0.8rem;
  }
}

/* Animation when data loads */
.pr-content.loaded {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Run Selector Dropdown Styling */
.run-selector-wrapper {
  position: relative;
  max-width: 28rem;
  margin: 0 auto 1.5rem;
}

.dropdown-arrow {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  transition: transform 0.3s ease;
  color: #ffffff;
  font-size: 1rem;
}

.dropdown-arrow.open {
  transform: translateY(-50%) rotate(90deg);
}

#run-selector {
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  background-color: #374151;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 3rem;
  width: 100%;
}

#run-selector:hover {
  border-color: var(--theme-primary);
  background-color: #4b5563;
  box-shadow: 0 4px 12px var(--theme-primary-20);
}

#run-selector:hover + .dropdown-arrow {
  color: var(--theme-primary);
}

#run-selector:focus {
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 3px var(--theme-primary-30);
  outline: none;
  background-color: #4b5563;
}

/* Dropdown options styling */
#run-selector option {
  background-color: #1f2937 !important;
  color: #ffffff !important;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 500;
}

#run-selector option:checked {
  background: linear-gradient(135deg, var(--theme-primary-40) 0%, rgba(249, 115, 22, 0.4) 100%) !important;
  color: #ffffff !important;
  font-weight: 600;
}

/* Label styling */
label[for="run-selector"] {
  font-weight: 600;
  font-size: 1.125rem;
  color: #e5e7eb;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Run Details Styling */
#latest-run-details .card {
  animation: slideInUp 0.6s ease-out;
  padding-bottom: 3rem;
  margin-bottom: 2rem;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Heart rate progress bar animation */
.bg-pink-500 {
  transition: width 1s ease-out;
}

/* Elevation gradient bar animation */
.bg-gradient-to-t {
  transition: height 1s ease-out;
}

/* Responsive map */
#latest-run-details img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

/* Stats grid hover effects */
#latest-run-details .bg-gray-700 {
  transition: all 0.3s ease;
}

#latest-run-details .bg-gray-700:hover {
  background-color: rgba(55, 65, 81, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--theme-primary-20);
}

/* Run Details Card Styling */
.run-details-card {
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(17, 24, 39, 0.95) 100%);
  border: 1px solid var(--theme-primary-20);
}

/* Map Container */
.map-container {
  height: 300px;
  position: relative;
}

@media (max-width: 768px) {
  .map-container {
    height: 400px !important;
    margin-bottom: 1.5rem !important;
  }
}

@media (max-width: 480px) {
  .map-container {
    height: 350px !important;
    margin-bottom: 1.5rem !important;
  }
}

/* Main Stats Cards */
.stat-card {
  background: linear-gradient(135deg, rgba(55, 65, 81, 0.5) 0%, rgba(31, 41, 55, 0.5) 100%);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px var(--theme-primary-30);
  border-color: var(--theme-primary-50);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-icon {
  font-size: 1.5rem;
  color: var(--theme-primary);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: #9ca3af;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: 100%;
}

.stat-value {
  color: #ffffff;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  width: 100%;
}

.stat-unit {
  font-size: 1rem;
  color: #9ca3af;
  font-weight: 400;
}

/* Detail Cards */
.detail-card {
  background: linear-gradient(135deg, rgba(55, 65, 81, 0.4) 0%, rgba(31, 41, 55, 0.4) 100%);
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
}

.detail-title {
  color: #ffffff;
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

/* Heart Rate Stats */
.hr-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: rgba(31, 41, 55, 0.5);
  border-radius: 0.5rem;
  border-left: 3px solid var(--theme-primary);
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
  margin-bottom: 0.5rem;
}

.hr-stat-row:last-child {
  margin-bottom: 0;
}

.hr-stat-row:hover {
  background: rgba(31, 41, 55, 0.8);
  transform: scale(1.02);
  box-shadow: 0 4px 12px var(--theme-primary-20);
}

.hr-stat-row:active {
  background: rgba(31, 41, 55, 0.9);
  transform: scale(1.01);
  box-shadow: 0 2px 8px var(--theme-primary-30);
}

.hr-label {
  color: #9ca3af;
  font-size: 0.875rem;
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
}

.hr-value {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
}

.hr-value.max {
  color: #ef4444;
}

/* Heart Rate Gauge */
.hr-gauge-container {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(17, 24, 39, 0.5);
  border-radius: 0.75rem;
}

.hr-gauge {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

/* Elevation Stats */
.elev-stat-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(31, 41, 55, 0.3);
  border-radius: 0.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
}

.elev-stat-row:hover {
  background: rgba(31, 41, 55, 0.7);
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.elev-stat-row:active {
  background: rgba(31, 41, 55, 0.8);
  transform: scale(1.01);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.elev-stat-row.highlight {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.elev-stat-row.highlight:hover {
  background: rgba(16, 185, 129, 0.25);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.elev-stat-row.highlight:active {
  background: rgba(16, 185, 129, 0.3);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.elev-icon {
  font-size: 1.25rem;
  width: 2rem;
  text-align: center;
}

.elev-label {
  color: #9ca3af;
  font-size: 0.875rem;
  flex: 1;
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
}

.elev-value {
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
}

/* Elevation Visualization */
.elevation-viz {
  background: rgba(17, 24, 39, 0.5);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-top: 0.5rem;
}

.elevation-viz svg {
  filter: drop-shadow(0 2px 4px rgba(16, 185, 129, 0.3));
}

/* Extra Stats Cards */
.extra-stat-card {
  background: linear-gradient(135deg, rgba(55, 65, 81, 0.3) 0%, rgba(31, 41, 55, 0.3) 100%);
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: default;
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
}

.extra-stat-card:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, rgba(55, 65, 81, 0.6) 0%, rgba(31, 41, 55, 0.6) 100%);
  box-shadow: 0 6px 16px var(--theme-primary-20);
  border: 1px solid var(--theme-primary-20);
}

.extra-stat-card:active {
  transform: scale(1.02);
  box-shadow: 0 3px 10px var(--theme-primary-30);
}

.extra-stat-icon {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.extra-stat-label {
  color: #9ca3af;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
}

.extra-stat-value {
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
}

/* Leaflet Map Customization */
.leaflet-container {
  background: linear-gradient(135deg, #1f2937 0%, #0f1419 100%) !important;
  border-radius: 0.5rem;
  overflow: hidden;
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 6px 16px var(--theme-primary-20) !important;
  margin: 10px !important;
  border-radius: 0.5rem !important;
  overflow: hidden !important;
}

.leaflet-control-zoom a {
  background: linear-gradient(135deg, rgba(55, 65, 81, 0.95) 0%, rgba(31, 41, 55, 0.95) 100%) !important;
  color: #ffffff !important;
  border: 1px solid var(--theme-primary-30) !important;
  border-radius: 0 !important;
  width: 40px !important;
  height: 40px !important;
  line-height: 40px !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  transition: all 0.3s ease !important;
  backdrop-filter: blur(10px) !important;
}

.leaflet-control-zoom a:first-child {
  border-bottom: 1px solid var(--theme-primary-20) !important;
}

.leaflet-control-zoom a:hover {
  background: var(--theme-gradient) !important;
  color: #ffffff !important;
  border-color: var(--theme-primary) !important;
  transform: scale(1.1) !important;
  box-shadow: 0 0 15px var(--theme-primary-50) !important;
}

.leaflet-control-zoom a:active {
  transform: scale(0.95) !important;
}

.leaflet-popup-content-wrapper {
  background-color: rgba(31, 41, 55, 0.95) !important;
  color: #ffffff !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

/* Mobile Responsiveness for Running Section */
@media (max-width: 768px) {
  /* Map container mobile optimization - Make it much larger and full width */
  #run-map {
    height: 400px !important;
  }

  /* Map parent container should also be larger */
  .run-details-card > div[style*="height: 250px"] {
    height: 400px !important;
  }

  /* Run details card */
  .run-details-card {
    padding: 1rem !important;
  }

  .run-details-card h4 {
    font-size: 1.5rem !important;
  }

  /* Force ALL grids to be single column on mobile - override Tailwind */
  #latest-run-details .grid,
  #latest-run-details .grid.grid-cols-1,
  #latest-run-details .grid.grid-cols-2,
  #latest-run-details .grid.grid-cols-3,
  #latest-run-details .grid.grid-cols-4,
  #latest-run-details .grid.lg\\:grid-cols-4,
  #latest-run-details .grid.md\\:grid-cols-4 {
    grid-template-columns: 1fr !important;
    display: grid !important;
  }

  /* Stat cards mobile layout */
  .stat-card {
    padding: 1rem !important;
  }

  .stat-value {
    font-size: 1.5rem !important;
  }

  .stat-icon {
    font-size: 1.5rem !important;
  }

  .stat-label {
    font-size: 0.75rem !important;
  }

  /* Detail cards stack on mobile */
  .detail-card {
    padding: 1.25rem !important;
    margin-bottom: 1rem !important;
  }

  .detail-title {
    font-size: 1.05rem !important;
    margin-bottom: 1.25rem !important;
  }

  /* Heart rate stats mobile - Better spacing and sizing */
  .hr-stat-row {
    padding: 1rem 1rem !important;
    margin-bottom: 0.75rem !important;
  }

  .hr-stat-row:last-child {
    margin-bottom: 0 !important;
  }

  .hr-label, .elev-label {
    font-size: 0.85rem !important;
  }

  .hr-value, .elev-value {
    font-size: 1.2rem !important;
    font-weight: 700 !important;
  }

  /* Extra stat cards mobile */
  .extra-stat-card {
    padding: 1rem !important;
  }

  .extra-stat-label {
    font-size: 0.75rem !important;
  }

  .extra-stat-value {
    font-size: 0.95rem !important;
  }

  .extra-stat-icon {
    font-size: 1.75rem !important;
  }

  /* Heart rate gauge mobile - Reduce size to balance layout */
  .hr-gauge-container {
    padding: 0.75rem 0.5rem !important;
    margin-top: 1rem !important;
  }

  .hr-gauge {
    max-width: 240px !important;
    margin: 0 auto !important;
  }

  /* Elevation visualization mobile */
  .elevation-viz {
    padding: 0.75rem 0.25rem !important;
    margin-top: 1rem !important;
  }

  /* Elevation stat rows mobile spacing */
  .elev-stat-row {
    padding: 1rem !important;
    margin-bottom: 0.75rem !important;
  }

  .elev-stat-row:last-child {
    margin-bottom: 0 !important;
  }

  /* Add space below card content sections */
  .detail-card > .space-y-4 {
    gap: 0 !important;
  }

  .detail-card > .space-y-3 {
    gap: 0 !important;
  }

  /* Add margin between detail cards on mobile */
  .grid.grid-cols-1.md\\:grid-cols-2 {
    gap: 1rem !important;
  }

  /* Run selector mobile */
  #run-selector {
    font-size: 0.875rem !important;
    padding: 0.65rem !important;
    padding-right: 2.5rem !important;
  }

  .dropdown-arrow {
    font-size: 0.875rem !important;
    right: 0.75rem !important;
  }

  /* Reduce gap on mobile */
  .grid {
    gap: 0.75rem !important;
  }
}

@media (max-width: 480px) {
  /* Extra small devices - Keep map large on small screens too */
  #run-map {
    height: 350px !important;
  }

  /* Force ALL grids to be single column on extra small mobile */
  #latest-run-details .grid,
  #latest-run-details .grid.grid-cols-1,
  #latest-run-details .grid.grid-cols-2,
  #latest-run-details .grid.grid-cols-3,
  #latest-run-details .grid.grid-cols-4,
  #latest-run-details .grid.lg\\:grid-cols-4,
  #latest-run-details .grid.md\\:grid-cols-4 {
    grid-template-columns: 1fr !important;
    display: grid !important;
  }

  .stat-card {
    padding: 0.75rem !important;
  }

  .stat-value {
    font-size: 1.25rem !important;
  }

  .stat-label {
    font-size: 0.7rem !important;
  }

  .extra-stat-card {
    padding: 0.6rem !important;
  }

  .extra-stat-value {
    font-size: 0.8rem !important;
  }

  .extra-stat-label {
    font-size: 0.65rem !important;
  }

  .run-details-card h4 {
    font-size: 1.35rem !important;
  }

  .detail-title {
    font-size: 0.95rem !important;
  }

  .hr-stat-row {
    padding: 1.15rem 0.85rem !important;
  }

  .hr-gauge-container {
    padding: 1.25rem 0.75rem !important;
  }

  .elev-stat-row {
    padding: 0.9rem !important;
  }
}

.leaflet-popup-tip {
  background-color: rgba(31, 41, 55, 0.95) !important;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .stat-value {
    font-size: 1.5rem;
  }

  .stat-icon {
    font-size: 1.25rem;
  }

  .hr-gauge-container {
    padding: 0.5rem;
  }

  .extra-stat-icon {
    font-size: 1.5rem;
  }
}
