/* upgrades.css — ONLY upgrades cards (no tokens, no imports) */

/* ========== UPGRADE SECTION WRAPPER ========== */
.upgrades-section{
  display:flex;
  flex-direction:column;
  width:100%;
  max-width:100%;
  margin:0 auto;
  background: var(--bg-card);
  padding:14px;
  padding-bottom: calc(250px + env(safe-area-inset-bottom));
  border-radius:16px;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  box-sizing:border-box;
  height:auto;
}

/* ❌ Убираем большой заголовок "Улучшения" внутри секции */
.upgrades-section > h2{
  display:none !important;
}

.upgrades-section .upgrades-list{
  padding-bottom:20px;
  box-sizing:border-box;
  min-height:0;
}

/* ========== UPGRADE CARD ========== */
.upgrades-section .upgrade{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:stretch;

  padding:16px 14px 14px;
  margin:12px 0;

  border-radius:18px;

  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03)),
    var(--bg-item);

  border: 1px solid rgba(255,255,255,.07);
  box-shadow:
    0 10px 26px rgba(0,0,0,.22),
    inset 0 1px 0 rgba(255,255,255,.06);

  overflow:hidden;
}

/* Заголовок апгрейда */
.upgrades-section .upgrade h3{
  margin:0;
  padding:0 6px 10px;
  text-align:center;

  font-size:18px;
  font-weight:900;
  color: rgba(210, 176, 106, .95);
  text-shadow: 0 1px 0 rgba(0,0,0,.35);
}

/* Полоска под заголовком */
.upgrades-section .upgrade h3::after{
  content:"";
  display:block;
  height:2px;
  width:74%;
  margin:10px auto 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(210, 176, 106, .65),
    transparent
  );
}

/* Описание */
.upgrades-section .upgrade p{
  margin:10px 0 12px;
  padding:0 10px;
  text-align:center;
  font-size:13.5px;
  line-height:1.45;
  color: var(--text-secondary);
}

/* ========== STATS ========== */
.upgrades-section .upgrade-stats{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin:6px 0 14px;
}

/* Общая плашка */
.upgrades-section .upgrade-stats > span{
  display:flex;
  align-items:center;
  justify-content:center;

  padding:10px 12px;
  border-radius:12px;

  background: rgba(0,0,0,.16);
  border: 1px solid rgba(255,255,255,.06);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 4px 12px rgba(0,0,0,.18);

  color: rgba(230,230,250,.92);
  font-size:13px;
  font-weight:700;
}

/* Значения */
.upgrades-section .upgrade-stats > span > span{
  font-weight:900;
  color: var(--text-primary);
  margin-left:4px;
}

/* =========================================
   MULTIPLIER ROW (farm) — xNOW → xNEXT
   ========================================= */
.upgrades-section .farm-mult-row{
  font-weight:800;

  background:
    linear-gradient(180deg, rgba(210,176,106,.10), rgba(255,255,255,.02)),
    rgba(0,0,0,.16);

  border: 1px solid rgba(210,176,106,.16);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 4px 12px rgba(0,0,0,.18);

  color: rgba(230,230,250,.90);
}

/* убираем левый margin у значений в этой строке */
.upgrades-section .farm-mult-row > span{
  margin-left:0;
}

/* NOW */
.upgrades-section .farm-mult-row > span:first-of-type{
  color: rgba(230,230,250,.92);
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
}

/* стрелка */
.upgrades-section .farm-mult-row > span:first-of-type::after{
  content:" \2192 ";
  font-weight:900;
  color: rgba(210,176,106,.75);
  margin:0 6px;
}

/* NEXT */
.upgrades-section .farm-mult-row > span:last-of-type{
  color: rgba(210,176,106,.95);
  text-shadow: 0 1px 0 rgba(0,0,0,.35);
}

/* =========================================
   SLOTS ROW — NOW → NEXT (ферма/инкубатор)
   класс: .slots-row
   ========================================= */
.upgrades-section .slots-row{
  font-weight:800;

  /* чуть мягче чем множитель */
  background:
    linear-gradient(180deg, rgba(210,176,106,.06), rgba(255,255,255,.015)),
    rgba(0,0,0,.16);

  border: 1px solid rgba(210,176,106,.10);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 4px 12px rgba(0,0,0,.18);

  color: rgba(230,230,250,.90);
}

/* в slots-row убираем стандартный margin-left:4px */
.upgrades-section .slots-row > span{
  margin-left:0;
}

/* NOW (1-е число) */
.upgrades-section .slots-row > span:first-of-type{
  color: rgba(230,230,250,.92);
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
}

/* стрелка между now и next */
.upgrades-section .slots-row > span:first-of-type::after{
  content:" \2192 ";
  font-weight:900;
  color: rgba(210,176,106,.72);
  margin:0 6px;
}

/* NEXT (2-е число) */
.upgrades-section .slots-row > span:last-of-type{
  color: rgba(210,176,106,.95);
  text-shadow: 0 1px 0 rgba(0,0,0,.35);
}

/* ========== PRICE FIX (NO nth-child) ========== */
.upgrades-section .upgrade-stats > span.upgrade-price{
  font-size:0; /* скрываем "Цена:" и старый "$" */
  justify-content:center;
}

.upgrades-section .upgrade-stats > span.upgrade-price::before{
  content:"Цена:";
  font-size:13px;
  font-weight:800;
  color: rgba(230,230,250,.86);
  margin-right:8px;
}

.upgrades-section .upgrade-stats > span.upgrade-price > span[id$="-cost"]{
  font-size:13px;
  font-weight:900;
  color: var(--text-primary);
}

/* один-единственный $ */
.upgrades-section .upgrade-stats > span.upgrade-price > span[id$="-cost"]::after{
  content:"$";
  font-weight:900;
  color: rgba(210,210,230,.70);
  margin-left:0;
}

/* ========== MOBILE ========== */
@media (max-width:480px){
  .upgrades-section{
    padding:12px;
    padding-bottom:20px;
    border-radius:14px;
  }

  .upgrades-section .upgrade{
    padding:14px 12px 12px;
    margin:10px 0;
    border-radius:16px;
  }

  .upgrades-section .upgrade h3{
    font-size:16px;
  }

  .upgrades-section .upgrade p{
    font-size:12.5px;
  }

  .upgrades-section .upgrade-stats > span{
    padding:9px 10px;
    font-size:12.5px;
  }

  .upgrades-section .upgrade-stats > span.upgrade-price::before{
    font-size:12.5px;
  }

  .upgrades-section .upgrade-stats > span.upgrade-price > span[id$="-cost"]{
    font-size:12.5px;
  }
}

/* ===== MAX MODE (логично показываем "MAX") ===== */
.upgrades-section .farm-mult-row.is-max > span:first-of-type::after,
.upgrades-section .slots-row.is-max > span:first-of-type::after{
  content:" \2192 ";
  color: rgba(255,255,255,.20);
}

/* "MAX" (второе значение) — более спокойное, но читаемое */
.upgrades-section .farm-mult-row.is-max > span:last-of-type,
.upgrades-section .slots-row.is-max > span:last-of-type{
  color: rgba(230,230,250,.55);
  text-shadow:none;
  letter-spacing:.4px;
}

/* фон при MAX чуть глушим, чтобы было понятно что упёрлись */
.upgrades-section .farm-mult-row.is-max,
.upgrades-section .slots-row.is-max{
  border-color: rgba(255,255,255,.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015)),
    rgba(0,0,0,.16);
}
