/* Import VT323 font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

body {
  margin: 0;
  font-family: 'VT323', monospace;
  font-weight: 400;
  /* Dark page background so transparent canvas shows a dark sky instead of white */
  background: linear-gradient(180deg, #0b0b0f 0%, #111217 100%);
}

html,body{
    overscroll-behavior: none;
}

/* Ensure the document doesn't scroll and canvas fills the viewport */
html, body {
  height: 100%;
  overflow: hidden; /* Prevent scrolling so canvas never becomes larger than the screen */
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out;
}

.loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-content {
  text-align: center;
  max-width: 600px;
  width: 90%;
}

.loading-message {
  font-family: 'VT323', monospace;
  font-size: 32px;
  color: #000000;
  margin-bottom: 60px;
  letter-spacing: 2px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-bar-container {
  width: 100%;
  height: 30px;
  background: #ffffff;
  border: 3px solid #000000;
  position: relative;
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  background: #000000;
  width: 0%;
  transition: width 0.3s ease-out;
  position: relative;
}

.loading-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.loading-percent {
  font-family: 'VT323', monospace;
  font-size: 24px;
  color: #000000;
  margin-top: 20px;
  letter-spacing: 2px;
}

/* Welcome Popup */
.welcome-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.welcome-card {
  background: #1a1a1a;
  border: 4px solid #ffffff;
  padding: 40px;
  max-width: 500px;
  text-align: center;
  box-shadow: 
    0 0 30px rgba(255, 255, 255, 0.5),
    inset 0 0 20px rgba(255, 255, 255, 0.1);
  animation: cardGlow 2s ease-in-out infinite;
}

@keyframes cardGlow {
  0%, 100% {
    box-shadow: 
      0 0 30px rgba(255, 255, 255, 0.5),
      inset 0 0 20px rgba(255, 255, 255, 0.1);
  }
  50% {
    box-shadow: 
      0 0 40px rgba(255, 255, 255, 0.7),
      inset 0 0 30px rgba(255, 255, 255, 0.2);
  }
}


@keyframes glitch {
  0%, 100% {
    transform: translate(0);
  }
  20% {
    transform: translate(-2px, 2px);
  }
  40% {
    transform: translate(-2px, -2px);
  }
  60% {
    transform: translate(2px, 2px);
  }
  80% {
    transform: translate(2px, -2px);
  }
}

.welcome-title {
  font-family: 'VT323', monospace;
  font-size: 42px;
  color: #ffffff;
  margin: 0 0 30px 0;
  letter-spacing: 4px;
  text-shadow: 
    0 0 10px rgba(0, 0, 0, 0.8),
    2px 2px 0 rgba(0, 0, 0, 0.8);
}

.welcome-body {
  margin-bottom: 30px;
}

.welcome-text {
  font-family: 'VT323', monospace;
  font-size: 24px;
  color: #ff0202;
  margin: 15px 0;
  line-height: 1.4;
  letter-spacing: 1px;
}

.text-glow {
  color: #00ffff;
  text-shadow: 
    0 0 10px rgba(0, 255, 255, 0.8),
    0 0 20px rgba(0, 255, 255, 0.5);
  font-weight: 700;
}

.warning-text {
  color: #ffffff;
  margin-top: 20px;
  font-size: 20px;
  animation: textPulse 2s ease-in-out infinite;
}

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

.welcome-button {
  font-family: 'VT323', monospace;
  font-size: 28px;
  background: #000000;
  color: #eae6e6;
  border: 3px solid #ffffff;
  padding: 15px 40px;
  cursor: pointer;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all 0.1s steps(2);
  box-shadow: 
    4px 4px 0 rgba(255, 255, 255, 0.3),
    inset -2px -2px 0 rgba(0, 0, 0, 0.5),
    inset 2px 2px 0 rgba(255, 255, 255, 0.2);
}

.welcome-button:hover {
  background: #ffffff;
  color: #000000;
  transform: translateY(-2px);
  box-shadow: 
    6px 6px 0 rgba(255, 255, 255, 0.5),
    inset -2px -2px 0 rgba(0, 0, 0, 0.3),
    inset 2px 2px 0 rgba(255, 255, 255, 0.3);
}

.welcome-button:active {
  transform: translateY(0);
  box-shadow: 
    2px 2px 0 rgba(0, 255, 0, 0.3),
    inset -2px -2px 0 rgba(0, 0, 0, 0.7),
    inset 2px 2px 0 rgba(0, 255, 0, 0.1);
}

/* Headers use VT323 */
h1, h2, h3, h4, h5, h6 {
  font-family: 'VT323', monospace;
  font-weight: 400;
}

/* Cursor styles for interactive elements */
.clickable-cursor {
  cursor: pointer !important;
}

.default-cursor {
  cursor: default !important;
}

/* Settings panel range input styling */
#settingsPanel input[type="range"] {
  /* make the draggable bar visually longer within the panel and full-width */
  width: 100%;
  height: 12px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent; /* track painted below */
  margin-top: 6px;
}

