/* profile.css — ГЛАВНАЯ (4.1): компактный профиль + витрина + кнопка ловли
   Сделано по макету «v3 · Компактный профиль + витрина на 10».
   Разметка — index.html (#main-tab), логика витрины — home.js. */

/* ====== вкладка ======
   4.2: главная — ровно один экран, без прокрутки. Сверху карточка (+ полоска заданий у новичков),
   снизу «Ловить голубей» прямо над нижней панелью, а витрина занимает всё, что осталось,
   и сама уменьшается на низких телефонах (container query по высоте блока .showcase). */
#main-tab{
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px calc(env(safe-area-inset-bottom, 0px) + 84px);
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
#main-tab.active{
  display: flex;
  flex-direction: column;
}
#main-tab[hidden]{ display: none; }
#main-tab > .home-card,
#main-tab > .q-strip{ flex: 0 0 auto; width: 100%; }

/* фон на главной: картинка крупнее и прижата к низу — трава начинается под профилем.
   Только для телефонов в портрете; на широких экранах остаётся как было. */
@media (max-aspect-ratio: 3/4){
  body.on-main::before{
    background-size: 100% 100%, auto 130%;
    background-position: 0 0, 50% 100%;
  }
}

/* ====== карточка профиля ====== */
#main-tab .home-card{
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 10px 0;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(28,36,62,.9);
  box-shadow: 0 10px 26px rgba(0,0,0,.35);
  overflow: hidden;
  box-sizing: border-box;
  max-width: 430px;
  margin: 0 auto;
}

#main-tab .home-top{
  display: flex;
  align-items: center;
  gap: 10px;
}

#main-tab #tg-avatar{
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  object-fit: cover;
  background: #2b2b3b;
}

#main-tab .player-meta{
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#main-tab #tg-username{
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#main-tab #player-id{
  font-size: 11px;
  font-weight: 700;
  color: #a9adc9;
}

#main-tab .home-ico{
  position: relative;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
#main-tab .home-ico > img{ width: 24px; height: 24px; display: block; }
#main-tab .home-ico:active{ transform: scale(.95); }

/* «есть подарки в коллекции» — красная точка вместо большой таблички NEW */
#main-tab .home-dot{
  position: absolute;
  right: -4px;
  top: -5px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff3b5c;
  border: 2px solid #1c243e;
}
#main-tab .home-dot.hidden{ display: none; }
#main-tab .home-dot.pop{ animation: homeDotPop .4s ease; }
@keyframes homeDotPop{ 50%{ transform: scale(1.5); } }

#main-tab .home-chips{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

#main-tab .home-chip{
  height: 34px;
  box-sizing: border-box;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}
#main-tab .home-chip .chip-feather{ width: 16px; height: 16px; }
#main-tab .home-chip--income{
  background: rgba(74,222,128,.12);
  border-color: rgba(74,222,128,.3);
  color: #8ff0b4;
  font-size: 13px;
}

#main-tab .home-progress{
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
}
#main-tab .home-progress__bar{
  flex: 1 1 auto;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  overflow: hidden;
}
#main-tab .home-progress__fill{
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4db8ff, #4ade80);
}
#main-tab .home-progress__eta{
  font-size: 11px;
  font-weight: 800;
  color: #a9adc9;
  min-width: 24px;
  text-align: right;
}

/* ====== витрина ====== */
#main-tab .showcase{
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  container-type: size;
}

#main-tab .sc-label{
  position: absolute;
  left: 8px;
  z-index: 3;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(20,22,44,.78);
  font-size: 12px;
  font-weight: 900;
  color: #fff;
}

/* сцена: координаты мест в % (макет 390×372), home.js ставит голубей */
#main-tab .sc-stage{
  position: relative;
  width: 100%;
  aspect-ratio: 390 / 372;
  margin: 36px auto 0;
  flex: 0 0 auto;
}
/* низкий экран: сцена ужимается по высоте.
   36px сверху — место под надпись «Витрина N / M», 81px снизу — кнопка ловли с отступами */
@supports (container-type: size){
  #main-tab .sc-stage{ width: min(100%, calc((100cqh - 36px - 81px) * 390 / 372)); }
}

/* зона под витриной: всё свободное место, кнопка — по центру (между голубями и панелью) */
#main-tab .hunt-zone{
  flex: 1 1 auto;
  min-height: 81px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#main-tab .sc-slot{
  position: absolute;
  transform: translate(-50%, 0);
}

#main-tab .sc-pg{
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
#main-tab .sc-pg img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  transform-origin: 50% 95%;
  animation: scIdle 2.4s ease-in-out infinite;
  animation-delay: var(--sc-delay, 0s);
}
#main-tab .sc-pg:active img{ transform: scale(1.06, .94); }

