/* Стили развивашки №2 «Números». Палитра — синий Gelimo + цветные акценты
   из палитры цифр. Большие тапающиеся элементы для пальцев 2–5 лет. */

:root {
  --g-blue: #02528a;
  --g-blue-soft: #a8dbff;
  --g-red: #ed1c25;
  --g-cream: #fff8ee;
  --g-yellow: #ffd23f;
  --g-pink: #ff5e8a;
  --g-green: #6dd47e;
  --g-text: #02528a;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: "Satoshi", "Nunito", "Comic Sans MS", system-ui, sans-serif;
  color: var(--g-text);
  background: linear-gradient(180deg, #d6f0ff 0%, #fff8ee 100%);
  overflow: hidden; user-select: none; -webkit-user-select: none;
}

#app { position: fixed; inset: 0; }

.screen {
  position: absolute; inset: 0;
  display: none; flex-direction: column; padding: 16px;
  animation: fadein 0.4s ease;
}
.screen.active { display: flex; }
@keyframes fadein { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }

/* Стартовый и финальный экраны */
#screen-intro, #screen-reward { align-items: center; justify-content: center; text-align: center; position: relative; }

/* Маскоты — большие emoji (ленивец + обезьянка) */
.mascot {
  width: 280px; height: 200px;
  filter: drop-shadow(0 12px 24px rgba(2, 82, 138, 0.2));
  margin-bottom: 8px;
}
.mascot.bob { animation: bob 2.4s ease-in-out infinite; transform-origin: center bottom; }
.mascot-emoji {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  font-size: 140px; line-height: 1;
}
.mascot-emoji .m-left  { transform: rotate(-6deg); }
.mascot-emoji .m-right { transform: rotate(6deg); }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

/* Бренд-плашка */
.brand-bar { position: absolute; top: 16px; left: 16px; }
.brand-logo {
  display: inline-flex; align-items: center;
  background: white; padding: 8px 16px; border-radius: 999px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  font-weight: 900; color: var(--g-blue);
  font-size: 20px; letter-spacing: 0.3px;
}
.brand-slot .brand-logo { background: transparent; box-shadow: none; padding: 0; font-size: 18px; }

h1 { font-size: 48px; margin: 16px 0 0; color: var(--g-blue); letter-spacing: -0.5px; }
h2 { font-size: 40px; margin: 16px 0 4px; color: var(--g-blue); }
.subtitle { font-size: 20px; margin: 4px 0 24px; opacity: 0.7; }

/* Возрастные кнопки */
.age-picker { display: flex; gap: 12px; margin-bottom: 24px; }
.age-btn {
  background: white; border: 3px solid transparent; cursor: pointer;
  padding: 12px 18px; border-radius: 16px; font-family: inherit;
  font-weight: 700; font-size: 16px; color: var(--g-blue);
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
  transition: transform 0.1s, border-color 0.2s;
}
.age-btn:active { transform: translateY(1px); }
.age-btn.selected { border-color: var(--g-red); background: var(--g-blue-soft); }

.big-btn {
  background: var(--g-red); color: white; border: none;
  font-size: 24px; font-weight: 800; padding: 16px 36px; border-radius: 999px;
  box-shadow: 0 6px 0 #b8141c, 0 12px 24px rgba(237, 28, 37, 0.35);
  cursor: pointer; transition: transform 0.1s; font-family: inherit;
}
.big-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #b8141c, 0 4px 8px rgba(237, 28, 37, 0.35); }
.big-btn.alt { background: var(--g-blue); box-shadow: 0 6px 0 #013a63, 0 12px 24px rgba(2,82,138,0.35); }
.big-btn.alt:active { box-shadow: 0 2px 0 #013a63, 0 4px 8px rgba(2,82,138,0.35); }
.big-btn.ghost {
  background: white; color: var(--g-blue);
  box-shadow: 0 4px 0 #c3d8e6, 0 8px 16px rgba(0,0,0,0.12);
}
.reward-actions { display: flex; flex-direction: column; gap: 14px; align-items: center; }

/* Плашка с заданием */
.task-bar {
  display: flex; align-items: center; gap: 12px;
  background: white; padding: 10px 16px; border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08); margin-bottom: 12px; flex-shrink: 0;
}
.task-text { font-weight: 800; font-size: 17px; flex: 1; color: var(--g-blue); }
.counter {
  background: var(--g-yellow); color: var(--g-blue);
  padding: 6px 14px; border-radius: 999px; font-weight: 800;
  font-size: 18px; white-space: nowrap;
}
.bar-btn {
  background: var(--g-cream); border: none;
  width: 38px; height: 38px; border-radius: 50%;
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  flex-shrink: 0; transition: transform 0.1s;
  font-family: inherit;
}
.bar-btn:active { transform: translateY(1px) scale(0.95); }
.bar-btn.muted { opacity: 0.45; }
.bar-btn.skip { background: var(--g-red); color: white; font-weight: 800; }

/* Подсказка через 10 сек простоя */
.obj.hint, .digit-tile.hint {
  animation: hint-pulse 0.8s ease-in-out 3; z-index: 5;
}
@keyframes hint-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 3px 4px rgba(0,0,0,0.2)); }
  50%      { transform: scale(1.3); filter: drop-shadow(0 0 24px #ffd700) drop-shadow(0 0 8px #ffaa00); }
}
.region.hint {
  fill: rgba(255,215,0,0.4) !important;
  stroke: #ffd700; stroke-width: 6;
  animation: hint-pulse 0.8s ease-in-out 3;
}

/* Общая игровая область */
.play-area { flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 0; }

/* Поле с цифрами / разбросанными объектами */
.play-field {
  flex: 1; position: relative;
  background: white; border-radius: 24px;
  box-shadow: inset 0 0 0 4px rgba(2,82,138,0.15);
  overflow: hidden;
}
.number-field { background: linear-gradient(180deg, #e6f5ff 0%, #fff5e6 100%); }

.obj {
  position: absolute; width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; cursor: pointer; transition: transform 0.15s;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.2));
}
.obj svg { width: 100%; height: 100%; }
.obj:active { transform: scale(0.92); }
.obj.found { animation: pop 0.5s ease forwards; pointer-events: none; }
.obj.shake { animation: shake 0.4s; }
@keyframes pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.5) rotate(15deg); filter: drop-shadow(0 0 24px gold); }
  100% { transform: scale(1.15); filter: drop-shadow(0 0 12px gold); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-8px) rotate(-5deg); }
  75%      { transform: translateX(8px) rotate(5deg); }
}

