
/* ============================================================
   0) БАЗА: фон внутри iframe
============================================================ */
html,
body {
  margin: 0;
  padding: 0;
  background: #d4f9fa;
  font-family: "Baloo 2", system-ui, sans-serif;
}

/* ============================================================
   1) ГЛАВНЫЙ КОНТЕЙНЕР ИГРЫ
============================================================ */
.game-container {
  width: 320px;

  /* ПК-положение */
  margin-top: 30px;
  margin-left: 3px;
  margin-right: auto;
  margin-bottom: 10px;

  background: #d4f9fa;
  border-radius: 18px;
  overflow: visible;
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* ============================================================
   2) HEADER
============================================================ */
.teddy-header {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 17px;
  font-weight: 700;
  color: #ff9051;
  padding: 8px 12px 4px 12px;
}

.teddy-title {
  text-align: center;
}

/* ============================================================
   3) STATUS BAR
============================================================ */
.teddy-status {
  display: flex;
  justify-content: space-between;
  padding: 0 12px;
  margin: 2px 0 4px 0;
}

.pill {
  background: #fff7df;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 13px;
}

/* ============================================================
   4) TEDDY PLAY AREA
============================================================ */
.teddy-play-area {
  background: linear-gradient(#dff5ff, #fdf4df);
  border-radius: 14px;
  padding: 4px 8px 6px 8px;
  display: flex;
  justify-content: center;
  margin: 0 8px;
}

.teddy-stage {
  position: relative;
  width: 180px;
  height: 160px;
}

#teddyBase {
  position: relative;
  height: 160px;
  width: auto;
  margin: 0 auto;
}

#teddyBody {
  width: 117px;
  height: auto;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  z-index: 1;
}

.cloth-layer {
  width: 117px;
  height: auto;
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  pointer-events: none;
  display: none;
  z-index: 10;
}

/* индивидуальные смещения */
#hatLayer {
  top: -32px;
  transform: translateX(-50%) scale(0.71);
  z-index: 20;
}


#bottomLayer {
  top: 89px;
  width: 104px;
  z-index: 12;
    
}



/* ============================================================
   5) CONTROL PANEL
============================================================ */
.controls {
  padding: 6px 12px 10px 12px;
}

.category {
  margin-bottom: 8px;
}

.cat-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 3px;
}

.options {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.opt {
 display: block;
  border: 1px solid #d8e4ea;
  border-radius: 8px;
   font-size: 12px;
  background: white;
  cursor: pointer;
    position: relative;
  padding-left: 22px;
}

.opt::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* цветные точки */
.color-yellow::before { background: #ffd84d; }
.color-blue::before   { background: #4da6ff; }
.color-grey::before   { background: #d9d9d9; }

.color-green::before       { background: #4caf50; }
.color-dark-green::before  { background: #2e7d32; }
.color-light-green::before { background: #7ccc7c; }

.opt.remove {
  background: #ffeaea;
  border-color: #f8baba;
}

.opt.active {
  background: #fff3d9;
  border-color: #ffb661;
}

/* ============================================================
   6) BOTTOM BUTTONS
============================================================ */
.bottom-buttons {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.btn {
  flex: 1;
  padding: 8px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
}

.btn-clear { background: white; }
.btn-random { background: #ffb65c; color: white; }

/* ============================================================
   7) МОБИЛЬНАЯ ВЕРСТКА
============================================================ */
@media (max-width: 600px) {

  .game-container {
    margin-top: 90px !important;
    margin-left: auto;
    margin-right: auto;
  }

  .teddy-status { margin-bottom: 0 !important; }

  .teddy-status .pill:last-child {
    margin-right: 28px;
  }

  .teddy-play-area {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  min-height: 138px; /* 140–150 ✅ */
}

  .teddy-stage {
    height: 160px !important;
  }

  #teddyBase {
    height: 150px !important;
  }
}

/* ============================================================
   8) <400px
============================================================ */
@media (max-width: 400px) {
  .game-container {
    margin-top: 82px;
  }
}

/* ============================================================
   Teddy End Panel
============================================================ */

.teddy-end-restart {
  background: #ffb65c;
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 12px;
  font-size: 17px;
  cursor: pointer;
}

/* ============================================================
   CONFETTI (FIREWORK)
============================================================ */
 
@keyframes softExplode {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.6);
  }
  70% {
    opacity: 1;
    transform: translate(calc(-50% + var(--dx)),
                         calc(-50% + var(--dy))) scale(1.2);
  }
  100% {
    opacity: 0.9;
    transform: translate(calc(-50% + var(--dx)),
                         calc(-50% + var(--dy))) scale(1);
  }
}

body {
  overflow-x: hidden;
    position: relative;
}

/* ============================================================
   Teddy END — финальная панель + внутреннее окно
   (аналогично overlay в игре с каплями)
============================================================ */


/* Оверлей поверх всей карточки игры */
.teddy-end-panel {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;

  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: .25s ease;

  z-index: 5000;
}

/* когда игра закончилась */
.teddy-end-panel.show {
  opacity: 1;
  pointer-events: auto;
}

/* Внутреннее «окошко» с текстом и кнопкой */
.teddy-end-modal {
  width: 320px;
  max-width: 90%;
  min-height: 260px;
    opacity: 1 !important;
  background: #dcf6ff;
  border-radius: 18px;
  padding: 24px 20px 32px 20px;

  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
    
}

/* Заголовок и текст внутри финального окна */
.teddy-end-panel h2 {
  font-size: 26px;
  font-weight: 800;
  color: #ff9051;
  margin-bottom: 10px;
}

.teddy-end-panel p {
  font-size: 26px;
  font-weight: 600;
  color: #4e72ae;
  line-height: 1.4;
  margin-bottom: 20px;
}

/* Кнопка «Nochmal spielen» */

.teddy-end-restart:hover {
  background: #ffa940;
}

/* Скрываем игровое поле под финальным окном */
.game-container.ended .controls,
.game-container.ended .teddy-stage,
.game-container.ended .teddy-status,
.game-container.ended .teddy-header {
  opacity: 0;
  pointer-events: none;
}

/* ============================================================
   CONFETTI (FIREWORK) — как было, только относительно панели
============================================================ */
.firework {
  position: absolute;
  z-index: 6000;
  pointer-events: none;
  opacity: 1 !important;
}

@keyframes teddyConfettiFly {
  0% {
    transform: translate(0, 0) scale(0.5);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) scale(1);
    opacity: 0;
  }
}

.game-container.ended .teddy-stage {
  transition: opacity .4s ease;
}

.teddy-end-panel.show .teddy-end-modal {
  animation: none !important;
}
    
}

@keyframes pop {
  0% { transform: scale(.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}