/* свечение редких */
#main-tab .sc-pg.rarity-legendary img{ filter: drop-shadow(0 0 9px rgba(255,200,60,.9)); }
#main-tab .sc-pg.rarity-mythical  img{ filter: drop-shadow(0 0 11px rgba(255,102,204,.9)); }
#main-tab .sc-pg.rarity-epic      img{ filter: drop-shadow(0 0 7px rgba(178,76,255,.75)); }
#main-tab .sc-pg.rarity-exclusive img{ filter: drop-shadow(0 0 9px rgba(63,209,192,.9)); }

/* метка серии под лапками (например «Бета») — как табличка, на голове смотрелась криво */
#main-tab .sc-tag{
  position: absolute;
  left: 50%;
  top: calc(100% - 9px);
  transform: translateX(-50%);
  z-index: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(20,190,170,.92);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  pointer-events: none;
}

/* монетка «+доход» раз в минуту */
#main-tab .sc-pop{
  position: absolute;
  left: 50%;
  top: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(20,22,44,.82);
  color: #ffd35a;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  pointer-events: none;
  animation: scPop 1.8s ease-out forwards;
}

/* пустое место и место за замком */
#main-tab .sc-empty,
#main-tab .sc-lock{
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0;
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
#main-tab .sc-empty{
  border: 3px dashed rgba(255,255,255,.85);
  background: rgba(20,22,44,.45);
  animation: scSlot 1.8s ease-in-out infinite;
}
#main-tab .sc-lock{
  border: 2px solid rgba(255,255,255,.25);
  background: rgba(20,22,44,.6);
  color: #d7d9ea;
  font-size: 11px;
  font-weight: 900;
}
#main-tab .sc-lock img{ width: 14px; height: 14px; }

@keyframes scIdle{ 0%,100%{ transform: scale(1,1); } 50%{ transform: scale(1.04,.96); } }
@keyframes scSlot{ 0%,100%{ opacity: .7; } 50%{ opacity: 1; } }
@keyframes scPop{
  0%  { opacity: 0; transform: translate(-50%, 8px) scale(.7); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1.08); }
  70% { opacity: 1; transform: translate(-50%, -18px) scale(1); }
  100%{ opacity: 0; transform: translate(-50%, -28px); }
}

/* ====== кнопка «Ловить голубей» ====== */
#main-tab .hunt-cta{
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(293px, 100%);
  height: 61px;
  margin: 0 auto;
  flex: 0 0 auto;
  padding: 0 12px 0 9px;
  box-sizing: border-box;
  border-radius: 18px;
  border: 1px solid #9fd3ff;
  background: linear-gradient(180deg, #00B318, #007D01);
  box-shadow: 0 10px 26px rgba(0,0,0,.35);
  color: #fff;
  font-family: inherit;
  overflow: hidden;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
#main-tab .hunt-cta:active{ transform: scale(.98); }

#main-tab .hunt-cta__sheen{
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.28) 50%, rgba(255,255,255,0) 100%);
  transform: translateX(-150%) skewX(-18deg);
  animation: ctaSheen 3.6s ease-in-out infinite;
  pointer-events: none;
}

#main-tab .hunt-cta__ico{
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffcf4d, #f5a623);
  box-shadow: inset 0 -3px 0 rgba(150,80,0,.35);
  display: grid;
  place-items: center;
}
#main-tab .hunt-cta__ico img{
  width: 28px;
  height: 28px;
  filter: brightness(.3) sepia(1) saturate(3) hue-rotate(-10deg);
  transform-origin: 30% 90%;
  animation: ctaNet 1.6s ease-in-out infinite;
}

#main-tab .hunt-cta__txt{
  position: relative;
  flex: 1 1 auto;
  text-align: left;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(0,60,0,.45);
  white-space: nowrap;
}

#main-tab .hunt-cta__pg{
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  filter: drop-shadow(0 0 6px rgba(255,220,80,.9));
  animation: ctaBob 2s ease-in-out infinite;
}

@keyframes ctaSheen{ 0%,55%{ transform: translateX(-150%) skewX(-18deg); } 85%,100%{ transform: translateX(320%) skewX(-18deg); } }
@keyframes ctaNet{ 0%,100%{ transform: rotate(-8deg); } 50%{ transform: rotate(12deg); } }
@keyframes ctaBob{ 0%,100%{ transform: translateY(0) rotate(-3deg); } 50%{ transform: translateY(-4px) rotate(3deg); } }

/* не рисуем анимации, когда главная скрыта (экономим батарею) */
#main-tab[hidden] *{ animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce){
  #main-tab *{ animation: none !important; }
}
