:root {
  --primary: #4361ee;
  --secondary: #3f37c9;
  --accent: #4895ef;
  --light: #f8f9fa;
  --dark: #212529;
  --success: #4cc9f0;
  --danger: #f72585;
  --warning: #f8961e;
  --info: #560bad;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  color: var(--light);
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
  animation: fadeIn 1s ease;
}

h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, #f72585, #b5179e, #7209b7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.subtitle {
  font-size: 1.2rem;
  opacity: 0.8;
  margin-bottom: 1.5rem;
}

.author-info {
  margin-top: 1rem;
  font-size: 0.9rem;
  opacity: 0.7;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.social-links a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s;
}

.social-links a:hover {
  color: var(--success);
}

.social-links i {
  margin-right: 0.3rem;
}

.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.game-board {
  position: relative;
  width: 100%;
  height: 400px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.towers {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  height: 100%;
  padding: 0 2rem;
}

.tower {
  position: relative;
  width: 20px;
  height: 80%;
  background: linear-gradient(to bottom, #adb5bd, #6c757d);
  border-radius: 10px;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.tower:hover {
  transform: translateY(-5px);
}

.tower.active {
  background: linear-gradient(to bottom, #ff9e00, #ff7b00);
}

.disk {
  height: 30px;
  border-radius: 15px;
  margin-bottom: 5px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.disk.selected {
  transform: translateY(-50px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

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

.btn-primary:hover {
  background: var(--secondary);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--dark);
  color: white;
}

.btn-secondary:hover {
  background: #343a40;
  transform: translateY(-2px);
}

.btn-success {
  background: var(--success);
  color: var(--dark);
}

.btn-success:hover {
  background: #38b6db;
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #e51774;
  transform: translateY(-2px);
}

.btn-info {
  background: var(--info);
  color: white;
}

.btn-info:hover {
  background: #4a0cb1;
  transform: translateY(-2px);
}

.stats {
  display: flex;
  justify-content: space-around;
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}

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

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent);
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.8;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  padding: 2rem;
  border-radius: 15px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.modal.active .modal-content {
  transform: translateY(0);
}

.modal h2 {
  margin-bottom: 1rem;
  color: var(--accent);
}

.modal p {
  margin-bottom: 2rem;
}

.rules-list,
.controls-list {
  text-align: left;
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.rules-list li,
.controls-list li {
  margin-bottom: 0.5rem;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.difficulty-selector {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0;
}

.difficulty-btn {
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s;
}

.difficulty-btn.active {
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.easy {
  background: #4cc9f0;
}

.medium {
  background: #4895ef;
}

.hard {
  background: #4361ee;
}

.expert {
  background: #3f37c9;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(30deg);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}

.stat-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
  border-radius: 10px;
}

.stat-item h3 {
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.stat-item p {
  margin-bottom: 0.5rem;
}

.explanation {
  font-size: 0.9rem;
  opacity: 0.8;
}

.complexity-visual {
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  margin-top: 1rem;
  overflow: hidden;
}

.complexity-bar {
  height: 100%;
  transition: width 0.5s ease;
}

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

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

@keyframes confetti {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background: #f72585;
  top: -10px;
  z-index: 999;
  animation: confetti 3s linear forwards;
}

@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }
  
  .subtitle {
    font-size: 1rem;
  }
  
  .controls {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }

  .difficulty-selector {
    flex-direction: column;
    align-items: center;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}