#settingsPanel input[type="range"]::-webkit-slider-runnable-track {
  height: 12px;
  background: #e60000; /* vivid red */
  border-radius: 8px;
}

#settingsPanel input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border: 3px solid #9f0000;
  border-radius: 50%;
  margin-top: -4px; /* center the thumb on the track */
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

#settingsPanel input[type="range"]::-moz-range-track {
  height: 12px;
  background: #e60000;
  border-radius: 8px;
}

#settingsPanel input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #ffffff;
  border: 3px solid #9f0000;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* Nudge the settings close button upward so it doesn't intersect the range */


/* Achievements close button styling: black background */


/* Small safety: ensure settings panel internals have spacing so the X doesn't overlap */
#settingsPanel label[for="dragSpeedRange"] { margin-bottom: 10px; display:block; }

#positionInfo {
  position: fixed;
  top: 16px;
  right: 16px;
  color: white;
  font-family: 'VT323', monospace;
  font-weight: 400;
  font-size: 16px;
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 10px;
  border-radius: 5px;
  z-index: 2000;
  pointer-events: none;
  /* Hidden by default; can be enabled via console: seePositionInfo(true) */
  display: none;
}

/* Navbar styling - PSX retro style */
.navbar {
  position: fixed;
  bottom: 20px; /* align with corner buttons which are 20px from bottom */
  left: 0;
  right: 0;
  height: 48px; /* match the corner button height for visual alignment */
  background: transparent;
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  z-index: 1000;
  font-family: 'VT323', monospace;
  box-shadow: none;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  backdrop-filter: none;
}

.navbar-menu {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  height: 48px;
  min-width: 48px;
  background: rgba(30, 30, 30, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  color: #ffffff;
  font-family: 'VT323', monospace;
  font-weight: 400;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.1s steps(2);
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 
    2px 2px 0 rgba(0, 0, 0, 0.4),
    inset -1px -1px 0 rgba(0, 0, 0, 0.3),
    inset 1px 1px 0 rgba(255, 255, 255, 0.1);
}

.nav-button:hover {
  background: rgba(50, 50, 50, 0.9);
  border-color: rgba(0, 255, 255, 0.5);
  color: #00ffff;
  text-shadow: 0 0 6px rgba(0, 255, 255, 0.6);
  transform: translateY(-2px);
  box-shadow: 
    3px 3px 0 rgba(0, 0, 0, 0.4),
    inset -1px -1px 0 rgba(0, 0, 0, 0.3),
    inset 1px 1px 0 rgba(255, 255, 255, 0.2);
}

.nav-button:active {
  transform: translateY(0);
  box-shadow: 
    1px 1px 0 rgba(0, 0, 0, 0.4),
    inset -1px -1px 0 rgba(0, 0, 0, 0.4),
    inset 1px 1px 0 rgba(255, 255, 255, 0.05);
}

.nav-icon {
  font-size: 20px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Bottom-right corner controls (settings + achievements) */
.corner-controls {
  position: fixed;
  right: 16px;
  bottom: 20px;
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 1500; /* above navbar (1000) */
}

.corner-controls .control-button {
  height: 48px; /* match nav-button height */
  min-width: 48px;
  padding: 0 12px;
}

/* More menu (overflow) - mobile only */
.more-toggle { /* hidden by default; shown on small screens via media query */
  display: none;
}

.more-menu {
  position: fixed;
  right: 16px;
  bottom: 76px; /* appear above the corner controls */
  display: flex;
  flex-direction: column;
  gap: 6px;
  /* match settings/achievement panel look */
  background: rgba(20,20,20,0.95) !important;
  padding: 8px;
  border-radius: 0; /* square corners per request */
  border: 3px solid #ffffff !important;
  box-shadow: 0 8px 20px rgba(0,0,0,0.6);
  z-index: 10005; /* above rotation pad and settings panel */
  font-family: 'VT323', monospace !important;
  color: #ffffff !important;
}

.more-menu .more-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  color: #fff;
  font-family: 'VT323', monospace;
  border: none;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}

.more-menu .more-item:active { transform: scale(0.995); }

.nav-text {
  font-size: 14px;
  line-height: 1;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .navbar {
    padding: 0 10px;
  }
  
  .nav-button {
    padding: 6px 8px;
    gap: 4px;
  }
  
  .nav-text {
    display: none;
  }
  
  .nav-icon {
    font-size: 18px;
  }
}

/* On narrow mobile screens, hide individual controls and show the overflow toggle */
@media (max-width: 420px) {
  #instructionsToggle, #settingsButton {
    display: none !important;
  }
  #moreToggle { display: inline-flex !important; }
}

