* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}
body {
  font-family: "Open Sans", Arial, sans-serif;
  background: #f0ebe5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}
.game-wrap {
  max-width: 900px;
  width: 100%;
  background: #fffffff0;
  border-radius: 56px 56px 40px 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  padding: 24px 24px 32px;
  border: 4px solid #ffb74d;
}
/* ===== ШАПКА ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.title {
  font-size: 22px;
  font-weight: 800;
  color: #4e342e;
  background: #ffe0b2;
  padding: 6px 20px;
  border-radius: 40px;
  border: 3px dashed #ff8a65;
}
.counter-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #e8eaf6;
  padding: 6px 16px 6px 12px;
  border-radius: 40px;
  border: 3px solid #3f51b5;
}
.counter-box .counter-number {
  font-weight: 800;
  font-size: 20px;
  color: #3f51b5;
  background: #ffffff;
  padding: 0 10px;
  border-radius: 20px;
  min-width: 36px;
  text-align: center;
}
.hero-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #e3f2fd;
  padding: 6px 18px 6px 8px;
  border-radius: 60px;
  border: 3px solid #5b9bd5;
}
.hero-name {
  font-weight: 700;
  color: #1a237e;
  font-size: 18px;
}
/* ===== ПРОГРЕСС ===== */
.progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: #d7ccc8;
  border-radius: 20px;
  margin-bottom: 12px;
  overflow: hidden;
  border: 2px solid #bcaaa4;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #81c784, #4caf50);
  border-radius: 20px;
  transition: width 0.5s ease;
}
/* ===== СТАНЦИИ ===== */
.stations {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0 18px;
  position: relative;
  padding: 0 4px;
}
.stations::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 20px;
  right: 20px;
  height: 6px;
  background: #d7ccc8;
  border-radius: 6px;
  transform: translateY(-50%);
  z-index: 0;
}
.station-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #d7ccc8;
  border: 4px solid #bcaaa4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #4e342e;
  z-index: 1;
  transition: 0.3s;
  position: relative;
}
.station-dot.active {
  background: #5b9bd5;
  border-color: #1a237e;
  color: #fff;
  box-shadow: 0 0 0 6px #bbdefb;
  transform: scale(1.1);
}
.station-dot.done {
  background: #81c784;
  border-color: #2e7d32;
  color: #fff;
}
.station-dot.locked {
  opacity: 0.5;
  filter: grayscale(0.5);
}
.station-dot .label {
  position: absolute;
  top: -28px;
  font-size: 10px;
  white-space: nowrap;
  background: #fff3e0;
  padding: 0 8px;
  border-radius: 10px;
  color: #4e342e;
  font-weight: 600;
  display: none;
}
.station-dot.active .label,
.station-dot.done .label {
  display: block;
}
/* ===== КОМИКС-ПАНЕЛЬ ===== */
.comic-panel {
  background: #fffde7;
  border: 6px solid #3e2c1b;
  border-radius: 32px;
  padding: 12px;
  margin: 10px 0 16px;
  box-shadow:
    inset 0 0 0 2px #ffe082,
    0 8px 0 #3e2c1b;
  min-height: 0;
  perspective: 1200px;
  overflow: hidden;
  position: relative;
}
.comic-scene-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1672 / 941;
  min-height: 0;
  border-radius: 20px;
  overflow: hidden;
}
.comic-scene {
  width: 100%;
  aspect-ratio: 1672 / 941;
  min-height: 0;
  border-radius: 20px;
  background: #e8f5e9;
  position: relative;
  overflow: hidden;
  padding: 0;
  transform-origin: center center;
  transition:
    transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform: rotateY(0deg) scale(1);
  opacity: 1;
}
.comic-scene #sceneContent {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.comic-scene.active {
  transform: rotateY(0deg) scale(1);
  opacity: 1;
}
.comic-scene.flipping-out-left {
  transform: rotateY(90deg) scale(0.8);
  opacity: 0;
}
.comic-scene.flipping-out-right {
  transform: rotateY(-90deg) scale(0.8);
  opacity: 0;
}
.comic-scene.flipping-in-left {
  transform: rotateY(-90deg) scale(0.8);
  opacity: 0;
}
.comic-scene.flipping-in-left.active {
  transform: rotateY(0deg) scale(1);
  opacity: 1;
}
.comic-scene.flipping-in-right {
  transform: rotateY(90deg) scale(0.8);
  opacity: 0;
}
.comic-scene.flipping-in-right.active {
  transform: rotateY(0deg) scale(1);
  opacity: 1;
}
/* ===== СТРЕЛКИ ===== */
.nav-arrows {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
  pointer-events: none;
}
.nav-arrow {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 4px solid #3e2c1b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: #3e2c1b;
  cursor: pointer;
  transition: 0.2s;
  box-shadow: 0 4px 0 #3e2c1b;
}
.nav-arrow:hover {
  transform: scale(1.08);
  background: #ffffff;
}
.nav-arrow:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #3e2c1b;
}
.nav-arrow.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none !important;
  pointer-events: none;
}
/* ===== IMAGE SCENE ===== */
.scene-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.scene-background {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  inset: 0;
}
/* ===== ОБЛАКА ===== */
.comic-bubble {
  position: absolute;
  z-index: 3;
  background: #ffffff;
  border: 3px solid #3e2c1b;
  border-radius: 16px 16px 16px 4px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #1a237e;
  max-width: clamp(120px, 24vw, 180px);
  box-shadow: 3px 3px 0 #3e2c1b;
  line-height: 1.3;
  animation: bubblePop 0.4s ease-out;
}
.comic-bubble::before {
  content: "";
  position: absolute;
  bottom: -14px;
  left: 20px;
  border: 8px solid transparent;
  border-top: 8px solid #3e2c1b;
}
.comic-bubble .speaker-name {
  font-size: 10px;
  color: #e65100;
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
}
.comic-bubble.talk-left {
  top: 10px;
  left: 10px;
}
.comic-bubble.talk-right {
  top: 10px;
  right: 10px;
}
@keyframes bubblePop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  70% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ===== КАРТОЧКИ ===== */
.cards-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 10px 0;
}
.cards-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.card {
  background: #ffffff;
  border: 4px solid #5b9bd5;
  border-radius: 20px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  color: #1a237e;
  box-shadow: 0 4px 0 #3e6b9b;
  cursor: grab;
  transition: 0.15s;
  flex: 1 0 auto;
  max-width: 200px;
  text-align: center;
  background: #f3f9ff;
}
.card:active {
  cursor: grabbing;
  opacity: 0.6;
}
.card.wrong {
  border-color: #ff5252;
  background: #ffebee;
  box-shadow: 0 0 0 4px #ff8a80;
  animation: shake 0.3s;
}
.card.correct {
  border-color: #66bb6a;
  background: #e8f5e9;
  box-shadow: 0 4px 0 #2e7d32;
  cursor: default;
  opacity: 0.8;
}
.drop-zone {
  min-height: 60px;
  border: 4px dashed #bcaaa4;
  border-radius: 24px;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
  background: #fff3e0;
  transition: 0.2s;
}
.drop-zone.drag-over {
  border-color: #5b9bd5;
  background: #e3f2fd;
}
.hint-box {
  background: #ffecb3;
  border-radius: 20px;
  padding: 12px 16px;
  margin: 10px 0 8px;
  border-left: 8px solid #ff8a65;
  font-size: 15px;
  color: #4e342e;
  display: none;
}
.hint-box.show {
  display: block;
  animation: fadeIn 0.3s;
}
.soft-skill-box {
  background: #e8eaf6;
  border-radius: 20px;
  padding: 14px 18px;
  margin: 12px 0 8px;
  border-left: 8px solid #3f51b5;
  display: none;
}
.soft-skill-box.show {
  display: block;
  animation: fadeIn 0.4s;
}
.soft-skill-box .skill-title {
  font-weight: 800;
  color: #1a237e;
  font-size: 18px;
}
.soft-skill-box .skill-desc {
  font-size: 15px;
  color: #283593;
  margin-top: 4px;
  line-height: 1.5;
}
.soft-skill-box .skill-tip {
  background: #c5cae9;
  border-radius: 12px;
  padding: 8px 14px;
  margin-top: 8px;
  font-size: 14px;
  color: #1a237e;
}
.btn-group {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
}
.btn {
  background: #5b9bd5;
  border: none;
  border-radius: 40px;
  padding: 12px 28px;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  box-shadow: 0 6px 0 #2a5f8a;
  cursor: pointer;
  transition: 0.08s linear;
  border: 2px solid #1a237e;
  flex: 1 0 auto;
  max-width: 200px;
}
.btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #2a5f8a;
}
.btn.green {
  background: #81c784;
  box-shadow: 0 6px 0 #2e7d32;
  border-color: #1b5e20;
}
.btn.orange {
  background: #ffb74d;
  box-shadow: 0 6px 0 #e65100;
  border-color: #bf360c;
  color: #3e2c1b;
}
.btn:disabled {
  opacity: 0.4;
  transform: translateY(4px);
  box-shadow: 0 2px 0 #2a5f8a;
  pointer-events: none;
}
.celebration {
  background: #fff9c4;
  border-radius: 40px;
  padding: 16px;
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  color: #f57f17;
  border: 6px solid #ffb300;
  animation: fadeIn 0.5s;
}
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-8px);
  }
  75% {
    transform: translateX(8px);
  }
}
@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(-8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 600px) {
  .game-wrap {
    padding: 16px;
  }
  .title {
    font-size: 16px;
  }
  .counter-box .counter-number {
    font-size: 16px;
    min-width: 28px;
  }
  .card {
    font-size: 13px;
    padding: 8px 12px;
    max-width: 150px;
  }
  .station-dot {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  .station-dot .label {
    display: none !important;
  }
  .comic-bubble {
    font-size: 10px;
    padding: 6px 8px;
    max-width: clamp(82px, 28vw, 120px);
  }
  .nav-arrow {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
}
