:root {
  --bg: linear-gradient(135deg, #581c87, #be185d);
  --card-bg: rgba(30, 10, 30, 0.95);
  --text: #fff;
  --green: #10b981;
  --orange: #f97316;
  --red: #ef4444;
  --gray: #6b7280;
  --btn-text: #ffffff;
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.3);
  --shadow-btn: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.3);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
  overflow-x: hidden;
}

/* === ЗАЛИПАЮЩАЯ КНОПКА "НАЧАТЬ ИГРУ" === */
.sticky-start-btn {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 16px 32px;
  background: linear-gradient(135deg, #ec4899, #be185d);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(236, 72, 153, 0.4);
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
  border: none;
  min-width: 200px;
  text-align: center;
  letter-spacing: 0.5px;
}

.sticky-start-btn:hover {
  transform: translateX(-50%) translateY(-3px);
  box-shadow: 0 10px 24px rgba(236, 72, 153, 0.6);
}

/* === ФИКСИРОВАННАЯ КНОПКА РЕСТАРТ — В ЛЕВОМ ВЕРХНЕМ УГЛУ === */
.fixed-restart-btn {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1001;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: rgba(100, 100, 100, 0.4);
  color: white;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}

.fixed-restart-btn:hover {
  background: rgba(100, 100, 100, 0.6);
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* === ЛЕНДИНГ === */
.container {
  max-width: 500px;
  width: 90%;
  margin: 40px auto;
  padding: 30px 25px;
  background: var(--card-bg);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
  pointer-events: none;
  animation: floatGradient 8s infinite alternate;
}

@keyframes floatGradient {
  from { transform: rotate(0deg); }
  to { transform: rotate(180deg); }
}

.container h1 {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0.7));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  opacity: 0.9;
  margin-bottom: 28px;
  font-size: 18px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.btn-primary {
  display: block;
  width: 100%;
  padding: 18px;
  margin: 28px 0;
  background: linear-gradient(135deg, #ec4899, #be185d);
  color: white;
  text-decoration: none;
  border-radius: 16px;
  font-size: 19px;
  font-weight: 700;
  transition: var(--transition);
  box-shadow: var(--shadow-btn);
  border: none;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.7s;
  z-index: -1;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  background: linear-gradient(135deg, #f062a1, #c2236e);
}

.feature {
  margin: 24px 0;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: var(--transition);
}

.feature:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 20px -10px;
}

.feature h3 {
  font-size: 1.4rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  color: var(--text);
}

.feature h3::before {
  content: "✓";
  color: #ec4899;
  font-size: 18px;
  font-weight: bold;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.game-description {
  margin: 30px 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  line-height: 1.8;
}

.game-description h2,
.game-description h3 {
  color: var(--text);
  margin: 24px 0 12px;
  font-weight: 700;
  font-size: 1.5rem;
  position: relative;
  padding-bottom: 8px;
}

.game-description h2::after,
.game-description h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--green);
  border-radius: 2px;
}

.game-description ul {
  list-style: none;
  padding-left: 0;
  margin: 20px 0;
}

.game-description li {
  padding: 10px 0;
  padding-left: 24px;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.game-description li::before {
  content: "•";
  color: var(--green);
  font-size: 20px;
  position: absolute;
  left: 0;
  top: -2px;
}

.game-description p:last-child {
  font-weight: 700;
  color: var(--text);
  margin-top: 30px;
  font-size: 17px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  border-left: 4px solid var(--red);
}

.levels-info {
  display: flex;
  gap: 14px;
  margin: 30px 0;
  justify-content: center;
  flex-wrap: wrap;
}

.level-card {
  flex: 1;
  min-width: 130px;
  padding: 20px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: var(--transition);
  cursor: default;
  backdrop-filter: blur(8px);
}

.level-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.1);
}

.level-card h3 {
  font-size: 1.3rem;
  margin-bottom: 6px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.level-card p {
  font-size: 13px;
  opacity: 0.8;
  margin-top: 4px;
}

.level-card.green h3 { color: var(--green); }
.level-card.orange h3 { color: var(--orange); }
.level-card.red h3 { color: var(--red); }

.level-card.green { border-color: rgba(16, 185, 129, 0.3); }
.level-card.orange { border-color: rgba(249, 115, 22, 0.3); }
.level-card.red { border-color: rgba(239, 68, 68, 0.3); }

footer {
  text-align: center;
  margin-top: 40px;
  font-size: 13px;
  opacity: 0.6;
  color: var(--text);
  font-weight: 500;
}

footer span {
  color: var(--red);
}

/* === ИГРОВОЙ ЭКРАН === */
.game-container {
  max-width: 500px;
  width: 90%;
  margin: 40px auto;
  padding: 30px 25px;
  background: var(--card-bg);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

.game-container::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
}

.header {
  text-align: center;
  margin-bottom: 24px;
  position: relative;
}

.level-tag, .player-tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  margin: 4px 6px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.2px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(4px);
}

