/* ============================================
   LINKED LIST ACADEMY - MAIN STYLES
   Cyberpunk Neon Theme with Retro-Futuristic Elements
   ============================================ */

:root {
  /* Primary Colors */
  --neon-cyan: #00fff5;
  --neon-magenta: #ff00ff;
  --neon-yellow: #ffff00;
  --neon-green: #39ff14;
  --neon-orange: #ff6600;
  --neon-red: #ff0044;
  --neon-blue: #00aaff;
  --neon-purple: #bf00ff;

  /* Background Colors */
  --bg-dark: #0a0a0f;
  --bg-darker: #050508;
  --bg-card: rgba(15, 15, 25, 0.9);
  --bg-panel: rgba(20, 20, 35, 0.95);

  /* Text Colors */
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0a0;
  --text-accent: var(--neon-cyan);

  /* Gradients */
  --gradient-main: linear-gradient(
    135deg,
    #0a0a0f 0%,
    #1a1a2e 50%,
    #16213e 100%
  );
  --gradient-card: linear-gradient(
    145deg,
    rgba(30, 30, 50, 0.8) 0%,
    rgba(20, 20, 35, 0.9) 100%
  );
  --gradient-neon: linear-gradient(
    90deg,
    var(--neon-cyan),
    var(--neon-magenta),
    var(--neon-cyan)
  );

  /* Effects */
  --glow-cyan:
    0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan),
    0 0 40px var(--neon-cyan);
  --glow-magenta:
    0 0 10px var(--neon-magenta), 0 0 20px var(--neon-magenta),
    0 0 40px var(--neon-magenta);
  --glow-green: 0 0 10px var(--neon-green), 0 0 20px var(--neon-green);

  /* Fonts */
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Rajdhani', sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
}

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

body {
  font-family: var(--font-body);
  background: var(--gradient-main);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ============================================
   SCANLINES & NOISE EFFECTS
   ============================================ */

.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 245, 0.01) 2px,
    rgba(0, 255, 245, 0.01) 4px
  );
  animation: scanline 8s linear infinite;
}

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

.noise {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* ============================================
   SCREEN TRANSITIONS
   ============================================ */

.screen {
  display: none;
  min-height: 100vh;
  animation: fadeIn 0.5s ease-out;
}

.screen.active {
  display: block;
}

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

/* ============================================
   MAIN MENU HEADER
   ============================================ */

.main-header {
  text-align: center;
  padding: 60px 20px 40px;
  position: relative;
}

.logo-container {
  position: relative;
  display: inline-block;
}

.logo-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 150px;
  background: radial-gradient(
    ellipse,
    rgba(0, 255, 245, 0.3) 0%,
    transparent 70%
  );
  filter: blur(40px);
  animation: pulse-glow 3s ease-in-out infinite;
}

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

.main-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  letter-spacing: 0.2em;
  background: var(--gradient-neon);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-flow 3s linear infinite;
  text-shadow: var(--glow-cyan);
  position: relative;
}

@keyframes gradient-flow {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

.sub-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--neon-magenta);
  text-shadow: var(--glow-magenta);
  letter-spacing: 0.5em;
  margin-top: 10px;
}

.tagline {
  font-family: var(--font-body);
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-top: 20px;
  letter-spacing: 0.1em;
}

/* ============================================
   GAMES GRID
   ============================================ */

.games-grid {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 40px 60px;
}

.category-section {
  margin-bottom: 50px;
}

.category-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--neon-cyan);
  margin-bottom: 25px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(0, 255, 245, 0.3);
  display: flex;
  align-items: center;
  gap: 15px;
  letter-spacing: 0.15em;
}

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

.game-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 25px;
}

/* ============================================
   GAME CARD
   ============================================ */

.game-card {
  position: relative;
  background: var(--gradient-card);
  border: 1px solid rgba(0, 255, 245, 0.2);
  border-radius: 15px;
  padding: 30px 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-neon);
  background-size: 200% 100%;
  animation: gradient-flow 3s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.game-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--neon-cyan);
  box-shadow:
    0 10px 40px rgba(0, 255, 245, 0.2),
    inset 0 0 30px rgba(0, 255, 245, 0.05);
}