/* Ensure settings panel has square corners */
#settingsPanel {
  border-radius: 0 !important;
  /* Match other dark panels (achievements) so blacks and font look consistent */
  background: rgba(20,20,20,0.95) !important;
  border: 3px solid #ffffff !important;
  font-family: 'VT323', monospace !important;
  color: #ffffff !important;
}

/* LinkedIn Popup Card - Retro Paper Style */
.linkedin-popup {
  position: fixed;
  bottom: 10%; /* Updated to set bottom to 10% for screen popup */
  left: 50%;
  transform: translateX(-50%);
  /* Raised so popups appear above canvas and other overlays */
  z-index: 12000;
  pointer-events: all;
  animation: floatIn 0.5s ease-out;
}

/* Ensure canvas sits above the watermark but below UI popups */
/* Canvas should be fixed and cover the viewport exactly so it can't be scrolled
   or be smaller/larger than the screen. Use vw/vh to accommodate OS-level UI. */
body > canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 1;
}

/* Watermark placed top-right but under canvas so 3D content covers it */
#canvasWatermark {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 0; /* intentionally below canvas (canvas z-index:1) */
  pointer-events: none; /* don't block interactions */
  font-family: 'VT323', monospace;
  color: #ffffff; /* white */
  user-select: none;
  mix-blend-mode: normal;
  text-align: right;
}

#canvasWatermark .watermark-title {
  font-size: 36px; /* ~2x larger */
  letter-spacing: 6px;
  font-weight: 700;
  text-transform: uppercase;
}

#canvasWatermark .watermark-sub {
  font-size: 22px; /* ~2x larger */
  letter-spacing: 2px;
  opacity: 0.95;
  margin-top: 6px;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px) rotate(2deg);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) rotate(-1deg);
  }
}

.popup-card {
  background: #f5f5dc;
  border: 4px solid #000000;
  box-shadow: 
    8px 8px 0 rgba(0, 0, 0, 0.3),
    inset 0 0 20px rgba(139, 69, 19, 0.1);
  padding: 30px;
  min-width: 320px;
  max-width: 400px;
  font-family: 'VT323', monospace;
  transform: rotate(-1deg);
  position: relative;
  animation: subtleFloat 3s ease-in-out infinite;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* Small screen popup override */
#screenPopup .popup-card {
  min-width: unset;
  max-width: 100px;
  padding: 12px 10px;
}

#screenPopup .popup-title {
  font-size: 14px;
}

#screenPopup .popup-text {
  font-size: 12px;
  text-align: center;
  margin: 0;
}

/* Make the X button huge and center it for the screen popup */
#screenPopup .popup-card {
  max-width: unset; /* allow card to fit large button */
  padding: 6px;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* Ensure the large X button is centered (don't use absolute positioning) */
#screenPopup .popup-close {
  position: static !important;
  top: unset !important;
  right: unset !important;
  width: 50px; /* Reduced size to 50px */
  height: 50px; /* Reduced size to 50px */
  font-size: 28px; /* Adjusted font size */
  border-radius: 6px; /* Adjusted border radius */
  box-shadow: 4px 4px 0 rgba(0,0,0,0.25); /* Adjusted box shadow */
}

#screenPopup .popup-close:active { transform: scale(0.98); }