/* Цифра-плитка (используется во многих играх) */
.digit-tile { width: 88px; height: 88px; }
.digit-tile svg, .seq-cell svg { width: 100%; height: 100%; display: block; }
.digit-tile.option {
  position: relative; width: 100px; height: 100px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; margin: 8px;
  transition: transform 0.15s;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}
.digit-tile.option:active { transform: scale(0.92); }
.digit-tile.found { animation: pop 0.5s ease forwards; pointer-events: none; }
.digit-tile.shake { animation: shake 0.4s; }

/* Игра «Quantos existem?» */
.count-area { flex: 1; display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.count-items {
  flex: 1;
  background: white; border-radius: 24px;
  box-shadow: inset 0 0 0 4px rgba(2,82,138,0.15);
  display: flex; flex-wrap: wrap; gap: 14px;
  align-items: center; justify-content: center; padding: 18px;
  overflow: hidden;
}
.count-emoji {
  font-size: 56px;
  animation: bounce-in 0.4s ease both;
}
@keyframes bounce-in {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); }
}
.count-options {
  display: flex; justify-content: center; gap: 14px;
  flex-shrink: 0;
}

/* Игра «Quem tem mais?» */
.more-area {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 12px;
  background: white; border-radius: 24px; padding: 16px;
  box-shadow: inset 0 0 0 4px rgba(2,82,138,0.15);
}
.more-side, .more-equal {
  background: var(--g-blue-soft); border: 4px solid white;
  border-radius: 24px; padding: 16px; cursor: pointer;
  font-family: inherit; transition: transform 0.15s;
  box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}