.card-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at 50% 0%,
    rgba(0, 255, 245, 0.1) 0%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.game-card:hover .card-glow {
  opacity: 1;
}

.card-number {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  color: rgba(0, 255, 245, 0.1);
  position: absolute;
  top: 10px;
  right: 15px;
  line-height: 1;
}

.game-card h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.game-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

.difficulty {
  display: flex;
  gap: 5px;
}

.star {
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
}

.star.active {
  background: var(--neon-yellow);
  box-shadow: 0 0 10px var(--neon-yellow);
}

/* ============================================
   GAME CONTAINER
   ============================================ */

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 30px;
  background: var(--bg-panel);
  border-bottom: 1px solid rgba(0, 255, 245, 0.2);
}

.back-btn {
  font-family: var(--font-display);
  font-size: 0.9rem;
  background: transparent;
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.back-btn:hover {
  background: rgba(0, 255, 245, 0.1);
  box-shadow: var(--glow-cyan);
}

.back-btn .arrow {
  font-size: 1.2rem;
}

.game-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
  letter-spacing: 0.1em;
}

.game-stats {
  display: flex;
  gap: 30px;
}

.stat {
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--neon-green);
  text-shadow: var(--glow-green);
}

/* ============================================
   GAME CONTENT AREA
   ============================================ */

.game-content {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  padding: 20px;
  min-height: calc(100vh - 200px);
}

.game-area {
  background: var(--bg-card);
  border: 1px solid rgba(0, 255, 245, 0.2);
  border-radius: 15px;
  padding: 30px;
  position: relative;
  overflow: hidden;
  min-height: 500px;
}

.game-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(
      circle at 20% 80%,
      rgba(0, 255, 245, 0.05) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(255, 0, 255, 0.05) 0%,
      transparent 40%
    );
  pointer-events: none;
}

.controls-panel {
  background: var(--bg-card);
  border: 1px solid rgba(0, 255, 245, 0.2);
  border-radius: 15px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.instructions {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.instructions h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--neon-cyan);
  margin-bottom: 15px;
  letter-spacing: 0.1em;
}

.instructions ul {
  list-style: none;
  padding: 0;
}

.instructions li {
  padding: 8px 0;
  padding-left: 20px;
  position: relative;
}

.instructions li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--neon-cyan);
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
}

.action-btn {
  font-family: var(--font-display);
  font-size: 0.85rem;
  padding: 15px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.action-btn.primary {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
  color: var(--bg-dark);
  font-weight: 700;
}

.action-btn.primary:hover {
  box-shadow: 0 0 30px rgba(0, 255, 245, 0.5);
  transform: scale(1.02);
}

.action-btn.secondary {
  background: transparent;
  border: 1px solid var(--neon-magenta);
  color: var(--neon-magenta);
}

.action-btn.secondary:hover {
  background: rgba(255, 0, 255, 0.1);
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.3);
}

.action-btn.danger {
  background: transparent;
  border: 1px solid var(--neon-red);
  color: var(--neon-red);
}

.action-btn.danger:hover {
  background: rgba(255, 0, 68, 0.1);
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ============================================
   CODE PANEL
   ============================================ */

.code-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-darker);
  border-top: 1px solid rgba(0, 255, 245, 0.3);
  transform: translateY(calc(100% - 50px));
  transition: transform 0.4s ease;
  z-index: 100;
}

.code-panel.expanded {
  transform: translateY(0);
}

.code-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 25px;
  cursor: pointer;
  background: var(--bg-panel);
  border-bottom: 1px solid rgba(0, 255, 245, 0.2);
}

.code-icon {
  color: var(--neon-green);
  font-size: 1.2rem;
}

.code-header span {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--text-primary);
  letter-spacing: 0.1em;
}

.toggle-code {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--neon-cyan);
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.code-panel.expanded .toggle-code {
  transform: rotate(180deg);
}