@keyframes subtleFloat {
  0%, 100% {
    transform: rotate(-1deg) translateY(0px);
  }
  50% {
    transform: rotate(1deg) translateY(-5px);
  }
}

/* Paper texture effect */
.popup-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(139, 69, 19, 0.03) 2px,
      rgba(139, 69, 19, 0.03) 4px
    );
  pointer-events: none;
}

.popup-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  background: #000000;
  color: #ffffff;
  border: 3px solid #000000;
  font-family: 'VT323', monospace;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s steps(2);
  box-shadow: 
    3px 3px 0 rgba(0, 0, 0, 0.3),
    inset -1px -1px 0 rgba(0, 0, 0, 0.3),
    inset 1px 1px 0 rgba(255, 255, 255, 0.2);
  z-index: 10;
}

.popup-close:hover {
  background: #ff0000;
  color: #ffffff;
  transform: scale(1.1);
  box-shadow: 
    4px 4px 0 rgba(0, 0, 0, 0.4),
    inset -1px -1px 0 rgba(0, 0, 0, 0.3),
    inset 1px 1px 0 rgba(255, 255, 255, 0.3);
}

.popup-close:active {
  transform: scale(0.95);
  box-shadow: 
    2px 2px 0 rgba(0, 0, 0, 0.4),
    inset -1px -1px 0 rgba(0, 0, 0, 0.4),
    inset 1px 1px 0 rgba(255, 255, 255, 0.1);
}

.popup-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 3px solid #000000;
}

/* Uniform action buttons inside popup cards (except the TV/screen popup which has special styling)
   Targets primary call-to-action links and buttons inside the popup body.
*/
.popup-card .resume-btn,
.popup-card .linkedin-button,
.popup-card .popup-return-btn,
.popup-card .popup-body a,
.popup-card .popup-body button {
  display: inline-block;
  background: #000000;
  color: #ffffff;
  border: 3px solid #000000;
  padding: 10px 16px;
  font-family: 'VT323', monospace;
  font-size: 18px;
  text-decoration: none;
  letter-spacing: 1px;
  cursor: pointer;
  text-align: center;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.3), inset -2px -2px 0 rgba(0,0,0,0.2), inset 2px 2px 0 rgba(255,255,255,0.08);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.08s ease;
}

.popup-card .resume-btn:hover,
.popup-card .linkedin-button:hover,
.popup-card .popup-return-btn:hover,
.popup-card .popup-body a:hover,
.popup-card .popup-body button:hover {
  background: #ff0000;
  border-color: #ff0000;
  transform: translateY(-2px);
}

.popup-card .resume-btn:active,
.popup-card .linkedin-button:active,
.popup-card .popup-return-btn:active,
.popup-card .popup-body a:active,
.popup-card .popup-body button:active {
  transform: translateY(0);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.35), inset -1px -1px 0 rgba(0,0,0,0.25);
}