.more-side { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 240px; }
.more-equal {
  font-size: 64px; font-weight: 900; color: var(--g-blue);
  width: 100px; height: 100px;
  display: flex; align-items: center; justify-content: center;
  background: var(--g-cream);
}
.more-side:active, .more-equal:active { transform: translateY(2px) scale(0.97); }
.more-mascot { font-size: 64px; }
.more-items { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.more-row { font-size: 28px; line-height: 1; letter-spacing: 2px; }
.more-count { font-size: 38px; font-weight: 900; color: var(--g-red); }
.more-side.found, .more-equal.found { animation: pop 0.5s ease forwards; }
.more-side.shake, .more-equal.shake { animation: shake 0.4s; }

/* Игра «Ligue o número certo» */
.link-area {
  flex: 1; display: grid; grid-template-columns: 130px 1fr; gap: 16px;
  background: white; border-radius: 24px; padding: 16px;
  box-shadow: inset 0 0 0 4px rgba(2,82,138,0.15);
  min-height: 0; overflow: hidden;
}
.link-col { position: relative; height: 100%; }
.link-digits .obj.digit-tile {
  position: absolute; left: 50%; transform: translateX(-50%);
  width: 88px; height: 88px;
}
.link-digits .obj.digit-tile:nth-child(1) { top: 4%; transform: translateX(-50%); }
.link-digits .obj.digit-tile:nth-child(2) { top: 36%; transform: translateX(-50%); }
.link-digits .obj.digit-tile:nth-child(3) { top: 68%; transform: translateX(-50%); }
.link-groups { display: flex; flex-direction: column; justify-content: space-around; gap: 10px; }
.link-group {
  background: var(--g-blue-soft); border: 3px dashed var(--g-blue);
  border-radius: 20px; padding: 16px; min-height: 80px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.15s;
}
.link-group-emojis { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; font-size: 32px; }
.link-group.over { background: var(--g-yellow); transform: scale(1.04); }
.link-group.matched { background: #d4f5d4; border-style: solid; border-color: var(--g-green); }
.link-group.shake { animation: shake 0.4s; }

/* Игра «Dê os objetos certos» */
.give-area {
  flex: 1; display: flex; flex-direction: column; gap: 12px;
  background: white; border-radius: 24px; padding: 12px;
  box-shadow: inset 0 0 0 4px rgba(2,82,138,0.15);
  min-height: 0;
}
.give-top {
  display: flex; align-items: center; gap: 16px;
  padding: 8px 12px;
  background: var(--g-blue-soft); border-radius: 16px;
}
.give-mascot {
  font-size: 80px; transition: transform 0.3s;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}
.give-mascot.happy { animation: feed-bounce 0.5s; }
@keyframes feed-bounce {
  0%, 100% { transform: scale(1) rotate(0); }
  40%      { transform: scale(1.25) rotate(-8deg); }
  70%      { transform: scale(1.15) rotate(8deg); }
}
.give-zone {
  flex: 1; min-height: 90px;
  border: 3px dashed var(--g-red);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  color: var(--g-red); font-weight: 800; font-size: 14px;
  background: rgba(237, 28, 37, 0.05);
  animation: give-zone-pulse 1.4s ease-in-out infinite;
}
@keyframes give-zone-pulse {
  0%, 100% { background: rgba(237, 28, 37, 0.05); transform: scale(1); }
  50%      { background: rgba(237, 28, 37, 0.12); transform: scale(1.02); }
}
.give-items {
  flex: 1; position: relative;
  background: var(--g-cream); border-radius: 16px;
}

/* Игра «Complete a sequência» */
.seq-area { flex: 1; display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.seq-row {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 16px;
  background: white; border-radius: 24px; padding: 16px;
  box-shadow: inset 0 0 0 4px rgba(2,82,138,0.15);
}
.seq-cell {
  width: 92px; height: 92px;
  display: flex; align-items: center; justify-content: center;
}
.seq-cell.blank {
  border: 4px dashed var(--g-red);
  border-radius: 16px;
  font-size: 56px; font-weight: 900; color: var(--g-red);
}
.seq-options { display: flex; justify-content: center; gap: 14px; flex-shrink: 0; }

/* Игра «Pinte cada número» */
.coloring-numbers { flex: 1; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.cn-canvas {
  flex: 1;
  background: white; border-radius: 24px;
  display: flex; align-items: center; justify-content: space-around;
  flex-wrap: wrap; padding: 14px;
  box-shadow: inset 0 0 0 4px rgba(2,82,138,0.15);
}
.cn-canvas.single { justify-content: center; }
.cn-hint {
  text-align: center; font-weight: 700; color: var(--g-blue);
  font-size: 16px; padding: 4px; opacity: 0.85;
}
.cn-digit {
  width: 110px; height: 110px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
  transition: transform 0.2s;
}
.cn-digit.big { width: 200px; height: 200px; }
.cn-digit svg { width: 100%; height: 100%; }
.palette-color.expected {
  animation: palette-pulse 0.9s ease-in-out infinite;
  border-color: gold;
  box-shadow: 0 0 18px gold, 0 3px 8px rgba(0,0,0,0.2);
}
.palette-color.dim { opacity: 0.45; }
@keyframes palette-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}
.cn-digit .region { cursor: pointer; transition: fill 0.25s; }
.cn-digit.solved { animation: pop 0.5s ease forwards; }
.color-palette {
  display: flex; gap: 12px; justify-content: center;
  padding: 12px; background: white; border-radius: 20px;
  flex-shrink: 0;
}
.palette-color {
  width: 48px; height: 48px; border-radius: 50%;
  cursor: pointer; border: 4px solid white;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}
.palette-color:active { transform: scale(0.92); }
.palette-color.selected {
  transform: scale(1.2);
  border-color: gold;
  box-shadow: 0 0 16px gold, 0 3px 8px rgba(0,0,0,0.2);
}
.cn-bridge {
  display: none;
  background: var(--g-blue-soft); border-radius: 16px;
  padding: 14px 16px; text-align: center;
}
.cn-bridge.visible { display: block; animation: fadein 0.4s ease; }
.bridge-text { font-weight: 700; color: var(--g-blue); margin-bottom: 8px; }
.bridge-btn {
  display: inline-block;
  background: var(--g-red); color: white;
  padding: 12px 24px; border-radius: 999px;
  text-decoration: none; font-weight: 800;
  box-shadow: 0 3px 0 #b8141c;
}

/* Теоретический блок 1..10 */
.theory-area {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: white; border-radius: 24px; padding: 20px;
  box-shadow: inset 0 0 0 4px rgba(2,82,138,0.15);
}
.theory-card {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.theory-digit { width: 140px; height: 140px; animation: bounce-in 0.5s ease both; }
.theory-digit svg { width: 100%; height: 100%; }
.theory-items {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  max-width: 80vw;
}
.theory-emoji { font-size: 44px; animation: bounce-in 0.3s ease both; }
.theory-label {
  font-size: 24px; font-weight: 800; color: var(--g-blue);
}

/* Drag and drop */
.obj.draggable { cursor: grab; touch-action: none; }
.obj.draggable:active { cursor: grabbing; }
.obj.dragging {
  z-index: 1000; transform: scale(1.25);
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.35));
  cursor: grabbing; transition: transform 0.1s;
}

/* Салют — общий и мини (точечный возле клика) */
.salute {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 100;
  overflow: hidden;
}
.salute.mini { position: fixed; inset: 0; z-index: 2000; }
.salute span {
  position: absolute;
  font-size: 36px;
  animation: salute-burst 1.6s ease-out forwards;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
  transform-origin: center;
}
.salute.mini span { font-size: 28px; }
@keyframes salute-burst {
  0%   { transform: translate(0,0) scale(0) rotate(0); opacity: 1; }
  20%  { transform: translate(0,0) scale(1.4) rotate(0); opacity: 1; }
  100% {
    transform: translate(var(--tx,0px), var(--ty,-280px)) scale(0.4) rotate(var(--rot,360deg));
    opacity: 0;
  }
}

/* Кувырок обезьянки — оверлей поверх игрового поля при правильном ответе */
.monkey-flip-overlay {
  position: fixed;
  top: 50%; left: 50%;
  font-size: 110px;
  z-index: 1500;
  pointer-events: none;
  animation: monkey-flip 0.85s ease-out forwards;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.25));
}
@keyframes monkey-flip {
  0%   { transform: translate(-50%, -50%) scale(0.4) rotate(0); opacity: 0; }
  25%  { transform: translate(-50%, -50%) scale(1.2) rotate(180deg); opacity: 1; }
  50%  { transform: translate(-50%, -75%) scale(1.3) rotate(360deg); opacity: 1; }
  75%  { transform: translate(-50%, -50%) scale(1.2) rotate(540deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(0.6) rotate(720deg); opacity: 0; }
}

/* Экран «Отдых для глаз» */
.eye-rest {
  flex: 1;
  background: linear-gradient(180deg, #d6f0ff 0%, #fff8ee 100%);
  border-radius: 24px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px; padding: 24px; text-align: center;
}
.eye-rest-mascot { font-size: 96px; animation: bob 2.4s ease-in-out infinite; }
.eye-rest-title { font-size: 28px; color: var(--g-blue); margin: 0; font-weight: 900; }
.eye-rest-text { font-size: 17px; color: var(--g-text); opacity: 0.8; margin: 0; max-width: 320px; }
.eye-rest-countdown {
  font-size: 64px; font-weight: 900; color: var(--g-red);
  background: white; border-radius: 50%; width: 96px; height: 96px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(237, 28, 37, 0.25);
  animation: countdown-pulse 1s ease-in-out infinite;
}
@keyframes countdown-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}

/* Конфетти финального экрана */
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti span { position: absolute; font-size: 32px; animation: fall 3s linear infinite; }
@keyframes fall {
  0%   { transform: translateY(-50px) rotate(0); }
  100% { transform: translateY(110vh) rotate(720deg); }
}