.code-content {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  padding: 20px 25px;
  max-height: 300px;
  overflow-y: auto;
  color: var(--text-primary);
  background: var(--bg-darker);
}

.code-content .keyword {
  color: var(--neon-magenta);
}

.code-content .function {
  color: var(--neon-cyan);
}

.code-content .string {
  color: var(--neon-green);
}

.code-content .comment {
  color: #666;
}

.code-content .number {
  color: var(--neon-orange);
}

/* ============================================
   LINKED LIST VISUALIZATION
   ============================================ */

.linked-list-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
  overflow-x: auto;
  min-height: 200px;
  flex-wrap: wrap;
}

.node {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  animation: nodeAppear 0.5s ease-out;
}

@keyframes nodeAppear {
  from {
    opacity: 0;
    transform: scale(0.5) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.node-box {
  width: 80px;
  height: 80px;
  background: var(--gradient-card);
  border: 2px solid var(--neon-cyan);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer;
}

.node-box:hover {
  border-color: var(--neon-magenta);
  box-shadow: var(--glow-magenta);
  transform: scale(1.1);
}

.node-box.selected {
  border-color: var(--neon-yellow);
  box-shadow: 0 0 20px var(--neon-yellow);
}

.node-box.highlighted {
  animation: pulse-highlight 1s ease-in-out infinite;
}

@keyframes pulse-highlight {
  0%,
  100% {
    box-shadow: 0 0 10px var(--neon-green);
  }
  50% {
    box-shadow:
      0 0 30px var(--neon-green),
      0 0 50px var(--neon-green);
  }
}

.node-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--neon-cyan);
}

.node-address {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-secondary);
  margin-top: 5px;
}

.node-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--neon-magenta);
  margin-top: 8px;
}

.node-arrow {
  width: 50px;
  height: 4px;
  background: var(--neon-cyan);
  position: relative;
  margin: 0 5px;
  animation: arrowGlow 2s ease-in-out infinite;
}

@keyframes arrowGlow {
  0%,
  100% {
    box-shadow: 0 0 5px var(--neon-cyan);
  }
  50% {
    box-shadow:
      0 0 15px var(--neon-cyan),
      0 0 25px var(--neon-cyan);
  }
}

.node-arrow::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  border-left: 12px solid var(--neon-cyan);
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

.node-arrow.broken {
  background: var(--neon-red);
  animation: break-shake 0.5s ease-in-out;
}

.node-arrow.broken::after {
  border-left-color: var(--neon-red);
}

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

.null-node {
  width: 60px;
  height: 40px;
  border: 2px dashed rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Pointer Labels */
.pointer-label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.pointer-label.head {
  background: rgba(0, 255, 245, 0.2);
  color: var(--neon-cyan);
  top: -25px;
}

.pointer-label.tail {
  background: rgba(255, 0, 255, 0.2);
  color: var(--neon-magenta);
  top: -25px;
}

.pointer-label.current {
  background: rgba(57, 255, 20, 0.2);
  color: var(--neon-green);
  bottom: -25px;
}

.pointer-label.slow {
  background: rgba(0, 170, 255, 0.2);
  color: var(--neon-blue);
  top: -25px;
}

.pointer-label.fast {
  background: rgba(255, 102, 0, 0.2);
  color: var(--neon-orange);
  top: -25px;
}

/* ============================================
   DLL SPECIFIC STYLES
   ============================================ */

.dll-node {
  position: relative;
}

.dll-node-box {
  width: 100px;
  height: 80px;
  background: var(--gradient-card);
  border: 2px solid var(--neon-purple);
  border-radius: 12px;
  display: grid;
  grid-template-columns: 25px 1fr 25px;
  overflow: hidden;
}

.dll-prev,
.dll-next {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.8rem;
  background: rgba(191, 0, 255, 0.1);
  color: var(--neon-purple);
}

.dll-data {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-left: 1px solid rgba(191, 0, 255, 0.3);
  border-right: 1px solid rgba(191, 0, 255, 0.3);
}

.dll-arrow-prev {
  width: 40px;
  height: 3px;
  background: var(--neon-magenta);
  position: relative;
}

.dll-arrow-prev::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  border-right: 10px solid var(--neon-magenta);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

/* ============================================
   CYCLE VISUALIZATION
   ============================================ */

.cycle-container {
  position: relative;
  min-height: 400px;
}

.cycle-arrow {
  position: absolute;
  stroke: var(--neon-red);
  fill: none;
  stroke-width: 3;
  stroke-dasharray: 8 4;
  animation: dashMove 1s linear infinite;
}

@keyframes dashMove {
  to {
    stroke-dashoffset: -12;
  }
}

/* ============================================
   INPUT PANEL
   ============================================ */

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
}

