﻿:root {
  --primary: #667eea;
  --secondary: #764ba2;
  --success: #2ecc71;
  --error: #e74c3c;
  --warning: #f39c12;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}
#app {
  width: 100%;
  max-width: 900px;
  padding: 20px;
}
#particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.screen {
  display: none;
  animation: fadeIn 0.4s ease;
}
.screen.active {
  display: block;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.hero {
  text-align: center;
  margin-bottom: 40px;
}
.glitch {
  font-size: 3.5rem;
  font-weight: 900;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
  position: relative;
  animation: glowPulse 2s ease-in-out infinite;
}
@keyframes glowPulse {
  0%,
  100% {
    filter: drop-shadow(0 0 10px var(--primary));
  }
  50% {
    filter: drop-shadow(0 0 20px var(--secondary));
  }
}
.tagline {
  font-size: 1.3rem;
  opacity: 0.9;
  color: #b4b4ff;
}
.difficulty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}
.diff-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 30px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.diff-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}
.diff-card.selected {
  border-color: var(--primary);
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.2),
    rgba(118, 75, 162, 0.2)
  );
  box-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
}
.diff-card .icon {
  font-size: 3rem;
}
.diff-card .name {
  font-size: 1.3rem;
  font-weight: 700;
}
.diff-card .desc {
  font-size: 0.9rem;
  opacity: 0.7;
}
.high-score {
  text-align: center;
  font-size: 1.2rem;
  margin: 30px 0;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 215, 0, 0.3);
}
.btn-primary,
.btn-secondary {
  width: 100%;
  padding: 18px;
  font-size: 1.2rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  color: #fff;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(102, 126, 234, 0.6);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  margin-top: 15px;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}
.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 30px;
}
.stat {
  text-align: center;
}
.stat .label {
  display: block;
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 5px;
}
.stat .value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.game-container {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 40px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.pattern-title {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 30px;
  font-weight: 600;
  color: #b4b4ff;
}
.sequence {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.sequence-item {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.2);
  animation: slideIn 0.4s ease backwards;
  transition: all 0.3s ease;
}
.sequence-item:hover {
  transform: scale(1.1);
}
.sequence-item.empty {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.2),
    rgba(118, 75, 162, 0.2)
  );
  border-style: dashed;
  border-color: var(--primary);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}
.options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 15px;
}
.option-btn {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 20px;
  font-size: 1.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #fff;
  font-family: inherit;
}
.option-btn:hover:not(:disabled) {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}
.option-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.option-btn.correct {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  border-color: #2ecc71;
  animation: correctPulse 0.6s ease;
}
.option-btn.incorrect {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  border-color: #e74c3c;
  animation: shake 0.5s ease;
}
@keyframes correctPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}
.feedback {
  margin-top: 30px;
  text-align: center;
  padding: 20px;
  border-radius: 12px;
  font-size: 1.3rem;
  font-weight: 600;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.feedback.show {
  animation: bounceIn 0.5s ease;
}
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
.feedback.correct {
  background: linear-gradient(
    135deg,
    rgba(46, 204, 113, 0.2),
    rgba(39, 174, 96, 0.2)
  );
  border: 2px solid #2ecc71;
  color: #2ecc71;
}
.feedback.incorrect {
  background: linear-gradient(
    135deg,
    rgba(231, 76, 60, 0.2),
    rgba(192, 57, 43, 0.2)
  );
  border: 2px solid #e74c3c;
  color: #e74c3c;
}
.feedback .combo {
  font-size: 2rem;
  animation: comboFloat 1s ease;
}
.feedback .rule {
  font-size: 1rem;
  opacity: 0.9;
  margin-top: 5px;
}
@keyframes comboFloat {
  0% {
    transform: translateY(10px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}
.results-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 50px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.results-title {
  font-size: 2.5rem;
  margin-bottom: 30px;
  background: linear-gradient(45deg, #ffd700, #ffed4e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.final-score {
  margin: 30px 0;
}
.final-score span:first-child {
  display: block;
  font-size: 5rem;
  font-weight: 900;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.final-score .pts {
  display: block;
  font-size: 1.2rem;
  opacity: 0.7;
  margin-top: 10px;
}
.new-high {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #1a1a2e;
  padding: 15px 30px;
  border-radius: 50px;
  font-weight: 900;
  font-size: 1.2rem;
  margin: 20px 0;
  display: inline-block;
  animation: rainbow 2s ease-in-out infinite;
}
@keyframes rainbow {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 40px 0;
}
.stat-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.stat-num {
  display: block;
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-lbl {
  display: block;
  margin-top: 8px;
  font-size: 0.9rem;
  opacity: 0.7;
}
.results-actions {
  display: flex;
  gap: 15px;
}
@media (max-width: 768px) {
  .hero .glitch {
    font-size: 2.5rem;
  }
  .difficulty-grid {
    grid-template-columns: 1fr;
  }
  .options {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .results-actions {
    flex-direction: column;
  }
}
