:root{
    --mn-bg-1:#0F1F1A;
    --mn-bg-2:#1E3A2F;
    --mn-accent:#4CAF7A;
    --mn-accent-2:#7ED9B2;
    --mn-text:#EAF5EF;
  }
  
  /* ===== общий стиль карточек модалок (мягко, без конфликтов) ===== */
  .modal-card{
    color: var(--mn-text);
  }
  
  /* ===== Daily fullscreen + scroll только у подарков ===== */
  #dailyModal .mining-card{
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    display:flex;
    flex-direction:column;
    overflow:hidden;
  }
  
  /* фон-картинка только сверху */
  #dailyModal .mining-card::before{
    content:"";
    position:absolute;
    inset:0;
    background:url("/static/assets/module_bg.jpg") center/cover no-repeat;
    z-index:0;
  }
  #dailyModal .mining-card::after{
    content:"";
    position:absolute;
    inset:0;
    z-index:1;
  }
  #dailyModal .mining-card > *{ position:relative; z-index:2; }
  
  /* фикс верх + низ, скролл только gifts */
  #dailyModal .modal-title,
  #dailyModal .modal-subtitle,
  #dailyModal .daily-info,
  #dailyModal #dailyClaimBtn,
  #dailyModal #dailyStatusText{ flex:0 0 auto; }
  
  #dailyModal .daily-gifts{
    flex:1 1 auto;
    overflow-y:auto;
    padding-bottom:16px;
  }
  
  /* ===== подарки: иконки закрытый/открытый + галочка ===== */
  .daily-gift{ position:relative; }
  
  .daily-gift .gift-open{ display:none; }
  .daily-gift.opened .gift-closed{ display:none; }
  .daily-gift.opened .gift-open{ display:inline; }
  
  /* locked всегда закрытый */
  .daily-gift.locked .gift-open{ display:none; }
  .daily-gift.locked .gift-closed{ display:inline; opacity:.7; }
  
  .daily-gift.today{
    border-color: var(--mn-accent);
    box-shadow: 0 0 12px rgba(76,175,122,0.5);
  }
  
  .daily-gift.done::after{
    content:"✓";
    position:absolute;
    top:6px;
    right:8px;
    color: var(--mn-accent-2);
    font-weight:900;
  }
  
  /* кнопка daily — зелёная */
  
  /* ===== FIX: hidden должен точно скрывать ===== */
.hidden { display: none !important; }

/* ===== FIX: лидерборд в результате игры ===== */
.game-lb {
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(8px);
}

/* Шапка "Лидеры" + крестик */
.game-lb-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}

.game-lb-title{
  font-weight:800;
  font-size:16px;
}

/* Кнопка закрытия — маленькая, НЕ плашка */
.game-lb-close{
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  padding: 0 !important;
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 22px;
  line-height: 34px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

.game-lb-close:active{
  transform: scale(0.98);
}

/* "Ты: #..." */
.game-lb-me{
  margin: 8px 0 10px;
  font-size: 14px;
  opacity: 0.95;
}

/* список */
.game-lb-list{
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.game-lb-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border-radius:14px;
  background: rgba(255,255,255,0.10);
}

.game-lb-place{
  width: 26px;
  text-align:center;
  opacity: .9;
  font-weight:800;
}

.game-lb-user{
  display:flex;
  align-items:center;
  gap:10px;
  flex:1 1 auto;
  min-width:0;
}

.game-lb-ava{
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(255,255,255,0.12);
}

.game-lb-name{
  font-weight:700;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.game-lb-score{
  font-weight:800;
  white-space:nowrap;
}

.game-lb-empty{
  margin-top:10px;
  opacity:.9;
  text-align:center;
}

.game-rules-actions{
  display:flex;
  gap:10px;
  justify-content:center;
  margin-top: 14px;
}

.btn-ghost{
  background: rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 16px;
  padding: 10px 16px;
  font-weight: 800;
}

/* лидерборд в правилах */
.rules-lb{
  margin-top: 14px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.08);
}

.rules-lb-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 10px;
}

.rules-lb-title{ font-weight: 900; }

.rules-lb-close{
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(0,0,0,0.06);
  font-size: 22px;
  line-height: 1;
}

.rules-lb-me{
  margin: 6px 0 10px;
  font-weight: 900;
}

.rules-lb-list{
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  flex-direction:column;
  gap:8px;
  max-height: 40vh;
  overflow:auto;
}

.rules-lb-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.06);
}

.rules-lb-place{
  width: 28px;
  text-align:center;
  font-weight: 900;
  opacity: .85;
}

.rules-lb-user{
  flex:1;
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.rules-lb-ava{
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,0.06);
}

.rules-lb-name{
  font-weight: 900;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}

.rules-lb-score{
  font-weight: 900;
  white-space: nowrap;
}

.rules-lb-empty{
  margin-top: 10px;
  text-align:center;
  font-weight: 800;
  opacity: .85;
}

/* ===== RULES LEADERBOARD: bottom sheet (вылезает снизу) ===== */

.game-rules-modal{
  position: fixed;
  inset: 0;
  z-index: 41;
}

/* когда открыт лидерборд — правила приглушаем */
.game-rules-modal.lb-open .game-rules-window{
  opacity: 0.25;
  transform: scale(0.98);
  pointer-events: none;
}

/* сам bottom-sheet */
#gameRulesLb.rules-lb{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  width: calc(100% - 16px);
  max-width: 520px;
  margin: 0 auto 8px;

  background: #fff7ea;                 /* НЕ чёрный */
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 24px 24px 18px 18px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.35);

  padding: 12px 12px 14px;

  transform: translateY(110%);
  transition: transform 0.22s ease, opacity 0.22s ease;
  opacity: 0;
}

/* состояние "открыто" */
#gameRulesLb.rules-lb.is-open{
  transform: translateY(0);
  opacity: 1;
}

/* ручка сверху */
.rules-lb-handle{
  width: 46px;
  height: 5px;
  border-radius: 999px;
  background: rgba(0,0,0,0.18);
  margin: 4px auto 10px;
}

/* чтобы список нормально скроллился внизу */
#gameRulesLb .rules-lb-list{
  max-height: 46vh;
  overflow: auto;
}

/* крестик чуть “как в играх” */
#gameRulesLb .rules-lb-close{
  border: 0;
  background: rgba(0,0,0,0.06);
  border-radius: 12px;
}