/* Achievements UI */
#achievements-toast-container {
  position: fixed;
  bottom: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 11000;
  pointer-events: none;
}
.achievement-toast {
  min-width: 220px;
  max-width: 320px;
  background: rgba(0,0,0,0.95);
  color: #fff;
  border: 3px solid #fff;
  padding: 12px 14px;
  font-family: 'VT323', monospace;
  transform: translateY(-8px);
  opacity: 0;
  transition: all 0.25s ease;
  pointer-events: auto;
}
.achievement-toast.visible {
  transform: translateY(0);

/* Achievement row icon */
.achievement-icon {
  width: 28px;
  display: inline-block;
  text-align: center;
  font-weight: 700;
  margin-right: 8px;
  font-size: 16px;
}
.achievement-item .achievement-icon { color: #ff6b6b; }
.achievement-item.unlocked .achievement-icon { color: #7bff7b; }

/* Right-align the icon inside the row */
.achievement-item { display:flex; align-items:center; justify-content:space-between; }
.achievement-item .achievement-icon { margin-right: 0; margin-left: 12px; }
.achievement-item .achievement-icon, .achievement-item.unlocked .achievement-icon { font-size:18px; }
  opacity: 1;
}
.achievement-toast .achievement-toast-desc {
  font-size: 12px;
  color: #cfcfcf;
}

#achievements-panel {
  position: fixed;
  left: 18px;
  bottom: 80px;
  width: 320px;
  max-height: 50vh;
  overflow: auto;
  background: rgba(20,20,20,0.95);
  color: #fff;
  border: 3px solid #fff;
  z-index: 11000;
  padding: 10px;
  font-family: 'VT323', monospace;
}
.achievements-panel.hidden { display: none; }
.achievements-panel-header { display:flex; justify-content:space-between; align-items:center; }
.achievements-list { display:flex; flex-direction:column; gap:8px; padding:8px 0; }
.achievement-item { 
  font-size: 40px;
  padding:8px; 
  border:2px solid rgba(255, 0, 0, 0.45); /* red border for locked */
  background: rgba(139,0,0,0.04); /* subtle red tint */
  color: #ff0000;
}
.achievement-item.unlocked {
  font-size:24px;
  background: rgba(0,139,0,.1); /* subtle green tint */
  border:2px solid rgb(0, 255, 0); /* green border for unlocked */
  color: #00ff08;
}
.achievement-item .achievement-title { font-size:16px; color:#ff0000; }
.achievement-item.unlocked .achievement-title { color:#017501; }
.achievement-item .achievement-desc { font-size:12px; color:#a90303; }
.achievement-item.unlocked .achievement-desc { font-size:12px; color:#0c9200; }
.achievements-reset { margin:8px; padding:8px; background:#000; color:#fff; border:2px solid #fff; cursor:pointer; }
.achievements-panel-close { background:transparent; color:#fff; border:0; font-size:20px; cursor:pointer; }

.linkedin-icon {
  color: #0077b5;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.2));
}

.popup-title {
  font-size: 28px;
  color: #000000;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.popup-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.popup-text {
  font-size: 20px;
  color: #333333;
  margin: 0;
  letter-spacing: 1px;
}

.linkedin-button {
  display: block;
  background: #000000;
  color: #ffffff;
  text-align: center;
  padding: 12px 24px;
  font-family: 'VT323', monospace;
  font-size: 22px;
  text-decoration: none;
  border: 3px solid #000000;
  letter-spacing: 2px;
  transition: all 0.1s steps(2);
  box-shadow: 
    4px 4px 0 rgba(0, 0, 0, 0.3),
    inset -2px -2px 0 rgba(0, 0, 0, 0.3),
    inset 2px 2px 0 rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.linkedin-button:hover {
  background: #0077b5;
  border-color: #0077b5;
  transform: translateY(-2px);
  box-shadow: 
    6px 6px 0 rgba(0, 0, 0, 0.3),
    inset -2px -2px 0 rgba(0, 0, 0, 0.3),
    inset 2px 2px 0 rgba(255, 255, 255, 0.3);
}

.linkedin-button:active {
  transform: translateY(0);
  box-shadow: 
    2px 2px 0 rgba(0, 0, 0, 0.3),
    inset -2px -2px 0 rgba(0, 0, 0, 0.4),
    inset 2px 2px 0 rgba(255, 255, 255, 0.1);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .popup-card {
    min-width: 280px;
    padding: 20px;
  }
  
  .popup-title {
    font-size: 22px;
  }
  
  .popup-text {
    font-size: 18px;
  }
  
  .linkedin-button {
    font-size: 20px;
    padding: 10px 20px;
  }
}

/* About Me Popup Card */
.about-popup {
  position: fixed;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  /* Ensure about popups appear above the rotation pad and other overlays */
  z-index: 12000;
  pointer-events: all;
  animation: floatIn 0.5s ease-out;
}

.popup-card-scrollable {
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.popup-body-scrollable {
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 50vh;
  padding-right: 10px;
  /* Custom scrollbar styling for retro look */
  scrollbar-width: thin;
  scrollbar-color: #000000 #f5f5dc;
}

.popup-body-scrollable::-webkit-scrollbar {
  width: 12px;
}

.popup-body-scrollable::-webkit-scrollbar-track {
  background: #f5f5dc;
  border: 2px solid #000000;
}

.popup-body-scrollable::-webkit-scrollbar-thumb {
  background: #000000;
  border: 2px solid #f5f5dc;
}

.popup-body-scrollable::-webkit-scrollbar-thumb:hover {
  background: #333333;
}

.about-icon {
  color: #000000;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.2));
}

.about-section-title {
  font-family: 'VT323', monospace;
  font-size: 22px;
  color: #000000;
  margin: 15px 0 10px 0;
  letter-spacing: 2px;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.about-section-title:first-child {
  margin-top: 0;
}

.technical-skills-section {
  color: #cc0000;
}

.technical-skills-section .about-section-title {
  color: #cc0000;
}

/* Interactive indicators removed — no DOM exclamation markers are used. */

/* Mobile responsive for about popup */
@media (max-width: 768px) {
  .popup-card-scrollable {
    max-height: 60vh;
  }
  
  .popup-body-scrollable {
    max-height: 40vh;
  }
  
  .about-section-title {
    font-size: 20px;
  }
}

/* Mute button styling */
.mute-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 0; /* Square corners for retro look */
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: all 0.1s steps(2); /* Stepped animation for pixelated effect */
  padding: 0;
  image-rendering: pixelated; /* Pixelate any images */
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  box-shadow: 
    2px 2px 0 rgba(0, 0, 0, 0.5),
    inset -1px -1px 0 rgba(0, 0, 0, 0.3),
    inset 1px 1px 0 rgba(255, 255, 255, 0.2); /* Retro beveled edge */
}

/* Settings and achievements live in the bottom-right corner (see .corner-controls) */

/* If an achievement image is used in other contexts, keep a reasonable default size */
#achievementsToggle img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

/* Also make the popup header icon larger and white */
.popup-header img[alt="Achievements"] {
  width: 48px;
  height: 48px;
}

/* Mute button UI removed; programmatic audio controls remain in audioController.js */

.button, .nav-button, .mute-button, .control-button, #achievementsToggle, 
.popup-card .resume-btn, .popup-card .linkedin-button, .popup-card .popup-return-btn,
.popup-card .popup-body a, .popup-card .popup-body button, .popup-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  height: 48px;
  min-width: 48px;
  background: rgba(30, 30, 30, 0.95);
  border: 2px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-family: 'VT323', monospace;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 
    2px 2px 0 rgba(0, 0, 0, 0.4),
    inset -1px -1px 0 rgba(0, 0, 0, 0.3),
    inset 1px 1px 0 rgba(255, 255, 255, 0.08);
  transition: all 0.1s steps(2);
  image-rendering: pixelated;
}

/* Hover for most buttons: use red accent (except LinkedIn button) */
button:hover, .button:hover, .nav-button:hover, .mute-button:hover, #achievementsToggle:hover,
.popup-card .resume-btn:hover, .popup-card .popup-return-btn:hover,
.popup-card .popup-body a:hover, .popup-card .popup-body button:hover, .popup-close:hover {
  background: rgba(80, 18, 18, 0.98); /* dark red */
  border-color: rgba(224, 67, 54, 0.6);
  color: #ffcdd2; /* light red/pink text for contrast */
  text-shadow: 0 0 6px rgba(224, 67, 54, 0.45);
  transform: translateY(-2px);
  box-shadow: 
    3px 3px 0 rgba(0, 0, 0, 0.4),
    inset -1px -1px 0 rgba(0, 0, 0, 0.3),
    inset 1px 1px 0 rgba(255, 255, 255, 0.08);
}

/* Keep the LinkedIn button using the cyan accent on hover */
.popup-card .linkedin-button:hover {
  background: rgba(50, 50, 50, 0.98);
  border-color: rgba(0, 255, 255, 0.45);
  color: #00ffff;
  text-shadow: 0 0 6px rgba(0, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 
    3px 3px 0 rgba(0, 0, 0, 0.4),
    inset -1px -1px 0 rgba(0, 0, 0, 0.3),
    inset 1px 1px 0 rgba(255, 255, 255, 0.2);
}

button:active, .button:active, .nav-button:active, .mute-button:active, #achievementsToggle:active,
.popup-card .resume-btn:active, .popup-card .linkedin-button:active, .popup-card .popup-return-btn:active,
.popup-card .popup-body a:active, .popup-card .popup-body button:active, .popup-close:active {
  transform: translateY(0);
  box-shadow: 
    1px 1px 0 rgba(0, 0, 0, 0.4),
    inset -1px -1px 0 rgba(0, 0, 0, 0.3),
    inset 1px 1px 0 rgba(255, 255, 255, 0.06);
}

/* Keep positioning-only behavior for corner buttons (they still use the .mute-button class)
   but they inherit the appearance above. */
