:root {
  --primary: #ff00ff;
  --secondary: #00ffff;
  --accent: #ff1493;
  --bg: #0a0a1a;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'VT323', monospace;
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

.app-container {
  min-height: 100vh;
  position: relative;
  background: linear-gradient(180deg, var(--bg) 0%, #000010 100%);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.app-container.mounted {
  opacity: 1;
}

/* Stars */
.stars-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  animation: twinkle 2s infinite ease-in-out;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Grid background */
.grid-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    linear-gradient(transparent 0%, transparent 50%, rgba(255, 0, 255, 0.03) 100%),
    linear-gradient(90deg, transparent 99%, rgba(255, 0, 255, 0.1) 100%),
    linear-gradient(transparent 99%, rgba(255, 0, 255, 0.1) 100%);
  background-size: 100% 100%, 50px 50px, 50px 50px;
  pointer-events: none;
  z-index: 1;
  perspective: 500px;
  transform: rotateX(60deg) translateY(50%);
  transform-origin: center bottom;
  opacity: 0.5;
}

/* Scanlines */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 100;
  animation: scanline-move 10s linear infinite;
}

@keyframes scanline-move {
  0% { background-position: 0 0; }
  100% { background-position: 0 100px; }
}

/* Main content */
.main-content {
  position: relative;
  z-index: 10;
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

/* Profile section */
.profile-section {
  text-align: center;
  margin-bottom: 30px;
}

.profile-image-container {
  position: relative;
  display: inline-block;
  cursor: pointer;
  margin-bottom: 20px;
}

.profile-image {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--primary);
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

.profile-glow {
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border-radius: 50%;
  background: var(--primary);
  filter: blur(20px);
  opacity: 0.5;
  z-index: 1;
  animation: pulse-glow 2s infinite ease-in-out;
}

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

.profile-image-container:hover .profile-image {
  transform: scale(1.05);
  box-shadow: 0 0 30px var(--primary);
}

.profile-image-container:active .profile-image {
  transform: scale(0.95);
}

.profile-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.5rem;
  color: white;
  text-shadow: 
    0 0 10px var(--primary),
    0 0 20px var(--primary),
    0 0 30px var(--primary);
  margin-bottom: 10px;
  letter-spacing: 2px;
}

.profile-username {
  font-family: 'VT323', monospace;
  font-size: 1.5rem;
  color: var(--secondary);
  text-shadow: 0 0 10px var(--secondary);
  margin-bottom: 10px;
}

.profile-tagline {
  font-family: 'VT323', monospace;
  font-size: 1.3rem;
  color: var(--accent);
  font-style: italic;
  text-shadow: 0 0 10px var(--accent);
}

/* Control panel */
.control-panel {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-bottom: 40px;
}

.control-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  padding: 12px 20px;
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  box-shadow: 
    0 0 10px rgba(255, 0, 255, 0.3),
    inset 0 0 10px rgba(255, 0, 255, 0.1);
}

.control-btn:hover {
  background: var(--primary);
  color: black;
  box-shadow: 0 0 20px var(--primary);
}

.control-btn.active {
  background: var(--primary);
  color: black;
}

.theme-select {
  appearance: none;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ff00ff' d='M6 9L1 4h10z'/%3E%3C/svg%3E") no-repeat right 10px center;
  padding-right: 35px;
}

.theme-select option {
  background: #0a0a1a;
  color: var(--primary);
  font-family: 'VT323', monospace;
  font-size: 1rem;
}

/* Links grid */
.links-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 500px;
  margin-bottom: 40px;
}

@media (max-width: 500px) {
  .links-grid {
    grid-template-columns: 1fr;
  }
}

.link-card {
  background: rgba(10, 10, 26, 0.9);
  border: 3px solid var(--primary);
  padding: 25px;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 
    0 0 15px rgba(255, 0, 255, 0.3),
    inset 0 0 30px rgba(255, 0, 255, 0.05);
}

.link-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 1px solid var(--primary);
  opacity: 0.3;
  pointer-events: none;
}

.link-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 
    0 0 30px var(--primary),
    inset 0 0 50px rgba(255, 0, 255, 0.1);
  border-color: var(--secondary);
}

.link-card-twitter:hover {
  border-color: #1da1f2;
  box-shadow: 0 0 30px #1da1f2;
}

.link-card-telegram:hover {
  border-color: #0088cc;
  box-shadow: 0 0 30px #0088cc;
}

.link-card-instagram:hover {
  border-color: #e4405f;
  box-shadow: 0 0 30px #e4405f;
}

.link-card-berrry:hover {
  border-color: #ff4757;
  box-shadow: 0 0 30px #ff4757;
}

.link-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.link-icon {
  font-size: 2rem;
  position: absolute;
  top: -10px;
  left: 0;
  filter: drop-shadow(0 0 5px var(--primary));
}

.link-dots {
  position: absolute;
  top: -10px;
  right: 0;
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 3px;
  text-shadow: 0 0 10px var(--accent);
}

.link-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.75rem;
  color: white;
  text-align: center;
  margin-top: 30px;
  text-shadow: 0 0 10px var(--primary);
  letter-spacing: 1px;
}

/* Footer */
.footer {
  text-align: center;
  margin-top: auto;
  padding: 20px;
}

.footer p {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: var(--primary);
  text-shadow: 0 0 10px var(--primary);
}

.footer a {
  color: var(--secondary);
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer a:hover {
  text-shadow: 0 0 20px var(--secondary);
}

/* Animations */
.fade-in {
  animation: fadeIn 0.6s ease forwards;
  opacity: 0;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

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

/* Glitch effect */
.glitching {
  animation: glitch 0.3s infinite;
}

.glitching .profile-name,
.glitching .link-label {
  animation: text-glitch 0.1s infinite;
}

@keyframes glitch {
  0% { transform: translate(0); filter: hue-rotate(0deg); }
  20% { transform: translate(-5px, 5px); filter: hue-rotate(90deg); }
  40% { transform: translate(-5px, -5px); filter: hue-rotate(180deg); }
  60% { transform: translate(5px, 5px); filter: hue-rotate(270deg); }
  80% { transform: translate(5px, -5px); filter: hue-rotate(360deg); }
  100% { transform: translate(0); filter: hue-rotate(0deg); }
}

@keyframes text-glitch {
  0% { text-shadow: 2px 0 red, -2px 0 cyan; }
  50% { text-shadow: -2px 0 red, 2px 0 cyan; }
  100% { text-shadow: 2px 0 red, -2px 0 cyan; }
}

/* Confetti */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
  to {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Matrix rain */
.matrix-rain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.matrix-column {
  position: absolute;
  top: -100%;
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  color: #00ff00;
  text-shadow: 0 0 10px #00ff00;
  writing-mode: vertical-rl;
  animation: matrix-fall 4s linear forwards;
  opacity: 0.8;
}

@keyframes matrix-fall {
  from { transform: translateY(0); }
  to { transform: translateY(200%); }
}

/* Responsive */
@media (max-width: 640px) {
  .profile-name {
    font-size: 1rem;
  }
  
  .profile-image {
    width: 120px;
    height: 120px;
  }
  
  .control-btn {
    font-size: 0.6rem;
    padding: 10px 15px;
  }
  
  .link-label {
    font-size: 0.65rem;
  }
  
  .footer p {
    font-size: 0.5rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .scanlines {
    display: none;
  }
}

/* Focus states */
.control-btn:focus,
.link-card:focus {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}