.input-group label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.input-group input,
.input-group select {
  font-family: var(--font-mono);
  font-size: 1rem;
  padding: 12px 15px;
  background: var(--bg-darker);
  border: 1px solid rgba(0, 255, 245, 0.3);
  border-radius: 8px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 255, 245, 0.2);
}

.input-group input::placeholder {
  color: var(--text-secondary);
}

/* ============================================
   MODALS
   ============================================ */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.modal.active {
  display: flex;
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background: var(--bg-panel);
  border: 1px solid rgba(0, 255, 245, 0.3);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  max-width: 450px;
  position: relative;
  overflow: hidden;
}

.modal-content h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 25px;
  letter-spacing: 0.1em;
}

.modal-content.victory h2 {
  color: var(--neon-green);
  text-shadow: var(--glow-green);
}

.modal-content.gameover h2 {
  color: var(--neon-red);
}

.victory-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at 50% 20%,
    rgba(57, 255, 20, 0.2) 0%,
    transparent 60%
  );
  pointer-events: none;
}

.stats-display {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 30px;
}

.final-stat {
  text-align: center;
}

.final-stat .label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.final-stat .value {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--neon-cyan);
}

.modal-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.btn-primary,
.btn-secondary {
  font-family: var(--font-display);
  font-size: 0.9rem;
  padding: 15px 30px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.1em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
  border: none;
  color: var(--bg-dark);
  font-weight: 700;
}

.btn-primary:hover {
  box-shadow: 0 0 30px rgba(0, 255, 245, 0.5);
  transform: scale(1.05);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--text-secondary);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

/* Tutorial Modal */
.modal-content.tutorial {
  max-width: 600px;
  text-align: left;
}

.modal-content.tutorial h2 {
  color: var(--neon-cyan);
  text-align: center;
}

#tutorial-content {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 25px;
  padding-right: 15px;
}

#tutorial-content h4 {
  color: var(--neon-magenta);
  margin: 20px 0 10px;
}

#tutorial-content p,
#tutorial-content li {
  color: var(--text-secondary);
  line-height: 1.6;
}

#tutorial-content ul {
  padding-left: 20px;
}

#tutorial-content code {
  font-family: var(--font-mono);
  background: var(--bg-darker);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--neon-green);
}

.modal-content.tutorial .btn-primary {
  display: block;
  width: 100%;
}

/* ============================================
   GHOST & MONSTER ANIMATIONS
   ============================================ */

.ghost {
  position: absolute;
  font-size: 3rem;
  animation: float 2s ease-in-out infinite;
  z-index: 10;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.ghost.attacking {
  animation: attack 0.5s ease-in-out;
}

@keyframes attack {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.5);
  }
  100% {
    transform: scale(1);
  }
}

/* ============================================
   LRU CACHE SPECIFIC
   ============================================ */

.lru-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.cache-display {
  background: var(--bg-darker);
  border: 1px solid rgba(0, 255, 245, 0.3);
  border-radius: 12px;
  padding: 20px;
}

.cache-display h4 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--neon-cyan);
  margin-bottom: 15px;
}

.cache-items {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  min-height: 80px;
  align-items: center;
}