.level-tag.green { 
  background: rgba(16, 185, 129, 0.2); 
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--green);
}
.level-tag.orange { 
  background: rgba(249, 115, 22, 0.2); 
  border-color: rgba(249, 115, 22, 0.3);
  color: var(--orange);
}
.level-tag.red { 
  background: rgba(239, 68, 68, 0.2); 
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--red);
}

.player-tag.man { 
  background: rgba(59, 130, 246, 0.2); 
  border-color: rgba(59, 130, 246, 0.3);
  color: #3b82f6;
}
.player-tag.woman { 
  background: rgba(236, 72, 153, 0.2); 
  border-color: rgba(236, 72, 153, 0.3);
  color: #ec4899;
}

.task {
  min-height: 140px;
  padding: 28px 20px;
  margin: 24px 0;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  text-align: center;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.6;
  border-left: 5px solid var(--green);
  border-right: 5px solid transparent;
  transition: var(--transition);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.task.green { border-left-color: var(--green); }
.task.orange { border-left-color: var(--orange); }
.task.red { border-left-color: var(--red); }

.task:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15), inset 0 0 15px rgba(0, 0, 0, 0.2);
}

/* === КНОПКИ В ОДНОЙ СТРОКЕ — АДАПТИВНЫЕ === */
.controls {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  justify-content: center;
  padding: 0 10px;
  flex-wrap: nowrap;
  min-height: 50px;
}

.action-btn {
  flex: 1;
  height: 50px;
  border: none;
  border-radius: 14px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-btn);
  color: var(--btn-text);
  text-transform: capitalize;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.action-btn span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  transition: font-size 0.2s ease;
}

@media (max-width: 360px) {
  .action-btn span {
    font-size: 13px;
  }
}

.action-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform 0.2s ease;
}

.next-task-btn svg {
  transform: rotate(0deg);
}

.next-level-btn svg {
  transform: rotate(-90deg);
}

.next-task-btn.green { background: var(--green); }
.next-task-btn.orange { background: var(--orange); }
.next-task-btn.red { background: var(--red); }

.next-level-btn.orange { background: var(--orange); }
.next-level-btn.red { background: var(--red); }

.next-level-btn.disabled {
  background: var(--gray) !important;
  color: rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
  opacity: 0.7;
}

.action-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.action-btn:hover svg {
  transform: rotate(0deg) translateX(2px);
}

.next-level-btn:hover svg {
  transform: rotate(-90deg) translateX(2px);
}

.action-btn:active {
  transform: translateY(0) scale(0.98);
}

/* === ССЫЛКА "НА ГЛАВНУЮ" === */
.back-link {
  display: block;
  width: fit-content;
  margin: 28px auto 0;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.back-link:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* === АДАПТИВНОСТЬ === */
@media (max-width: 480px) {
  .container, .game-container {
    padding: 22px 18px;
  }

  .container h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 16px;
    margin-bottom: 20px;
  }

  .btn-primary {
    font-size: 17px;
    padding: 16px;
  }

  .feature h3 {
    font-size: 1.2rem;
  }

  .task {
    font-size: 16px;
    min-height: 120px;
    padding: 22px 16px;
  }

  .controls {
    gap: 8px;
  }

  .action-btn {
    height: 48px;
    font-size: 15px;
    padding: 0 14px;
  }

  .action-btn svg {
    width: 18px;
    height: 18px;
  }

  .restart-btn {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  .level-card {
    min-width: 110px;
    padding: 16px 12px;
  }

  .level-card h3 {
    font-size: 1.2rem;
  }

  .back-link {
    padding: 10px 20px;
    font-size: 13px;
  }
}

@media (max-width: 360px) {
  .container h1 {
    font-size: 1.8rem;
  }

  .btn-primary {
    font-size: 16px;
    padding: 14px;
  }

  .task {
    font-size: 15px;
    min-height: 110px;
  }

  .action-btn {
    height: 44px;
    font-size: 14px;
  }

  .fixed-restart-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .back-link {
    padding: 8px 18px;
    font-size: 12px;
  }
}

/* === ПЕРЕХОДЫ И АНИМАЦИИ === */
* {
  transition: all 0.3s ease-out;
}

html {
  scroll-behavior: smooth;
}