.cache-item {
  background: var(--gradient-card);
  border: 1px solid var(--neon-purple);
  border-radius: 8px;
  padding: 15px 20px;
  text-align: center;
  transition: all 0.3s ease;
}

.cache-item.lru {
  border-color: var(--neon-red);
  animation: pulse-red 1s ease-in-out infinite;
}

@keyframes pulse-red {
  0%,
  100% {
    box-shadow: 0 0 5px var(--neon-red);
  }
  50% {
    box-shadow: 0 0 20px var(--neon-red);
  }
}

.cache-item.mru {
  border-color: var(--neon-green);
}

.cache-key {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.cache-value {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--neon-cyan);
}

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

@media (max-width: 1024px) {
  .game-content {
    grid-template-columns: 1fr;
  }

  .controls-panel {
    order: -1;
  }

  .game-area {
    min-height: 350px;
  }
}

@media (max-width: 768px) {
  .games-grid {
    padding: 20px;
  }

  .game-cards {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
  }

  .game-card {
    padding: 20px 15px;
  }

  .game-header {
    flex-wrap: wrap;
    gap: 15px;
  }

  .game-title {
    order: -1;
    width: 100%;
    text-align: center;
  }

  .linked-list-container {
    flex-direction: column;
    gap: 20px;
  }

  .node-arrow {
    transform: rotate(90deg);
    width: 30px;
  }
}

@media (max-width: 480px) {
  .main-title {
    letter-spacing: 0.1em;
  }

  .sub-title {
    letter-spacing: 0.2em;
  }

  .game-cards {
    grid-template-columns: 1fr;
  }

  .modal-content {
    margin: 20px;
    padding: 25px;
  }

  .stats-display {
    flex-direction: column;
    gap: 15px;
  }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 245, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 245, 0.5);
}

/* ============================================
   SPECIAL ANIMATIONS
   ============================================ */

.shake {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}

.pop {
  animation: pop 0.3s ease-out;
}

@keyframes pop {
  0% {
    transform: scale(0);
  }
  70% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.slide-in-left {
  animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-in-right {
  animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.bounce {
  animation: bounce 0.6s ease;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-15px);
  }
  50% {
    transform: translateY(0);
  }
  70% {
    transform: translateY(-7px);
  }
}

.glow-pulse {
  animation: glowPulse 1.5s ease-in-out infinite;
}

@keyframes glowPulse {
  0%,
  100% {
    filter: drop-shadow(0 0 5px currentColor);
  }
  50% {
    filter: drop-shadow(0 0 20px currentColor);
  }
}

/* Message Toast */
.toast {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-panel);
  border: 1px solid var(--neon-cyan);
  border-radius: 10px;
  padding: 15px 30px;
  font-family: var(--font-display);
  color: var(--neon-cyan);
  z-index: 2000;
  animation:
    toastIn 0.3s ease-out,
    toastOut 0.3s ease-in 2.7s forwards;
}

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

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

.toast.success {
  border-color: var(--neon-green);
  color: var(--neon-green);
}

.toast.error {
  border-color: var(--neon-red);
  color: var(--neon-red);
}

/* ============================================
   INTERSECTION SPECIFIC STYLES
   ============================================ */

.intersection-container {
  position: relative;
  min-height: 400px;
}

.list-row {
  display: flex;
  align-items: center;
  margin-bottom: 60px;
  position: relative;
}

.list-label {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--neon-cyan);
  width: 80px;
  text-align: right;
  padding-right: 20px;
}

.intersection-node {
  background: linear-gradient(135deg, var(--neon-green), var(--neon-cyan));
  border-color: var(--neon-green) !important;
}

/* ============================================
   CLONE/COPY SPECIFIC STYLES
   ============================================ */

.clone-container {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.original-list,
.cloned-list {
  position: relative;
}

.original-list h4,
.cloned-list h4 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

.random-arrow {
  position: absolute;
  stroke: var(--neon-magenta);
  fill: none;
  stroke-width: 2;
  stroke-dasharray: 5 3;
}
